-
Notifications
You must be signed in to change notification settings - Fork 2
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: Generator CLI support #80
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.
In general, while I support the approach, I am skeptical of the quantity of code required to have the two modes working together.
It seems we are adding a lot of custom code to implement a mixin-like functionality, that is likely outside of the domain of this package.
Trying to reduce complexity, I would recommend :
- either trying to upstream such logic directly to yo,
- or reconsidering making a custom generator (in a separate package)
- or implementing cli mode as default, without interactive mode.
I guess "yeoman-way" is to use config files if you don't want interactive prompts: https://yeoman.io/authoring/storage |
a450f58
to
9851e95
Compare
9851e95
to
01cefed
Compare
e3d105e
to
cddf459
Compare
cddf459
to
7c269f7
Compare
…older is not in pascalcase
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.
If we go for cli only, we can get rid of the prompting helpers and keep the generator to one file using this.argument
Done
Creates a prompting module that allows generators to request and read CLI input. Switches the generator to use CLI input only.
This will allow the generator to be executed programmatically, enhancing its testability.
QA
bun i
yo @canonical/canonical-ds:component
- see that the generator now fails due to missing required positional argumentyo @canonical/canonical-ds:component path/to/button
- see that the generator creates a default button componentyo @canonical/canonical-ds:component path/to/button --withStories --withStyles
- see the generators also includes storybook and style filesyo @canonical/canonical-ds:component --help
- see the generator displays input parameter helpPR readiness check
Feature 🎁
,Breaking Change 💣
,Bug 🐛
,Documentation 📝
,Maintenance 🔨
.package.json
:check
andcheck:fix
.build
.Screenshots