Repository navigation
fix(plugin): strip bun's bundle path comments so the tarball verifies - #7
Merged
Merged
Conversation
bun build writes `// <module path>` above every inlined module, and the path depends on the install: a bun workspace shows `node_modules/zod/...` while CI shows `../node_modules/.bun/zod@4.1.8/node_modules/zod/...`. The code is byte-identical, but verify-release.ts hashes the tarball, so a healthy publish read as "served bytes do not match the local pack — do not install". The build now drops those comments, which also stops the bundle leaking an install path.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
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.
What
The plugin build now strips bun's
// <module path>comments fromdist/, so a published tarball is a function of the source alone.Why
verify-release.ts 0.5.23reported:The tarballs differ only in those comments: bun writes
// node_modules/zod/v4/core/core.jsin a bun-workspace install and// ../node_modules/.bun/zod@4.1.8/node_modules/zod/v4/core/core.jsin CI's npm install. Removing them from both sides makesdist/index.jsidentical, anddist/tui.jsalready was.So the published 0.5.23 is sound — but every future release would have failed the same check, and the bundle was also leaking an install path.
Verification
bun run buildnow ends withstripped bundle path comments in 1 file(s);grep -c '^// .*node_modules/' dist/index.js dist/tui.jsreturns 0 for both.bun test246 pass / 0 fail.Note
verify-release.ts 0.5.23still reports MISMATCH by design: that tarball was built before this change. The next release (0.5.24) should verify clean, which is the real proof this works.