-
Notifications
You must be signed in to change notification settings - Fork 50
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
install commander, update cli to run using it #126
Conversation
🦋 Changeset detectedLatest commit: 304450c The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
@@ -16,6 +16,7 @@ | |||
"@babel/runtime": "^7.5.5", | |||
"@manypkg/get-packages": "^1.1.3", | |||
"chalk": "^2.4.2", | |||
"commander": "^8.3.0", |
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.
The preferred package to handle this sort of stuff would be this: https://www.npmjs.com/package/meow . It's the one used by both Changesets and Preconstruct (and those projects are maintained by roughly the same group of people~)
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 see and understand why that makes sense. I want to argue in favor of commander over meow here, after looking over meow.
- commander provides a solid api, and docs for that api. https://github.com/commander-cli/commander
- normally I would prefer meow's method of returning POJOs and arrays, but their documentation is solely lacking relative to commander, and is actually much less flexible than commander's api which is typically the benefit with returning POJOs and the like.
- commander's help text is automatically generated, it doesn't need maintaining, and won't go out of date. They're able to do this because you must declare each command and options within their api
- also due to how commands are called, with commander you can query help for commands individually, which comes for free, whereas you'd have to do that all yourself with meow.
- Commander allows for a lot of streamlining and simplification of the code you as a maintainer have to write, even after giving you all the above benefits. Commander takes care of parsing the command line more completely than meow does, and allows for the calling of disparate functions based on commands.
I created PR #128 that accomplishes similar with meow, which you can use for comparison. As the maintainer, it's, of course, completely up to you which you choose to take (if either!). I appreciate the work you've done and would love to contribute in the way most helpful to you.
closing because I stopped receiving feedback from maintainers. |
The help descriptions could probably use a little tweaking, but this mirrors what the cli was doing before while adding a
help
flag using a robust library (commander) that could do even more to improve the dev experience.Proposed patch for #125