Open imaustink opened 6 years ago
There is a generator generator already and a guide for it:https://donejs.com/generator.html
Does this do what you need?
To restate, I think you should create an rvm-component generator (instead of mixing this into the current generator). The types of generators is unlimited, making trying to support them all within DoneJS problematic. This is why we made creating new ones easy.
I agree about this becoming a generator. I think one reason why this type of request comes up often is because it's more natural to do donejs add component MyComponent
than it is to do donejs add rvm-component MyComponent
. For can-components it's not donejs add can-component my-component
.
I wonder if we should support some method to alias generator names, so that you can use the shorthand. The flow might be like this:
donejs add rvm-component
donejs alias component rvm-component
donejs add component MyComponent
What
A related issue (donejs/generator-donejs#140) outlines the method of using the
.donejs
folder to customize a generator's templates. It would be nice to have the ability to custom the generator itself.Why
For a
react-view-model
project. Since a custom element tag name that the component prompt collects doesn't translate well to a react component so I'd like to change the prompt and it's validation.You could also do things like making a component generator that prompts you for a type and builds one of several predefined types.
How
My immediate thought would be to modify the
add
command to do something like:Comments Please 😃
I am happy to implement this in my spare time because I'd like to see it done ASAP. I just would like a little input first so I know if I am heading down the wrong path before I start.