fix(yarn) detect yarn berry when running bin #1388
Merged
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
yarnPath
setup; 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-network
seems to be failing because I don't havemockito
locally