-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
Command: vue config implemented #1554
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
Merge branch 'dev' of https://github.com/beardedpayton/vue-cli into dev
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.
Thanks for the PR! A few things:
-
The
~/.vuerc
file is a config file that may contain presets, it is not the preset itself. The command descriptions and logs need to adjusted. -
The implementation currently does not handle nested paths. You will need packages like https://github.com/jonschlinkert/get-value to handle nested paths.
@yyx990803 thanks for the feedback. Can you provide me an example of proposed wording for one of the commands? |
Just replacing |
@yyx990803 Changes made and pushed. Nested path support implemented with dependencies commands/logs updated |
@beardedpayton
Wouldn't be better to just use one dependency for this case? I am thinking https://github.com/sindresorhus/dot-prop |
@yyx990803 Do the changes look good to be merged? Or does this PR need more work? |
packages/@vue/cli/bin/vue.js
Outdated
.description('inspect and modify the config') | ||
.option('-g, --get <path>', 'get value from preset') | ||
.option('-s, --set <path> <value>', 'set preset value') | ||
.option('-d, --delete <path>', 'delete preset from config') |
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.
You are still using the word preset
in here and above.
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.
@pksunkara whoops, thanks for that. Just made the changes.
I've wrapped up the new
vue config
command.Takeway:
If there is a better way to do a conditional check to only print the config and resolved path when
vue config
is invoked let me know.Out of the box Commander doesn't support options with multiple values. My work around for the
vue config -s <path> <value>
command was to pass an optional argument to the command and do a conditional check if present.I added the dependency opn for opening the config file with
vue config -e
if there is a shared utility for this I couldn't track it down.Hope everything looks good!