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

Bug: T354875
Change-Id: Ibd611396c48ff6f971ee251b59f13e350e0f812f
This commit is contained in:
Volker E 2024-01-16 00:12:36 +01:00
parent 2ef5278784
commit 31ef381e90
4 changed files with 15 additions and 13 deletions

20
package-lock.json generated
View file

@ -40,7 +40,7 @@
"redux-thunk": "2.3.0",
"stylelint-config-wikimedia": "0.16.1",
"svg-inline-loader": "0.8.2",
"svgo": "3.0.2",
"svgo": "3.2.0",
"tap-mocha-reporter": "5.0.1",
"url-loader": "4.1.1",
"wdio-mediawiki": "2.3.0",
@ -13940,15 +13940,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"
},
@ -26332,15 +26333,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

@ -17,7 +17,7 @@
"doc": "jsdoc -c jsdoc.json # SKIPPED! && npm run build-storybook",
"linter:js": "eslint --cache .",
"linter:styles": "stylelint \"src/**/*.less\"",
"minify-svg": "svgo --config=.svgo.config.js --quiet --recursive --folder resources/ext.popups.images/",
"minify:svg": "svgo --config=.svgo.config.js --quiet --recursive --folder resources/ext.popups.images/",
"node-debug": "node -v && npm -v && echo 'Please ensure you are running the correct version of nvm before running this command.'",
"precommit": "npm -s t",
"selenium-daily": "npm run selenium-test",
@ -61,7 +61,7 @@
"redux-thunk": "2.3.0",
"stylelint-config-wikimedia": "0.16.1",
"svg-inline-loader": "0.8.2",
"svgo": "3.0.2",
"svgo": "3.2.0",
"tap-mocha-reporter": "5.0.1",
"url-loader": "4.1.1",
"wdio-mediawiki": "2.3.0",

View file

@ -3,5 +3,5 @@
<title>
sad face
</title>
<path d="M2 0a2 2 0 0 0-2 2v18l4-4h14a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2zm4 4c1.336 0 2.007 1.617 1.06 2.56-.943.947-2.56.276-2.56-1.06A1.5 1.5 0 0 1 6 4zm8 0c1.336 0 2.007 1.617 1.06 2.56-.943.947-2.56.276-2.56-1.06A1.5 1.5 0 0 1 14 4zm-4 5c2.61 0 4.83.67 5.65 3H4.35C5.17 9.67 7.39 9 10 9z"/>
<path d="M2 0a2 2 0 0 0-2 2v18l4-4h14a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2zm4 4c1.336 0 2.007 1.617 1.06 2.56-.943.947-2.56.276-2.56-1.06A1.5 1.5 0 0 1 6 4m8 0c1.336 0 2.007 1.617 1.06 2.56-.943.947-2.56.276-2.56-1.06A1.5 1.5 0 0 1 14 4m-4 5c2.61 0 4.83.67 5.65 3H4.35C5.17 9.67 7.39 9 10 9"/>
</svg>

Before

Width:  |  Height:  |  Size: 453 B

After

Width:  |  Height:  |  Size: 448 B

View file

@ -3,5 +3,5 @@
<title>
sad face
</title>
<path d="M18 0a2 2 0 0 1 2 2v18l-4-4H2a2 2 0 0 1-2-2V2a2 2 0 0 1 2-2zm-4 4c-1.336 0-2.007 1.617-1.06 2.56.943.947 2.56.276 2.56-1.06A1.5 1.5 0 0 0 14 4zM6 4C4.664 4 3.993 5.617 4.94 6.56c.943.947 2.56.276 2.56-1.06A1.5 1.5 0 0 0 6 4zm4 5c-2.61 0-4.83.67-5.65 3h11.3c-.82-2.33-3.04-3-5.65-3z"/>
<path d="M18 0a2 2 0 0 1 2 2v18l-4-4H2a2 2 0 0 1-2-2V2a2 2 0 0 1 2-2zm-4 4c-1.336 0-2.007 1.617-1.06 2.56.943.947 2.56.276 2.56-1.06A1.5 1.5 0 0 0 14 4M6 4C4.664 4 3.993 5.617 4.94 6.56c.943.947 2.56.276 2.56-1.06A1.5 1.5 0 0 0 6 4m4 5c-2.61 0-4.83.67-5.65 3h11.3c-.82-2.33-3.04-3-5.65-3"/>
</svg>

Before

Width:  |  Height:  |  Size: 455 B

After

Width:  |  Height:  |  Size: 452 B