devkit icon indicating copy to clipboard operation
devkit copied to clipboard

bug(schematics): component changeDetectionStrategy alias -c clashes with --collection alias shorthand

Open Hotell opened this issue 8 years ago • 2 comments

Bug Report or Feature Request (mark with an x)

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

Area

- [] devkit
- [x] schematics

Versions

Node: 8.10 Npm: 5.7.1 OS: High Sierra

Repro steps

When creating custom schematic and extending from current @schematics/[email protected] for custom component blueprint, alias for changeDetection is c, which clashes with --collection shorthand alias

yarn ng g myc helloWorld -c=OnPush -d -c @martin_hotell/schematics
  • myc : is custom blueprint for component which uses the same collection metadata as current @schematic/angular

The log given by the failure

image

Desired functionality

There are multiple typos fro aliases names within component blueprint

  • changeDetection : https://github.com/angular/devkit/blob/master/packages/schematics/angular/component/schema.json#L55
  • viewEncapsulation: https://github.com/angular/devkit/blob/master/packages/schematics/angular/component/schema.json#L48
  • inlineTemlate: https://github.com/angular/devkit/blob/master/packages/schematics/angular/component/schema.json#L42
  • inlineStyle: https://github.com/angular/devkit/blob/master/packages/schematics/angular/component/schema.json#L36

before, the aliases were different

  • cd not c
  • it not t
  • is not s
  • ve not v

I can send PR, if you want.

Thanks

Hotell avatar Mar 17 '18 18:03 Hotell

This bug is super annoying, since it takes some time to figure out, why ng g c helloWorld doesn't work anymore.

gjungb avatar Mar 27 '18 15:03 gjungb

This issue was moved to angular/angular-cli#12132

alexeagle avatar Sep 04 '18 23:09 alexeagle