Skip to content

[TRACKING] Custom Templates for Generators #6593

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
20 tasks done
hansl opened this issue Jun 6, 2017 · 8 comments
Closed
20 tasks done

[TRACKING] Custom Templates for Generators #6593

hansl opened this issue Jun 6, 2017 · 8 comments
Labels
feature Issue that requests a new feature

Comments

@hansl
Copy link
Contributor

hansl commented Jun 6, 2017

Implement usage of Schematics (see this PR) in the CLI and allow custom templates.

This requires some design to have a default collection and use a custom collection + schematics.

This issue can be considered completed when:

@hansl hansl changed the title [TRACKING] Custom Templates for [TRACKING] Custom Templates for Generators Jun 6, 2017
@filipesilva filipesilva added the feature Issue that requests a new feature label Jun 26, 2017
@Splaktar
Copy link
Contributor

Splaktar commented Jul 2, 2017

I'm very interested in this feature. I've spent some time prototyping the ability to hack custom blueprints into the current CLI for an Enterprise client. I've got it working, but I've run into a number of issues that make things a bit more hacky than I'd like. I'm doing the initial design for this client from now until July 5th, but then I'll need to implement the new system with custom schematics and custom app schematics starting the first week of September.

Is there a design document for this work that I can review and/or provide feedback on?

I've looked at the devkit repo a good bit and saw the example schematic, but I haven't yet figured out how to start testing it w/ the CLI.

Publish a default Angular Collection that contains most blueprints we have and maybe some others

How will custom collections/schematics be added to an Angular CLI project? This sounds like they would be published as npm packages?

The first post says that the following is done:

Add configuration flag in angular-cli.json to use a collection by default, so that ng g my-awesome-schematics will use the default collection which includes my-awesome-schematics.

Which flag in the schema.json is this? I wasn't able to find one that seemed to fit this description.

Move all blueprints in the CLI to Schematics
I may be able to help with this if the tooling is ready and I can get some guidance.

@Splaktar
Copy link
Contributor

Splaktar commented Jul 5, 2017

I spoke to @Brocco and got my questions answered.

  • No design doc available.
  • For the initial design, you will be able to add a single collection of schematics which will override/extend the original defaults. These can be added via NPM Modules or via pointing to a path on the File system. This is implemented by Engines in DevKit. It's possible additional Engines could be added in the future.
  • The angular-cli.json flag for schematics is implemented on a private branch and will be pushed to this repo soon.

Brocco added a commit to Brocco/angular-cli that referenced this issue Jul 13, 2017
@Splaktar
Copy link
Contributor

Awesome progress on this!

Brocco added a commit to Brocco/angular-cli that referenced this issue Jul 20, 2017
Brocco added a commit to Brocco/angular-cli that referenced this issue Jul 21, 2017
Brocco added a commit to Brocco/angular-cli that referenced this issue Jul 25, 2017
Brocco added a commit to Brocco/angular-cli that referenced this issue Jul 25, 2017
Brocco added a commit to Brocco/angular-cli that referenced this issue Aug 2, 2017
Brocco added a commit to Brocco/angular-cli that referenced this issue Aug 3, 2017
Brocco added a commit to Brocco/angular-cli that referenced this issue Aug 3, 2017
Brocco added a commit to Brocco/angular-cli that referenced this issue Aug 3, 2017
Brocco added a commit to Brocco/angular-cli that referenced this issue Aug 3, 2017
Brocco added a commit to Brocco/angular-cli that referenced this issue Aug 7, 2017
Brocco added a commit to Brocco/angular-cli that referenced this issue Aug 8, 2017
Brocco added a commit to Brocco/angular-cli that referenced this issue Aug 8, 2017
Brocco added a commit to Brocco/angular-cli that referenced this issue Aug 8, 2017
Brocco added a commit to Brocco/angular-cli that referenced this issue Aug 8, 2017
Brocco added a commit to Brocco/angular-cli that referenced this issue Aug 8, 2017
Brocco added a commit to Brocco/angular-cli that referenced this issue Aug 9, 2017
Brocco added a commit to Brocco/angular-cli that referenced this issue Aug 9, 2017
Brocco added a commit to Brocco/angular-cli that referenced this issue Aug 9, 2017
Brocco added a commit to Brocco/angular-cli that referenced this issue Aug 9, 2017
Brocco added a commit to Brocco/angular-cli that referenced this issue Aug 9, 2017
Brocco added a commit to Brocco/angular-cli that referenced this issue Aug 10, 2017
Brocco added a commit to Brocco/angular-cli that referenced this issue Aug 10, 2017
Brocco added a commit to Brocco/angular-cli that referenced this issue Aug 10, 2017
Brocco added a commit to Brocco/angular-cli that referenced this issue Aug 10, 2017
Brocco added a commit to Brocco/angular-cli that referenced this issue Aug 10, 2017
Brocco added a commit to Brocco/angular-cli that referenced this issue Aug 10, 2017
Brocco added a commit to Brocco/angular-cli that referenced this issue Aug 10, 2017
Brocco added a commit to Brocco/angular-cli that referenced this issue Aug 11, 2017
Brocco added a commit to Brocco/angular-cli that referenced this issue Aug 11, 2017
Brocco added a commit to Brocco/angular-cli that referenced this issue Aug 16, 2017
Brocco added a commit to Brocco/angular-cli that referenced this issue Aug 16, 2017
Brocco added a commit to Brocco/angular-cli that referenced this issue Aug 16, 2017
Brocco added a commit to Brocco/angular-cli that referenced this issue Aug 16, 2017
Brocco added a commit to Brocco/angular-cli that referenced this issue Aug 16, 2017
Brocco added a commit that referenced this issue Aug 16, 2017
@Vaelor
Copy link

Vaelor commented Aug 17, 2017

Being very eager to try this out, I got the new master branch now that the branch is merged and all the critical stuff seems to be there. I created a custom collection (I just took @schematics/angular and changed a few things) and ran ng new -c ./my-own-collection testproject. Which ofc did not work (I see that there are still a few checkmarks not finished ;-) ).

Now, I may be way too early trying this out, but I also did not see any plans for further documentation on this Tracking Issue for the collections. So as a bit of - maybe way to early - feedback, I guess a little bit more documentation how such a collection needs to be set up (or where) in order for something like ng new -c my-own-collection testproject to work, would not hurt. My instinct of just taking your @schematics/angular-collection, modifying it and pointing to the modified version seems to have been the wrong instinct :-D

Oh and awesome work on this! Thanks a lot!

@MickL
Copy link

MickL commented Aug 24, 2017

Could you please provide a documentation? I updated to 1.4.0-rc0 and cant create a component anymore: ng g c not working. ng g component working. ng g component shared/mycomponent (to create component inside module) not working.

Also i dont know what schematics are and the github project doesn't contain any readme.

@Oddnoun
Copy link

Oddnoun commented Oct 6, 2017

Any further updates on this?

@Robinyo
Copy link

Robinyo commented Jan 3, 2018

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature Issue that requests a new feature
Projects
None yet
Development

No branches or pull requests

8 participants