Skip to content

Specify multiple default collections #12157

Description

@alexeagle

From @jeffbcross on October 31, 2017 22:4

Bug Report or Feature Request (mark with an x)

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

Area

- [] devkit
- [x] schematics

Desired functionality

It'd be nice to have multiple collections configured in my CLI project instead of a single default collection. I.e. I'd like to have a project that gives preference to nrwl/schematics but will fall back to angular/schematics if I try to generate something not provided by nrwl/schematics. This would make it easier to publish many focused schematics without requiring the user to specify the collection each time they're generating something new. My naive suggestion is to change the .angular-cli.json schema from a single collection value to a cascading array of collections like so:

"defaults": {
  "collection": "nrwl/schematics"
}
"defaults": {
  "collections": [
    "nrwl/schematics",
    "angular/schematics"
  ]
}

Then when calling ng generate, schematics would use the first collection that provides a matching schematic.

This issue seems cross-cutting between CLI and Schematics, so I thought this repository was the most appropriate place to open it, but lmk if I should open it on angular/angular-cli.

(This may seem similar to #34, but it's more focused on end user experience than schematics author experience).

Copied from original issue: angular/devkit#249

Metadata

Metadata

Assignees

Labels

area: @angular/clifeatureLabel used to distinguish feature request from other issuesfeature: under considerationFeature request for which voting has completed and the request is now under consideration

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions