Releases: nivekcode/svg-to-ts
v8.0.0
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 currentconversionType
is set toconstants
- Use
svg-to-ts-object
if your currentconversionType
is set toobject
- Use
svg-to-ts-files
if your currentconversionType
is set tofiles
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
v7.1.0
v7.0.0 - Autumn Leaves
7.0.0 (2021-10-05)
chore
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
andremoveRasterImage
) you have to add asvgo.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
v6.0.1
Christmas Cookie 🍪
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
BREAKING CHANGES
- The
IconNameSubset
helper is now dynamically
generated based off of theinterfaceName
property. Any references to
this will need updating.