build: Update 'svgo' to latest v3.2.0 and re-minify SVGs

The latest update of 'svgo' dependency includes three optimizations on
converting path commands, which
- improves closing paths and how we determine if to use absolute or
  relative commands.
- round arc or convert to lines based on the geometric sagitta
- convert cubic Bézier curves to quadratic Bézier curves where possible
Also unifiying npm command to qua standard notation `minify:svg`.

Bug: T354875
Change-Id: I38ccbfa62ee7afcfb10eee7853b33648863f54ad
This commit is contained in:
Volker E 2024-01-16 00:17:03 +01:00
parent 8f79cb6ad9
commit df7d5b95ac
4 changed files with 29 additions and 27 deletions

20
package-lock.json generated
View file

@ -18,7 +18,7 @@
"grunt-stylelint": "0.19.0",
"mwbot": "1.0.10",
"stylelint-config-wikimedia": "0.16.1",
"svgo": "3.0.2",
"svgo": "3.2.0",
"wdio-mediawiki": "2.3.0"
}
},
@ -10445,15 +10445,16 @@
"dev": true
},
"node_modules/svgo": {
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/svgo/-/svgo-3.0.2.tgz",
"integrity": "sha512-Z706C1U2pb1+JGP48fbazf3KxHrWOsLme6Rv7imFBn5EnuanDW1GPaA/P1/dvObE670JDePC3mnj0k0B7P0jjQ==",
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/svgo/-/svgo-3.2.0.tgz",
"integrity": "sha512-4PP6CMW/V7l/GmKRKzsLR8xxjdHTV4IMvhTnpuHwwBazSIlw5W/5SmPjN8Dwyt7lKbSJrRDgp4t9ph0HgChFBQ==",
"dev": true,
"dependencies": {
"@trysound/sax": "0.2.0",
"commander": "^7.2.0",
"css-select": "^5.1.0",
"css-tree": "^2.2.1",
"css-tree": "^2.3.1",
"css-what": "^6.1.0",
"csso": "^5.0.5",
"picocolors": "^1.0.0"
},
@ -19198,15 +19199,16 @@
"dev": true
},
"svgo": {
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/svgo/-/svgo-3.0.2.tgz",
"integrity": "sha512-Z706C1U2pb1+JGP48fbazf3KxHrWOsLme6Rv7imFBn5EnuanDW1GPaA/P1/dvObE670JDePC3mnj0k0B7P0jjQ==",
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/svgo/-/svgo-3.2.0.tgz",
"integrity": "sha512-4PP6CMW/V7l/GmKRKzsLR8xxjdHTV4IMvhTnpuHwwBazSIlw5W/5SmPjN8Dwyt7lKbSJrRDgp4t9ph0HgChFBQ==",
"dev": true,
"requires": {
"@trysound/sax": "0.2.0",
"commander": "^7.2.0",
"css-select": "^5.1.0",
"css-tree": "^2.2.1",
"css-tree": "^2.3.1",
"css-what": "^6.1.0",
"csso": "^5.0.5",
"picocolors": "^1.0.0"
}

View file

@ -2,7 +2,7 @@
"name": "RevisionSlider",
"private": true,
"scripts": {
"minify-svg": "svgo --config=.svgo.config.js --quiet --recursive --folder resources/",
"minify:svg": "svgo --config=.svgo.config.js --quiet --recursive --folder resources/",
"selenium-daily": "npm run selenium-test",
"selenium-test": "wdio tests/selenium/wdio.conf.js",
"test": "grunt test"
@ -20,7 +20,7 @@
"grunt-stylelint": "0.19.0",
"mwbot": "1.0.10",
"stylelint-config-wikimedia": "0.16.1",
"svgo": "3.0.2",
"svgo": "3.2.0",
"wdio-mediawiki": "2.3.0"
}
}

View file

@ -3,7 +3,7 @@
<path fill="#e5e5e5" d="m151.97 146.18 14.012 10.107 12.701-9.658 12.395 9.563 13.295-9.563 12.323 9.317 13.077-9.362 13.5 9.517-.077-83.412h-91.337z"/>
<g stroke-linecap="round" stroke-width="1.18">
<path fill="none" stroke="#e6e6e6" d="m.59.59 254.82.002-.1 147.02-11.832 8.656-13.686-9.393-13.102 9.364-12.159-9.496-13.425 9.514-12.621-9.522-12.588 9.584-13.695-9.553-13.033 9.491-11.662-9.344-13.35 9.374-12.438-9.335-12.727 9.307-13.837-9.399-13.394 9.41-12.139-9.535-12.125 9.523-13.325-9.34-11.247 9.33L.589 147.06z"/>
<path fill="#e5e5e5" stroke="#e5e5e5" stroke-linejoin="round" d="M37.24 34.614c-.257-7.083-6.174-12.635-13.259-12.441-7.084.193-12.689 6.059-12.561 13.144.129 7.086 5.943 12.745 13.03 12.68 7.087-.064 12.798-5.827 12.797-12.914"/>
<path fill="#e5e5e5" stroke="#e5e5e5" stroke-linejoin="round" d="M37.24 34.614c-.257-7.083-6.174-12.635-13.259-12.441-7.084.193-12.689 6.059-12.561 13.144.129 7.086 5.943 12.745 13.03 12.68s12.798-5.827 12.797-12.914"/>
<path fill="#e5e5e5" stroke="#e5e5e5" d="M13.15 56.621h23.004v-3.773H13.15zm.092 70.479h23.003V70.304H13.242z"/>
<path fill="#d8d8d8" stroke="#d8d8d8" d="M226.49 10.134h23.93V5.597h-23.93z"/>
</g>

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB

View file

@ -1,27 +1,27 @@
<svg xmlns="http://www.w3.org/2000/svg" width="256" height="157.05" viewBox="0 0 256 157.05">
<path fill="#e5e5e5" d="m206.756 146.449-12.449 9.835-13.216-9.616-13.979 9.288-12.887-9.288-12.231 9.507-13.433-9.397-11.795 9.397-13.258-9.78.424-73.714 102.934.006-.11 73.762z"/>
<path fill="#e5e5e5" d="m104.03 146.18-14.012 10.107-12.701-9.658-12.395 9.563-13.295-9.563-12.323 9.317-13.077-9.362-13.5 9.517.077-83.412h91.337l-.111 73.491z"/>
<path fill="#e5e5e5" d="m206.756 146.449-12.449 9.835-13.216-9.616-13.979 9.288-12.887-9.288-12.231 9.507-13.433-9.397-11.795 9.397-13.258-9.78.424-73.714 102.934.006z"/>
<path fill="#e5e5e5" d="m104.03 146.18-14.012 10.107-12.701-9.658-12.395 9.563-13.295-9.563-12.323 9.317-13.077-9.362-13.5 9.517.077-83.412h91.337z"/>
<g stroke-linecap="round" stroke-width="1.18">
<path fill="none" stroke="#e6e6e6" d="M255.41.59.59.592l.1 147.021 11.832 8.656 13.686-9.393 13.102 9.364 12.159-9.496 13.425 9.514 12.621-9.522 12.588 9.584 13.695-9.553 13.033 9.491 11.662-9.344 13.35 9.374 12.438-9.335 12.727 9.307 13.837-9.399 13.394 9.41 12.139-9.535 12.125 9.523 13.325-9.34 11.247 9.33 12.336-9.188L255.41.59z"/>
<path fill="#e5e5e5" stroke="#e5e5e5" stroke-linejoin="round" d="M218.759 34.614c.257-7.083 6.174-12.635 13.259-12.441 7.084.193 12.689 6.059 12.561 13.144-.129 7.086-5.943 12.745-13.03 12.68-7.087-.064-12.798-5.827-12.797-12.914"/>
<path fill="#e5e5e5" stroke="#e5e5e5" d="M242.848 56.621h-23.004v-3.773h23.004v3.773zm-.092 70.479h-23.003V70.304h23.003V127.1z"/>
<path fill="#d8d8d8" stroke="#d8d8d8" d="M29.51 10.134H5.58V5.597h23.93v4.537z"/>
<path fill="none" stroke="#e6e6e6" d="M255.41.59.59.592l.1 147.021 11.832 8.656 13.686-9.393 13.102 9.364 12.159-9.496 13.425 9.514 12.621-9.522 12.588 9.584 13.695-9.553 13.033 9.491 11.662-9.344 13.35 9.374 12.438-9.335 12.727 9.307 13.837-9.399 13.394 9.41 12.139-9.535 12.125 9.523 13.325-9.34 11.247 9.33 12.336-9.188z"/>
<path fill="#e5e5e5" stroke="#e5e5e5" stroke-linejoin="round" d="M218.759 34.614c.257-7.083 6.174-12.635 13.259-12.441 7.084.193 12.689 6.059 12.561 13.144-.129 7.086-5.943 12.745-13.03 12.68s-12.798-5.827-12.797-12.914"/>
<path fill="#e5e5e5" stroke="#e5e5e5" d="M242.848 56.621h-23.004v-3.773h23.004zm-.092 70.479h-23.003V70.304h23.003z"/>
<path fill="#d8d8d8" stroke="#d8d8d8" d="M29.51 10.134H5.58V5.597h23.93z"/>
</g>
<path fill="#e5e5e5" stroke="#e5e5e5" d="M2.057 14.518h252.06"/>
<g stroke-linecap="round">
<path fill="#e5e5e5" stroke="#e5e5e5" stroke-width="1.18" d="M246.67 10.045h-29.72V5.508h29.72v4.537z"/>
<path fill="#d8d8d8" stroke="#d8d8d8" stroke-width="1.18" d="M77.24 10.309H66.414V5.772H77.24v4.537zm-31.115-.282H35.299V5.49h10.826v4.537zm15.346-.038H50.645V5.452h10.826v4.537z"/>
<path fill="none" stroke="#e5e5e5" d="M208.18 10.278h-89.865V5.413h89.865v4.865z"/>
<path fill="#e2e5e5" stroke="#e5e5e5" stroke-width="1.18" d="M205.096 8.227h-.761v-.788h.761v.788z"/>
<path fill="#e5e5e5" stroke="#e5e5e5" stroke-width="1.18" d="M246.67 10.045h-29.72V5.508h29.72z"/>
<path fill="#d8d8d8" stroke="#d8d8d8" stroke-width="1.18" d="M77.24 10.309H66.414V5.772H77.24zm-31.115-.282H35.299V5.49h10.826zm15.346-.038H50.645V5.452h10.826z"/>
<path fill="none" stroke="#e5e5e5" d="M208.18 10.278h-89.865V5.413h89.865z"/>
<path fill="#e2e5e5" stroke="#e5e5e5" stroke-width="1.18" d="M205.096 8.227h-.761v-.788h.761z"/>
</g>
<g fill="#347bff">
<path d="m194.964 48.105-10.478 9.874.02-19.772 10.458 9.898zm-12.993-.065H169.52V37.01h12.451v11.03z"/>
<path d="m194.964 48.105-10.478 9.874.02-19.772zm-12.993-.065H169.52V37.01h12.451z"/>
<path stroke="#347bff" d="M33.62 48.129H184.6"/>
<path d="m26.607 47.955 10.477 9.874-.02-19.772-10.457 9.898zm143.215 8.533h-12.45v-8.3h12.45v8.3zm-13.105 6.225h-12.449V47.97h12.449v14.743zM142.52 47.842h-12.451V30.15h12.451v17.692zm-12.888.128h-12.45V34.427h12.45V47.97zm-12.976.146h-12.45V37.85h12.45v10.266zm-12.665 18.43h-12.45V48.198h12.45v18.348zm-25.948-7.928h-12.45V48.352h12.45v10.266zm13.283-10.811h-12.45V30.333h12.45v17.474zM64.76 63.424H52.311V48.352H64.76v15.072zM52.096 47.807h-12.45V37.54h12.449v10.267z"/>
<path d="m26.607 47.955 10.477 9.874-.02-19.772zm143.215 8.533h-12.45v-8.3h12.45zm-13.105 6.225h-12.449V47.97h12.449zM142.52 47.842h-12.451V30.15h12.451zm-12.888.128h-12.45V34.427h12.45zm-12.976.146h-12.45V37.85h12.45zm-12.665 18.43h-12.45V48.198h12.45zm-25.948-7.928h-12.45V48.352h12.45zm13.283-10.811h-12.45V30.333h12.45zM64.76 63.424H52.311V48.352H64.76zM52.096 47.807h-12.45V37.54h12.449z"/>
</g>
<g fill="#d8d8d8">
<path d="M201.926 91.889h-81.473v-3.057h81.473v3.057zm0-8.518h-29.27v-6.334h29.27v6.334zm.109 22.518h-81.473v-3.058h81.473v3.058zm0 8h-56.354v-3.058h56.354v3.058zm0 14h-81.473v-3.059h81.473v3.059zm-.055 8h-81.473v-3.059h81.473v3.059zm.055 6h-40.627v-3.059h40.627v3.059zm-102.987-58.9H69.779v-6.334h29.269v6.334zm.109 8.9H17.686v-3.057h81.472v3.057zm0 22H17.686v-3.058h81.472v3.058zm0-15H17.686v-3.058h81.472v3.058zm0 7H70.543v-3.058h28.614v3.058zm0 22H17.686v-3.059h81.472v3.059zm0-8H17.686v-3.059h81.472v3.059zm-.055 22H17.63v-3.059h81.472v3.059zm12.653-69.103v78.196h-3.058V72.786h3.058z"/>
<path d="m111.746 150.84-3.038.221 3.039 2.229-.001-2.45z"/>
<path d="m111.754 150.864-3.054-.683v.883l3.047 2.226.007-2.426z"/>
<path d="M201.926 91.889h-81.473v-3.057h81.473zm0-8.518h-29.27v-6.334h29.27zm.109 22.518h-81.473v-3.058h81.473zm0 8h-56.354v-3.058h56.354zm0 14h-81.473v-3.059h81.473zm-.055 8h-81.473v-3.059h81.473zm.055 6h-40.627v-3.059h40.627zm-102.987-58.9H69.779v-6.334h29.269zm.109 8.9H17.686v-3.057h81.472zm0 22H17.686v-3.058h81.472zm0-15H17.686v-3.058h81.472zm0 7H70.543v-3.058h28.614zm0 22H17.686v-3.059h81.472zm0-8H17.686v-3.059h81.472zm-.055 22H17.63v-3.059h81.472zm12.653-69.103v78.196h-3.058V72.786z"/>
<path d="m111.746 150.84-3.038.221 3.039 2.229z"/>
<path d="m111.754 150.864-3.054-.683v.883l3.047 2.226z"/>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB