From f2e8e38db1212cca779da06f56dd70130c1c6e44 Mon Sep 17 00:00:00 2001 From: Seth Falco Date: Tue, 11 Jun 2024 23:25:14 +0100 Subject: [PATCH] chore(deps): upgrade to svgo@v4.0.0 --- package.json | 4 ++-- pnpm-lock.yaml | 61 ++++++++++++++++++++++++++++++++------------------ src/ipx.ts | 2 +- 3 files changed, 42 insertions(+), 25 deletions(-) diff --git a/package.json b/package.json index 3c4e9f0..06c296a 100644 --- a/package.json +++ b/package.json @@ -49,7 +49,7 @@ "ofetch": "^1.3.4", "pathe": "^1.1.2", "sharp": "^0.33.3", - "svgo": "^3.2.0", + "svgo": "^4.0.0-rc.0", "ufo": "^1.5.3", "unstorage": "^1.10.2", "xss": "^1.0.15" @@ -69,4 +69,4 @@ "vitest": "^1.5.2" }, "packageManager": "pnpm@9.0.6" -} \ No newline at end of file +} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 45e745f..6af3660 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -45,8 +45,8 @@ importers: specifier: ^0.33.3 version: 0.33.3 svgo: - specifier: ^3.2.0 - version: 3.2.0 + specifier: ^4.0.0-rc.0 + version: 4.0.0-rc.0 ufo: specifier: ^1.5.3 version: 1.5.3 @@ -364,6 +364,7 @@ packages: '@humanwhocodes/config-array@0.11.14': resolution: {integrity: sha512-3T8LkOmg45BV5FICb15QQMsyUSWrQ8AygVfC7ZG32zOalnqrilm018ZVCw0eapXux8FtA33q8PSRSstjee3jSg==} engines: {node: '>=10.10.0'} + deprecated: Use @eslint/config-array instead '@humanwhocodes/module-importer@1.0.1': resolution: {integrity: sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==} @@ -371,6 +372,7 @@ packages: '@humanwhocodes/object-schema@2.0.2': resolution: {integrity: sha512-6EwiSjwWYP7pTckG6I5eyFANjPhmPjUX9JRLUSfNPC7FX7zK9gyZAfUEaECL6ALTpGX5AjnBq3C9XmVWPitNpw==} + deprecated: Use @eslint/object-schema instead '@img/sharp-darwin-arm64@0.33.3': resolution: {integrity: sha512-FaNiGX1MrOuJ3hxuNzWgsT/mg5OHG/Izh59WW2mk1UwYHUwtfbhk5QNKYZgxf0pLOhx9ctGiGa2OykD71vOnSw==} @@ -1066,6 +1068,10 @@ packages: colorette@2.0.20: resolution: {integrity: sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==} + commander@11.1.0: + resolution: {integrity: sha512-yPVavfyCcRhmorC7rWlkHn15b4wDVgVmBA7kV4QVBsF7kv/9TKJAbAXVTxvTnwP8HHKjRCJDClKbciiYS7p0DQ==} + engines: {node: '>=16'} + commander@2.20.3: resolution: {integrity: sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==} @@ -1608,10 +1614,12 @@ packages: glob@7.2.3: resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==} + deprecated: Glob versions prior to v9 are no longer supported glob@8.1.0: resolution: {integrity: sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==} engines: {node: '>=12'} + deprecated: Glob versions prior to v9 are no longer supported globals@11.12.0: resolution: {integrity: sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==} @@ -1721,6 +1729,7 @@ packages: inflight@1.0.6: resolution: {integrity: sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==} + deprecated: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful. inherits@2.0.4: resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} @@ -2080,9 +2089,6 @@ packages: typescript: optional: true - mlly@1.5.0: - resolution: {integrity: sha512-NPVQvAY1xr1QoVeG0cy8yUYC7FQcOx6evl/RjT1wL5FvzPnzOysoqB/jmx/DhssT2dYa8nxECLAaFI/+gVLhDQ==} - mlly@1.6.1: resolution: {integrity: sha512-vLgaHvaeunuOXHSmEbZ9izxPx3USsk8KCQ8iC+aTlp5sKRSoZvwhHh5L9VbKSaVC6sJDqbyohIS76E2VmHIPAA==} @@ -2111,9 +2117,6 @@ packages: resolution: {integrity: sha512-mNcltoe1R8o7STTegSOHdnJNN7s5EUvhoS7ShnTHDyOSd+8H+UdWODq6qSv67PjC8Zc5JRT8+oLAMCr0SIXw7g==} engines: {node: ^16 || ^18 || >= 20} - node-fetch-native@1.6.2: - resolution: {integrity: sha512-69mtXOFZ6hSkYiXAVB5SqaRvrbITC/NPyqv7yuu/qw0nmgPyYbIMYYNIDhNtwPrzk0ptrimrLz/hhjvm4w5Z+w==} - node-fetch-native@1.6.4: resolution: {integrity: sha512-IhOigYzAKHd244OC0JIMIUrjzctirCmPkaIfhDeGcEETWof5zKYUW7e7MYvChGWh/4CJeXEgsRyGzuF334rOOQ==} @@ -2546,6 +2549,7 @@ packages: rimraf@3.0.2: resolution: {integrity: sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==} + deprecated: Rimraf versions prior to v4 are no longer supported hasBin: true rollup-plugin-dts@6.1.0: @@ -2583,6 +2587,9 @@ packages: safe-regex@2.1.1: resolution: {integrity: sha512-rx+x8AMzKb5Q5lQ95Zoi6ZbJqwCLkqi3XuJXp5P3rT8OEc6sZCJG5AE5dU3lsgRr/F4Bs31jSlVN+j5KrsGu9A==} + sax@1.4.1: + resolution: {integrity: sha512-+aWOz7yVScEGoKNd4PA10LZ8sk0A/z5+nXQG5giUO5rprX9jgYsTdov9qCchZiPIZezbZH+jRut8nPodFAX4Jg==} + scule@1.3.0: resolution: {integrity: sha512-6FtHJEvt+pVMIB9IBY+IcCJ6Z5f1iQnytgyfKMhDKgmzYG+TeH/wx1y3l27rshSbLiSanrR9ffZDrEsmjlQF2g==} @@ -2729,6 +2736,11 @@ packages: engines: {node: '>=14.0.0'} hasBin: true + svgo@4.0.0-rc.0: + resolution: {integrity: sha512-V6DFAkoKXl9GFPZPKNDcJpeXQtMhJT3mgt0VIJTuTe89Ih4ZMtlVR/Djxm0WZX1+9TC7srNhQG6Ffs7EcB4T7Q==} + engines: {node: '>=16.0.0'} + hasBin: true + system-architecture@0.1.0: resolution: {integrity: sha512-ulAk51I9UVUyJgxlv9M6lFot2WP3e7t8Kz9+IS6D4rVba1tR9kON+Ey69f+1R4Q8cd45Lod6a4IcJIxnzGc/zA==} engines: {node: '>=18'} @@ -3913,7 +3925,7 @@ snapshots: convert-gitmoji: 0.1.5 execa: 8.0.1 mri: 1.2.0 - node-fetch-native: 1.6.2 + node-fetch-native: 1.6.4 ofetch: 1.3.4 open: 9.1.0 pathe: 1.1.2 @@ -3983,6 +3995,8 @@ snapshots: colorette@2.0.20: {} + commander@11.1.0: {} + commander@2.20.3: {} commander@7.2.0: {} @@ -4679,7 +4693,7 @@ snapshots: citty: 0.1.6 consola: 3.2.3 defu: 6.1.4 - node-fetch-native: 1.6.2 + node-fetch-native: 1.6.4 nypm: 0.3.6 ohash: 1.1.3 pathe: 1.1.2 @@ -5147,13 +5161,6 @@ snapshots: optionalDependencies: typescript: 5.4.5 - mlly@1.5.0: - dependencies: - acorn: 8.11.3 - pathe: 1.1.2 - pkg-types: 1.0.3 - ufo: 1.5.3 - mlly@1.6.1: dependencies: acorn: 8.11.3 @@ -5175,8 +5182,6 @@ snapshots: node-addon-api@7.1.0: {} - node-fetch-native@1.6.2: {} - node-fetch-native@1.6.4: {} node-forge@1.3.1: {} @@ -5646,6 +5651,8 @@ snapshots: dependencies: regexp-tree: 0.1.27 + sax@1.4.1: {} + scule@1.3.0: {} semver@5.7.2: {} @@ -5819,6 +5826,16 @@ snapshots: csso: 5.0.5 picocolors: 1.0.0 + svgo@4.0.0-rc.0: + dependencies: + commander: 11.1.0 + css-select: 5.1.0 + css-tree: 2.3.1 + css-what: 6.1.0 + csso: 5.0.5 + picocolors: 1.0.0 + sax: 1.4.1 + system-architecture@0.1.0: {} tapable@2.2.1: {} @@ -5939,7 +5956,7 @@ snapshots: jiti: 1.21.0 magic-string: 0.30.7 mkdist: 1.4.0(typescript@5.4.5) - mlly: 1.5.0 + mlly: 1.6.1 pathe: 1.1.2 pkg-types: 1.0.3 pretty-bytes: 6.1.1 @@ -5962,7 +5979,7 @@ snapshots: consola: 3.2.3 defu: 6.1.4 mime: 3.0.0 - node-fetch-native: 1.6.2 + node-fetch-native: 1.6.4 pathe: 1.1.2 universalify@2.0.1: {} @@ -5976,7 +5993,7 @@ snapshots: listhen: 1.7.2 lru-cache: 10.2.0 mri: 1.2.0 - node-fetch-native: 1.6.2 + node-fetch-native: 1.6.4 ofetch: 1.3.4 ufo: 1.5.3 transitivePeerDependencies: diff --git a/src/ipx.ts b/src/ipx.ts index 03043be..4c5697e 100644 --- a/src/ipx.ts +++ b/src/ipx.ts @@ -180,7 +180,7 @@ export function createIPX(userOptions: IPXOptions): IPX { const { optimize } = await getSVGO(); const svg = optimize(sourceData.toString("utf8"), { ...options.svgo, - plugins: ["removeScriptElement", ...(options.svgo?.plugins || [])], + plugins: ["removeScripts", ...(options.svgo?.plugins || [])], }).data; return { data: svg,