Skip to content

Releases: nivekcode/svg-to-ts

v8.0.0

02 Feb 23:21
Compare
Choose a tag to compare

8.0.0 (2022-02-02)

What's new

  • This version introduces new binaries, a svg-to-ts-constants, svg-to-ts-files, svg-to-ts-object.
  • conversionType is no longer a configuration option

How to migrate

Update the npm script or the npx statement where you call svg-to-ts:

  • Use svg-to-ts-constants if your current conversionType is set to constants
  • Use svg-to-ts-object if your current conversionType is set to object
  • Use svg-to-ts-files if your current conversionType is set to files

Features

BREAKING CHANGES

  • binaries: Instead of providing one binary, svg-to-ts we now provide 3 binaries, one for file,
    object and one for constants

143

v7.1.1

15 Jan 12:54
Compare
Choose a tag to compare

7.1.1 (2022-01-15)

Bug Fixes

  • file-helper: add missing comma and release latest file helper fix (ea0c1ab)

v7.1.0

24 Oct 16:58
Compare
Choose a tag to compare

7.1.0 (2021-10-24)

Features

  • enum: add enum type option (630f8f4)

v7.0.0 - Autumn Leaves

05 Oct 11:33
Compare
Choose a tag to compare

7.0.0 (2021-10-05)

chore

  • (svgo) update svgo to v2: update svgo to v2 - config object change (688223e), closes #127

BREAKING CHANGES

  • (svgo) update svgo to v2: svg-to-ts now ships with svgo 2. SVGO 2 has different syntax of passing
    configuration. Furthermore we use the SVGO default object and dont introduce a custom fallback
    anymore

What changed

Update SVGO to v2

To optimize icons we internally use SVGO. In v7 we now use SVGO v2 under the hood. SVGO v2 brings a bunch of performance optimization and a new way to pass configurations. More on the official SVGO page.

SVGO config

Custom SVGO configurations now have to be specified in a svgo.config.js file located in the root of your project. The svgo.config.js has to export a configuration object. For example.

module.exports = {
  plugins: [
    {
      name: 'preset-default',
      params: {
        overrides: {
          // customize options for plugins included in preset
          builtinPluginName: {
            optionName: 'optionValue',
          },
          // or disable plugins
          anotherBuiltinPlugin: false,
        },
      },
    },
    // Enable builtin plugin not included in preset
    'moreBuiltinPlugin',
    // Enable and configure builtin plugin not included in preset
    {
      name: 'manyBuiltInPlugin',
      params: {
        optionName: 'value',
      },
    },
  ],
};

Consult the official SVGO page to find out more.

No more SVGO default config from svg-to-ts
In v6 svg-to-ts was using its own default for SVGO. In v7 we removed the default config and rely on the default of SVGO.

In case you prefer to still use the same options as today please add a svgo.config.js with the following content to the root of your project.

  module.exports = {
    plugins: [
      'cleanupAttrs',
      'removeDoctype',
      'removeXMLProcInst',
      'removeComments',
      'removeMetadata',
      'removeTitle',
      'removeDesc',
      'removeUselessDefs',
      'removeEditorsNSData',
      'removeEmptyAttrs',
      'removeHiddenElems',
      'removeEmptyText',
      'removeEmptyContainers',
      'cleanupEnableBackground',
      'convertStyleToAttrs',
      'convertColors',
      'convertPathData',
      'convertTransform',
      'removeUnknownsAndDefaults',
      'removeNonInheritableGroupAttrs',
      'removeUselessStrokeAndFill',
      'removeUnusedNS',
      'cleanupIDs',
      'cleanupNumericValues',
      'moveElemsAttrsToGroup',
      'moveGroupAttrsToElems',
      'collapseGroups',
      'mergePaths',
      'convertShapeToPath',
      'sortAttrs',
      'removeDimensions',
      'prefixIds',
    ]
  }

This config is almost the same as the default config from SVGO. But it disables the removeViewBox and the removeRasterImage properties.

completeIconSet renamed

In v6 svg-to-ts generates a completeIconSet file. However, the convention for filenames is not camelcase but kebap case. Therefore in v7 we will generate the complete icon set in a file named complete-icon-set.

How to migrate

  • If you happy with the SVGO defaults you don't have to do anything.
  • If you want to apply the same defaults as in v6 (disable removeViewBox and removeRasterImage) you have to add a svgo.config.js file with the following content to the root of your project.
module.exports = {
    plugins: [
      'cleanupAttrs',
      'removeDoctype',
      'removeXMLProcInst',
      'removeComments',
      'removeMetadata',
      'removeTitle',
      'removeDesc',
      'removeUselessDefs',
      'removeEditorsNSData',
      'removeEmptyAttrs',
      'removeHiddenElems',
      'removeEmptyText',
      'removeEmptyContainers',
      'cleanupEnableBackground',
      'convertStyleToAttrs',
      'convertColors',
      'convertPathData',
      'convertTransform',
      'removeUnknownsAndDefaults',
      'removeNonInheritableGroupAttrs',
      'removeUselessStrokeAndFill',
      'removeUnusedNS',
      'cleanupIDs',
      'cleanupNumericValues',
      'moveElemsAttrsToGroup',
      'moveGroupAttrsToElems',
      'collapseGroups',
      'mergePaths',
      'convertShapeToPath',
      'sortAttrs',
      'removeDimensions',
      'prefixIds',
    ]
  }

v6.0.2

06 Sep 09:24
Compare
Choose a tag to compare

6.0.2 (2021-09-06)

Bug Fixes

  • typo: Generate barrel file (03f58e1)

v6.0.1

09 Apr 17:44
Compare
Choose a tag to compare

6.0.1 (2021-04-09)

Bug Fixes

  • 🐛 handle large icon sets > 10k. Closes: 115 (133e16b)

Christmas Cookie 🍪

06 Dec 18:37
Compare
Choose a tag to compare

6.0.0 (2020-12-06)

Bug Fixes

  • 🐛 ensures name subset helper always has a unique name (d1a5d69), closes #91
  • 🐛 start spinner on generation start (6f34ab0)

Features

  • 🎸 add verbose logging feature (068eb1f)
  • 🎸 logging steps with spinners (55d7685)

BREAKING CHANGES

  • The IconNameSubset helper is now dynamically
    generated based off of the interfaceName property. Any references to
    this will need updating.

v5.7.1

31 Oct 14:31
Compare
Choose a tag to compare

5.7.1 (2020-10-31)

Bug Fixes

  • 🐛 handle file names with special characters (475c333)

v5.7.0

27 Oct 23:27
Compare
Choose a tag to compare

5.7.0 (2020-10-27)

Features

  • 🎸 export helpers and converters for usage in JS/TS (66182e8)

v5.6.2

19 Oct 07:49
Compare
Choose a tag to compare

5.6.2 (2020-10-19)

Bug Fixes

  • remove svg-to-ts attribute from .svg-to-tsrc example (f1f575a)
  • replace 'modelFileName' by 'fileName' in exemple (7d0c43a)