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.
This commit is contained in:
silverwind
2025-09-04 15:17:33 +02:00
committed by GitHub
parent 879b896656
commit e9655df082
7 changed files with 263 additions and 1683 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 6.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.8 KiB

After

Width:  |  Height:  |  Size: 7.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

After

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 21 KiB

View File

@@ -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);
}

View File

@@ -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"
}

1933
tools/pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff