Fix several changeset version issues with workspace protocol dependencies#1888
Merged
Andarist merged 13 commits intochangesets:mainfrom Apr 1, 2026
Merged
Conversation
🦋 Changeset detectedLatest commit: 2ea0a77 The changes in this PR will be included in the next version bump. This PR includes changesets to release 6 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1888 +/- ##
==========================================
+ Coverage 81.84% 83.37% +1.52%
==========================================
Files 55 56 +1
Lines 2396 2466 +70
Branches 725 748 +23
==========================================
+ Hits 1961 2056 +95
+ Misses 429 404 -25
Partials 6 6 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Andarist
reviewed
Mar 28, 2026
changeset version issues with workspace protocol dependencies
Andarist
approved these changes
Apr 1, 2026
Merged
nnecec
pushed a commit
to nnecec/changesets-docs
that referenced
this pull request
Apr 16, 2026
…encies (changesets#1888) * fix(apply-release-plan): strip workspace: prefix before semver range comparison * fix: restore yarn.lock from upstream to fix CI parse error * style: fix prettier formatting * style: fix prettier formatting in apply-release-plan utils * remove the lock * fix implementation * fix: add oldVersion to test fixtures and format files * style: fix prettier formatting in apply-release-plan * add tests * fix workspace:path/to/pkg * add more tests * fix dir in test-utils * fix changesets --------- Co-authored-by: Maks Pikov <mixelburg@users.noreply.github.com> Co-authored-by: Maks Pikov <mixelburg@gmail.com> Co-authored-by: Mateusz Burzyński <mateuszburzynski@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1886
Problem
When a package uses explicit -style versions (as opposed to the shorthand , , ), the
shouldUpdateDependencyBasedOnConfigfunction passes the raw range string (including theworkspace:prefix) tosemver.satisfies. Semver can't parse the prefix and always returnsfalse, making the function treat every explicit workspace range as "out of range" and forcing unnecessary version bumps.For example, if
pkg-ahas"pkg-b": "workspace:^1.0.0"inpeerDependenciesandpkg-bbumps from1.0.0to1.0.1, changesets would incorrectly decide the range is violated and bumppkg-aas well — even withonlyUpdatePeerDependentsWhenOutOfRange: true.Fix
Strip the
workspace:prefix fromdepVersionRangebefore callingsemverSatisfies. The implicit workspace aliases (^,~,*) are not real semver ranges, so they're handled separately (the caller alreadycontinues on them).Changes
packages/apply-release-plan/src/utils.ts: strip prefix, guard implicit aliasespackages/apply-release-plan/src/utils.test.ts: new unit tests for the fixed cases