Ship only what consumers need in the published packages - #13
Merged
Conversation
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) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two kinds of dead weight were reaching npm. Three lines of config; no runtime code changed.
Sourcemaps.
sourceMap: truesat intsconfig.base.json, so every package emitted.js.mapnext to its output andfiles: ["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.test-support.ts. Scaffolding imported only by*.test.ts, but because it is not itself a.test.tsfile the build'sexcludenever caught it and it compiled intodist(11.9 kB inblogwright, 6.6 kB inblogwright-pds). Now excluded from both build configs. It stays fully typechecked — thetsconfig.typecheck.jsonfiles overrideexcludeto[], which is what makes this safe.blogwrightblogwright-coreblogwright-pdsTogether: 845.4 → 625.0 kB unpacked (−26%), 183 → 121 files.
Already correct and left alone: the
filesfields were properly restrictive,blogwright-build-agentisprivateand never publishes, andagent/Dockerfile+agent-manifest.jsonare needed to build the MicroVM image.Verified: clean rebuild leaves zero
.mapfiles, zerotest-support*in anydist, no dangling imports and no orphanedsourceMappingURLcomments;node dist/bin.js --helpruns; build, lint, typecheck, knip,--frozen-lockfileand 331 tests all pass.Ships with a patch changeset — this changes published artifacts, so it is not internal-only.
Not included:
agent/server.jsis 297.7 kB of the CLI's remaining 438 kB and ships unminified. A minified rolldown build measures 140.9 kB, a further 52.7% cut. Left out deliberately: that bundle is the build server running inside the MicroVM, so minifying turns build-failure stack traces into mangled names, and the AWS SDK's inlined dynamic imports are the shape that tends to break under minification. It needs a real deploy to verify, not just the build-agent unit tests, which cover source rather than the bundle.🤖 Generated with Claude Code