turborepo
2c7bad58 - fix: berry prune including all builtin patch descriptors (#4770)

Commit
2 years ago
fix: berry prune including all builtin patch descriptors (#4770) ### Description Addresses the issue @erj826 found in [#2791](https://github.com/vercel/turbo/issues/2791#issuecomment-1527616578) 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.
Parents
Loading