You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs(publish): add pre-publish tarball smoke test + codify npm before-bypass
Pre-publish: pack each tarball, install in /tmp, and verify the entry
points actually resolve before running `npm publish`. `npm test` runs
against source, not a packed tarball, so it misses bugs like
monorepo-relative imports that escape the `files` allowlist. v1.40.1
shipped broken because this check didn't exist.
Post-publish install step: add `--prefer-online` (so freshly-published
versions resolve instead of the local cache) and `--before=9999-12-31`
to bypass the user's global `before` supply-chain guard for scratch
installs. Note explicitly: keep the global config intact — do not
suggest `npm config delete before`. The user keeps it on purpose as
a mitigation against post-compromise dependency updates.
The post-publish step now also runs `run402 allowance status` as a
real end-to-end smoke test, so a broken tarball surfaces immediately.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: .claude/commands/publish.md
+45-3Lines changed: 45 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,6 +21,44 @@ After updating all three package.json files, run `npm install --package-lock-onl
21
21
22
22
Stage and commit: `git add package.json cli/package.json sdk/package.json package-lock.json && git commit -m "chore: bump version to <new_version>"`
23
23
24
+
## Pre-publish tarball smoke test
25
+
26
+
`npm test` runs against the source tree, not a packed tarball, so it misses bugs like monorepo-relative imports that escape the `files` allowlist. Pack each tarball, install it in a scratch dir, and verify the entry points actually load before publishing. v1.40.1 shipped broken because this step didn't exist — every `run402` command threw `ERR_MODULE_NOT_FOUND`.
27
+
28
+
**About `--before=9999-12-31`:** the user's global npm has a `before` date pinned as a supply-chain mitigation (blocks installing packages published after that date, in case a dependency is compromised). Scratch installs in `/tmp` can safely bypass it per-invocation with `--before=9999-12-31`. Do **not** suggest the user remove the global config — they want it.
29
+
30
+
Run these in sequence. If any check fails, stop and fix the root cause. Do **not**`npm publish`.
gh workflow run deploy-site.yml -R kychee-com/run402-private
56
94
```
57
95
(Or `gh api repos/kychee-com/run402-private/dispatches -f event_type=public-docs-updated` if you want the trigger to show up in the audit log as a `repository_dispatch`.)
58
-
6.**Install the new version locally** so `run402` on the command line uses the just-published version:
96
+
6.**Install the new version locally and smoke-test it** so `run402` on the command line uses the just-published version — and so a broken publish gets caught immediately, not when the user next runs a command:
Verify with `run402 --version` and confirm it matches the new version.
102
+
-`--prefer-online` forces npm to hit the registry instead of a stale local cache (the new version can otherwise appear missing for a minute after publish).
103
+
-`--before=9999-12-31` bypasses the user's global `before` supply-chain guard for this one install. Keep the global config intact — do not run `npm config delete before`.
104
+
- Expect `run402 --version` to print the new version, and `run402 allowance status` to return valid JSON with the user's wallet info. If either fails with `ERR_MODULE_NOT_FOUND` or similar, the published tarball is broken — tell the user loudly and prepare a hotfix version immediately.
63
105
7. Print a summary of what was published, including the new version and npm URLs:
0 commit comments