chore: build before publish (prepack guard + green build)#16
Conversation
0.5.0 shipped without dist/ because nothing built before `npm publish`. Make the build clean and guard publishes on it: - prepack: "npm run build" — npm publish/pack now always build dist/ first, so a buildless publish can't happen again. - Clear the pre-existing build errors so the guard doesn't block publish: skipLibCheck (3 @types/node lib-internal errors), targz.ts Buffer→Uint8Array, and run.ts reporter compose(new spec()) (was passing the class — this also fixes the spec reporter output). - CI now gates check + build alongside the tests across the matrix. Verified: check/build exit 0, 15/15 tests pass, and `npm pack` rebuilds dist/ via prepack after `rm -rf dist`. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Code Review
This pull request adds a prepack script to package.json, instantiates spec in src/run.ts, updates the chunk types to Uint8Array in src/targz.ts, and enables skipLibCheck in tsconfig.json. The review feedback highlights a potential issue in src/targz.ts where stream errors are not handled, which could cause the Promise to hang indefinitely. It is recommended to handle errors on both the pack and gzip streams.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
30f3c18 to
1c61156
Compare
Makes
npm run buildexit clean so it can guard publishes — 0.5.0 shipped withoutdist/because nothing built beforenpm publish.prepack: "npm run build"—npm publish/npm packnow always builddist/first; a buildless publish can't happen again.skipLibCheck(3@types/nodelib-internal errors),targz.tsBuffer→Uint8Array, andrun.tsreportercompose(new spec())— it was passing the reporter class (this also fixes the spec output, which I confirmed renders correctly).check+buildalongside the tests across the matrix.Verified locally:
check/buildexit 0, 15/15 tests pass, andnpm packrebuildsdist/viaprepackafterrm -rf dist.🤖 Generated with Claude Code