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

feat(create-redwood-app): cli flags to show up help and version information #671

Merged
merged 8 commits into from
Jun 16, 2020

Conversation

jamesgeorge007
Copy link
Contributor

create-redwood-app --help | -h
create-redwood-app --version | -v

Previously create-redwood-app --help would create a directory under the name --help within the current path.

@thedavidprice
Copy link
Contributor

@jamesgeorge007 thanks for this! And great catch. This will be 100% needed sooner than later, for example, once the TypeScript support is complete and individuals can choose the installation language target.

Your custom code looks great. But we've been using Yargs for the Redwood CLI (example file). Would you be interested in attempting to implement this with Yargs?

Definitely open to discussion! And, at the very least, we could go ahead and move forward with merging this code and then following up with a Yargs improvement.

Thoughts?

@jamesgeorge007
Copy link
Contributor Author

Maybe we could onboard an arg-parser library, but IMHO it isn't necessary for a CLI utility of similar sort whose sole purpose is project scaffolding.

@thedavidprice
Copy link
Contributor

At this time, the requirements are very simple indeed. But in the near future there are going to be increasing options for the type of installation:

  • language target (as I mentioned)
  • Sides to include: default will be web and api but installation might target only one or the other, and in the future, we'll see react native, electron, etc. be available
  • Templates: this is a bit further out, but using a different "starter" or configuration will be technically possible (although unplanned as of yet)
  • Tying in other tools (like diagnostics) at the time of installation, etc.

The last reason is for consistency -- we're using Yargs everywhere else. Whether or not we do it now, we will end up using Yargs for this.

All that said, I'm ok to proceed as is. But if you'd like to take a swing at Yargs, it's definitely of value and I (we) would support you as needed.

What would you like to do as a next step?

@jamesgeorge007
Copy link
Contributor Author

jamesgeorge007 commented Jun 13, 2020

Let's land this one as of now and revisit the yargs implementation in a follow-up PR.

@thedavidprice thedavidprice added this to the next release milestone Jun 16, 2020
@thedavidprice
Copy link
Contributor

@jamesgeorge007 sounds good and the PR looks good. Merging now.

Thanks again 🚀

@thedavidprice thedavidprice merged commit f9d365f into redwoodjs:master Jun 16, 2020
@jamesgeorge007 jamesgeorge007 deleted the feat/cli-flags branch June 16, 2020 07:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic/cli topic/crwa create-redwood-app
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants