-
Notifications
You must be signed in to change notification settings - Fork 2.1k
fix: improve prune for yarn 3 #10634
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Skipped Deployment
|
…iptors The Berry lockfile resolution fix now correctly preserves both the original descriptor (as used by packages) and the resolved descriptor (from yarn resolutions) in the pruned lockfile. This allows packages to find their dependencies using either descriptor form. Updated test expectation from: "is-odd@npm:3.0.0" to: "is-odd@^0.1.2, is-odd@npm:3.0.0" This reflects the correct behavior where yarn combines multiple descriptors that resolve to the same package into a single entry.
| $ grep -F '"is-odd@npm:' out/yarn.lock | ||
| "is-odd@npm:3.0.0": | ||
| $ grep -F '"is-odd@' out/yarn.lock | ||
| "is-odd@^0.1.2, is-odd@npm:3.0.0": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@chris-olszewski I'm pretty dubious of this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't correct. Either:
- We're now emitting
is-odd@^0.1.2inyarn.lockwhich is an invalid locator - We're not emitting that and this test change will fail
chris-olszewski
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need some real tests with real lockfiles to verify this change. I'm pretty suspect of it as it currently stands.
| resolutions: Some( | ||
| [("ajv".to_string(), "^8".to_string())] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to actually recreate the fixture lockfile and not just set resolutions here.
|
This PR was part of an experiment I was doing to test how fast we could reliably go in the repo with LLMs. We've seen enough PRs we don't like come through that we think could be improved by first circling back to improve the health of the codebase. As a first step, we're going to be investing in test coverage. Closing this PR with these interests in mind. |
Description
Fixes #2791
Testing Instructions
Tests have been added for the previous failing cases