Repository navigation
fix(ci): bump @changesets/cli to 2.31.1 for npm 12 compatibility - #488
Conversation
npm 12 (released 2026-07-08) changed `npm info --json` to always wrap its output in an array, even for a single package spec. The release job installs `npm@latest` for OIDC trusted publishing, so it now gets 12.x. @changesets/cli 2.29.7 reads `pkgInfo.versions` off the parsed JSON directly; on an array that is `undefined`, so `publishedVersions` falls back to `[]` and every package looks unpublished. `changeset publish` then attempts to republish already-released versions and the registry rejects them with E403, failing every push to main. 2.31.1 normalizes the array (changesets#2159), restoring correct published-version detection under both npm 11 and npm 12. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.OpenSSF Scorecard
Scanned Files
|
📦 Bundle size report
Summary
File breakdownanipres — 58 files · 862.5 KiB raw · 219.8 KiB gzip · — raw / — gzip
app — 370 files · 16.78 MiB raw · 15.24 MiB gzip · — raw / — gzip
slidev-addon-anipres — 47 files · 5.58 MiB raw · 2.35 MiB gzip · −5 B (−0.0%) raw / −51 B (−0.0%) gzip
worker — 2 files · 5.61 MiB raw · 1.04 MiB gzip · +8 B (+0.0%) raw / +6 B (+0.0%) gzip
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (1)
WalkthroughThe project updates its ChangesChangesets CLI update
Estimated code review effort: 1 (Trivial) | ~2 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)✨ Finishing Touches🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint install failed: lockfile failed supply-chain policy check. Run 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. Comment |

Motivation
The
releasejob has been failing on every push tomain— most recently run 30535460404:Both versions have been on npm since 2026-05-11, so
changeset publishshould have skipped them entirely.Root cause
This is not caused by #485 — that PR left the
releasejob byte-for-byte unchanged. It is a coincidence of timing: this was the first push tomainsince 2026-05-26, and the breakage landed in between.npm 12 (released 2026-07-08) changed
npm info --jsonto always return an array, even for a single package spec:The release job runs
npm install -g npm@latest— required for npm trusted publishing (needs >= 11.5.1) — which now resolves to 12.x.@changesets/cli2.29.7 readspkgInfo.versionsstraight off the parsed JSON. On an array that isundefined, sopublishedVersionsfalls back to[], every package is treated as unpublished, andchangeset publishattempts to republish already-released versions.For contrast, the last green release run (2026-05-26, same changesets version, npm 11) correctly logged:
Upstream: changesets/changesets#2164, fixed by changesets/changesets#2159, shipped in
@changesets/cli2.31.1.Key changes
@changesets/cli^2.29.7→^2.31.1. 2.31.1 addsnormalizeInfoJson()(Array.isArray(parsed) ? parsed[0] : parsed), which works under both npm 11 and npm 12.No changeset is included — this is release tooling only, with no user-facing or API change.
Note on lockfile size
The lockfile diff is larger than a one-line dep bump suggests. Two legitimate causes:
libc:fields that the previously-committed (pnpm 10-era) lockfile lacks;debug's optionalsupports-colorpeer to resolve tree-wide, adding(supports-color@10.2.2)peer suffixes.pnpm install --frozen-lockfilepasses and the supply-chain policy check is clean (1631 entries).Testing done
Verified the exact predicate that fails in CI, against real npm 12 output:
Also run locally:
pnpm install --frozen-lockfile— clean, lockfile unmodified by installpnpm --filter anipres test— 21 passed (4 files)pnpm --filter anipres lint— cleanpnpm --filter anipres build— succeedsThe release job itself only runs on pushes to
main, so it cannot be exercised by this PR's CI; it will be validated when this merges.🤖 Generated with Claude Code
Summary by CodeRabbit