From e094773671d8d62c38b9690d2078eef3c48c9dba Mon Sep 17 00:00:00 2001 From: Volker E Date: Tue, 16 Jan 2024 14:54:33 +0100 Subject: [PATCH] build: Update 'svgo' to latest v3.2.0 and re-minify SVGs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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: I0c712a4cec011ddda3a55caf4ecf493e1e00f3c8 --- package-lock.json | 20 +++++++++++--------- package.json | 4 ++-- resources/images/back-grey-ltr.svg | 2 +- resources/images/back-grey-rtl.svg | 2 +- resources/images/cog-sprite.svg | 2 +- resources/images/cog.svg | 2 +- resources/images/compact-links-ltr.svg | 12 ++++++------ resources/images/compact-links-rtl.svg | 12 ++++++------ resources/images/display.svg | 2 +- resources/images/help.svg | 2 +- resources/images/input.svg | 2 +- resources/images/language-base20.svg | 2 +- resources/images/remove-input.svg | 2 +- 13 files changed, 34 insertions(+), 32 deletions(-) diff --git a/package-lock.json b/package-lock.json index 567ef064..b87c6e2a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15,7 +15,7 @@ "postcss-less": "6.0.0", "sfnt2woff": "^1.0.1", "stylelint-config-wikimedia": "0.16.1", - "svgo": "3.0.2" + "svgo": "3.2.0" } }, "node_modules/@aashutoshrathi/word-wrap": { @@ -4663,15 +4663,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" }, @@ -8502,15 +8503,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" } diff --git a/package.json b/package.json index af1deab8..3a712f38 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "private": true, "scripts": { "build-lib": "./scripts/build.sh", - "minify-svg": "svgo --config=.svgo.config.js --quiet --recursive --folder resources/images/", + "minify:svg": "svgo --config=.svgo.config.js --quiet --recursive --folder resources/images/", "test": "grunt test" }, "devDependencies": { @@ -16,7 +16,7 @@ "postcss-less": "6.0.0", "sfnt2woff": "^1.0.1", "stylelint-config-wikimedia": "0.16.1", - "svgo": "3.0.2" + "svgo": "3.2.0" }, "eslintIgnore": [ "lib/**", diff --git a/resources/images/back-grey-ltr.svg b/resources/images/back-grey-ltr.svg index 49a86d66..52c28c75 100644 --- a/resources/images/back-grey-ltr.svg +++ b/resources/images/back-grey-ltr.svg @@ -1,4 +1,4 @@ - + diff --git a/resources/images/back-grey-rtl.svg b/resources/images/back-grey-rtl.svg index 4fbf3a5a..47a6936c 100644 --- a/resources/images/back-grey-rtl.svg +++ b/resources/images/back-grey-rtl.svg @@ -1,4 +1,4 @@ - + diff --git a/resources/images/cog-sprite.svg b/resources/images/cog-sprite.svg index aee7abfb..fd6fa767 100644 --- a/resources/images/cog-sprite.svg +++ b/resources/images/cog-sprite.svg @@ -1,7 +1,7 @@ - + diff --git a/resources/images/cog.svg b/resources/images/cog.svg index ad8165b0..179963f6 100644 --- a/resources/images/cog.svg +++ b/resources/images/cog.svg @@ -1,4 +1,4 @@ - + diff --git a/resources/images/compact-links-ltr.svg b/resources/images/compact-links-ltr.svg index 65ef981c..aa13b4ee 100644 --- a/resources/images/compact-links-ltr.svg +++ b/resources/images/compact-links-ltr.svg @@ -7,18 +7,18 @@ - - - - + + + + - + - + diff --git a/resources/images/compact-links-rtl.svg b/resources/images/compact-links-rtl.svg index 0fd7bc02..26e61e3f 100644 --- a/resources/images/compact-links-rtl.svg +++ b/resources/images/compact-links-rtl.svg @@ -7,18 +7,18 @@ - - - - + + + + - + - + diff --git a/resources/images/display.svg b/resources/images/display.svg index e9016adb..68c9cce4 100644 --- a/resources/images/display.svg +++ b/resources/images/display.svg @@ -1,4 +1,4 @@ - + diff --git a/resources/images/help.svg b/resources/images/help.svg index 1d786f05..a1f72284 100644 --- a/resources/images/help.svg +++ b/resources/images/help.svg @@ -1,4 +1,4 @@ - + diff --git a/resources/images/input.svg b/resources/images/input.svg index c34ae53a..177ebfb2 100644 --- a/resources/images/input.svg +++ b/resources/images/input.svg @@ -1,4 +1,4 @@ - + diff --git a/resources/images/language-base20.svg b/resources/images/language-base20.svg index 007c96ac..a644ea0d 100644 --- a/resources/images/language-base20.svg +++ b/resources/images/language-base20.svg @@ -3,5 +3,5 @@ language - + diff --git a/resources/images/remove-input.svg b/resources/images/remove-input.svg index cb6ce8cf..c1dcb6e6 100644 --- a/resources/images/remove-input.svg +++ b/resources/images/remove-input.svg @@ -1,5 +1,5 @@ - +