Repository navigation
Conversation
👷 Deploy request for changesets pending review.Visit the deploys page to approve it
|
🦋 Changeset detectedLatest commit: e891298 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 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 |
This branch has not been deployed
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.
Problem
When
changeset versionupdates an internal dependency range, hyphen ranges such as1.0.0 - 2.0.0are silently rewritten to the bare new version. The upper bound — and with it the whole compatibility window — disappears from the manifest.With:
and changesets
pkg-a: minor+pkg-b: patch,changeset versionproduces:pkg-a@1.1.0is inside the authored window, so the range should stay bounded (for example>=1.1.0 <=2.0.0).This is the same class of bug as #2271, which #2297 fixed for ranges written with explicit
>/<comparators.new Range("1.0.0 - 2.0.0").set[0]also contains exactly one lower (>=) and one upper (<=) comparator, butgetNewDependencyRangedecided whether a range was bounded by looking for literal>/<characters in the input string, so hyphen ranges fell through to the^/~/>=fallback and were replaced with a bare version.Fix
Recognize the hyphen syntax as bounded as well, so those ranges reuse the existing bounded-range branch. Caret, tilde and x-ranges still keep their shorthand form, and union ranges still fall back as before.
Tests
packages/apply-release-plan/src/index.test.ts:1.2.0 - 2.0.0with aminorrelease to1.3.0now yields>=1.3.0 <=2.0.0instead of1.3.0. Removing the source change makes this case fail, so the test does lock in the behavior.pnpm exec vitest run packages/apply-release-plan/src packages/cli/src/commands/version packages/assemble-release-plan/src→ 410 passed / 1 todo.pnpm exec tsc,pnpm exec eslint <changed files>andpnpm exec oxfmt --check <changed files>pass.One note on output shape: the range is normalized to
>=x <=y, matching how the existing bounded branch already rewrites>=1.0.0 <2.0.0. Keeping the hyphen spelling would need style information thatgetNewDependencyRangedoes not carry today; happy to rework it if you would rather preserve the authored form.