…ts major
The preview always used @changesets/get-release-plan@4 (changesets v2
libraries). Repos on changesets v3 dropped the
onlyUpdatePeerDependentsWhenOutOfRange experimental option, which v2 needs,
so minor bumps showed as major in the preview (e.g. TanStack/query
@tanstack/react-query 5.104.3 -> 6.0.0 instead of 5.105.0).
Bundle both v4 and v5 under npm aliases and pick the one that matches the
@changesets/cli major installed in GITHUB_WORKSPACE, defaulting to v3.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
🎯 Changes
The
Changeset Version Previewcomment shows major bumps forminorchangesets on repos that have moved to changesets v3. For example, on TanStack/query#12059 it shows@tanstack/react-query5.104.3 → 6.0.0, whilechangeset-botand the real release give a minor (5.105.0).Cause
The action always used
@changesets/get-release-plan@^4, which is built on the changesets v2 libraries (@changesets/config@^3,@changesets/assemble-release-plan@^6). In v2, a minor bump makes every package that lists it inpeerDependenciesgo major, unless the config sets___experimentalUnsafeOptions_WILL_CHANGE_IN_PATCH.onlyUpdatePeerDependentsWhenOutOfRange. TanStack/query removed that option when it moved to changesets v3 (TanStack/query#11583), because v3 doesn't need it. Itsfixedgroup then takes every package to 6.0.0.Results with a single
'@tanstack/react-query': minorchangeset on TanStack/query:@tanstack/react-querylit-query/svelte-querypnpm exec changeset status(@changesets/cli3.0.3)@changesets/get-release-plan@4.0.16(current action)@changesets/get-release-plan@4.0.16+ the experimental option put back in the config@changesets/get-release-plan@5.0.2Fix
A plain bump to v5 would break repos that still use changesets v2. Of the 12 repos using this action, 5 are on
@changesets/cli@^2:So the action now installs both majors under npm aliases (
get-release-plan-v4,get-release-plan-v5). It resolves@changesets/cli/package.jsonfromGITHUB_WORKSPACEand uses the matchingget-release-plan(cli v2 → v4, cli v3 → v5). If the CLI can't be found or its major isn't known, it falls back to v5 with a warning. Every user runsSetup Tools, which installs the repo's dependencies, before this action, so the CLI can be found.I also tried loading
get-release-planfrom the repo's ownnode_modules, so the preview could never drift from the release tool. That doesn't work for v3, because@changesets/cli@3no longer depends on@changesets/get-release-plan.v5 has no API changes that affect this script: the default export is still the function, and
ReleasePlan.releases[]has the same shape. v5 is ESM-only and needs Node^22.11 || ^24 || >=26.Testing
Ran
GITHUB_WORKSPACE=… node preview-changeset-versions.mjsagainst fresh, installed clones:'@tanstack/react-query': minor: the fixed group shows 5.104.3 → 5.105.0 minor; lit/svelte/vue-query-devtools show patch. There are no major bumps, and the result matchespnpm exec changeset statuspackage for package.'@tanstack/router-core': minor:router-coreshows minor and the rest show patch. This matcheschangeset status("NO packages to be bumped at major").@changesets/cli: warns and falls back to v5.Follow-up
After this merges, the repos need to bump their pinned
TanStack/config/.github/changeset-preview@<sha>to pick up the fix. TanStack/query pinse4b48f16568324f76f467aa4c2aac2f05db632c3in.github/workflows/pr.yml(jobversion-preview).✅ Checklist
pnpm test:pr. (This changes only a GitHub Action, whichtest:prdoesn't cover. I tested it manually as described above.)🚀 Release Impact
🤖 Generated with Claude Code
Summary by CodeRabbit