schematics icon indicating copy to clipboard operation
schematics copied to clipboard

Needs to support the `flat` flag

Open markwhitfeld opened this issue 6 years ago • 0 comments

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report  
[ ] Performance issue
[X] Feature request
[ ] Documentation issue or request
[ ] Support request => https://github.com/ngxs/store/blob/master/CONTRIBUTING.md
[ ] Other... Please describe:

Current behavior

Currently the store, state and actions schematics generate within a folder named after the name provided. For example, ng generate @ngxs/schematics:store sample --path=app/src/sample/store generates:

src/app/src/sample/store/sample/sample.actions.ts
src/app/src/sample/store/sample/sample.state.spec.ts
src/app/src/sample/store/sample/sample.state.ts

It does not allow me to generate these files directly into the app/src/sample/store folder but always creates the subfolder.

Expected behavior

I would like to be able to specify --flat=true to generate the files directly into the target. For example, ng generate @ngxs/schematics:store sample --path=app/src/sample/store --flat=true would generate:

src/app/src/sample/store/sample.actions.ts
src/app/src/sample/store/sample.state.spec.ts
src/app/src/sample/store/sample.state.ts

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

Not to force a directory structure on the user and to align with an option available in @angular/schematics.

markwhitfeld avatar Feb 13 '19 08:02 markwhitfeld