Skip to content
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

Add addons/tools after generation through CLI #508

Open
1 of 3 tasks
Pandawan opened this issue Sep 11, 2019 · 1 comment
Open
1 of 3 tasks

Add addons/tools after generation through CLI #508

Pandawan opened this issue Sep 11, 2019 · 1 comment

Comments

@Pandawan
Copy link

Pandawan commented Sep 11, 2019

I'm submitting a...

  • Bug report
  • Feature request
  • Documentation issue or request

Current behavior

Right now, after having created a project, there is no way to automatically add a tool/addon (i.e. prettier). You have to manually go through and install the package, set it up. You can, of course, create a new project and see all the files that reference that specific package, but that is tedious/complicated and could be made much more efficient/simple.

Expected behavior

Similar to the update method asking you which files you want to update and which tools/addons you want to install, there should be a CLI command (i.e. ngx add <name>) which would run the tool/addon-generation part of the update command, and similarly ask you which files you want to override/merge, etc.

Although you might sometime need to setup other things manually, having this as a starting base would be very helpful.

@Pandawan Pandawan changed the title Add addons after generation through CLI Add addons/tools after generation through CLI Sep 11, 2019
@sinedied
Copy link
Member

sinedied commented Oct 4, 2019

This one is a tough question I have been thinking since the introduction of schematics in ng CLI, but I haven't made my mind yet on what we should do in this regard.

Some thoughts for discussion:

  • Schematics are made to do exactly that, but:

    • are more complex to maintain
    • are more suited for small, targeted changes: it would mean that we would need to convert each choice of the generator into a separate schematic. While more flexible, I'm afraid that this would become a nightmare to test and maintain
    • are tied to JS/TS/Angular ecosystem: it would be more difficult to integrate backend generators for Java, C# etc
  • On the other hand, Yeoman is nice & easy for bootstrapping project, but not really for updates or individual, target changes. It's not perfect, but has been proven to be at least manageable until now.

  • Mixing schematics & the actual Yeoman approach would be the dream combo: Yeoman for orchestration and base app bootstrapping + targeted schematics for some parts (tools, auth, features etc), but:

    • it would need significant effort to implement, though it's possible to do it "1 schematic at a time" for progressive migration
    • testing tools needs to be updated properly at the same time to avoid regressions

As for me, I don't have the bandwidth to undertake a change this significant in the architecture of this tool, but if anyone wants to take a look at this (even in a POC branch) I'm not against it.
Just integrating an existing schematic from the community into the "regular" generator process could be a nice first step.

@bursauxa @creal73 any thougths?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants