Specify multiple default collections
See original GitHub issueFrom @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
Issue Analytics
- State:
- Created 5 years ago
- Reactions:24
- Comments:17 (13 by maintainers)
It definitely would be great for working with different sets of schematics ! I currently switch manually from one set to the other (@ngrx/schematics <-> @ionic/angular-toolkit)
Yep, it would be especially useful for mobile dev. I also have to switch between @ngrx/schematics and @nativescript/schematics