Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: support yarn4 semver resolutions (#7442)
### Description Fixes #7414 Crux of the issue is that Yarn4 started encoding the default `npm:` protocol in `yarn.lock`, but not in other places where it is assumed such as [`resolutions` in `package.json`](https://yarnpkg.com/configuration/manifest#resolutions). We work around this by now applying overrides on packages that would match a `resolution` entry if the `npm:` protocol was added. ### Testing Instructions Added unit test, existing unit tests. Verified repro provided in repo now produces a pruned lockfile that is `yarn install --immutable` Closes TURBO-2404
- Loading branch information
1 parent
ae69ebc
commit b417e36
Showing
3 changed files
with
96 additions
and
2 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# This file is generated by running "yarn install" inside your project. | ||
# Manual changes might be lost - proceed with caution! | ||
|
||
__metadata: | ||
version: 8 | ||
cacheKey: 10 | ||
|
||
"@reproduce/something@workspace:packages/something": | ||
version: 0.0.0-use.local | ||
resolution: "@reproduce/something@workspace:packages/something" | ||
dependencies: | ||
react: "npm:^18.2.0" | ||
languageName: unknown | ||
linkType: soft | ||
|
||
"js-tokens@npm:^3.0.0 || ^4.0.0": | ||
version: 4.0.0 | ||
resolution: "js-tokens@npm:4.0.0" | ||
checksum: 10/af37d0d913fb56aec6dc0074c163cc71cd23c0b8aad5c2350747b6721d37ba118af35abdd8b33c47ec2800de07dedb16a527ca9c530ee004093e04958bd0cbf2 | ||
languageName: node | ||
linkType: hard | ||
|
||
"loose-envify@npm:^1.1.0": | ||
version: 1.4.0 | ||
resolution: "loose-envify@npm:1.4.0" | ||
dependencies: | ||
js-tokens: "npm:^3.0.0 || ^4.0.0" | ||
bin: | ||
loose-envify: cli.js | ||
checksum: 10/6517e24e0cad87ec9888f500c5b5947032cdfe6ef65e1c1936a0c48a524b81e65542c9c3edc91c97d5bddc806ee2a985dbc79be89215d613b1de5db6d1cfe6f4 | ||
languageName: node | ||
linkType: hard | ||
|
||
"react@npm:18.1.0": | ||
version: 18.1.0 | ||
resolution: "react@npm:18.1.0" | ||
dependencies: | ||
loose-envify: "npm:^1.1.0" | ||
checksum: 10/d1ec025276096aa8b87cc4ee95f911612f21c4d54e08a3fdf5a9d3d2242f825142eef300b13f26e17a14a94adcb640f4278ae5b4fe0de3a912adc325434b9a2a | ||
languageName: node | ||
linkType: hard | ||
|
||
"reproduce@workspace:.": | ||
version: 0.0.0-use.local | ||
resolution: "reproduce@workspace:." | ||
languageName: unknown | ||
linkType: soft |
This file contains 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
This file contains 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