Adds basic support for .yamlrc.yml (yarnPath only, v2) #7350
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
Ref: yarnpkg/berry#239
I'm planning to rename
.yarnrc
files into.yarnrc.yml
in order to avoid problems where configuration for two different syntaxes / documentations would have to be used together. My hope is that it'll help the migration plan become smoother and less unpredictable.This proposal has one drawback: the
yarn-path
settings. The v1 (which I expect to stay the version in the global path for some time) doesn't know how to read the.yarnrc.yml
file, and to look for theyarn-path
settings there. We could make the v2 write theyarn-path
settings into the old.yarnrc
file (rather than.yarnrc.yml
), but that would require to have both.yarnrc
and.yarnrc.yml
at the same time when using the v2, which I'd prefer to avoid.To solve this, my plan is to:
.yarnrc
filesyarn-path
in the.yarnrc.yml
file.yarnrc.yml
fileyarn policies set-version
write a.yarnrc.yml
when installing the v2This diff solves 1, 2, and 3. The fourth point is optional and will be done at a later point if at all.
Test plan
Ran Yarn with a local
.yarnrc.yml
, worked successfully. Tests will validate that the old workflow also work.