Platform: Schematics documentation: command to generate store includes unnecessary flag

Created on 24 May 2018  路  8Comments  路  Source: ngrx/platform

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report  
[ ] Feature request
[X] Documentation issue or request

What is the current behavior?

command for generating a store seems to include some redundant commands
ng g store AppState --root --module app.module.ts --collection @ngrx/schematics is what's suggested in the docs, but ng g store AppState --root --module app works just fine

Expected behavior:

Docs would include just what's minimally required

Accepting PRs Docs Schematics

Most helpful comment

The new way to generate a schematic if you don't have the default set is

ng generate @ngrx/schematics:store [options]

All 8 comments

--collection @ngrx/schematic is used if the ngrx schematics isn't set as default schematic.
Do you want to submit a PR to enhance the docs?

Sure thing!

Wait I'm wrong.
I believe the --collection option isn't used anymore - see docs.
Thus can be removed.

The new way to generate a schematic if you don't have the default set is

ng generate @ngrx/schematics:store [options]

Please best to link this stuff to docs where everybody can find the latest, instead of leaving breadcrumbs in PR :(

Also, in https://ngrx.io/guide/schematics/install, there should be a mention about setting the Schematics as default so that following examples match.

ng config cli.defaultCollection @ngrx/schematics

In https://ngrx.io/guide/schematics/store, and same with others, the command is only
ng generate store State [options]
but it generates the error
Schematic "store" not found in collection "@schematics/angular".

Otherwise, and as @brandonroberts said, there should be the prefix @ngrx/schematics:

I am not sure how you would phrase it, so I don't do a PR.
Anyway, it's really a little thing, the rest is great, thanks!

Thanks for the feedback @vpcom , I believe has this covered https://next.ngrx.io/guide/schematics/install.

Yes, well done! But I was meaning for the current stable v7.

Was this page helpful?
0 / 5 - 0 ratings