-
Notifications
You must be signed in to change notification settings - Fork 0
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
CLI command for initializing component boilerplate #109
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.
This is so awesome. I took it for a test run and am definitely going to use this in the future. Very glad for the validation, not only of camel case but also if the directory exists already.
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.
This is awesome, I have just 2 things for consideration here:
- What if we refactored to use the more updated version of the
inquirer
package here. - Could we make it optional to specify the ComponentName as a command line arg so this could run in a single command? Like
npm create-component MyNewComponent
? I'd think if the user leaves the argument off, it would prompt for the name as it currently does, but if they do provide it, it just skips the prompt.
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.
This is fantastic!
What's in this pull request
Description
Running
npm run create-component
will ask for a component name and create 3 boilerplate files (svelte, story, and docs). Checks for PascalCase and uses theinquirer
package for JS-based CLI functionality (dev-only dependency).Future features to consider:
src/lib/
.docs.mdx
template (instead of.docs.md
)Before submitting, please check that you've
CHANGELOG.md
Next
section