@@ -1,16 +1,32 @@
11 ---
22 description: Create a new tagged npm release (patch/minor/major)
3+execution: inline
34 ---
45
56 Create a new npm release for this repo. The bump type is: $1 (default to "patch" if not provided).
67
78 Steps to follow exactly:
8-1. Run `bun run typecheck && bun run format && bun run lint && bun test` — stop and report any failures before proceeding.
9-2. Read `package.json` and determine the current version.
10-3. Compute the next version by bumping the $1 part of the semver (patch/minor/major). Default to "patch" if $1 is empty.
11-4. Update the `version` field in `package.json` to the new version.
12-5. Run `bun run build` to produce a fresh `dist/mc.js`.
13-6. Commit all staged and unstaged changes with the message: `chore: release v<new-version>`.
14-7. Create a git tag `v<new-version>` on that commit, make sure to use `-m "<version>"` to avoid interactive message editing.
15-8. Push the commit and the tag: `git push && git push --tags`.
16-9. Ask the user to run `npm publish` to publish to npm to complete the push with passkey auth.
9+1. Normalize bump type to one of `patch|minor|major`; if empty, use `patch`.
10+2. Verify git state before doing anything:
11+ - current branch must be `main`
12+ - working tree must be clean
13+ - run `git fetch origin --tags` and ensure `HEAD` equals `origin/main`
14+ If any check fails, stop and report.
15+3. Run `bun run typecheck && bun run format && bun run lint && bun test` — stop and report failures.
16+4. Read `package.json` and capture both `name` and current `version`.
17+5. Compute the next semver version by bumping the selected part.
18+6. Guardrails before mutating files:
19+ - ensure git tag `v<new-version>` does not exist locally or on origin
20+ - ensure npm version does not already exist: `npm view <package-name>@<new-version> version`
21+ If either exists, stop and report.
22+7. Update the `version` field in `package.json` to `<new-version>`.
23+8. Run `bun run build`.
24+9. Commit all staged and unstaged changes with message: `chore: release v<new-version>`.
25+10. Create annotated tag: `git tag -a v<new-version> -m "<new-version>"`.
26+11. Push explicitly to main and the exact tag:
27+ - `git push origin main`
28+ - `git push origin v<new-version>`
29+12. Post-push verification: run `npm view <package-name>@<new-version> version`.
30+ - If it already exists, report that publish already happened and do **not** ask user to publish again.
31+ - If it does not exist, ask user to run `npm publish` (passkey auth step).
32+