From dccbacbf54172c36cf77e3432fa7395b6602e633 Mon Sep 17 00:00:00 2001 From: Alvaro Date: Wed, 10 Jun 2026 13:13:28 +0200 Subject: [PATCH] fix: ship @chkit/clickhouse/e2e-testkit from dist, not unshipped src MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #28 — the `/e2e-testkit` subpath export pointed at `./src/e2e-testkit.ts` under both conditions, but `files: ["dist"]` excludes src, so importing `@chkit/clickhouse/e2e-testkit` from the published package was a hard module-not-found. Build it to dist (drop the tsconfig exclude) and point the export at dist, keeping a `source` condition for in-repo type resolution. #27 (codegen hard-pinning @chkit/core) was already resolved upstream: codegen now declares `@chkit/core: workspace:*`. #42 (dropping the `source` export condition) was investigated and dropped: the repo relies on `source` so `tsc` can type-check sibling packages from source without a build (the `typecheck` task depends on `^typecheck`, not `^build`), and a plugin-backfill test asserts its presence. Removing it broke CI. Correctly handling #42 needs publish-time stripping — deferred. Verified: typecheck passes with no dist present (CI's condition); full build/lint/test green; e2e-testkit resolves to dist under Node and Bun. Co-Authored-By: Claude Opus 4.8 (1M context) --- .changeset/fix-published-exports.md | 5 +++++ packages/clickhouse/package.json | 5 +++-- packages/clickhouse/tsconfig.json | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) create mode 100644 .changeset/fix-published-exports.md diff --git a/.changeset/fix-published-exports.md b/.changeset/fix-published-exports.md new file mode 100644 index 00000000..9bcd84f1 --- /dev/null +++ b/.changeset/fix-published-exports.md @@ -0,0 +1,5 @@ +--- +"@chkit/clickhouse": patch +--- + +Fix the `@chkit/clickhouse/e2e-testkit` subpath export. Both conditions pointed at `./src/e2e-testkit.ts`, which `files: ["dist"]` excludes from the published tarball, so importing the subpath from the published package hit a hard module-not-found. Build it to `dist` and point the export there (keeping a `source` condition for in-repo type resolution). diff --git a/packages/clickhouse/package.json b/packages/clickhouse/package.json index aab162e4..b78fe840 100644 --- a/packages/clickhouse/package.json +++ b/packages/clickhouse/package.json @@ -28,8 +28,9 @@ "default": "./dist/index.js" }, "./e2e-testkit": { - "bun": "./src/e2e-testkit.ts", - "default": "./src/e2e-testkit.ts" + "source": "./src/e2e-testkit.ts", + "types": "./dist/e2e-testkit.d.ts", + "default": "./dist/e2e-testkit.js" } }, "files": [ diff --git a/packages/clickhouse/tsconfig.json b/packages/clickhouse/tsconfig.json index 9d644dd9..d38ac708 100644 --- a/packages/clickhouse/tsconfig.json +++ b/packages/clickhouse/tsconfig.json @@ -5,5 +5,5 @@ "outDir": "dist" }, "include": ["src/**/*.ts"], - "exclude": ["src/**/*.test.ts", "src/e2e-testkit.ts"] + "exclude": ["src/**/*.test.ts"] }