Skip to content

fix(release): check the npm login before releasing; point reruns at release:publish - #26

Merged
crcatala merged 2 commits into
mainfrom
fix/release-preflight
Oct 22, 2026
Merged

crcatala merged 2 commits into
mainfrom
fix/release-preflight

Conversation

@crcatala-vps

Copy link
Copy Markdown
Collaborator

Summary

pnpm release only publishes to npm after release-it has bumped, tagged and pushed, so a missing npm login was discovered too late (this happened on v0.0.2). Rerunning pnpm release then failed with "CHANGELOG.md has no unreleased user-facing entries", which hid the actual fix (pnpm release:publish).

Changes

  • releaseProblems() in scripts/release-lib.mjs, checked by release.mjs release before release-it starts:
    • not logged in to npm → refuse, "run npm login first"
    • HEAD already tagged with the current version (a half-finished release) → refuse, "run pnpm release:publish"
  • release:dry now goes through release.mjs release --dry-run, so the dry run catches a missing login too
  • Publish failures and refusals end with what to do next; after pnpm release they say the commit and tag are already pushed and only pnpm release:publish is left
  • RELEASING.md: prerequisites, step 1 and the recovery section updated

Testing

  • Unit tests for releaseProblems (logged in, no login, rerun at a tagged HEAD); pnpm verify passes (482 tests)
  • Ran for real without an npm login:
    • pnpm release:dry at the v0.0.2 commit → HEAD is already the v0.0.2 release ... run \pnpm release:publish``
    • release.mjs release --dry-run on an untagged commit → You are not logged in to npm: run \npm login` first` (before release-it runs)
    • release.mjs publish → lists the problems, then Fix this, then run \pnpm release:publish` again.`

🤖 Generated with Claude Code

crcatala-vps and others added 2 commits October 22, 2026 08:11
…t release:publish

pnpm release only publishes to npm after release-it has pushed the commit and tag, so a missing npm login was found too late, and rerunning pnpm release then failed on the empty Unreleased section. Check npm whoami (and whether HEAD is already the release) before release-it starts, also for release:dry, and say that pnpm release:publish finishes a half-done release.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Christian Catalan <crcatala@gmail.com>
…lish recovery

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Christian Catalan <crcatala@gmail.com>
@crcatala
crcatala merged commit f175824 into main Oct 22, 2026
5 checks passed
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