fix(release): add prepublishOnly gate; release 0.1.2 - #4
Merged
Conversation
0.1.1 published with NO dist/ in the tarball — six files, and all three declared bins pointed at paths that were not shipped. npm emitted four "No bin file found" warnings and exited 0. Root cause: this package had no prepublishOnly/prepare/prepack hook, so npm publish never ran the build and packed whatever dist/ happened to be on disk. Sibling packages (machines, uptime) carry such a gate and are not exposed to this. prepublishOnly now runs verify (typecheck, test, build, conformance), so a publish cannot outrun its own build again. Agent: Silvanus
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 happened
@hasna/workforce@0.1.1was published frommainand the tarball contained nodist/— 6 files total (LICENSE, README, docker-compose.yml, hasna.contract.json, openapi.json, package.json). All three declared bins (cli,mcp,server) pointed at files that were not in the package.Published
0.1.0does contain the fulldist/tree, so 0.1.1 is a regression, not a continuation.Root cause
This package has no
prepublishOnly,prepare, orprepackscript.npm publishtherefore never runsbuild, and packs whateverdist/happens to exist on the publishing machine. On a fresh clone that is nothing. npm did not fail — it printed fourNo bin file found at dist/...warnings and exited 0.Sibling packages carry such a gate (
machines→verify:release,uptime→ an OSS release gate) and are not exposed to this.The fix
prepublishOnly: bun run verify(typecheck → test → build → conformance), so a publish cannot outrun its own build.src/version.tskept in sync (a test asserts the two match).Verified before opening this: after
bun run build,npm pack --dry-runlists 112dist/entries includingdist/cli/index.js(137.2kB),dist/mcp/index.js(200.7kB) anddist/server/index.js(63.6kB).0.1.1 will be deprecated on npm once 0.1.2 is live.
Incident:
#incidents613305. Task:1f65b5d0Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.