-
Notifications
You must be signed in to change notification settings - Fork 155
Collection Extension / Merging #34
Comments
This is a key feature for my use case. The ability to build on top of existing collections and modify them as needed will open up a ton of possibilities, I'm looking forward to playing with this. |
Just came here to add a feature request for exactly this. Nice to see it already on the radar. My main concern with not having this functionality is that if our company creates it's own collection copied from the default, even if it's just to change one minor thing, we're committing to potentially a lot of additional maintenance work to ensure we're always in sync with the latest and greatest updates from here. And since we likely wouldn't commit to that additional effort, we need to decide on either all in on the default "CLI way" or all in on no longer staying current with it. Neither option is ideal. We're currently faced with a similar problem with the CLI webpack "eject" approach, but I digress. |
@bmayen we support You can safely depend on the Angular collection, and extends it to bring those schematic in yours. You could always extend a schematic by using it and then modifying its content, so what you describe was already possible without this issue (it's a core feature and a goal of schematic to be extendable and composable). Just to reiterate: he only thing that's valid for this issue that's not already possible is to have "extra" schematics from the extended collection, without having to redefine or extend them in your own collection. For example, if you want to provide the original {
"schematics": {
"component": { "extends": "@schematics/angular:component" }
}
} to your This issue is bound to fix that. A use case that we're looking at is adding a copyright notice to all files created in a collection. It doesn't make much sense to rebuild all schematics provided by |
Ah, gotcha. Thanks for the clarification and all the amazing work! |
@hansl, could you help clarify something for me? In my original comment I mentioned "if our company creates it's own collection copied from the default, even if it's just to change one minor thing, we're committing to potentially a lot of additional maintenance work to ensure we're always in sync with the latest and greatest updates from here". But you indicated that this wasn't a problem since we can extend existing collections. But let's say we want to slightly modify some files output by default If I'm understanding you correctly, that's what this issue is about. Any idea where this might fall on the timeline? |
You can create a collection, depend on What you're describing is the goal of this feature. No idea on timeline. |
Thanks for the clarification! |
@bmayen can you provide a example, i'm following these instructions and related issues and is not working for me, thanks in advance |
Sometimes you want to reuse schematics from another collection as is. For example, someone could want to implement a collection that is the exact same as the angular one (same schematics), but changes only 1 schematic. All the others should be the same. Or maybe a company wants to have a default collection on their CLI but have that collection include schematics from a number of other collections.
A proper system should allow merging of collections, with some resolution if there's a collusion, and a list of schematics that it implements itself (might be empty). As an example (the schema is just an example):
This would include the base angular schematics, the base my-company schematics and the pages schematics. This helps with separating development of each of those, while the end user can just install and use one collection. The schematics are merged, with names being overridden by pages, then base, then angular.
The text was updated successfully, but these errors were encountered: