turbo
bf837773 - fix(yarn4): avoid overwriting non-npm protocols (#6723)

Commit
2 years ago
fix(yarn4): avoid overwriting non-npm protocols (#6723) ### Description Fixes #6715 Yarn 4 now makes the default protocol of `npm` (e.g. `"foo": "*"` is really `"foo": "npm:*"`) explicit in the lockfile representation. This means that workspaces that reference a package with and without a protocol will end up with multiple protocols for a single descriptor. e.g. If one package has a dependency `"c": "*"` and another package in the workspace has a dependency `"c": "workspace:*"` In Yarn3 those result in the following descriptors: `c@*, c@workspace:*, c@workspace:pkgs/c` In Yarn4 those result in the following descriptors: `c@npm:*, c@workspace:*, c@workspace:pkgs/c` We cannot get rid of the logic for case without a protocol as that would break our Yarn3 usage. ### Testing Instructions Added unit test that has a lockfile with mixed protocols. Existing unit tests verify the Yarn3 behavior is still supported. Closes TURBO-1856 Co-authored-by: Chris Olszewski <Chris Olszewski>
Parents
Loading