Skip to content

[TRACKING] Custom Templates for Generators #6593

Closed

Description

@hansl

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:

Activity

  1. changed the title [-][TRACKING] Custom Templates for [/-] [+][TRACKING] Custom Templates for Generators[/+] on Jun 6, 2017
  2. added
    featureLabel used to distinguish feature request from other issues
    on Jun 26, 2017
  3. Splaktar commented on Jul 2, 2017

    @Splaktar
    Contributor

    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.

  4. Splaktar commented on Jul 5, 2017

    @Splaktar
    Contributor

    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.
  5. Splaktar commented on Jul 15, 2017

    @Splaktar
    Contributor

    Awesome progress on this!

  6. 21 remaining items

  7. Vaelor commented on Aug 17, 2017

    @Vaelor

    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!

  8. MickL commented on Aug 24, 2017

    @MickL

    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.

  9. Oddnoun commented on Oct 6, 2017

    @Oddnoun

    Any further updates on this?

  10. angular-automatic-lock-bot commented on Sep 7, 2019

    @angular-automatic-lock-bot

    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.

  11. locked and limited conversation to collaborators on Sep 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureLabel used to distinguish feature request from other issues

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions