Fix pnpm 11 publish errors handling by cyphercodes · Pull Request #2132 · changesets/changesets · GitHub
Skip to content

Fix pnpm 11 publish errors handling - #2132

Merged
Andarist merged 5 commits into
changesets:mainfrom
cyphercodes:fix-publish-already-published-e403
Jul 2, 2026
Merged

Andarist merged 5 commits into
changesets:mainfrom
cyphercodes:fix-publish-already-published-e403

Conversation

@cyphercodes

Copy link
Copy Markdown
Contributor

Summary

  • Make already-published publish error detection tolerate missing JSON error.summary.
  • Check summary, detail, message, and raw stdout/stderr for the already-published message.
  • Add pnpm regression coverage for E403 JSON errors without a summary.

Fixes #2099

Test plan

  • pnpm install --frozen-lockfile
  • pnpm vitest run packages/cli/src/commands/publish/__tests__/index.test.ts packages/cli/src/commands/publish/__tests__/publishPackages.test.ts packages/cli/src/commands/publish/__tests__/npm-utils.test.ts
  • pnpm lint -- packages/cli/src/commands/publish/npm-utils.ts packages/cli/src/commands/publish/__tests__/npm-utils.test.ts
  • pnpm types:check
  • pnpm format
  • git diff --check

@changeset-bot

changeset-bot Bot commented Jun 29, 2026 •

Copy link
Copy Markdown

@codecov

codecov Bot commented Jun 29, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.24%. Comparing base (4a0213f) to head (0f28bd6).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2132      +/-   ##
==========================================
+ Coverage   87.67%   88.24%   +0.57%     
==========================================
  Files          72       72              
  Lines        2596     2604       +8     
  Branches      691      698       +7     
==========================================
+ Hits         2276     2298      +22     
+ Misses        296      283      -13     
+ Partials       24       23       -1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Comment on lines +402 to +407

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not a fan of this. We should use targeted logic. We should probably hoist the formatPublishError call and use the normalized error throughout the caller's logic

@Andarist Andarist changed the title Handle already-published publish errors without summary Fix pnpm 11 publish errors handling Jul 2, 2026
@Andarist
Andarist enabled auto-merge July 2, 2026 11:06
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.

changeset publish crashes on already-published packages under npm trusted publishing (OIDC)

2 participants