Skip to content

feat(release): smoke-test the packed tarball before every npm publish - #1504

Merged
davila7 merged 1 commit into
mainfrom
claude/project-thread-ofa5w0
Nov 10, 2026
Merged

davila7 merged 1 commit into
mainfrom
claude/project-thread-ofa5w0

Conversation

@davila7

@davila7 davila7 commented Nov 10, 2026 •

Copy link
Copy Markdown
Owner

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:

  1. versions are in sync (as before),
  2. npm run test:install-paths passes (the --skill test from fix(cli): 1.33.1, --skill installs reported failure and were not tracked #1503), and
  3. scripts/prepublish-check.mjs passes. It runs npm pack (the exact tarball npm will upload), then prod-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=1 skips 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.mjs on main: 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 test green.

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.

  • prepublishOnly now also runs npm run test:install-paths and the new scripts/prepublish-check.mjs, which runs npm pack and 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.mjs gains a --cli-tarball <path> option for that flow; its default behavior is unchanged.
  • Optional env var CCT_SKIP_PREPUBLISH_SMOKE=1 skips only the smoke step — it needs network (GitHub and www.aitmpl.com); do not use it for a release.
  • CLAUDE.md now guides publishing through npm login --auth-type=web instead of a token and documents the new gate plus the 202/E404 npm responses.

Written for commit 8b37062. Summary will update on new commits.

View guided diff Turn on auto-fix

1.33.0 was published with every --skill install failing; the only check
before publish was the version sync. prepublishOnly now also runs the
--skill install test and scripts/prepublish-check.mjs, which packs the
package and runs prod-smoke-test.mjs's CLI checks (an install of every
component type, tracking off) against that tarball. Verified: passes on
main, stops the publish with the 1.33.0 line restored.

- prod-smoke-test.mjs: --cli-tarball <path>
- CLAUDE.md: publish with npm login --auth-type=web (no tokens), the new
  prepublish gate, 202/E404 meanings

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012PXzcbUeN566p89EuSse2f
@davila7 davila7 self-assigned this Nov 10, 2026

davila7 commented Nov 10, 2026

Copy link
Copy Markdown
Owner Author

All checks green fails on purpose here: this PR touches MANUAL_PATHS (scripts/, package.json), so the gate's "merge by hand" error is expected and is not a code failure. It needs a manual merge.


Generated by Claude Code

@davila7
davila7 marked this pull request as ready for review November 10, 2026 03:37
@davila7
davila7 merged commit 5ed191d into main Nov 10, 2026
7 of 9 checks passed
@davila7
davila7 deleted the claude/project-thread-ofa5w0 branch November 10, 2026 03:37
@greptile-apps

greptile-apps Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 4/5

[Medium impact] The changes affect the npm release workflow for the CLI.

The Windows publishing failure must be fixed before merging.

Findings

  1. P1 Windows publishing stops ▶

Summary

Adds checks before npm publication:

  • npm publishes only after the packed CLI passes its install checks.
  • Release instructions use npm web login instead of saved tokens.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[npm publish] --> B[Check version sync]
  B --> C[Run skill-install test]
  C --> D{Skip smoke check?}
  D -->|No| E[Pack into temporary folder]
  E --> F[Run CLI checks against tarball]
  F --> G{Checks pass?}
  G -->|No| H[Stop publication]
  G -->|Yes| I[Continue publication]
  D -->|Yes| I
Loading

Reviews (3) · Last reviewed commit: "feat(release): smoke-test the packed tar..." · Reviewed by Greptile

const run = (cmd, args, opts = {}) => spawnSync(cmd, args, { cwd: root, stdio: 'inherit', ...opts });

try {
const pack = spawnSync('npm', ['pack', '--ignore-scripts', '--pack-destination', out, '--json'], { cwd: root, encoding: 'utf8' });

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Windows publishing stops

On Windows, spawnSync('npm', ...) cannot launch the standard npm.cmd shim without a shell. The new required gate therefore stops at npm pack, even when the package is valid.

Start npm through process.execPath and process.env.npm_execpath, or use a Windows-safe launcher. The npx call in runCli needs the same treatment because this gate now requires it.

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.

2 participants