turbo
02ac381f - fix(prune): fix Yarn1 entries getting merged erroneously (#9627)

Commit
1 year ago
fix(prune): fix Yarn1 entries getting merged erroneously (#9627) ### Description Fixes #8849 This is a port of https://github.com/yarnpkg/yarn/pull/9023/to our codebase. Previously, Yarn would collapse all identical entries to share a slot in the lockfile with the keys joined by `,` e.g. `next@latest, next@15.1.0`. We copied that logic which resulted in `string-width-cjs@npm:string-width@4.2.0` and `string-width@4.2.0` getting collapsed as they have identical data: ``` version "4.2.0" resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.0.tgz#952182c46cc7b2c313d1596e623992bd163b72b5" integrity sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg== dependencies: emoji-regex "^8.0.0" is-fullwidth-code-point "^3.0.0" strip-ansi "^6.0.0" ``` This behavior was altered in the PR linked above where now it will no longer group keys for identical entries if they have different package names in the keys. So since `string-width-cjs != string-width` these will have separate slots. This PR intentionally isn't super Rust-y so we're able to better update our behavior to match Yarn in case we need to update. ### Testing Instructions Added a unit test from reproduction to ensure that we no longer merge the problematic entries.
Parents
Loading