Update tools/package.json dependencies, remove imagemin-zopfli (#35406)
imagemin-zopfli brings a lot of [vulnerable dependencies](https://github.com/go-gitea/gitea/security/dependabot) and it is unmaintained. The removal brings a size increase to these images, but I think ultimately this size does not matter enough. I verified this passes `pnpm audit` now.
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 6.6 KiB |
Before Width: | Height: | Size: 4.8 KiB After Width: | Height: | Size: 7.5 KiB |
Before Width: | Height: | Size: 4.2 KiB After Width: | Height: | Size: 6.8 KiB |
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 21 KiB |
@@ -1,5 +1,4 @@
|
||||
#!/usr/bin/env node
|
||||
import imageminZopfli from 'imagemin-zopfli'; // eslint-disable-line import-x/no-unresolved
|
||||
import {loadSVGFromString, Canvas, Rect, util} from 'fabric/node'; // eslint-disable-line import-x/no-unresolved
|
||||
import {optimize} from 'svgo';
|
||||
import {readFile, writeFile} from 'node:fs/promises';
|
||||
@@ -52,7 +51,6 @@ async function generate(svg, path, {size, bg}) {
|
||||
png = Buffer.concat([png, chunk]);
|
||||
}
|
||||
|
||||
png = await imageminZopfli({more: true})(png);
|
||||
await writeFile(outputFile, png);
|
||||
}
|
||||
|
||||
|
@@ -5,16 +5,15 @@
|
||||
"type": "module",
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"fabric": "^6.0.0",
|
||||
"imagemin-zopfli": "^7.0.0",
|
||||
"svgo": "^3.0.0",
|
||||
"fast-glob": "^3.0.0"
|
||||
"fabric": "^6.7.1",
|
||||
"svgo": "^4.0.0",
|
||||
"fast-glob": "^3.3.3"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"canvas": "^3.2.0"
|
||||
},
|
||||
"pnpm": {
|
||||
"onlyBuiltDependencies": ["canvas", "zopflipng-bin"],
|
||||
"onlyBuiltDependencies": ["canvas"],
|
||||
"overrides": {
|
||||
"canvas": "3.2.0"
|
||||
}
|
||||
|