Skip to content

Fixed an issue with workspace:^ and workspace:~ dependency ranges not being semantically treated as, respectively, ^CURRENT_VERSION and ~CURRENT_VERSION#1693

Merged
Andarist merged 1 commit intomainfrom
fix/workspace-caret
Jun 20, 2025
Merged

Fixed an issue with workspace:^ and workspace:~ dependency ranges not being semantically treated as, respectively, ^CURRENT_VERSION and ~CURRENT_VERSION#1693
Andarist merged 1 commit intomainfrom
fix/workspace-caret

Conversation

@Andarist
Copy link
Member

No description provided.

… not being semantically treated as, respectively, `^CURRENT_VERSION` and `~CURRENT_VERSION`
@Andarist Andarist requested a review from bluwy June 19, 2025 17:41
@changeset-bot
Copy link

changeset-bot bot commented Jun 19, 2025

🦋 Changeset detected

Latest commit: 05f4a4b

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@changesets/assemble-release-plan Patch
@changesets/cli Patch
@changesets/get-release-plan Patch

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
Copy link

codecov bot commented Jun 19, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 80.71%. Comparing base (9ce98a5) to head (05f4a4b).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1693      +/-   ##
==========================================
+ Coverage   80.68%   80.71%   +0.03%     
==========================================
  Files          54       54              
  Lines        2257     2261       +4     
  Branches      682      681       -1     
==========================================
+ Hits         1821     1825       +4     
  Misses        431      431              
  Partials        5        5              

☔ View full report in Codecov by Sentry.
📢 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.

});

it("should bump dependent package when bumping a `workspace:^` dependency", async () => {
it("should not bump dependent package when patch bumping a `workspace:^` dependency", async () => {
Copy link
Member Author

Choose a reason for hiding this comment

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

This test had wrong expected results. It can easily be observed by introducing this change to it:

      "packages/pkg-a/package.json": JSON.stringify({
        name: "pkg-a",
        version: "1.0.0",
        dependencies: {
-          "pkg-b": "workspace:^",
+          "pkg-b": "^1.0.0",
        },
      }),

Those should behave exactly the same as workspace:^ is just a sugar for the inlined "current version".

Copy link
Contributor

@bluwy bluwy left a comment

Choose a reason for hiding this comment

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

Makes sense 👍

@Andarist Andarist merged commit 6352819 into main Jun 20, 2025
6 checks passed
@Andarist Andarist deleted the fix/workspace-caret branch June 20, 2025 06:37
@github-actions github-actions bot mentioned this pull request Jun 20, 2025
@reabiliti
Copy link

reabiliti commented Jul 31, 2025

@bluwy @Andarist hi, We've tried setup new version and seems like now it's not follow docs - https://github.com/changesets/changesets/blob/main/docs/config-file-options.md#updateinternaldependencies

We have

pkg-a @ version 1.0.0
pkg-b @ version 1.0.0
  depends on pkg-a at range `^1.0.0

When sets "updateInternalDependencies": "patch", in changeset config, patch and minor version of package pkg-a doesn't trigger new version for pkg-b

Seems like now updateInternalDependencies is useless?

@bluwy
Copy link
Contributor

bluwy commented Aug 4, 2025

From what I understand in the docs, the bump only happens when cutting a patch for both pkg-a and pkg-b, so you have to cut a patch in pkg-b too to trigger that.

It would be best to open a new issue though if what you described has worked in a previous changesets version before and this PR affected it.

@Andarist
Copy link
Member Author

Andarist commented Aug 4, 2025

That is right - but I agree that this option is hard to understand without examples. @reabiliti maybe you are looking for this:

  "___experimentalUnsafeOptions_WILL_CHANGE_IN_PATCH": {
    "updateInternalDependents": "always"
  }

mbeckem added a commit to open-pioneer/trails-build-tools that referenced this pull request Sep 12, 2025
Workaround for current issue where a release may not be triggered for a dependent package.
See discussion here: changesets/changesets#1693 (comment)
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.

4 participants