build: Update SVGO to latest v2.2.2 and re-crush SVGs

SVGO v2.x changed configuration to JS, amending configuration.
Also re-crushing SVGs.

Change-Id: Id6379e06e6aa1c25760f8489166d354fca25cd52
This commit is contained in:
Volker E 2021-03-25 09:15:32 -07:00
parent 734ced999b
commit 5734191840
17 changed files with 17841 additions and 150 deletions

55
.svgo.config.js Normal file
View File

@ -0,0 +1,55 @@
/**
* SVGO Configuration
* Recommended options from:
* https://www.mediawiki.org/wiki/Manual:Coding_conventions/SVG#Exemplified_safe_configuration
*/
const { extendDefaultPlugins } = require( 'svgo' );
module.exports = {
multipass: true,
plugins: extendDefaultPlugins( [
{
name: 'cleanupIDs',
active: false
},
{
name: 'removeDesc',
active: false
},
{
name: 'removeRasterImages',
active: true
},
{
name: 'removeTitle',
active: false
},
{
name: 'removeViewBox',
active: false
},
{
// If the SVG doesn't start with an XML declaration, then its MIME type will
// be detected as "text/plain" rather than "image/svg+xml" by libmagic and,
// consequently, MediaWiki's CSSMin CSS minifier. libmagic's default database
// currently requires that SVGs contain an XML declaration:
// https://github.com/threatstack/libmagic/blob/master/magic/Magdir/sgml#L5
name: 'removeXMLProcInst',
active: false
},
{
name: 'sortAttrs',
active: true
}
] ),
// Configure the indent (default 4 spaces) used by `--pretty` here:
// @see https://github.com/svg/svgo/blob/master/lib/svgo/js2svg.js#L6 for more config options
//
// Unfortunately EOL cannot be configured, SVGO uses the platform's EOL marker.
// On non-unix systems the linebreaks will be normalized to LF (unix) only at git commit,
// assuming `core.autocrlf` is 'true' (default) or 'input'.
js2svg: {
indent: "\t",
pretty: true,
}
}

View File

@ -1,27 +0,0 @@
# Recommended options from:
# https://www.mediawiki.org/wiki/Manual:Coding_conventions/SVG#Exemplified_safe_configuration
#
multipass: true
plugins:
- cleanupIDs: false
- removeDesc: false
- removeRasterImages: true
- removeTitle: false
- removeViewBox: false
# If the SVG doesn't start with an XML declaration, then its MIME type will
# be detected as "text/plain" rather than "image/svg+xml" by libmagic and,
# consequently, MediaWiki's CSSMin CSS minifier. libmagic's default database
# currently requires that SVGs contain an XML declaration:
# https://github.com/threatstack/libmagic/blob/master/magic/Magdir/sgml#L5
- removeXMLProcInst: false
- sortAttrs: true
# Configure the indent (default 4 spaces) used by `--pretty` here:
# @see https://github.com/svg/svgo/blob/master/lib/svgo/js2svg.js#L6 for more config options
#
# Unfortunately EOL cannot be configured, svgo uses the platform's EOL marker.
# On non-unix systems the linebreaks will be normalized to LF (unix) only at git commit, assuming `core.autocrlf` is 'true' (default) or 'input'.
#
js2svg:
pretty: true
indent: "\t"

17875
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -13,7 +13,7 @@
"selenium-test": "npm -s run test:size",
"doc": "jsdoc -c jsdoc.json && npm run build-storybook",
"build-storybook": "bash dev-scripts/setup-storybook.sh && build-storybook --quiet --loglevel warn -o docs/ui",
"svgmin": "svgo --config=.svgo.yml -q -r -f resources/",
"svgmin": "svgo --config=.svgo.config.js -q -r -f resources/",
"pre-commit": "[ \"${PRE_COMMIT:-1}\" -eq 0 ] || npm -s t"
},
"pre-commit": "pre-commit",
@ -35,7 +35,7 @@
"node-fetch": "2.6.1",
"pre-commit": "1.2.2",
"stylelint-config-wikimedia": "0.10.3",
"svgo": "1.3.2",
"svgo": "2.2.2",
"typescript": "3.8.3",
"vue": "2.6.11"
}

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 12 12">
<path fill="#202122" d="M11.05 3.996l-.965-1.053-4.035 3.86-3.947-3.86L1.05 3.996l5 5 5-5"/>
<path fill="#202122" d="m11.05 3.996-.965-1.053-4.035 3.86-3.947-3.86L1.05 3.996l5 5 5-5"/>
</svg>

Before

Width:  |  Height:  |  Size: 224 B

After

Width:  |  Height:  |  Size: 223 B

View File

@ -3,5 +3,5 @@
<title>
chevron
</title>
<path d="M9 2l1.3 1.3L3.7 10l6.6 6.7L9 18l-8-8 8-8zm8.5 0L19 3.3 12.2 10l6.7 6.7-1.4 1.3-8-8 8-8z"/>
<path d="m9 2 1.3 1.3L3.7 10l6.6 6.7L9 18l-8-8 8-8zm8.5 0L19 3.3 12.2 10l6.7 6.7-1.4 1.3-8-8 8-8z"/>
</svg>

Before

Width:  |  Height:  |  Size: 261 B

After

Width:  |  Height:  |  Size: 261 B

View File

@ -3,5 +3,5 @@
<title>
chevron
</title>
<path d="M11 2L9.7 3.3l6.6 6.7-6.6 6.7L11 18l8-8zM2.5 2L1 3.3 7.8 10l-6.7 6.7L2.5 18l8-8z"/>
<path d="M11 2 9.7 3.3l6.6 6.7-6.6 6.7L11 18l8-8zM2.5 2 1 3.3 7.8 10l-6.7 6.7L2.5 18l8-8z"/>
</svg>

Before

Width:  |  Height:  |  Size: 253 B

After

Width:  |  Height:  |  Size: 253 B

View File

@ -2,5 +2,5 @@
<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12">
<path fill="#fff" stroke="#36c" d="M1.5 4.518h5.982V10.5H1.5z"/>
<path fill="#36c" d="M5.765 1H11v5.39L9.427 7.937l-1.31-1.31L5.393 9.35l-2.69-2.688 2.81-2.808L4.2 2.544z"/>
<path fill="#fff" d="M9.995 2.004l.022 4.885L8.2 5.07 5.32 7.95 4.09 6.723l2.882-2.88-1.85-1.852z"/>
<path fill="#fff" d="m9.995 2.004.022 4.885L8.2 5.07 5.32 7.95 4.09 6.723l2.882-2.88-1.85-1.852z"/>
</svg>

Before

Width:  |  Height:  |  Size: 388 B

After

Width:  |  Height:  |  Size: 387 B

View File

@ -2,5 +2,5 @@
<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12">
<path fill="#fff" stroke="#36c" d="M10.5 4.518H4.518V10.5H10.5z"/>
<path fill="#36c" d="M6.234 1H1v5.39l1.57 1.546 1.31-1.31L6.607 9.35l2.69-2.688-2.81-2.808L7.8 2.544z"/>
<path fill="#fff" d="M2.004 2.004L1.982 6.89 3.8 5.07l2.88 2.88 1.228-1.227-2.88-2.88 1.85-1.852z"/>
<path fill="#fff" d="M2.004 2.004 1.982 6.89 3.8 5.07l2.88 2.88 1.228-1.227-2.88-2.88 1.85-1.852z"/>
</svg>

Before

Width:  |  Height:  |  Size: 386 B

After

Width:  |  Height:  |  Size: 386 B

View File

@ -3,5 +3,5 @@
<title>
search
</title>
<path fill-rule="evenodd" d="M12.2 13.6a7 7 0 111.4-1.4l5.4 5.4-1.4 1.4-5.4-5.4zM13 8A5 5 0 113 8a5 5 0 0110 0z"/>
<path fill-rule="evenodd" d="M12.2 13.6a7 7 0 1 1 1.4-1.4l5.4 5.4-1.4 1.4-5.4-5.4zM13 8A5 5 0 1 1 3 8a5 5 0 0 1 10 0z"/>
</svg>

Before

Width:  |  Height:  |  Size: 274 B

After

Width:  |  Height:  |  Size: 280 B

View File

@ -8,5 +8,5 @@
</linearGradient>
<linearGradient id="b" x1="13.47" x2="4.596" y1="14.363" y2="3.397" gradientUnits="userSpaceOnUse" xlink:href="#a"/>
</defs>
<path fill="url(#b)" stroke="#c8b250" d="M8.103 1.146l2.175 4.408 4.864.707-3.52 3.431.831 4.845-4.351-2.287-4.351 2.287.831-4.845-3.52-3.431 4.864-.707z"/>
<path fill="url(#b)" stroke="#c8b250" d="m8.103 1.146 2.175 4.408 4.864.707-3.52 3.431.831 4.845-4.351-2.287-4.351 2.287.831-4.845-3.52-3.431 4.864-.707z"/>
</svg>

Before

Width:  |  Height:  |  Size: 620 B

After

Width:  |  Height:  |  Size: 620 B

View File

@ -11,5 +11,5 @@
</linearGradient>
<linearGradient id="b" x1="13.5" x2="4.6" y1="14.4" y2="3.4" gradientUnits="userSpaceOnUse" xlink:href="#a"/>
</defs>
<path fill="url(#b)" stroke="#7cb5d1" d="M8.1 1.1l2.2 4.5 4.8.7-3.5 3.4.9 4.8L8 12.2l-4.3 2.3.8-4.8L1 6.3l4.8-.7z"/>
<path fill="url(#b)" stroke="#7cb5d1" d="m8.1 1.1 2.2 4.5 4.8.7-3.5 3.4.9 4.8L8 12.2l-4.3 2.3.8-4.8L1 6.3l4.8-.7z"/>
</svg>

Before

Width:  |  Height:  |  Size: 602 B

After

Width:  |  Height:  |  Size: 602 B

View File

@ -11,8 +11,8 @@
</linearGradient>
</defs>
<g fill="none">
<path fill="#fff" d="M8.1 1.1l2.2 4.5 4.8.7-3.5 3.4.9 4.8L8 12.2l-4.3 2.3.8-4.8L1 6.3l4.8-.7z"/>
<path fill="#fff" d="m8.1 1.1 2.2 4.5 4.8.7-3.5 3.4.9 4.8L8 12.2l-4.3 2.3.8-4.8L1 6.3l4.8-.7z"/>
<path fill="url(#a)" d="M7 .4v10.9l-4.2 2.2.8-4.8L0 5.3l4.8-.7z" transform="translate(1 1)"/>
<path stroke="#c8b250" d="M8.1 1.1l2.2 4.5 4.8.7-3.5 3.4.9 4.8L8 12.2l-4.3 2.3.8-4.8L1 6.3l4.8-.7z"/>
<path stroke="#c8b250" d="m8.1 1.1 2.2 4.5 4.8.7-3.5 3.4.9 4.8L8 12.2l-4.3 2.3.8-4.8L1 6.3l4.8-.7z"/>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 737 B

After

Width:  |  Height:  |  Size: 737 B

View File

@ -11,8 +11,8 @@
</linearGradient>
</defs>
<g fill="none">
<path fill="#fff" d="M8.1 1.1l2.2 4.5 4.8.7-3.5 3.4.9 4.8L8 12.2l-4.3 2.3.8-4.8L1 6.3l4.8-.7z"/>
<path fill="#fff" d="m8.1 1.1 2.2 4.5 4.8.7-3.5 3.4.9 4.8L8 12.2l-4.3 2.3.8-4.8L1 6.3l4.8-.7z"/>
<path fill="url(#a)" d="M7 .4v10.9l-4.2 2.2.8-4.8L0 5.3l4.8-.7z" transform="translate(1 1)"/>
<path stroke="#7cb5d1" d="M8.1 1.1l2.2 4.5 4.8.7-3.5 3.4.9 4.8L8 12.2l-4.3 2.3.8-4.8L1 6.3l4.8-.7z"/>
<path stroke="#7cb5d1" d="m8.1 1.1 2.2 4.5 4.8.7-3.5 3.4.9 4.8L8 12.2l-4.3 2.3.8-4.8L1 6.3l4.8-.7z"/>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 725 B

After

Width:  |  Height:  |  Size: 725 B

View File

@ -3,5 +3,5 @@
<title>
watch highlighted
</title>
<path fill="#fff" stroke="#c8b250" d="M8.1 1.1l2.2 4.5 4.8.7-3.5 3.4.9 4.8L8 12.2l-4.3 2.3.8-4.8L1 6.3l4.8-.7z"/>
<path fill="#fff" stroke="#c8b250" d="m8.1 1.1 2.2 4.5 4.8.7-3.5 3.4.9 4.8L8 12.2l-4.3 2.3.8-4.8L1 6.3l4.8-.7z"/>
</svg>

Before

Width:  |  Height:  |  Size: 264 B

After

Width:  |  Height:  |  Size: 264 B

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16">
<path fill="#fff" stroke="#c8ccd1" d="M8.1 1.1l2.2 4.5 4.8.7-3.5 3.4.9 4.8L8 12.2l-4.3 2.3.8-4.8L1 6.3l4.8-.7z"/>
<path fill="#fff" stroke="#c8ccd1" d="m8.1 1.1 2.2 4.5 4.8.7-3.5 3.4.9 4.8L8 12.2l-4.3 2.3.8-4.8L1 6.3l4.8-.7z"/>
</svg>

Before

Width:  |  Height:  |  Size: 225 B

After

Width:  |  Height:  |  Size: 225 B

View File

@ -3,5 +3,5 @@
<title>
watch
</title>
<path fill="#fff" stroke="#7cb5d1" d="M8.1 1.1l2.2 4.5 4.8.7-3.5 3.4.9 4.8L8 12.2l-4.3 2.3.8-4.8L1 6.3l4.8-.7z"/>
<path fill="#fff" stroke="#7cb5d1" d="m8.1 1.1 2.2 4.5 4.8.7-3.5 3.4.9 4.8L8 12.2l-4.3 2.3.8-4.8L1 6.3l4.8-.7z"/>
</svg>

Before

Width:  |  Height:  |  Size: 252 B

After

Width:  |  Height:  |  Size: 252 B