angular-builders icon indicating copy to clipboard operation
angular-builders copied to clipboard

Use schematics for installation steps

Open just-jeb opened this issue 6 years ago • 10 comments

From @meltedspark on August 13, 2018 14:40

The following should be done automatically with schematics instead of requiring the user to do it manually:

  1. Removing Karma related stuff
  2. Updating Typescript configs
  3. Updating angular.json

Copied from original issue: angular-builders/jest#3

just-jeb avatar Aug 20 '18 17:08 just-jeb

I've developed some schematics doing this. I was about to develop my own builder for this when I find your project. We maybe can do something together...?

davinkevin avatar Aug 25 '18 11:08 davinkevin

Sure, you're more than welcome to make a PR for this!
You'll have to modify your schematics a bit (as it should change angular.json instead package.json).
It's also unnecessary to create Jest setup files (they are already included in the builder) and install Jest (as it is just a builder).
Basically the schematics for this builder would have to do the installations steps (except for step 1) described in the README.
If you're up to implementing this, please go ahead!

just-jeb avatar Aug 25 '18 11:08 just-jeb

I would also say that such a PR should contain an end-to-end test of installing the library, configuring the project using schematics and running the tests, but if it is too much I can handle this part.

just-jeb avatar Aug 25 '18 11:08 just-jeb

@davinkevin Shall I take it from here or you'd like to implement that?

just-jeb avatar Sep 03 '18 12:09 just-jeb

You can take it... I don't have time to do this sadly. 😓 Sorry

davinkevin avatar Sep 04 '18 03:09 davinkevin

I've actually made a schematic which includes your jest-builder. It can be found here: https://github.com/froko/ng-essentials

Any feedback is highly welcome!

froko avatar Sep 21 '18 17:09 froko

@froko Great work! I think it is a great initiative! Do you think it's possible for you to create a PR with the same functionality here? To make it all-in-one solution, so that one could simply run ng add @angular-builders/jest?
If not, would you mind me borrowing your source code and adding it here myself (with copyright of course)?

just-jeb avatar Sep 21 '18 20:09 just-jeb

Thank you for your great work. @froko @just-jeb When will this feature be available? It took me ten minutes to finish it manually today. If you can provide a schematics, my work efficiency will increase 300 times. 😁

asnowwolf avatar Jan 18 '20 05:01 asnowwolf

Hi everyone, I've updated the @briebug/jest-schematic to utilize this builder and support single and multi app/lib workspaces. It's published under a pre-release right now and can be installed at:

ng add @briebug/[email protected]

Feedback is welcome.

schuchard avatar Sep 12 '20 11:09 schuchard

@schuchard what do you think about adding this schematics as part of the builder? So that you could just run ng add @angular-builders/jest?

just-jeb avatar Oct 27 '20 14:10 just-jeb