Repository navigation
fix(release): build before publish, tag versions already on npm - #1
Conversation
…ady on npm npm publish validated bin before prepublishOnly built dist/, so CI would publish a tarball without the changeset command. The publish script also skipped tagging any version already on npm, so the hand-published 0.1.0 never got a tag or GitHub release. Tags are lightweight now so they do not carry the test-fixture git identity.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 51 minutes. View limit details
|
| Layer / File(s) | Summary |
|---|---|
Build before Changesets .github/workflows/release.yml |
The release workflow runs bun run build after dependency installation and before the Changesets action. |
Publication and remote tag checks scripts/publish.ts |
When npm already has the version, the script continues to check the remote tag. It stops if the tag exists, creates a tag when the lookup exits with code 2, and returns a ReleaseError for other lookup failures. |
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix
Merge Risk: 
Low · previous review 3a299
-
Some releases may need manual reporting or tag cleanup, but these failures are limited to specific release states.
Pre-merge checks: 
5
-
Full details: Docstring Coverage
-
Explanation
No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 1 files. (1 skipped: 1 unsupported.)
-
Finishing Touches
-
Generate docstrings
-
- Commit to this branch
- Create a new PR
Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Fixes the failing Release run (https://github.com/MapleTechLabs/changesets/actions/runs/41433533590).
What failed:
ENEEDAUTHonnpm publish. The package did not exist on npm yet, and trusted publishing (OIDC) cannot do a package's first publish. 0.1.0 has since been published by hand, so that part is unblocked once the trusted publisher is configured for this repo andrelease.yml.Fixed here:
npm publishdroppedbin(script name dist/bin.mjs was invalid and removed) because it checksbinbeforeprepublishOnlybuildsdist/. The workflow now builds first. Without this, a CI publish would ship a package with nochangesetcommand.scripts/publish.tsreturned early when the version was already on npm, so 0.1.0 never got a tag or GitHub release. It now tags whenever the remote tag is missing.Fixture <fixture@example.com>, 2026-01-01) from the sharedrunhelper.Verified locally: typecheck and build pass.
npm pack --dry-runkeepsdist/bin.mjswith no bin warning. Runningscripts/publish.tsreports 0.1.0 as already on npm, creates the@maple-dev/changesets@0.1.0tag and writes thegit-tagline toCHANGESETS_OUTPUT.🤖 Generated with Claude Code
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.Summary by CodeRabbit