Angular-cli: List the schematics of a collection

Created on 10 Jun 2018  路  5Comments  路  Source: angular/angular-cli

Bug Report or Feature Request (mark with an x)

- [ ] bug report -> please search issues before submitting
- [x] feature request

Area

- [ ] devkit
- [x] schematics

Versions

==> node --version
v8.11.2

==> npm --version
6.1.0

Desired functionality


A way to list the schematics in a collection. Something like:
ng g @ngrx/schematics --help

Adding a colon gets you closer... sort of:

==> ng g @ngrx/schematics: --help
usage: ng generate @ngrx/schematics:  [options]
options:
  --dryRun (-d)
    Run through without making any changes.
  --force (-f)
    Forces overwriting of files.

I currently do cat node_modules/@ngrx/schematics/collection.json, which works but isn't ideal.

Mention any other details that might be useful

angulacli help wanted triage #1 feature

Most helpful comment

--list-schematics works now with the schematics CLI.
It would be nice if this feature worked with the Angular CLI as well.

All 5 comments

The Schematics CLI has something like this in --list-schematics, but it doesn't seem to work anymore.

These commands give no output at all:

  • schematics @schematics/schematics --list-schematics
  • schematics @schematics/angular --list-schematics

I submitted https://github.com/angular/angular-cli/issues/12220 to track this issue in the schematics-cli (i.e. schematics) since this issue appears to be asking for this to be part of the Angular CLI (i.e. ng).

--list-schematics works now with the schematics CLI.
It would be nice if this feature worked with the Angular CLI as well.

For anyone who finds it helpful: ng g <other collection>: will list the schematics in that collection. For example:

$ ng g @ngrx/schematics:
Generates and/or modifies files based on a schematic.
usage: ng generate <schematic> [options]

arguments:
  schematic
    The schematic or collection:schematic to generate.

options:
  --defaults 
    When true, disables interactive input prompts for options with a default.
  --dry-run (-d)
    When true, runs through and reports activity without writing out results.
  --force (-f)
    When true, forces overwriting of existing files.
  --help 
    Shows a help message for this command in the console.
  --interactive 
    When false, disables interactive input prompts.

Available Schematics:
  Collection "@ngrx/schematics":
    action
    appShell
    application
    class
    component
    container
    create-effect-migration
    data
    directive
    effect
    entity
    enum
    feature
    guard
    interceptor
    interface
    library
    module
    ng-add
    ngrx-push-migration
    pipe
    reducer
    selector
    service
    serviceWorker
    store
    webWorker

Tested with @angular/cli 10.1.0.

Indeed the 鈥攈elp does print out a list of available schematics.

Therefore I am closing this feature request since it鈥檚 been addressed.

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

_This action has been performed automatically by a bot._

Was this page helpful?
0 / 5 - 0 ratings