Skip to content
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

Adding support for custom Schematics #630

Closed
EduardoSimon opened this issue Mar 24, 2020 · 9 comments
Closed

Adding support for custom Schematics #630

EduardoSimon opened this issue Mar 24, 2020 · 9 comments

Comments

@EduardoSimon
Copy link

EduardoSimon commented Mar 24, 2020

I'm submitting a...


[ ] Regression 
[ ] Bug report
[x] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead post your question on Stack Overflow.

Current behavior

Expected behavior

The desired behaviour would be, in the terminal:
nest generate command --(custom options)
nest generate event --(custom options)

What is the motivation / use case for changing the behavior?

In our Event sourcing library: https://github.com/ArkerLabs/event-sourcing-nestjs , we have a common structure for declaring event handler, command handlers and event updater. We would like to create custom schematics for consistency and ease of use. The ideal use case would be to integrate it with the nestjs cli and setting it up to use our custom schematic npm package. The team is used to operate with the cli thus making easier the learning phase.

Environment

 @nestjs/cli: 7.0.2
@kamilmysliwiec
Copy link
Member

Custom schematics are supported. @johnbiundo I think you wrote an article about that somewhere(? or just shared an example)

@EduardoSimon
Copy link
Author

Thats great! I'll be waiting for it!

@jmcdo29
Copy link
Member

jmcdo29 commented Mar 26, 2020

I think this is what you're thinking of: https://github.com/nestjsplus/dyn-schematics, pretty good dynamic module schematic created by @johnbiundo

@kamilmysliwiec
Copy link
Member

You can follow this example then: https://github.com/nestjsplus/dyn-schematics
We'll try to add a relevant tutorial to the official documentation too (as soon as possible)

@taozhiyuzhuo
Copy link

You can follow this example then: https://github.com/nestjsplus/dyn-schematics
We'll try to add a relevant tutorial to the official documentation too (as soon as possible)

dyn-schematics used by nest g -c (collection) @nestjsplus/dyn-schematics for custom schematics, nest-cli.json
file has the property collection default is "@nestjs/schematics" , can we change that to make custom schematics not need -c.

@oliviermattei
Copy link

maybe "collection" could accept an array of collection

@rthomps7
Copy link

rthomps7 commented Jan 5, 2021

I'm pretty confused about why collection doesn't seem to update anything. What's the purpose of it in the nest-cli.json then?

Seems the only way to change the collection is with -c.

Am I missing something?

@rthomps7
Copy link

rthomps7 commented Jan 5, 2021

Update: I found tracking of the bug here: #954

The CLI's default input is overriding the fallback of the nest-cli.json

@evenardo
Copy link

evenardo commented Jan 8, 2021

Oh Great! and I'm using it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants