From b865199ffaf98069db4733058f14597aa6526cdb Mon Sep 17 00:00:00 2001 From: Ant Stanley Date: Sat, 25 Jul 2026 10:24:33 +0200 Subject: [PATCH] Ship only what consumers need in the published packages MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Two kinds of dead weight were reaching npm. sourceMap was set in tsconfig.base.json, so every package emitted .js.map alongside its output and files: ["dist"] shipped the lot — 206 kB of maps across the three published packages, for artifacts nobody debugs from the registry. Removed from the base config; it is off by default everywhere now. test-support.ts is scaffolding imported only by *.test.ts, but it is not itself a .test.ts file, so the build exclude never caught it and it compiled into dist. Added to the build exclude for blogwright and blogwright-pds. It stays fully typechecked: the tsconfig.typecheck.json files override exclude to [], so they still see it and its tests. Unpacked: blogwright 540.4 -> 437.9 kB, blogwright-core 205.1 -> 127.8 kB, blogwright-pds 99.9 -> 58.9 kB; 183 files down to 121. No runtime code changed, and the built CLI still runs. blogwright-build-agent is private and never published; its bundle ships inside the CLI as agent/server.js and is untouched here. Co-Authored-By: Claude Opus 5 (1M context) --- .changeset/olive-clouds-repeat.md | 9 +++++++++ packages/cli/tsconfig.json | 2 +- packages/pds/tsconfig.json | 2 +- tsconfig.base.json | 1 - 4 files changed, 11 insertions(+), 3 deletions(-) create mode 100644 .changeset/olive-clouds-repeat.md diff --git a/.changeset/olive-clouds-repeat.md b/.changeset/olive-clouds-repeat.md new file mode 100644 index 0000000..c38820f --- /dev/null +++ b/.changeset/olive-clouds-repeat.md @@ -0,0 +1,9 @@ +--- +"blogwright": patch +"blogwright-core": patch +"blogwright-pds": patch +--- + +Ship smaller packages. The published tarballs no longer carry `.js.map` sourcemaps (`sourceMap` was set repo-wide in `tsconfig.base.json` and every emitted map was landing in `dist`), and `test-support.ts` — scaffolding imported only by `*.test.ts` — is now excluded from the build configs of `blogwright` and `blogwright-pds` rather than compiled into `dist`. It is still fully typechecked, since the `tsconfig.typecheck.json` files override `exclude` to `[]`. + +Unpacked sizes drop by a quarter overall: `blogwright` 540.4 kB → 437.9 kB, `blogwright-core` 205.1 kB → 127.8 kB, `blogwright-pds` 99.9 kB → 58.9 kB, and the three packages together go from 183 files to 121. No runtime code changed. diff --git a/packages/cli/tsconfig.json b/packages/cli/tsconfig.json index 2b07fcb..06e8f0a 100644 --- a/packages/cli/tsconfig.json +++ b/packages/cli/tsconfig.json @@ -6,5 +6,5 @@ "types": ["node"] }, "include": ["src/**/*"], - "exclude": ["dist", "**/*.test.ts"] + "exclude": ["dist", "**/*.test.ts", "src/test-support.ts"] } diff --git a/packages/pds/tsconfig.json b/packages/pds/tsconfig.json index 2b07fcb..06e8f0a 100644 --- a/packages/pds/tsconfig.json +++ b/packages/pds/tsconfig.json @@ -6,5 +6,5 @@ "types": ["node"] }, "include": ["src/**/*"], - "exclude": ["dist", "**/*.test.ts"] + "exclude": ["dist", "**/*.test.ts", "src/test-support.ts"] } diff --git a/tsconfig.base.json b/tsconfig.base.json index 6542e35..67db7c0 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -14,7 +14,6 @@ "noFallthroughCasesInSwitch": true, "exactOptionalPropertyTypes": true, "declaration": true, - "sourceMap": true, "skipLibCheck": true } }