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

feat(Schematics): extend/add to a schematic from another collection #262

Closed
mohammedzamakhan opened this issue Nov 6, 2017 · 3 comments
Closed

Comments

@mohammedzamakhan
Copy link

Bug Report or Feature Request (mark with an x)

- [x] feature request

Area

- [x] schematics

Desired functionality

Right now I know we can do something like

component: {
    extends: '@schematics/angular'
}

But I don't think we can add functionality upon this

Mention any other details that might be useful

USE CASE:

Example: I want to create a schematic that would be running like ng new angular-jest --collection jest_collection_name"

and it would create a new angular project using @schematics/angular, and then add more files that would make this application support running tests using jest.

@mohammedzamakhan
Copy link
Author

@Brocco

@geneshap
Copy link

geneshap commented Nov 19, 2017

create aliases for all angular schematics in your own collection (note that alias for just application is not enough since it in turn uses other schematics). then from your own custom schematic return something like this:
export default function (options: any): Rule { return chain([ schematic('application', { style: 'scss', routing: true, directory: options.name, name: options.name }), mergeWith(apply(url('./files'), [ template({ name: options.name, }), ])), ]);

@hansl
Copy link
Contributor

hansl commented Nov 22, 2017

Dupe of #34

@hansl hansl closed this as completed Nov 22, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants