Skip to content

fix(release): add prepublishOnly gate; release 0.1.2 - #4

Merged
andrei-hasna merged 1 commit into
mainfrom
fix/prepublish-gate-0.1.2
Jul 31, 2026
Merged

fix(release): add prepublishOnly gate; release 0.1.2#4
andrei-hasna merged 1 commit into
mainfrom
fix/prepublish-gate-0.1.2

Conversation

@andrei-hasna

@andrei-hasna andrei-hasna commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

What happened

@hasna/workforce@0.1.1 was published from main and the tarball contained no dist/ — 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.0 does contain the full dist/ tree, so 0.1.1 is a regression, not a continuation.

Root cause

This package has no prepublishOnly, prepare, or prepack script. npm publish therefore never runs build, and packs whatever dist/ happens to exist on the publishing machine. On a fresh clone that is nothing. npm did not fail — it printed four No bin file found at dist/... warnings and exited 0.

Sibling packages carry such a gate (machinesverify: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.
  • Version to 0.1.2, with src/version.ts kept in sync (a test asserts the two match).

Verified before opening this: after bun run build, npm pack --dry-run lists 112 dist/ entries including dist/cli/index.js (137.2kB), dist/mcp/index.js (200.7kB) and dist/server/index.js (63.6kB).

0.1.1 will be deprecated on npm once 0.1.2 is live.

Incident: #incidents 613305. Task: 1f65b5d0


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

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
@andrei-hasna
andrei-hasna merged commit ee3294f into main Jul 31, 2026
3 checks passed
@andrei-hasna
andrei-hasna deleted the fix/prepublish-gate-0.1.2 branch July 31, 2026 10:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant