Repository navigation
fix(workspace): link npm, Yarn and Bun workspace deps by range - #999
Open
arnaud-dezandee wants to merge 3 commits into
Open
arnaud-dezandee wants to merge 3 commits into
arnaud-dezandee wants to merge 3 commits into
Conversation
…range npm and Yarn classic reject the `workspace:` protocol, so in their workspaces every dependency between packages is a plain range like `*` or `^1.0.0`, and the package graph had no edges. npm, Yarn and Bun link a workspace package when its `version` satisfies the range; the graph now does the same for `package.json` `workspaces`, following npm's rule that `*` and an empty range match any version, prereleases included. pnpm workspaces are unchanged: pnpm links such ranges only with `linkWorkspacePackages`, which isn't read yet. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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.
Motivation
npm and Yarn classic reject the
workspace:protocol, so packages in their workspaces depend on each other with plain ranges like"*"or"^1.0.0". The package graph only linkedworkspace:specs, so an npm workspace had no edges:vp run --filter "...pkg"selected no dependents,-tanddependsOnwithfrom: "dependencies"ran nothing in dependencies, and-rignored dependency order.Changes
For
package.jsonworkspaces(npm, Yarn, Bun), a dependency now links to the workspace package of that name when itsversionsatisfies the range. As in npm,*and an empty range match any version, prereleases included.file:, tags and git specs don't link yet. pnpm is unchanged, since it links plain ranges only withlinkWorkspacePackages, which isn't read yet.js-semver, which has no dependencies and is already used by vite-plus;deny.tomlnow allows its MIT-0 license.vp run --filterreports a false cycle when sibling packages are linked via peer/devDependencies #411 (fix(graph): tolerate workspace package-ordering cycles #414 would tolerate those).*; they still link here, which only adds an ordering edge.file:andworkspace:../pathspecs.