-
-
Notifications
You must be signed in to change notification settings - Fork 21
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
Create new Ink app in a new directory #11
Create new Ink app in a new directory #11
Conversation
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.
Nice job 🚀
# Or create with TypeScript React | ||
$ npx create-ink-app --typescript | ||
$ npx create-ink-app --typescript my-fancy-ts-cli |
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.
$ npx create-ink-app --typescript my-fancy-ts-cli | |
$ npx create-ink-app my-fancy-ts-cli --typescript |
What do you think of a It would be interesting if the value received in the template argument matches the name of the template folder in the Example:npx create-ink-app my-fancy-ts-cli --template typescript-eslint The templates folder # ...
templates
|- _common
|- js
|- ts # rename to "typescript"
|- typescript-eslint
|- # ...
|- tsconfig.json
|- .eslintrc
|- # ...
# ... |
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 test anything. I left 1 suggestion. I didn't notice anything concerning that should prevent merging.
`, | ||
{ | ||
flags: { | ||
typescript: { |
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 would recommend making "project-directory" a flag too. It seems safer than accessing it as index 0.
cli.input[0]
seems fragile if for some reason something is misaligned and at position cli.input[1]
instead.
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 don't feel strongly about this.)
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 retract my suggestion. Convenience is more important. (I like the way you have it.)
Thanks @kevin940726 👍 |
Close #1.
Added support to pass a new input
<project-directory>
indicating where the project should be scaffolded in. Currently the input is optional, the current directory will be the default if it's not present, so that we can make this feature backward-compatible. In the future, we should at least add a warning if the input is not passed.I also added some basic helpful message upon successfully created an app. Wordings are TBD.
Example:
I intentionally move some logic to
cli.js
so that in the future we can support programmatic API by directly importingindex.js
as well.