arminbro / generate-react-cli

A simple React CLI to generate components instantly and more.

Home Page:https://www.npmjs.com/package/generate-react-cli

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Custom template reference.

PixelLifetime opened this issue · comments

Is your feature request related to a problem? Please describe.
We want to generate another custom file, something like "component.default.scss" that will hold our "!default" values. But we can't find a way to do it, looking through the code, component types are strictly defined.

Describe the solution you'd like
We would like that to be dynamic, meaning we can add any type of component to be generated given it's path. Like array of paths pointing to templates which will be generated and replaced with keywords.

Describe alternatives you've considered
Additional tool for generation, or custom command to generate it. But we would like to have everything in 1 package for convenience.

Additional context
Making this feature could possibly break compatibility with previous versions of the package if it has to be clean and things like component or lazy would be defined in array and not as constants. But it's also possible to make this as a side feature and keep these types as strict to keep backwards compatibility.

If no one else wants to implement this feature we would like to take it as a good first issue and implement it ourselves, but it would take some time for us to do because it's not a pressing matter right now. But we just need a heads up about if you are ok with this feature and you would accept our pull request.

Thank you!

Related to #22. The idea is basically the same, but keeping different attributes and configurations when generating these files.