-
Notifications
You must be signed in to change notification settings - Fork 155
feat(schematics): specify multiple default collections #249
Comments
Hey guys! I was able to implement this in Still have to look into tests though. Also it is possible that you might have had plan for other solution so please let me know. Also check following screens for the new behavior. Display help for Display detailed help for particular schematics (first matching schematics / collection pair wins so the order in schematics property in Generate items using schematics from different collections (again, first matching schematics / collection pair wins so the order in schematics property in |
There is now open PR with initial working implementation of this feature on Cheers 🍺 |
Would like this as well. |
any update on this? this is totally needed for great DX. Enforcing users to write thx |
From what I have seen in That way you don't have to delegate every schematic manualy, provide default ones out of the box and add custom on top of that. Thr big downside is that this leads to ONE custom collection set as a new default for This unfortunatelly doesn't support "multiple small focused collections from different authors" use case. 😞 |
Yeah I know, but this is to restrictive and repetitive and hard to maintain overall. Maybe, just guys, can you please give some statement or so, why @tomastrajan PR wasn't accepted yet or what are the plans ? I know we are all super busy, but would appreciate some response. thank you 🖖 |
Schematic collection extension supports 1 or more schematics with the last taking precedence. The currently envisioned concept is for a custom collection to be placed within the project and that collection to extend from any other schematic collections with the option to directly define other custom schematics if desired. As the schematic extension logic is fully implemented within the core of the schematics system, having similar but repeated logic within the CLI itself represents a maintenance and supportability concern. |
For reference, the collection extension PR: #398 |
I think I like that idea long term, at least assuming there will be an easy command for the user to run to add a schematic collection without needing to know the details of collection.json (maybe handled by ng add my-schematic?). Short term I dislike that every project is adding I know no one likes to give timelines, but I can't help but ask, any idea on a timeline for this (custom collection in the project)? Is it planned for any release yet? Any issue to track? |
You can already do that. |
Yeah, but there's none there by default in a project created by ng new. So everyone's adding |
This issue was moved to angular/angular-cli#12157 |
Bug Report or Feature Request (mark with an
x
)Area
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 toangular/schematics
if I try to generate something not provided bynrwl/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 singlecollection
value to a cascading array ofcollections
like so: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).
The text was updated successfully, but these errors were encountered: