svg-icons-builder icon indicating copy to clipboard operation
svg-icons-builder copied to clipboard

Add builder generation on install/add

Open kaltepeter opened this issue 5 years ago • 3 comments

Support installing or adding with --project flag to generate build-icons config in angular.json

Would be nice if schema matched the three possible conversionTypes.

Relates to #9

Sample for constants:

     "update-icons": {
          "builder": "@angular-extensions/svg-icons-builder:svg-icons-builder",
          "options": {
            "conversionType": "constants",
            "srcFiles": ["./projects/dinosaur-icons/icons/**/*.svg"],
            "outputDirectory": "./projects/dinosaur-icons/icons",
            "interfaceName": "DinosaurIcon",
            "typeName": "dinosaurIcon",
            "prefix": "dinosaurIcon",
            "modelFileName": "dinosaur-icons",
            "svgoConfig": {
              "plugins": [
                {
                  "cleanupAttrs": true
                }
              ]
            },
            "additionalModelFile": "./projects/dinosaur-icons/src/lib",
            "compileSources": true
          }
        },

kaltepeter avatar Oct 28 '20 13:10 kaltepeter

@kreuzerk thoughts on this?

kaltepeter avatar Oct 28 '20 13:10 kaltepeter

Definitely. This would be very nice. It would be nice that the ng-add command asks for the various properties. I am not yet sure how we can make this conditional - so for example that ng-add asks you for the conversionType. Based on that it should then aks for the correct options and then automatically configure the builder in the angular.json

nivekcode avatar Oct 28 '20 17:10 nivekcode

Yeah, I am not 100% certain either. It seems do-able to conditionally drive the builder called.

kaltepeter avatar Oct 29 '20 01:10 kaltepeter