fix(yarn) detect yarn berry when running bin#1388
Merged
charlespierce merged 3 commits intovolta-cli:mainfrom Jan 10, 2023
Merged
fix(yarn) detect yarn berry when running bin#1388charlespierce merged 3 commits intovolta-cli:mainfrom
charlespierce merged 3 commits intovolta-cli:mainfrom
Conversation
In Yarn 3, binaries should be run via `yarn run <bin-name>` instead of the assumption of `node_modules/.bin/<bin-name>`. This is required not only with pnp mode.
charlespierce
approved these changes
Dec 3, 2022
Contributor
charlespierce
left a comment
There was a problem hiding this comment.
A small naming suggestion, but otherwise this look good, thank you!
Contributor
|
Oh boo, sorry about that! It looks like GitHub requires us to manually approve the CI on follow-up pushes. And there's a small formatting issue failing the format check CI. Can you run |
Contributor
Author
|
@charlespierce oops sorry I missed the message. I pushed the fmt commit. |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
In Yarn 3, binaries should be run via
yarn run <bin-name>instead of the assumption ofnode_modules/.bin/<bin-name>. This is required not only with pnp mode.Note
I chose to detect .yarnrc.yml because this is how yarn uses
yarnPathsetup; this may not be required when using corepack, but volta does not support corepack yet.Ref yarnpkg.com:
I am very new to Rust, please correct me if there are things that are wrong or can be improved.
Test Plan
Built dev volta and verified it works on one of my yarn berry repo.
Note:
cargo test --all --features mock-networkseems to be failing because I don't havemockitolocally