Skip to content

Conversation

@rubencarvalho
Copy link
Contributor

Description

Adds a patch for @changesets/cli v2.29.7 that enables proper yarn support when publishing packages. The patch modifies two key functions:

  1. getPublishTool - Now detects and returns yarn as the publish tool when yarn is the package manager
  2. internalPublish - Uses yarn npm publish command instead of npm publish when yarn is detected

This ensures that workspace:* protocol references in package.json dependencies are properly replaced with actual version numbers during publishing.

Motivation and context

Without this patch, changeset publish fails to properly replace workspace:* references when publishing packages in a yarn workspace. This is because changesets defaults to using npm publish even in yarn workspaces, and npm doesn't understand yarn's workspace protocol.

The yarn npm publish command properly resolves workspace:* to the actual published version numbers before publishing to the registry.

Related issue(s)

This patch is a temporary solution until the upstream fix is merged and released.

@changeset-bot
Copy link

changeset-bot bot commented Oct 22, 2025

⚠️ No Changeset found

Latest commit: d4fe7db

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@rubencarvalho rubencarvalho changed the base branch from main to barebones October 22, 2025 14:11
@rubencarvalho rubencarvalho changed the title Ruben/patch changesets chore(tooling): add changesets cli patch to allow yarn npm publish Oct 22, 2025
@rubencarvalho rubencarvalho marked this pull request as ready for review October 22, 2025 18:55
@rubencarvalho rubencarvalho requested a review from a team as a code owner October 22, 2025 18:55
@rubencarvalho rubencarvalho added Tooling Status: Ready for review PR ready for review or re-review. 2nd gen These issues or PRs map to our 2nd generation work to modernizing infrastructure. labels Oct 22, 2025
@Rajdeepc
Copy link
Contributor

@rubencarvalho Can you add a minimum validation step like which yarn version is this tested and which CI jobs were validated? Requesting some context here why this was done?

Copy link
Contributor

@nikkimk nikkimk left a comment

Choose a reason for hiding this comment

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

lgtm

@rubencarvalho
Copy link
Contributor Author

@rubencarvalho Can you add a minimum validation step like which yarn version is this tested and which CI jobs were validated? Requesting some context here why this was done?

This is compatible with yarn 4 (our version). I tested this by running:

yarn changeset version --snapshot nightly
yarn changeset publish --tag nightly --no-git-tag

But this will still be re-tested under SWC-1236.

@rubencarvalho rubencarvalho merged commit d48c20d into barebones Oct 23, 2025
13 of 15 checks passed
@rubencarvalho rubencarvalho deleted the ruben/patch-changesets branch October 23, 2025 20:08
@github-actions
Copy link
Contributor

📚 Branch Preview

🔍 Visual Regression Test Results

When a visual regression test fails (or has previously failed while working on this branch), its results can be found in the following URLs:

Deployed to Azure Blob Storage: pr-5821

If the changes are expected, update the current_golden_images_cache hash in the circleci config to accept the new images. Instructions are included in that file.
If the changes are unexpected, you can investigate the cause of the differences and update the code accordingly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2nd gen These issues or PRs map to our 2nd generation work to modernizing infrastructure. Status: Ready for review PR ready for review or re-review. Tooling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants