feat(essentials): better yarn config commands#1141
Merged
arcanis merged 17 commits intoApr 10, 2020
Conversation
The value provided to `yarn config set` will be parsed as YAML if possible, else it will be used as a string.
There's no need for the extra complexity.
Member
Author
|
@arcanis, I'm wondering if we should make the |
arcanis
reviewed
Apr 6, 2020
Member
arcanis
left a comment
There was a problem hiding this comment.
Awesome! Just a little typeof value === 'string' to add to yarn config get and it'll be good to go! 😃
Co-Authored-By: Maël Nison <nison.mael@gmail.com>
Co-Authored-By: Maël Nison <nison.mael@gmail.com>
Member
Author
|
BTW, shouldn't we remove the polyfills for Node 8, since we dropped support for Node 8? |
Member
|
Yep, finally 🤡 |
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.
This PR has been updated to include the suggestions @arcanis gave me on Discord.
What's the problem this PR addresses?
Currently:
yarn config getdoesn't correctly display values that aren't stringsyarn config setcan only set string valuesHow did you fix it?
I made
yarn config getdisplay configuration values usinginspector as JSON when using the--jsonflag.For displaying them as JSON, I had to implement a function that recursively converts maps to objects.
I made
yarn config setaccept values as JSON when using the--jsonflag.When not using the
--jsonflag, values are set as strings.When using the
--jsonflag, values are parsed as JSON before being set.TODO:
yarn config getcommandyarn config setoutput. I'll let @arcanis handle this if he wants, as I'm not good at picking colors 😄