Skip to content

Commit 59aa7bf

Browse files
committed
chore: add prepublishOnly guard and document publish workflow
1 parent 05e0a63 commit 59aa7bf

2 files changed

Lines changed: 11 additions & 1 deletion

File tree

CLAUDE.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,15 @@ Shared formatting lives in `src/cli/format-sync.ts`. When adding new sync output
152152

153153
Internally, `vscode` and `copilot` remain distinct client types with separate path mappings (see `resolveClientMappings()` in `client-mapping.ts`).
154154

155+
## Publishing
156+
157+
**Never run `npm publish` directly.** Always use the two-step workflow:
158+
159+
1. `bun run publish:next` — publishes to the `next` tag
160+
2. `bun run promote:latest` — promotes `next` to `latest` after testing
161+
162+
A `prepublishOnly` guard in `package.json` blocks direct `npm publish`. This prevents untested releases from going to `latest`.
163+
155164
## Troubleshooting
156165

157166
### agent-browser

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@
2727
"prepare": "bun run build && (test -d .git && bunx prek install -t pre-push || true)",
2828
"release": "bun run scripts/release.ts",
2929
"release:next": "bun run scripts/release.ts next",
30-
"publish:next": "bun run build && bun publish --tag next",
30+
"prepublishOnly": "test \"$ALLOW_PUBLISH\" = '1' || (echo 'ERROR: Use bun run publish:next, then bun run promote:latest' && exit 1)",
31+
"publish:next": "bun run build && ALLOW_PUBLISH=1 npm publish --tag next",
3132
"promote:latest": "bun scripts/tag-channel.ts latest"
3233
},
3334
"keywords": [

0 commit comments

Comments
 (0)