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

ng g --list shows the wrong collection #14519

Closed
FrozenPandaz opened this issue May 24, 2019 · 2 comments · Fixed by #14530
Closed

ng g --list shows the wrong collection #14519

FrozenPandaz opened this issue May 24, 2019 · 2 comments · Fixed by #14530
Labels
area: @angular/cli freq1: low Only reported by a handful of users who observe it rarely severity5: regression
Milestone

Comments

@FrozenPandaz
Copy link
Contributor

FrozenPandaz commented May 24, 2019

🐞 Bug report

Command (mark with an x)

- [ ] new
- [ ] build
- [ ] serve
- [ ] test
- [ ] e2e
- [x] generate
- [ ] add
- [ ] update
- [ ] lint
- [ ] xi18n
- [ ] run
- [ ] config
- [ ] help
- [ ] version
- [ ] doc

Is this a regression?

I don't know but the code makes it seem like it worked once upon a time

Description

A clear and concise description of the problem...

Running ng g --list in a workspace which has a different default schematic than @schematics/angular prints out:

[--help stuff]

Available Schematics:
  Collection "@schematics/angular":
    library
    workspace-schematic

The schematics listed are indeed the schematics available in the default collection but the default collection is actually @nrwl/workspace.

It looks like the source code used to or intends to print out available schematics for all collections. I think this would be the preferred behavior.

🔬 Minimal Reproduction

npx create-nx-workspace@next ng-bug
cd ng-bug
ng g --list

🌍 Your Environment

CLI 8.0.0-rc.4

Anything else relevant?
This affects all Nx users + more?

@alan-agius4
Copy link
Collaborator

@FrozenPandaz, just a note, --list doesn't exists. You are fall backing to --help

mgechev pushed a commit that referenced this issue May 28, 2019
At the moment, collectionName and schematicCollections are not set in various schematics command which result in fallbacking to the hardcoded default collectionName https://github.com/angular/angular-cli/blob/master/packages/angular/cli/models/schematic-command.ts#L79

Hence, this will result in incorrect information being present when using the `--help`, `--list`.

Fixes #14519
mgechev pushed a commit that referenced this issue May 28, 2019
At the moment, collectionName and schematicCollections are not set in various schematics command which result in fallbacking to the hardcoded default collectionName https://github.com/angular/angular-cli/blob/master/packages/angular/cli/models/schematic-command.ts#L79

Hence, this will result in incorrect information being present when using the `--help`, `--list`.

Fixes #14519
@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: @angular/cli freq1: low Only reported by a handful of users who observe it rarely severity5: regression
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants