Skip to content
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

Closed
wants to merge 2 commits into from

Conversation

benkenawell
Copy link

@benkenawell benkenawell commented Nov 12, 2021

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

@changeset-bot
Copy link

changeset-bot bot commented Nov 12, 2021

🦋 Changeset detected

Latest commit: 304450c

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@manypkg/cli Minor

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",
Copy link
Collaborator

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~)

Copy link
Author

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.

  1. 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.
  2. 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
  3. 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.
  4. 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.

@benkenawell benkenawell mentioned this pull request Dec 25, 2021
@benkenawell
Copy link
Author

closing because I stopped receiving feedback from maintainers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants