feat(release): smoke-test the packed tarball before every npm publish
Merged
DA
11d ago+65+65+01234567890123456789-11-11-01234567890123456789
Requested by Daniel · project thread
What this PR does
Follow-up to #1503. Daniel asked that a broken release never go out again. 1.33.0 was published with every --skill install failing, and the only gate before npm publish was the version sync. Now prepublishOnly stops the publish unless:
- versions are in sync (as before),
npm run test:install-pathspasses (the--skilltest from #1503), andscripts/prepublish-check.mjspasses. It runsnpm pack(the exact tarball npm will upload), thenprod-smoke-test.mjs --only cli --cli-tarball <tgz>: the same batch install of agent, command, mcp, hook, setting, skill and mod the prod smoke test runs, into a temp folder with tracking off.
Other changes:
prod-smoke-test.mjs: new--cli-tarball <path>option (npx --package <tgz> claude-code-templates). Its default behaviour is unchanged.- CLAUDE.md: publishing uses
npm login --auth-type=web, not a token. It also documents the new gate and what 202 and E404 mean. CCT_SKIP_PREPUBLISH_SMOKE=1skips step 3 only (it needs network: GitHub and www.aitmpl.com).
Type
- New component
- Change to an existing component
- CLI (
cli-tool/src,cli-tool/bin) - Website (
dashboard/) - Docs or other (release tooling)
How I tested it
node scripts/prepublish-check.mjsonmain: 10/10 CLI checks pass against the packed 1.33.1 tarball.- With the 1.33.0 line (
source,) restored:FAIL batch install …,prepublish-check: the CLI smoke test failed against the packed tarball: not publishing, exit 1. - The published 1.33.1 against npm:
prod-smoke-test.mjs --only cli --cli-version 1.33.1→ 10/10,Installed 7 of 7 · 0 failed. - Root
npm testgreen.
Touches scripts/ and package.json, so it merges by hand.
Generated by Claude Code
Summary by cubic
Blocks npm publish unless the packed tarball passes the same CLI smoke test that missed the broken 1.33.0 release, where every --skill install failed. Affects release tooling only (scripts/ and package.json) — no new components, so docs/components.json needs no regeneration.
prepublishOnlynow also runsnpm run test:install-pathsand the newscripts/prepublish-check.mjs, which runsnpm packand the prod smoke test's CLI checks (an install of every component type, tracking off) against that exact tarball; a publish stops when any install fails.prod-smoke-test.mjsgains a--cli-tarball <path>option for that flow; its default behavior is unchanged.- Optional env var
CCT_SKIP_PREPUBLISH_SMOKE=1skips only the smoke step — it needs network (GitHub and www.aitmpl.com); do not use it for a release. CLAUDE.mdnow guides publishing throughnpm login --auth-type=webinstead of a token and documents the new gate plus the 202/E404 npm responses.