question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Specify multiple default collections

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:24
  • Comments:17 (13 by maintainers)

github_iconTop GitHub Comments

10reactions
G-Cyrillecommented, Apr 19, 2020

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)

3reactions
konradstcommented, Sep 5, 2020

Yep, it would be especially useful for mobile dev. I also have to switch between @ngrx/schematics and @nativescript/schematics

Read more comments on GitHub >

github_iconTop Results From Across the Web

What does "default collection in your Angular CLI project" mean?
If you specify anything different, like @angular-eslint/schematics, @ngrx/schematics. It enables command like ng generate to execute package ...
Read more >
Solved: Collections preview showing multiple "default" col...
I am struggling with collections in my app, does anyone know why every time I create a new collection (and preview within powerapps)...
Read more >
collections — Container datatypes — Python 3.11.1 ...
A ChainMap groups multiple dicts or other mappings together to create a single, updateable view. If no maps are specified, a single empty...
Read more >
defaultCollection | Nx
In the nx.json you can set a defaultCollection property like this: { "cli": { "defaultCollection": "@nrwl/next" } }. This would cause the following...
Read more >
db.collection.update() — MongoDB Manual
If set to false , updates one document. The default value is false . For additional information, see Update Multiple Documents Examples. writeConcern....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found