Skip to content
This repository was archived by the owner on Apr 4, 2025. It is now read-only.
This repository was archived by the owner on Apr 4, 2025. It is now read-only.

feat(schematics): specify multiple default collections #249

Description

@jeffbcross

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).

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions