Updating volta pin to support a --default flag#52
Updating volta pin to support a --default flag#52charlespierce wants to merge 4 commits intovolta-cli:mainfrom
volta pin to support a --default flag#52Conversation
text/0000-volta-use.md
Outdated
|
|
||
| One alternative would be to only change the verb for `install`, leaving `pin` completely untouched. This would be the least disruptive change, however it's very dependent on the verb / command that we choose. With the proposal of `volta use`, it would feel very unintuitive to run `volta use node@21` in a project, and then immediately get a message that it's set as the global but your local settings override. As a user, I would expect `volta use node@21` to mean the next call to `node --version` to display Node 21 is running. In order to make that work as users expect, we need to unify the two so that `volta use` _does_ actually change the Node for the current context. | ||
|
|
||
| Another difficulty of the unified behavior is that it's more difficult to explain when users run into edge cases. Right now there's a clear separation between "local" and "global" with two different commands. Unifying them means we'll need to clearly document how `volta use` behaves in each situation, and how to override that (with the `--global` or `--pin` flags). |
There was a problem hiding this comment.
This is basically exactly my point above. 😂 I take it to be the most significant drawback, and I think it is the thing which really mashes my buttons.
text/0000-volta-use.md
Outdated
| ## `volta default` or `volta global` | ||
|
|
||
| In the vein of replacing the verb for `install`, I also considered `default` or `global` for the command. The major issue with those is that they're adjectives, rather than verbs, so it's not immediately clear what the command means. Does `volta default node` mean "choose a default node" or "list the current default node"? That confusion is ultimately why I decided against using either of these for the command. | ||
|
|
||
| ## `volta set` | ||
|
|
||
| Another possibility for the command would be to make it more verbose, e.g. `volta set default node`. That solves the problems around `volta default` or `volta global` by adding a verb to make it very clear what you are doing. However, it makes the commands a fair bit more cumbersome to use, which I feel is ultimately a net negative compared to a single command. |
There was a problem hiding this comment.
👍🏼 to these; I agree quite strongly!
|
Suggestion from the main Volta repo: Having |
|
I definitely don’t have an objection to |
volta pin to support a --default flag
|
Updated to a new proposal of continuing to use |
|
@charlespierce - I really like this last round of updates, definitely makes more sense to me this way. |
I don't have a deep recollection, but I think we actually did have |
Proposal for updating
volta pinto add a--defaultflag that replaces the need forvolta install, combining all of the pin operations into a singlevolta pincommand.Rendered