-
Notifications
You must be signed in to change notification settings - Fork 241
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
Fallback to kebab-case command #357
Conversation
|
||
## Detailed Explanation | ||
|
||
Let's say that `npm my-command` is run. Then `npm` should first see if their is a builtin command called `my-command`. If not then it will look through the path for `npm-my-command`. If that fails, then the current fallback will be run: |
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.
what's the advantage of using npm-my-command
? is this a convention that's used (besides perhaps git)?
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.
I didn't completely understand your question. If you were asking why I chose my-command
, that was just an example. If you meant why custom commands should be a thing: Creating custom npm
command will allow developers to "extend" npm
with more CLI features for users.
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.
Allowing that would make "npm adds a new top-level command" a breaking change, and would also make npm
's interface different on a per-package basis.
Doesn't this have all the same problems that killed the |
@isaacs yes; It's the same non-deterministic approach we've discussed at length previously & I believe the general consensus, & our team's own feelings, were that we don't want to move forward with any kind of fallback support for top-level commands. This type of implementation can cause confusion between developers (ex. docs/how-tos get written with customized/nuanced commands that aren't supported out-of-the-box) & clobbers the namespace, hampering our future development |
See preview