-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: berry prune including all builtin patch descriptors (#4770)
### Description Addresses the issue @erj826 found in [#2791](#2791 (comment)) The issue came from us including all descriptors for patches included in the pruned lockfile. This is fine for patches created by `yarn patch` since this uses `resolutions` which results in the patch having a single descriptor. Yarn also includes [some patches](https://github.com/yarnpkg/berry/tree/master/packages/plugin-compat) by default if they appear in your lockfile. These patches don't go through `resolutions` and instead get routed through the [`reduceDependency` hook](https://yarnpkg.com/advanced/plugin-tutorial#hook-reduceDependency) which produces a new descriptor for each descriptor used for the original package. The fix was to only include patch descriptors if the embedded descriptor is present in the pruned lockfile. ### Testing Instructions Added a new test fixture where multiple workspaces depend on `resolve`, but use different ranges.
- Loading branch information
1 parent
ac765e7
commit 2c7bad5
Showing
2 changed files
with
134 additions
and
8 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,103 @@ | ||
# This file is generated by running "yarn install" inside your project. | ||
# Manual changes might be lost - proceed with caution! | ||
|
||
__metadata: | ||
version: 6 | ||
cacheKey: 8 | ||
|
||
"a@workspace:packages/a": | ||
version: 0.0.0-use.local | ||
resolution: "a@workspace:packages/a" | ||
dependencies: | ||
c: "*" | ||
resolve: ^1.22.2 | ||
languageName: unknown | ||
linkType: soft | ||
|
||
"b@workspace:packages/b": | ||
version: 0.0.0-use.local | ||
resolution: "b@workspace:packages/b" | ||
dependencies: | ||
c: "workspace:*" | ||
resolve: 1.22.3 | ||
languageName: unknown | ||
linkType: soft | ||
|
||
"c@*, c@workspace:*, c@workspace:packages/c": | ||
version: 0.0.0-use.local | ||
resolution: "c@workspace:packages/c" | ||
dependencies: | ||
resolve: ^1.22.0 | ||
languageName: unknown | ||
linkType: soft | ||
|
||
"function-bind@npm:^1.1.1": | ||
version: 1.1.1 | ||
resolution: "function-bind@npm:1.1.1" | ||
checksum: b32fbaebb3f8ec4969f033073b43f5c8befbb58f1a79e12f1d7490358150359ebd92f49e72ff0144f65f2c48ea2a605bff2d07965f548f6474fd8efd95bf361a | ||
languageName: node | ||
linkType: hard | ||
|
||
"has@npm:^1.0.3": | ||
version: 1.0.3 | ||
resolution: "has@npm:1.0.3" | ||
dependencies: | ||
function-bind: ^1.1.1 | ||
checksum: b9ad53d53be4af90ce5d1c38331e712522417d017d5ef1ebd0507e07c2fbad8686fffb8e12ddecd4c39ca9b9b47431afbb975b8abf7f3c3b82c98e9aad052792 | ||
languageName: node | ||
linkType: hard | ||
|
||
"is-core-module@npm:^2.12.0": | ||
version: 2.12.0 | ||
resolution: "is-core-module@npm:2.12.0" | ||
dependencies: | ||
has: ^1.0.3 | ||
checksum: f7f7eb2ab71fd769ee9fb2385c095d503aa4b5ce0028c04557de03f1e67a87c85e5bac1f215945fc3c955867a139a415a3ec4c4234a0bffdf715232660f440a6 | ||
languageName: node | ||
linkType: hard | ||
|
||
"path-parse@npm:^1.0.7": | ||
version: 1.0.7 | ||
resolution: "path-parse@npm:1.0.7" | ||
checksum: 49abf3d81115642938a8700ec580da6e830dde670be21893c62f4e10bd7dd4c3742ddc603fe24f898cba7eb0c6bc1777f8d9ac14185d34540c6d4d80cd9cae8a | ||
languageName: node | ||
linkType: hard | ||
|
||
"prune-edge@workspace:.": | ||
version: 0.0.0-use.local | ||
resolution: "prune-edge@workspace:." | ||
languageName: unknown | ||
linkType: soft | ||
|
||
"resolve@npm:1.22.3, resolve@npm:^1.22.0, resolve@npm:^1.22.2": | ||
version: 1.22.3 | ||
resolution: "resolve@npm:1.22.3" | ||
dependencies: | ||
is-core-module: ^2.12.0 | ||
path-parse: ^1.0.7 | ||
supports-preserve-symlinks-flag: ^1.0.0 | ||
bin: | ||
resolve: bin/resolve | ||
checksum: fb834b81348428cb545ff1b828a72ea28feb5a97c026a1cf40aa1008352c72811ff4d4e71f2035273dc536dcfcae20c13604ba6283c612d70fa0b6e44519c374 | ||
languageName: node | ||
linkType: hard | ||
|
||
"resolve@patch:resolve@1.22.3#~builtin<compat/resolve>, resolve@patch:resolve@^1.22.0#~builtin<compat/resolve>, resolve@patch:resolve@^1.22.2#~builtin<compat/resolve>": | ||
version: 1.22.3 | ||
resolution: "resolve@patch:resolve@npm%3A1.22.3#~builtin<compat/resolve>::version=1.22.3&hash=c3c19d" | ||
dependencies: | ||
is-core-module: ^2.12.0 | ||
path-parse: ^1.0.7 | ||
supports-preserve-symlinks-flag: ^1.0.0 | ||
bin: | ||
resolve: bin/resolve | ||
checksum: ad59734723b596d0891321c951592ed9015a77ce84907f89c9d9307dd0c06e11a67906a3e628c4cae143d3e44898603478af0ddeb2bba3f229a9373efe342665 | ||
languageName: node | ||
linkType: hard | ||
|
||
"supports-preserve-symlinks-flag@npm:^1.0.0": | ||
version: 1.0.0 | ||
resolution: "supports-preserve-symlinks-flag@npm:1.0.0" | ||
checksum: 53b1e247e68e05db7b3808b99b892bd36fb096e6fba213a06da7fab22045e97597db425c724f2bbd6c99a3c295e1e73f3e4de78592289f38431049e1277ca0ae | ||
languageName: node | ||
linkType: hard |
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