Skip to content

schematics-cli: inconsistency in referencing collection #12600

Closed
@Splaktar

Description

@Splaktar

Bug Report or Feature Request (mark with an x)

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

Command (mark with an x)

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

Versions

Angular CLI: 7.0.0-rc.3
Node: 10.11.0
OS: darwin x64
Angular: undefined
... 

Package                      Version
------------------------------------------------------
@angular-devkit/architect    0.9.0-rc.3 (cli-only)
@angular-devkit/core         7.0.0-rc.3
@angular-devkit/schematics   7.0.0-rc.3
@schematics/angular          7.0.0-rc.3 (cli-only)
@schematics/update           0.9.0-rc.3 (cli-only)
rxjs                         6.3.3
typescript                   2.9.2
npm ls -g --depth=0
/Users/splaktar/.nvm/versions/node/v10.11.0/lib
├── @angular-devkit/[email protected]
├── @angular/[email protected]

Repro steps

  1. Create a new schematics project using schematics schematic --name=test-schematic.
  2. cd test-schematic
  3. npm i
  4. npm run build
  5. schematics ./src: --list-schematics
  6. schematics .:my-full-schematic --name=test

The log given by the failure

N/A

Desired functionality

When authoring a schematic and doing manual testing locally, you do the following:
In schematics ./src: --list-schematics, you reference the collection via ./src:. This is very confusing as I tried a lot of variations before figuring this out, i.e. the following don't work: src:, .:, src/:, src/.:.
In schematics .:my-full-schematic --name=test, you reference the collection via .:.

It would be nice if .: worked for both of these. Can --list-schematics see that the package.json is there and has a collections field just like when running a schematic?

Mention any other details that might be useful

I also saw this with @angular-devkit/[email protected].

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions