From 3e15ea3e49b8153d1eae1e81fb945f8d5ced7705 Mon Sep 17 00:00:00 2001 From: Ryan Goree Date: Sun, 6 Oct 2024 12:02:51 -0500 Subject: [PATCH] Prep for build --- packages/drift/package.json | 29 ++++--------------- packages/drift/src/adapter/MockAdapter.ts | 5 ---- .../src/{exports.ts => exports/index.ts} | 0 packages/drift/src/exports/testing.ts | 6 ++++ packages/drift/tsup.config.ts | 12 +------- 5 files changed, 12 insertions(+), 40 deletions(-) rename packages/drift/src/{exports.ts => exports/index.ts} (100%) create mode 100644 packages/drift/src/exports/testing.ts diff --git a/packages/drift/package.json b/packages/drift/package.json index 246af59c..6cf2e34a 100644 --- a/packages/drift/package.json +++ b/packages/drift/package.json @@ -8,35 +8,16 @@ "types": "./dist/index.d.ts", "default": "./dist/index.js" }, - "./cache": { - "types": "./dist/cache.d.ts", - "default": "./dist/cache.js" - }, - "./contract": { - "types": "./dist/contract.d.ts", - "default": "./dist/contract.js" - }, - "./errors": { - "types": "./dist/errors.d.ts", - "default": "./dist/errors.js" - }, - "./network": { - "types": "./dist/network.d.ts", - "default": "./dist/network.js" - }, - "./stubs": { - "types": "./dist/stubs.d.ts", - "default": "./dist/stubs.js" + "./testing": { + "types": "./dist/testing.d.ts", + "default": "./dist/testing.js" }, "./package.json": "./package.json" }, "typesVersions": { "*": { - "cache": ["./dist/cache.d.ts"], - "contract": ["./dist/contract.d.ts"], - "errors": ["./dist/errors.d.ts"], - "network": ["./dist/network.d.ts"], - "stubs": ["./dist/stubs.d.ts"] + ".": ["./dist/index.d.ts"], + "testing": ["./dist/testing.d.ts"] } }, "scripts": { diff --git a/packages/drift/src/adapter/MockAdapter.ts b/packages/drift/src/adapter/MockAdapter.ts index ac299a96..53883298 100644 --- a/packages/drift/src/adapter/MockAdapter.ts +++ b/packages/drift/src/adapter/MockAdapter.ts @@ -373,8 +373,3 @@ export class MockAdapter implements ReadWriteAdapter { })(); } } - -export type AdapterOnWriteParams< - TAbi extends Abi = Abi, - TFunctionName extends FunctionName = FunctionName, -> = OptionalKeys, "args" | "address">; diff --git a/packages/drift/src/exports.ts b/packages/drift/src/exports/index.ts similarity index 100% rename from packages/drift/src/exports.ts rename to packages/drift/src/exports/index.ts diff --git a/packages/drift/src/exports/testing.ts b/packages/drift/src/exports/testing.ts new file mode 100644 index 00000000..16519c27 --- /dev/null +++ b/packages/drift/src/exports/testing.ts @@ -0,0 +1,6 @@ +export { MockAdapter } from "src/adapter/MockAdapter"; +export { + type MockContractParams, + MockContract, +} from "src/client/Contract/MockContract"; +export { MockDrift } from "src/client/Drift/MockDrift"; diff --git a/packages/drift/tsup.config.ts b/packages/drift/tsup.config.ts index 4d02f6ab..891d6c4c 100644 --- a/packages/drift/tsup.config.ts +++ b/packages/drift/tsup.config.ts @@ -1,17 +1,7 @@ import { defineConfig } from "tsup"; export default defineConfig({ - // Splitting the entry points in foundational packages like this makes it - // easier for wrapper packages to selectively re-export `*` from some entry - // points and while augmenting or modifying others. - entry: [ - "src/exports/cache.ts", - "src/exports/contract.ts", - "src/exports/errors.ts", - "src/exports/index.ts", - "src/exports/network.ts", - "src/exports/stubs.ts", - ], + entry: ["src/exports/index.ts", "src/exports/testing.ts"], format: ["esm"], sourcemap: true, dts: true,