From 4cef61f178efe57b92fb174700f9a0fa1baeb3d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Andr=C3=A9s=20Puglia?= Date: Wed, 16 Nov 2022 16:09:17 -0300 Subject: [PATCH 1/4] Bumps svgo to v3.0.1 --- package-lock.json | 229 +++++++++++++----- .../cli/src/__snapshots__/index.test.ts.snap | 118 ++++----- .../cli/src/__snapshots__/util.test.ts.snap | 8 +- .../src/__snapshots__/transform.test.ts.snap | 162 ++++++------- packages/plugin-svgo/package.json | 2 +- .../src/__snapshots__/index.test.ts.snap | 14 +- .../src/__snapshots__/index.test.ts.snap | 14 +- .../src/__snapshots__/index.test.ts.snap | 50 ++-- 8 files changed, 355 insertions(+), 242 deletions(-) diff --git a/package-lock.json b/package-lock.json index 02e8445d..816759b0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8891,6 +8891,7 @@ "version": "4.3.0", "resolved": "https://registry.npmjs.org/css-select/-/css-select-4.3.0.tgz", "integrity": "sha512-wPpOYtnsVontu2mODhA19JrqWxNsfdatRKd64kmpRbQgh1KtItko5sTnEpPdpSaJszTOhEMlF/RPz28qj4HqhQ==", + "dev": true, "dependencies": { "boolbase": "^1.0.0", "css-what": "^6.0.1", @@ -8903,15 +8904,16 @@ } }, "node_modules/css-tree": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/css-tree/-/css-tree-1.1.3.tgz", - "integrity": "sha512-tRpdppF7TRazZrjJ6v3stzv93qxRcSsFmW6cX0Zm2NVKpxE1WV1HblnghVv9TreireHkqI/VDEsfolRF1p6y7Q==", + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/css-tree/-/css-tree-2.2.1.tgz", + "integrity": "sha512-OA0mILzGc1kCOCSJerOeqDxDQ4HOh+G8NbOJFOTgOCzpw7fCBubk0fEyxp8AgOL/jvLgYA/uV0cMbe43ElF1JA==", "dependencies": { - "mdn-data": "2.0.14", - "source-map": "^0.6.1" + "mdn-data": "2.0.28", + "source-map-js": "^1.0.1" }, "engines": { - "node": ">=8.0.0" + "node": "^10 || ^12.20.0 || ^14.13.0 || >=15.0.0", + "npm": ">=7.0.0" } }, "node_modules/css-what": { @@ -8926,14 +8928,15 @@ } }, "node_modules/csso": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/csso/-/csso-4.2.0.tgz", - "integrity": "sha512-wvlcdIbf6pwKEk7vHj8/Bkc0B4ylXZruLvOgs9doS5eOsOpuodOV2zJChSpkp+pRpYQLQMeF04nr3Z68Sta9jA==", + "version": "5.0.5", + "resolved": "https://registry.npmjs.org/csso/-/csso-5.0.5.tgz", + "integrity": "sha512-0LrrStPOdJj+SPCCrGhzryycLjwcgUSHBtxNA8aIDxf0GLsRh1cKYhB00Gd1lDOS4yGH69+SNn13+TWbVHETFQ==", "dependencies": { - "css-tree": "^1.1.2" + "css-tree": "~2.2.0" }, "engines": { - "node": ">=8.0.0" + "node": "^10 || ^12.20.0 || ^14.13.0 || >=15.0.0", + "npm": ">=7.0.0" } }, "node_modules/currently-unhandled": { @@ -9292,6 +9295,7 @@ "version": "1.4.1", "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-1.4.1.tgz", "integrity": "sha512-VHwB3KfrcOOkelEG2ZOfxqLZdfkil8PtJi4P8N2MMXucZq2yLp75ClViUlOVwyoHEDjYU433Aq+5zWP61+RGag==", + "dev": true, "dependencies": { "domelementtype": "^2.0.1", "domhandler": "^4.2.0", @@ -9305,6 +9309,7 @@ "version": "2.2.0", "resolved": "https://registry.npmjs.org/entities/-/entities-2.2.0.tgz", "integrity": "sha512-p92if5Nz619I0w+akJrLZH0MX0Pb5DX39XOwQTtXSdQQOaYH03S1uIQp4mhOZtAXrxq4ViO67YTiLBo2638o9A==", + "dev": true, "funding": { "url": "https://github.com/fb55/entities?sponsor=1" } @@ -9324,6 +9329,7 @@ "version": "4.3.1", "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-4.3.1.tgz", "integrity": "sha512-GrwoxYN+uWlzO8uhUXRl0P+kHE4GtVPfYzVLcUxPL7KNdHKj66vvlhiweIHqYYXWlw+T8iLMp42Lm67ghw4WMQ==", + "dev": true, "dependencies": { "domelementtype": "^2.2.0" }, @@ -9338,6 +9344,7 @@ "version": "2.8.0", "resolved": "https://registry.npmjs.org/domutils/-/domutils-2.8.0.tgz", "integrity": "sha512-w96Cjofp72M5IIhpjgobBimYEfoPjx1Vx0BSX9P30WBdZW2WIKU0T1Bd0kz2eNZ9ikjKgHbEyKx8BB6H1L3h3A==", + "dev": true, "dependencies": { "dom-serializer": "^1.0.1", "domelementtype": "^2.2.0", @@ -15542,9 +15549,9 @@ } }, "node_modules/mdn-data": { - "version": "2.0.14", - "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.14.tgz", - "integrity": "sha512-dn6wd0uw5GsdswPFfsgMp5NSB0/aDe6fK94YJV/AJDYXL6HVLWBsxeq7js7Ad+mU2K9LAlwpk6kN2D5mwCPVow==" + "version": "2.0.28", + "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.28.tgz", + "integrity": "sha512-aylIc7Z9y4yzHYAJNuESG3hfhC+0Ibp/MAMiaOZgNv4pmEdFyfZhhhny4MNiAfWdBQ1RQ2mfDWmM1x8SvGyp8g==" }, "node_modules/media-typer": { "version": "0.3.0", @@ -19498,6 +19505,15 @@ "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/source-map-js": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.2.tgz", + "integrity": "sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==", "engines": { "node": ">=0.10.0" } @@ -19647,12 +19663,6 @@ "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, - "node_modules/stable": { - "version": "0.1.8", - "resolved": "https://registry.npmjs.org/stable/-/stable-0.1.8.tgz", - "integrity": "sha512-ji9qxRnOVfcuLDySj9qzhGSEFVobyt1kIOSkj1qZzYLzq7Tos/oUUWvotUPQLlrsidqsK6tBH89Bc9kL5zHA6w==", - "deprecated": "Modern JS already guarantees Array#sort() is a stable sort, so this library is deprecated. See the compatibility table on MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#browser_compatibility" - }, "node_modules/stack-utils": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/stack-utils/-/stack-utils-2.0.5.tgz", @@ -19895,23 +19905,26 @@ "integrity": "sha512-e4hG1hRwoOdRb37cIMSgzNsxyzKfayW6VOflrwvR+/bzrkyxY/31WkbgnQpgtrNp1SdpJvpUAGTa/ZoiPNDuRQ==" }, "node_modules/svgo": { - "version": "2.8.0", - "resolved": "https://registry.npmjs.org/svgo/-/svgo-2.8.0.tgz", - "integrity": "sha512-+N/Q9kV1+F+UeWYoSiULYo4xYSDQlTgb+ayMobAXPwMnLvop7oxKMo9OzIrX5x3eS4L4f2UHhc9axXwY8DpChg==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/svgo/-/svgo-3.0.1.tgz", + "integrity": "sha512-6kiDrstRCmA600TySGBu4VNA/FdEriOv7PKQRDOyIaVYUNamWvDSZjgMsM+mB0r0y5T7S3P5DkZJSIBQ/9QEsg==", "dependencies": { "@trysound/sax": "0.2.0", "commander": "^7.2.0", - "css-select": "^4.1.3", - "css-tree": "^1.1.3", - "csso": "^4.2.0", - "picocolors": "^1.0.0", - "stable": "^0.1.8" + "css-select": "^5.1.0", + "css-tree": "^2.2.1", + "csso": "^5.0.5", + "picocolors": "^1.0.0" }, "bin": { "svgo": "bin/svgo" }, "engines": { - "node": ">=10.13.0" + "node": ">=14.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/svgo" } }, "node_modules/svgo/node_modules/commander": { @@ -19922,6 +19935,61 @@ "node": ">= 10" } }, + "node_modules/svgo/node_modules/css-select": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/css-select/-/css-select-5.1.0.tgz", + "integrity": "sha512-nwoRF1rvRRnnCqqY7updORDsuqKzqYJ28+oSMaJMMgOauh3fvwHqMS7EZpIPqK8GL+g9mKxF1vP/ZjSeNjEVHg==", + "dependencies": { + "boolbase": "^1.0.0", + "css-what": "^6.1.0", + "domhandler": "^5.0.2", + "domutils": "^3.0.1", + "nth-check": "^2.0.1" + }, + "funding": { + "url": "https://github.com/sponsors/fb55" + } + }, + "node_modules/svgo/node_modules/dom-serializer": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-2.0.0.tgz", + "integrity": "sha512-wIkAryiqt/nV5EQKqQpo3SToSOV9J0DnbJqwK7Wv/Trc92zIAYZ4FlMu+JPFW1DfGFt81ZTCGgDEabffXeLyJg==", + "dependencies": { + "domelementtype": "^2.3.0", + "domhandler": "^5.0.2", + "entities": "^4.2.0" + }, + "funding": { + "url": "https://github.com/cheeriojs/dom-serializer?sponsor=1" + } + }, + "node_modules/svgo/node_modules/domhandler": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-5.0.3.tgz", + "integrity": "sha512-cgwlv/1iFQiFnU96XXgROh8xTeetsnJiDsTc7TYCLFd9+/WNkIqPTxiM/8pSd8VIrhXGTf1Ny1q1hquVqDJB5w==", + "dependencies": { + "domelementtype": "^2.3.0" + }, + "engines": { + "node": ">= 4" + }, + "funding": { + "url": "https://github.com/fb55/domhandler?sponsor=1" + } + }, + "node_modules/svgo/node_modules/domutils": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/domutils/-/domutils-3.0.1.tgz", + "integrity": "sha512-z08c1l761iKhDFtfXO04C7kTdPBLi41zwOZl00WS8b5eiaebNpY00HKbztwBq+e3vyqWNwWF3mP9YLUeqIrF+Q==", + "dependencies": { + "dom-serializer": "^2.0.0", + "domelementtype": "^2.3.0", + "domhandler": "^5.0.1" + }, + "funding": { + "url": "https://github.com/fb55/domutils?sponsor=1" + } + }, "node_modules/tapable": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.2.1.tgz", @@ -21819,7 +21887,7 @@ "dependencies": { "cosmiconfig": "^7.0.1", "deepmerge": "^4.2.2", - "svgo": "^2.8.0" + "svgo": "^3.0.1" }, "engines": { "node": ">=10" @@ -26011,7 +26079,7 @@ "requires": { "cosmiconfig": "^7.0.1", "deepmerge": "^4.2.2", - "svgo": "^2.8.0" + "svgo": "3.0.1" } }, "@svgr/rollup": { @@ -28815,6 +28883,7 @@ "version": "4.3.0", "resolved": "https://registry.npmjs.org/css-select/-/css-select-4.3.0.tgz", "integrity": "sha512-wPpOYtnsVontu2mODhA19JrqWxNsfdatRKd64kmpRbQgh1KtItko5sTnEpPdpSaJszTOhEMlF/RPz28qj4HqhQ==", + "dev": true, "requires": { "boolbase": "^1.0.0", "css-what": "^6.0.1", @@ -28824,12 +28893,12 @@ } }, "css-tree": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/css-tree/-/css-tree-1.1.3.tgz", - "integrity": "sha512-tRpdppF7TRazZrjJ6v3stzv93qxRcSsFmW6cX0Zm2NVKpxE1WV1HblnghVv9TreireHkqI/VDEsfolRF1p6y7Q==", + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/css-tree/-/css-tree-2.2.1.tgz", + "integrity": "sha512-OA0mILzGc1kCOCSJerOeqDxDQ4HOh+G8NbOJFOTgOCzpw7fCBubk0fEyxp8AgOL/jvLgYA/uV0cMbe43ElF1JA==", "requires": { - "mdn-data": "2.0.14", - "source-map": "^0.6.1" + "mdn-data": "2.0.28", + "source-map-js": "^1.0.1" } }, "css-what": { @@ -28838,11 +28907,11 @@ "integrity": "sha512-HTUrgRJ7r4dsZKU6GjmpfRK1O76h97Z8MfS1G0FozR+oF2kG6Vfe8JE6zwrkbxigziPHinCJ+gCPjA9EaBDtRw==" }, "csso": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/csso/-/csso-4.2.0.tgz", - "integrity": "sha512-wvlcdIbf6pwKEk7vHj8/Bkc0B4ylXZruLvOgs9doS5eOsOpuodOV2zJChSpkp+pRpYQLQMeF04nr3Z68Sta9jA==", + "version": "5.0.5", + "resolved": "https://registry.npmjs.org/csso/-/csso-5.0.5.tgz", + "integrity": "sha512-0LrrStPOdJj+SPCCrGhzryycLjwcgUSHBtxNA8aIDxf0GLsRh1cKYhB00Gd1lDOS4yGH69+SNn13+TWbVHETFQ==", "requires": { - "css-tree": "^1.1.2" + "css-tree": "~2.2.0" } }, "currently-unhandled": { @@ -29110,6 +29179,7 @@ "version": "1.4.1", "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-1.4.1.tgz", "integrity": "sha512-VHwB3KfrcOOkelEG2ZOfxqLZdfkil8PtJi4P8N2MMXucZq2yLp75ClViUlOVwyoHEDjYU433Aq+5zWP61+RGag==", + "dev": true, "requires": { "domelementtype": "^2.0.1", "domhandler": "^4.2.0", @@ -29119,7 +29189,8 @@ "entities": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/entities/-/entities-2.2.0.tgz", - "integrity": "sha512-p92if5Nz619I0w+akJrLZH0MX0Pb5DX39XOwQTtXSdQQOaYH03S1uIQp4mhOZtAXrxq4ViO67YTiLBo2638o9A==" + "integrity": "sha512-p92if5Nz619I0w+akJrLZH0MX0Pb5DX39XOwQTtXSdQQOaYH03S1uIQp4mhOZtAXrxq4ViO67YTiLBo2638o9A==", + "dev": true } } }, @@ -29132,6 +29203,7 @@ "version": "4.3.1", "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-4.3.1.tgz", "integrity": "sha512-GrwoxYN+uWlzO8uhUXRl0P+kHE4GtVPfYzVLcUxPL7KNdHKj66vvlhiweIHqYYXWlw+T8iLMp42Lm67ghw4WMQ==", + "dev": true, "requires": { "domelementtype": "^2.2.0" } @@ -29140,6 +29212,7 @@ "version": "2.8.0", "resolved": "https://registry.npmjs.org/domutils/-/domutils-2.8.0.tgz", "integrity": "sha512-w96Cjofp72M5IIhpjgobBimYEfoPjx1Vx0BSX9P30WBdZW2WIKU0T1Bd0kz2eNZ9ikjKgHbEyKx8BB6H1L3h3A==", + "dev": true, "requires": { "dom-serializer": "^1.0.1", "domelementtype": "^2.2.0", @@ -33723,9 +33796,9 @@ "dev": true }, "mdn-data": { - "version": "2.0.14", - "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.14.tgz", - "integrity": "sha512-dn6wd0uw5GsdswPFfsgMp5NSB0/aDe6fK94YJV/AJDYXL6HVLWBsxeq7js7Ad+mU2K9LAlwpk6kN2D5mwCPVow==" + "version": "2.0.28", + "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.28.tgz", + "integrity": "sha512-aylIc7Z9y4yzHYAJNuESG3hfhC+0Ibp/MAMiaOZgNv4pmEdFyfZhhhny4MNiAfWdBQ1RQ2mfDWmM1x8SvGyp8g==" }, "media-typer": { "version": "0.3.0", @@ -36722,7 +36795,13 @@ "source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==" + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + }, + "source-map-js": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.2.tgz", + "integrity": "sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==" }, "source-map-support": { "version": "0.5.13", @@ -36858,11 +36937,6 @@ "minipass": "^3.1.1" } }, - "stable": { - "version": "0.1.8", - "resolved": "https://registry.npmjs.org/stable/-/stable-0.1.8.tgz", - "integrity": "sha512-ji9qxRnOVfcuLDySj9qzhGSEFVobyt1kIOSkj1qZzYLzq7Tos/oUUWvotUPQLlrsidqsK6tBH89Bc9kL5zHA6w==" - }, "stack-utils": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/stack-utils/-/stack-utils-2.0.5.tgz", @@ -37049,23 +37123,62 @@ "integrity": "sha512-e4hG1hRwoOdRb37cIMSgzNsxyzKfayW6VOflrwvR+/bzrkyxY/31WkbgnQpgtrNp1SdpJvpUAGTa/ZoiPNDuRQ==" }, "svgo": { - "version": "2.8.0", - "resolved": "https://registry.npmjs.org/svgo/-/svgo-2.8.0.tgz", - "integrity": "sha512-+N/Q9kV1+F+UeWYoSiULYo4xYSDQlTgb+ayMobAXPwMnLvop7oxKMo9OzIrX5x3eS4L4f2UHhc9axXwY8DpChg==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/svgo/-/svgo-3.0.1.tgz", + "integrity": "sha512-6kiDrstRCmA600TySGBu4VNA/FdEriOv7PKQRDOyIaVYUNamWvDSZjgMsM+mB0r0y5T7S3P5DkZJSIBQ/9QEsg==", "requires": { "@trysound/sax": "0.2.0", "commander": "^7.2.0", - "css-select": "^4.1.3", - "css-tree": "^1.1.3", - "csso": "^4.2.0", - "picocolors": "^1.0.0", - "stable": "^0.1.8" + "css-select": "^5.1.0", + "css-tree": "^2.2.1", + "csso": "^5.0.5", + "picocolors": "^1.0.0" }, "dependencies": { "commander": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/commander/-/commander-7.2.0.tgz", "integrity": "sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==" + }, + "css-select": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/css-select/-/css-select-5.1.0.tgz", + "integrity": "sha512-nwoRF1rvRRnnCqqY7updORDsuqKzqYJ28+oSMaJMMgOauh3fvwHqMS7EZpIPqK8GL+g9mKxF1vP/ZjSeNjEVHg==", + "requires": { + "boolbase": "^1.0.0", + "css-what": "^6.1.0", + "domhandler": "^5.0.2", + "domutils": "^3.0.1", + "nth-check": "^2.0.1" + } + }, + "dom-serializer": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-2.0.0.tgz", + "integrity": "sha512-wIkAryiqt/nV5EQKqQpo3SToSOV9J0DnbJqwK7Wv/Trc92zIAYZ4FlMu+JPFW1DfGFt81ZTCGgDEabffXeLyJg==", + "requires": { + "domelementtype": "^2.3.0", + "domhandler": "^5.0.2", + "entities": "^4.2.0" + } + }, + "domhandler": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-5.0.3.tgz", + "integrity": "sha512-cgwlv/1iFQiFnU96XXgROh8xTeetsnJiDsTc7TYCLFd9+/WNkIqPTxiM/8pSd8VIrhXGTf1Ny1q1hquVqDJB5w==", + "requires": { + "domelementtype": "^2.3.0" + } + }, + "domutils": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/domutils/-/domutils-3.0.1.tgz", + "integrity": "sha512-z08c1l761iKhDFtfXO04C7kTdPBLi41zwOZl00WS8b5eiaebNpY00HKbztwBq+e3vyqWNwWF3mP9YLUeqIrF+Q==", + "requires": { + "dom-serializer": "^2.0.0", + "domelementtype": "^2.3.0", + "domhandler": "^5.0.1" + } } } }, diff --git a/packages/cli/src/__snapshots__/index.test.ts.snap b/packages/cli/src/__snapshots__/index.test.ts.snap index 975ce9a9..35230438 100644 --- a/packages/cli/src/__snapshots__/index.test.ts.snap +++ b/packages/cli/src/__snapshots__/index.test.ts.snap @@ -9,8 +9,8 @@ export { default as File } from './File' exports[`cli should not override config with cli defaults 1`] = ` "import * as React from 'react' const SvgFile = () => ( - - + + ) export default SvgFile @@ -32,8 +32,8 @@ exports[`cli should support --no-index 1`] = ` exports[`cli should support --prettier-config as file 1`] = ` "import * as React from 'react' const SvgFile = (props) => ( - - + + ) export default SvgFile @@ -44,8 +44,8 @@ export default SvgFile exports[`cli should support --prettier-config as json 1`] = ` "import * as React from 'react' const SvgFile = (props) => ( - - + + ) export default SvgFile @@ -56,9 +56,9 @@ export default SvgFile exports[`cli should support --svgo-config as file 1`] = ` "import * as React from 'react' const SvgFile = (props) => ( - + {'Rectangle 5'} - + ) export default SvgFile @@ -69,9 +69,9 @@ export default SvgFile exports[`cli should support --svgo-config as json 1`] = ` "import * as React from 'react' const SvgFile = (props) => ( - + {'Rectangle 5'} - + ) export default SvgFile @@ -134,8 +134,8 @@ exports[`cli should support different filename cases with directory output: --fi exports[`cli should support stdin filepath 1`] = ` "import * as React from 'react' const SvgFile = (props) => ( - - + + ) export default SvgFile @@ -147,14 +147,14 @@ exports[`cli should support various args: --desc-prop 1`] = ` "import * as React from 'react' const SvgFile = ({ desc, descId, ...props }) => ( {desc ? {desc} : null} - + ) export default SvgFile @@ -165,8 +165,8 @@ export default SvgFile exports[`cli should support various args: --expand-props none 1`] = ` "import * as React from 'react' const SvgFile = () => ( - - + + ) export default SvgFile @@ -177,8 +177,8 @@ export default SvgFile exports[`cli should support various args: --expand-props start 1`] = ` "import * as React from 'react' const SvgFile = (props) => ( - - + + ) export default SvgFile @@ -190,13 +190,13 @@ exports[`cli should support various args: --icon 1`] = ` "import * as React from 'react' const SvgFile = (props) => ( - + ) export default SvgFile @@ -208,13 +208,13 @@ exports[`cli should support various args: --icon 2em 1`] = ` "import * as React from 'react' const SvgFile = (props) => ( - + ) export default SvgFile @@ -226,13 +226,13 @@ exports[`cli should support various args: --icon 24 1`] = ` "import * as React from 'react' const SvgFile = (props) => ( - + ) export default SvgFile @@ -242,8 +242,8 @@ export default SvgFile exports[`cli should support various args: --jsx-runtime automatic 1`] = ` "const SvgFile = (props) => ( - - + + ) export default SvgFile @@ -254,8 +254,8 @@ export default SvgFile exports[`cli should support various args: --jsx-runtime classic-preact 1`] = ` "import { h } from 'preact' const SvgFile = (props) => ( - - + + ) export default SvgFile @@ -267,8 +267,8 @@ exports[`cli should support various args: --native --expand-props none 1`] = ` "import * as React from 'react' import Svg, { Path } from 'react-native-svg' const SvgFile = () => ( - - + + ) export default SvgFile @@ -281,13 +281,13 @@ exports[`cli should support various args: --native --icon 1`] = ` import Svg, { Path } from 'react-native-svg' const SvgFile = (props) => ( - + ) export default SvgFile @@ -301,13 +301,13 @@ import Svg, { Path } from 'react-native-svg' import { forwardRef } from 'react' const SvgFile = (props, ref) => ( - + ) const ForwardRef = forwardRef(SvgFile) @@ -320,8 +320,8 @@ exports[`cli should support various args: --native 1`] = ` "import * as React from 'react' import Svg, { Path } from 'react-native-svg' const SvgFile = (props) => ( - - + + ) export default SvgFile @@ -332,8 +332,8 @@ export default SvgFile exports[`cli should support various args: --no-dimensions 1`] = ` "import * as React from 'react' const SvgFile = (props) => ( - - + + ) export default SvgFile @@ -343,7 +343,7 @@ export default SvgFile exports[`cli should support various args: --no-prettier 1`] = ` "import * as React from "react"; -const SvgFile = props => ; +const SvgFile = props => ; export default SvgFile; " `; @@ -391,13 +391,13 @@ exports[`cli should support various args: --ref 1`] = ` import { forwardRef } from 'react' const SvgFile = (props, ref) => ( - + ) const ForwardRef = forwardRef(SvgFile) @@ -409,8 +409,8 @@ export default ForwardRef exports[`cli should support various args: --replace-attr-values "#063855=currentColor" 1`] = ` "import * as React from 'react' const SvgFile = (props) => ( - - + + ) export default SvgFile @@ -422,14 +422,14 @@ exports[`cli should support various args: --svg-props "hidden={true},id=hello" 1 "import * as React from 'react' const SvgFile = (props) => ( ) export default SvgFile @@ -441,14 +441,14 @@ exports[`cli should support various args: --title-prop 1`] = ` "import * as React from 'react' const SvgFile = ({ title, titleId, ...props }) => ( {title ? {title} : null} - + ) export default SvgFile @@ -468,15 +468,15 @@ const SvgFile = ( ref: Ref, ) => ( {desc ? {desc} : null} - + ) const ForwardRef = forwardRef(SvgFile) @@ -497,15 +497,15 @@ const SvgFile = ( ref: Ref, ) => ( {title ? {title} : null} - + ) const ForwardRef = forwardRef(SvgFile) @@ -519,13 +519,13 @@ exports[`cli should support various args: --typescript --ref 1`] = ` import { SVGProps, Ref, forwardRef } from 'react' const SvgFile = (props: SVGProps, ref: Ref) => ( - + ) const ForwardRef = forwardRef(SvgFile) @@ -538,8 +538,8 @@ exports[`cli should support various args: --typescript 1`] = ` "import * as React from 'react' import { SVGProps } from 'react' const SvgFile = (props: SVGProps) => ( - - + + ) export default SvgFile @@ -590,8 +590,8 @@ __fixtures__/withsvgrrc/file.svg -> __fixtures_build__/whole/withsvgrrc/file.tsx exports[`cli should work with a simple file 1`] = ` "import * as React from 'react' const SvgFile = (props) => ( - - + + ) export default SvgFile @@ -602,8 +602,8 @@ export default SvgFile exports[`cli should work with stdin 1`] = ` "import * as React from 'react' const SvgComponent = (props) => ( - - + + ) export default SvgComponent diff --git a/packages/cli/src/__snapshots__/util.test.ts.snap b/packages/cli/src/__snapshots__/util.test.ts.snap index b646cd7b..7e2194ca 100644 --- a/packages/cli/src/__snapshots__/util.test.ts.snap +++ b/packages/cli/src/__snapshots__/util.test.ts.snap @@ -3,8 +3,8 @@ exports[`util #convertFile should convert a file 1`] = ` "import * as React from 'react' const SvgFile = (props) => ( - - + + ) export default SvgFile @@ -15,13 +15,13 @@ exports[`util #convertFile should support a custom config path 1`] = ` "import * as React from 'react' const SvgFile = (props) => ( - + ) export default SvgFile diff --git a/packages/core/src/__snapshots__/transform.test.ts.snap b/packages/core/src/__snapshots__/transform.test.ts.snap index 6a62cb15..0afe6800 100644 --- a/packages/core/src/__snapshots__/transform.test.ts.snap +++ b/packages/core/src/__snapshots__/transform.test.ts.snap @@ -4,19 +4,19 @@ exports[`convert config accepts options {"descProp":true} 1`] = ` "import * as React from 'react' const SvgComponent = ({ desc, descId, ...props }) => ( {desc ? {desc} : null} @@ -29,13 +29,13 @@ export default SvgComponent exports[`convert config accepts options {"dimensions":false} 1`] = ` "import * as React from 'react' const SvgComponent = (props) => ( - + @@ -48,13 +48,13 @@ export default SvgComponent exports[`convert config accepts options {"expandProps":"start"} 1`] = ` "import * as React from 'react' const SvgComponent = (props) => ( - + @@ -67,13 +67,13 @@ export default SvgComponent exports[`convert config accepts options {"expandProps":false} 1`] = ` "import * as React from 'react' const SvgComponent = () => ( - + @@ -86,13 +86,13 @@ export default SvgComponent exports[`convert config accepts options {"exportType":"named"} 1`] = ` "import * as React from 'react' const SvgComponent = (props) => ( - + @@ -106,18 +106,18 @@ exports[`convert config accepts options {"icon":"2em"} 1`] = ` "import * as React from 'react' const SvgComponent = (props) => ( @@ -131,18 +131,18 @@ exports[`convert config accepts options {"icon":24} 1`] = ` "import * as React from 'react' const SvgComponent = (props) => ( @@ -156,18 +156,18 @@ exports[`convert config accepts options {"icon":true} 1`] = ` "import * as React from 'react' const SvgComponent = (props) => ( @@ -181,13 +181,13 @@ exports[`convert config accepts options {"memo":true} 1`] = ` "import * as React from 'react' import { memo } from 'react' const SvgComponent = (props) => ( - + @@ -201,13 +201,13 @@ export default Memo exports[`convert config accepts options {"namedExport":"Component","state":{"caller":{"previousExport":"export default \\"logo.svg\\";"}}} 1`] = ` "import * as React from 'react' const SvgComponent = (props) => ( - + @@ -222,13 +222,13 @@ exports[`convert config accepts options {"native":true,"expandProps":false} 1`] "import * as React from 'react' import Svg, { G, Path } from 'react-native-svg' const SvgComponent = () => ( - + @@ -243,18 +243,18 @@ exports[`convert config accepts options {"native":true,"icon":true} 1`] = ` import Svg, { G, Path } from 'react-native-svg' const SvgComponent = (props) => ( @@ -270,18 +270,18 @@ import Svg, { G, Path } from 'react-native-svg' import { forwardRef } from 'react' const SvgComponent = (props, ref) => ( @@ -296,13 +296,13 @@ exports[`convert config accepts options {"native":true} 1`] = ` "import * as React from 'react' import Svg, { G, Path } from 'react-native-svg' const SvgComponent = (props) => ( - + @@ -314,7 +314,7 @@ export default SvgComponent exports[`convert config accepts options {"prettier":false} 1`] = ` "import * as React from "react"; -const SvgComponent = props => ; +const SvgComponent = props => ; export default SvgComponent;" `; @@ -323,18 +323,18 @@ exports[`convert config accepts options {"ref":true} 1`] = ` import { forwardRef } from 'react' const SvgComponent = (props, ref) => ( @@ -348,13 +348,13 @@ export default ForwardRef exports[`convert config accepts options {"replaceAttrValues":{"none":"{black}"}} 1`] = ` "import * as React from 'react' const SvgComponent = (props) => ( - + @@ -367,13 +367,13 @@ export default SvgComponent exports[`convert config accepts options {"replaceAttrValues":{"none":"black"}} 1`] = ` "import * as React from 'react' const SvgComponent = (props) => ( - + @@ -387,19 +387,19 @@ exports[`convert config accepts options {"svgProps":{"a":"b","b":"{props.b}"}} 1 "import * as React from 'react' const SvgComponent = (props) => ( @@ -446,19 +446,19 @@ exports[`convert config accepts options {"titleProp":true} 1`] = ` "import * as React from 'react' const SvgComponent = ({ title, titleId, ...props }) => ( {title ? {title} : null} @@ -487,7 +487,7 @@ const SvgComponent = ({ desc, descId, ...props }) => ( {...props} > {desc ? {desc} : null} - + ) export default SvgComponent @@ -507,7 +507,7 @@ const SvgComponent = ({ title, titleId, ...props }) => ( {...props} > {title ? {title} : null} - + ) export default SvgComponent @@ -517,13 +517,13 @@ export default SvgComponent exports[`convert should convert 1`] = ` "import * as React from 'react' const SvgComponent = (props) => ( - + @@ -546,6 +546,12 @@ const SvgComponent = (props) => ( ( overflow: 'visible', enableBackground: 'accumulate', }} - width={4} + /> + - ( - + ) export default SvgComponent @@ -614,18 +614,18 @@ export default SvgComponent exports[`convert should not remove all style tags 1`] = ` "import * as React from 'react' const SvgComponent = (props) => ( - + - + @@ -640,12 +640,12 @@ exports[`convert should remove null characters 1`] = ` const SvgComponent = (props) => ( ( - + ( }} > - + diff --git a/packages/plugin-svgo/package.json b/packages/plugin-svgo/package.json index ab27e9dc..bc066293 100644 --- a/packages/plugin-svgo/package.json +++ b/packages/plugin-svgo/package.json @@ -39,6 +39,6 @@ "dependencies": { "cosmiconfig": "^7.0.1", "deepmerge": "^4.2.2", - "svgo": "^2.8.0" + "svgo": "^3.0.1" } } diff --git a/packages/plugin-svgo/src/__snapshots__/index.test.ts.snap b/packages/plugin-svgo/src/__snapshots__/index.test.ts.snap index ca9a0465..b54cef17 100644 --- a/packages/plugin-svgo/src/__snapshots__/index.test.ts.snap +++ b/packages/plugin-svgo/src/__snapshots__/index.test.ts.snap @@ -1,15 +1,15 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`svgo does not load runtime configuration with \`runtimeConfig: false\` 1`] = `""`; +exports[`svgo does not load runtime configuration with \`runtimeConfig: false\` 1`] = `""`; -exports[`svgo does not remove viewBox with \`icon\` option 1`] = `""`; +exports[`svgo does not remove viewBox with \`icon\` option 1`] = `""`; -exports[`svgo does not remove viewBox with when \`dimensions\` is false 1`] = `""`; +exports[`svgo does not remove viewBox with when \`dimensions\` is false 1`] = `""`; -exports[`svgo does remove style when \`native\` is true 1`] = `""`; +exports[`svgo does remove style when \`native\` is true 1`] = `""`; -exports[`svgo optimizes svg 1`] = `""`; +exports[`svgo optimizes svg 1`] = `""`; -exports[`svgo supports \`config.svgoConfig\` 1`] = `"Created with Sketch."`; +exports[`svgo supports \`config.svgoConfig\` 1`] = `"Created with Sketch."`; -exports[`svgo uses \`state.filePath\` to detect configuration 1`] = `""`; +exports[`svgo uses \`state.filePath\` to detect configuration 1`] = `""`; diff --git a/packages/rollup/src/__snapshots__/index.test.ts.snap b/packages/rollup/src/__snapshots__/index.test.ts.snap index 2920b32b..ae74412e 100644 --- a/packages/rollup/src/__snapshots__/index.test.ts.snap +++ b/packages/rollup/src/__snapshots__/index.test.ts.snap @@ -6,13 +6,13 @@ function _extends() { _extends = Object.assign ? Object.assign.bind() : function import * as React from "react"; var SvgFile = function SvgFile(props) { return /*#__PURE__*/React.createElement("svg", _extends({ + xmlns: "http://www.w3.org/2000/svg", width: 48, - height: 1, - xmlns: "http://www.w3.org/2000/svg" + height: 1 }, props), _path || (_path = /*#__PURE__*/React.createElement("path", { - d: "M0 0h48v1H0z", fill: "#063855", - fillRule: "evenodd" + fillRule: "evenodd", + d: "M0 0h48v1H0z" }))); }; export default SvgFile;" @@ -20,7 +20,7 @@ export default SvgFile;" exports[`rollup loader should convert file with previousExport of image plugin 1`] = ` "import * as React from "react"; -const SvgFile = props => ; +const SvgFile = props => ; export { SvgFile as ReactComponent }; var img = new Image(); img.src = 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iNDhweCIgaGVpZ2h0PSIxcHgiIHZpZXdCb3g9IjAgMCA0OCAxIiB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiPgogICAgPCEtLSBHZW5lcmF0b3I6IFNrZXRjaCA0Ni4yICg0NDQ5NikgLSBodHRwOi8vd3d3LmJvaGVtaWFuY29kaW5nLmNvbS9za2V0Y2ggLS0+CiAgICA8dGl0bGU+UmVjdGFuZ2xlIDU8L3RpdGxlPgogICAgPGRlc2M+Q3JlYXRlZCB3aXRoIFNrZXRjaC48L2Rlc2M+CiAgICA8ZGVmcz48L2RlZnM+CiAgICA8ZyBpZD0iUGFnZS0xIiBzdHJva2U9Im5vbmUiIHN0cm9rZS13aWR0aD0iMSIgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj4KICAgICAgICA8ZyBpZD0iMTktU2VwYXJhdG9yIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtMTI5LjAwMDAwMCwgLTE1Ni4wMDAwMDApIiBmaWxsPSIjMDYzODU1Ij4KICAgICAgICAgICAgPGcgaWQ9IkNvbnRyb2xzL1NldHRpbmdzIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSg4MC4wMDAwMDAsIDAuMDAwMDAwKSI+CiAgICAgICAgICAgICAgICA8ZyBpZD0iQ29udGVudCIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMC4wMDAwMDAsIDY0LjAwMDAwMCkiPgogICAgICAgICAgICAgICAgICAgIDxnIGlkPSJHcm91cCIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMjQuMDAwMDAwLCA1Ni4wMDAwMDApIj4KICAgICAgICAgICAgICAgICAgICAgICAgPGcgaWQ9Ikdyb3VwLTIiPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgPHJlY3QgaWQ9IlJlY3RhbmdsZS01IiB4PSIyNSIgeT0iMzYiIHdpZHRoPSI0OCIgaGVpZ2h0PSIxIj48L3JlY3Q+CiAgICAgICAgICAgICAgICAgICAgICAgIDwvZz4KICAgICAgICAgICAgICAgICAgICA8L2c+CiAgICAgICAgICAgICAgICA8L2c+CiAgICAgICAgICAgIDwvZz4KICAgICAgICA8L2c+CiAgICA8L2c+Cjwvc3ZnPgo='; @@ -29,13 +29,13 @@ export default img;" exports[`rollup loader should convert file with previousExport of url plugin 1`] = ` "import * as React from "react"; -const SvgFile = props => ; +const SvgFile = props => ; export { SvgFile as ReactComponent }; export default "data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2248px%22%20height%3D%221px%22%20viewBox%3D%220%200%2048%201%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%20%20%20%20%3Ctitle%3ERectangle%205%3C%2Ftitle%3E%20%20%20%20%3Cdesc%3ECreated%20with%20Sketch.%3C%2Fdesc%3E%20%20%20%20%3Cdefs%3E%3C%2Fdefs%3E%20%20%20%20%3Cg%20id%3D%22Page-1%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%2219-Separator%22%20transform%3D%22translate%28-129.000000%2C%20-156.000000%29%22%20fill%3D%22%23063855%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Controls%2FSettings%22%20transform%3D%22translate%2880.000000%2C%200.000000%29%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Content%22%20transform%3D%22translate%280.000000%2C%2064.000000%29%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Group%22%20transform%3D%22translate%2824.000000%2C%2056.000000%29%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Group-2%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Crect%20id%3D%22Rectangle-5%22%20x%3D%2225%22%20y%3D%2236%22%20width%3D%2248%22%20height%3D%221%22%3E%3C%2Frect%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E";" `; exports[`rollup loader should convert file without babel 1`] = ` "import * as React from "react"; -const SvgFile = props => ; +const SvgFile = props => ; export default SvgFile;" `; diff --git a/packages/webpack/src/__snapshots__/index.test.ts.snap b/packages/webpack/src/__snapshots__/index.test.ts.snap index 4fb64f76..b4c35c28 100644 --- a/packages/webpack/src/__snapshots__/index.test.ts.snap +++ b/packages/webpack/src/__snapshots__/index.test.ts.snap @@ -5,15 +5,15 @@ exports[`webpack loader supports url-loader 1`] = ` import * as React from "react"; var SvgIcon = function SvgIcon() { return _svg || (_svg = /*#__PURE__*/React.createElement("svg", { + xmlns: "http://www.w3.org/2000/svg", width: 88, - height: 88, - xmlns: "http://www.w3.org/2000/svg" + height: 88 }, /*#__PURE__*/React.createElement("g", { - stroke: "#063855", - strokeWidth: 2, fill: "none", fillRule: "evenodd", - strokeLinecap: "square" + stroke: "#063855", + strokeLinecap: "square", + strokeWidth: 2 }, /*#__PURE__*/React.createElement("path", { d: "M51 37 37 51M51 51 37 37" })))); @@ -25,15 +25,15 @@ export default "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz exports[`webpack loader transforms file (babel: false) 1`] = ` "import * as React from "react"; const SvgIcon = () => /*#__PURE__*/React.createElement("svg", { + xmlns: "http://www.w3.org/2000/svg", width: 88, - height: 88, - xmlns: "http://www.w3.org/2000/svg" + height: 88 }, /*#__PURE__*/React.createElement("g", { - stroke: "#063855", - strokeWidth: 2, fill: "none", fillRule: "evenodd", - strokeLinecap: "square" + stroke: "#063855", + strokeLinecap: "square", + strokeWidth: 2 }, /*#__PURE__*/React.createElement("path", { d: "M51 37 37 51M51 51 37 37" }))); @@ -46,15 +46,15 @@ function _extends() { _extends = Object.assign ? Object.assign.bind() : function import * as React from "react"; var SvgIcon = function SvgIcon(props) { return /*#__PURE__*/React.createElement("svg", _extends({ + xmlns: "http://www.w3.org/2000/svg", width: 88, - height: 88, - xmlns: "http://www.w3.org/2000/svg" + height: 88 }, props), _g || (_g = /*#__PURE__*/React.createElement("g", { - stroke: "#063855", - strokeWidth: 2, fill: "none", fillRule: "evenodd", - strokeLinecap: "square" + stroke: "#063855", + strokeLinecap: "square", + strokeWidth: 2 }, /*#__PURE__*/React.createElement("path", { d: "M51 37 37 51M51 51 37 37" })))); @@ -67,15 +67,15 @@ exports[`webpack loader transforms file 1`] = ` import * as React from "react"; var SvgIcon = function SvgIcon() { return _svg || (_svg = /*#__PURE__*/React.createElement("svg", { + xmlns: "http://www.w3.org/2000/svg", width: 88, - height: 88, - xmlns: "http://www.w3.org/2000/svg" + height: 88 }, /*#__PURE__*/React.createElement("g", { - stroke: "#063855", - strokeWidth: 2, fill: "none", fillRule: "evenodd", - strokeLinecap: "square" + stroke: "#063855", + strokeLinecap: "square", + strokeWidth: 2 }, /*#__PURE__*/React.createElement("path", { d: "M51 37 37 51M51 51 37 37" })))); @@ -88,15 +88,15 @@ exports[`webpack loader transforms file 2`] = ` import * as React from "react"; var SvgIcon = function SvgIcon() { return _svg || (_svg = /*#__PURE__*/React.createElement("svg", { + xmlns: "http://www.w3.org/2000/svg", width: 88, - height: 88, - xmlns: "http://www.w3.org/2000/svg" + height: 88 }, /*#__PURE__*/React.createElement("g", { - stroke: "#063855", - strokeWidth: 2, fill: "none", fillRule: "evenodd", - strokeLinecap: "square" + stroke: "#063855", + strokeLinecap: "square", + strokeWidth: 2 }, /*#__PURE__*/React.createElement("path", { d: "M51 37 37 51M51 51 37 37" })))); From 95cd93fb5a900f5ed167a4fc9f4dc6a2df90adb2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Andr=C3=A9s=20Puglia?= Date: Wed, 23 Nov 2022 09:09:28 -0300 Subject: [PATCH 2/4] Fixes typescript issue --- packages/core/src/config.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/core/src/config.ts b/packages/core/src/config.ts index 9468ca8b..3e86ecf0 100644 --- a/packages/core/src/config.ts +++ b/packages/core/src/config.ts @@ -1,6 +1,6 @@ import { cosmiconfig, cosmiconfigSync } from 'cosmiconfig' import type { Options as PrettierOptions } from 'prettier' -import type { OptimizeOptions as SvgoOptions } from 'svgo' +import type { Config as SvgoConfig } from 'svgo' import type { Options as TransformOptions } from '@svgr/babel-preset' import type { TransformOptions as BabelTransformOptions } from '@babel/core' import type { ConfigPlugin } from './plugins' @@ -25,7 +25,7 @@ export interface Config { prettier?: boolean prettierConfig?: PrettierOptions svgo?: boolean - svgoConfig?: SvgoOptions + svgoConfig?: SvgoConfig configFile?: string template?: TransformOptions['template'] memo?: boolean From c4a6ba09f5bfc6694a65da4f02677b3a5f945393 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Andr=C3=A9s=20Puglia?= Date: Wed, 23 Nov 2022 09:09:51 -0300 Subject: [PATCH 3/4] Bumps svgo to v3.0.2 --- package-lock.json | 37 ++++++++++++++++--------------- packages/core/package.json | 2 +- packages/plugin-svgo/package.json | 2 +- 3 files changed, 21 insertions(+), 20 deletions(-) diff --git a/package-lock.json b/package-lock.json index 816759b0..919da6d7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5774,12 +5774,13 @@ "dev": true }, "node_modules/@types/svgo": { - "version": "2.6.4", - "resolved": "https://registry.npmjs.org/@types/svgo/-/svgo-2.6.4.tgz", - "integrity": "sha512-l4cmyPEckf8moNYHdJ+4wkHvFxjyW6ulm9l4YGaOxeyBWPhBOT0gvni1InpFPdzx1dKf/2s62qGITwxNWnPQng==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@types/svgo/-/svgo-3.0.0.tgz", + "integrity": "sha512-G5qLWNq/rMvSM1EyY4E2iEd+s9km/PxLkzPkA2lghrgWJ2jrVMuB1ZsGOzL4YAWCy5sAoUw7SEQseHE2qypF2w==", + "deprecated": "This is a stub types definition. svgo provides its own type definitions, so you do not need this installed.", "dev": true, "dependencies": { - "@types/node": "*" + "svgo": "*" } }, "node_modules/@types/ws": { @@ -19905,9 +19906,9 @@ "integrity": "sha512-e4hG1hRwoOdRb37cIMSgzNsxyzKfayW6VOflrwvR+/bzrkyxY/31WkbgnQpgtrNp1SdpJvpUAGTa/ZoiPNDuRQ==" }, "node_modules/svgo": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/svgo/-/svgo-3.0.1.tgz", - "integrity": "sha512-6kiDrstRCmA600TySGBu4VNA/FdEriOv7PKQRDOyIaVYUNamWvDSZjgMsM+mB0r0y5T7S3P5DkZJSIBQ/9QEsg==", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/svgo/-/svgo-3.0.2.tgz", + "integrity": "sha512-Z706C1U2pb1+JGP48fbazf3KxHrWOsLme6Rv7imFBn5EnuanDW1GPaA/P1/dvObE670JDePC3mnj0k0B7P0jjQ==", "dependencies": { "@trysound/sax": "0.2.0", "commander": "^7.2.0", @@ -21811,7 +21812,7 @@ "cosmiconfig": "^7.0.1" }, "devDependencies": { - "@types/svgo": "^2.6.4" + "@types/svgo": "^3.0.0" }, "engines": { "node": ">=10" @@ -21887,7 +21888,7 @@ "dependencies": { "cosmiconfig": "^7.0.1", "deepmerge": "^4.2.2", - "svgo": "^3.0.1" + "svgo": "^3.0.2" }, "engines": { "node": ">=10" @@ -26039,7 +26040,7 @@ "@babel/core": "^7.19.6", "@svgr/babel-preset": "^6.5.1", "@svgr/plugin-jsx": "^6.5.1", - "@types/svgo": "^2.6.4", + "@types/svgo": "^3.0.0", "camelcase": "^6.2.0", "cosmiconfig": "^7.0.1" } @@ -26079,7 +26080,7 @@ "requires": { "cosmiconfig": "^7.0.1", "deepmerge": "^4.2.2", - "svgo": "3.0.1" + "svgo": "^3.0.2" } }, "@svgr/rollup": { @@ -26462,12 +26463,12 @@ "dev": true }, "@types/svgo": { - "version": "2.6.4", - "resolved": "https://registry.npmjs.org/@types/svgo/-/svgo-2.6.4.tgz", - "integrity": "sha512-l4cmyPEckf8moNYHdJ+4wkHvFxjyW6ulm9l4YGaOxeyBWPhBOT0gvni1InpFPdzx1dKf/2s62qGITwxNWnPQng==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@types/svgo/-/svgo-3.0.0.tgz", + "integrity": "sha512-G5qLWNq/rMvSM1EyY4E2iEd+s9km/PxLkzPkA2lghrgWJ2jrVMuB1ZsGOzL4YAWCy5sAoUw7SEQseHE2qypF2w==", "dev": true, "requires": { - "@types/node": "*" + "svgo": "*" } }, "@types/ws": { @@ -37123,9 +37124,9 @@ "integrity": "sha512-e4hG1hRwoOdRb37cIMSgzNsxyzKfayW6VOflrwvR+/bzrkyxY/31WkbgnQpgtrNp1SdpJvpUAGTa/ZoiPNDuRQ==" }, "svgo": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/svgo/-/svgo-3.0.1.tgz", - "integrity": "sha512-6kiDrstRCmA600TySGBu4VNA/FdEriOv7PKQRDOyIaVYUNamWvDSZjgMsM+mB0r0y5T7S3P5DkZJSIBQ/9QEsg==", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/svgo/-/svgo-3.0.2.tgz", + "integrity": "sha512-Z706C1U2pb1+JGP48fbazf3KxHrWOsLme6Rv7imFBn5EnuanDW1GPaA/P1/dvObE670JDePC3mnj0k0B7P0jjQ==", "requires": { "@trysound/sax": "0.2.0", "commander": "^7.2.0", diff --git a/packages/core/package.json b/packages/core/package.json index 0b989bf6..76c482c2 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -45,6 +45,6 @@ "cosmiconfig": "^7.0.1" }, "devDependencies": { - "@types/svgo": "^2.6.4" + "@types/svgo": "^3.0.0" } } diff --git a/packages/plugin-svgo/package.json b/packages/plugin-svgo/package.json index bc066293..342f3999 100644 --- a/packages/plugin-svgo/package.json +++ b/packages/plugin-svgo/package.json @@ -39,6 +39,6 @@ "dependencies": { "cosmiconfig": "^7.0.1", "deepmerge": "^4.2.2", - "svgo": "^3.0.1" + "svgo": "^3.0.2" } } From cea7a691c8d7418cbe7735a6c9eb8d545bdccdde Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Andr=C3=A9s=20Puglia?= Date: Mon, 6 Mar 2023 18:48:42 -0300 Subject: [PATCH 4/4] Remove deprecated @types/svgo --- package-lock.json | 84 ++++++++++++++------------------------ packages/core/package.json | 3 -- 2 files changed, 31 insertions(+), 56 deletions(-) diff --git a/package-lock.json b/package-lock.json index 919da6d7..7c03cf7a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4,6 +4,7 @@ "requires": true, "packages": { "": { + "name": "svgr", "workspaces": [ "packages/*", "examples/*" @@ -5773,16 +5774,6 @@ "integrity": "sha512-PKEmDmVWO8f4wwSZDHKHtdnYRM5NI4dCB0lawtUYpxfGhhuQ0qUky80qk6CR8SZhFrRcJmNnWOpN+8uh/X9qgg==", "dev": true }, - "node_modules/@types/svgo": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@types/svgo/-/svgo-3.0.0.tgz", - "integrity": "sha512-G5qLWNq/rMvSM1EyY4E2iEd+s9km/PxLkzPkA2lghrgWJ2jrVMuB1ZsGOzL4YAWCy5sAoUw7SEQseHE2qypF2w==", - "deprecated": "This is a stub types definition. svgo provides its own type definitions, so you do not need this installed.", - "dev": true, - "dependencies": { - "svgo": "*" - } - }, "node_modules/@types/ws": { "version": "8.5.3", "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.5.3.tgz", @@ -9038,9 +9029,9 @@ } }, "node_modules/decode-uri-component": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz", - "integrity": "sha512-hjf+xovcEn31w/EUYdTXQh/8smFL/dzYjohQGEIgjyNavaJfBY2p5F527Bo1VPATxv0VYTUC2bOcXvqFwk78Og==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.2.tgz", + "integrity": "sha512-FqUYQ+8o158GyGTrMFJms9qh3CqTKvAqgqsTnkLI8sKu0028orqBhxNMFkFen0zGyg6epACD32pjVk58ngIErQ==", "dev": true, "engines": { "node": ">=0.10" @@ -14900,9 +14891,9 @@ "dev": true }, "node_modules/json5": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.1.tgz", - "integrity": "sha512-1hqLFMSrGHRHxav9q9gNjJ5EXznIxGVO09xQRrwplcS8qs28pZ8s8hupZAmqDwZUmVZ2Qb2jnyPOWcDH8m8dlA==", + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", + "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", "bin": { "json5": "lib/cli.js" }, @@ -15257,9 +15248,9 @@ } }, "node_modules/loader-utils": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.3.tgz", - "integrity": "sha512-THWqIsn8QRnvLl0shHYVBN9syumU8pYWEHPTmkiVGd+7K5eFNVSY6AJhRvgGF70gg1Dz+l/k8WicvFCxdEs60A==", + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.4.tgz", + "integrity": "sha512-xXqpXoINfFhgua9xiqD8fPFHgkoq1mmmpE92WlDbm9rNRd/EbRb+Gqf908T2DMfuHjjJlksiK2RbHVOdD/MqSw==", "dev": true, "dependencies": { "big.js": "^5.2.2", @@ -15523,9 +15514,9 @@ } }, "node_modules/make-fetch-happen/node_modules/http-cache-semantics": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.0.tgz", - "integrity": "sha512-carPklcUh7ROWRK7Cv27RPtdhYhUsela/ue5/jKzjegVvXDqM2ILE9Q2BGn9JZJh1g87cp56su/FgQSzcWS8cQ==", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.1.tgz", + "integrity": "sha512-er295DKPVsV82j5kw1Gjt+ADA/XYHsajl82cGNQG2eyoPkvgUhX+nDIyelzhIWbbsXP39EHcI6l5tYs2FYqYXQ==", "dev": true }, "node_modules/makeerror": { @@ -20383,9 +20374,9 @@ } }, "node_modules/tsconfig-paths/node_modules/json5": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz", - "integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.2.tgz", + "integrity": "sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==", "dev": true, "dependencies": { "minimist": "^1.2.0" @@ -21811,9 +21802,6 @@ "camelcase": "^6.2.0", "cosmiconfig": "^7.0.1" }, - "devDependencies": { - "@types/svgo": "^3.0.0" - }, "engines": { "node": ">=10" }, @@ -26040,7 +26028,6 @@ "@babel/core": "^7.19.6", "@svgr/babel-preset": "^6.5.1", "@svgr/plugin-jsx": "^6.5.1", - "@types/svgo": "^3.0.0", "camelcase": "^6.2.0", "cosmiconfig": "^7.0.1" } @@ -26462,15 +26449,6 @@ "integrity": "sha512-PKEmDmVWO8f4wwSZDHKHtdnYRM5NI4dCB0lawtUYpxfGhhuQ0qUky80qk6CR8SZhFrRcJmNnWOpN+8uh/X9qgg==", "dev": true }, - "@types/svgo": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@types/svgo/-/svgo-3.0.0.tgz", - "integrity": "sha512-G5qLWNq/rMvSM1EyY4E2iEd+s9km/PxLkzPkA2lghrgWJ2jrVMuB1ZsGOzL4YAWCy5sAoUw7SEQseHE2qypF2w==", - "dev": true, - "requires": { - "svgo": "*" - } - }, "@types/ws": { "version": "8.5.3", "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.5.3.tgz", @@ -28983,9 +28961,9 @@ } }, "decode-uri-component": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz", - "integrity": "sha512-hjf+xovcEn31w/EUYdTXQh/8smFL/dzYjohQGEIgjyNavaJfBY2p5F527Bo1VPATxv0VYTUC2bOcXvqFwk78Og==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.2.tgz", + "integrity": "sha512-FqUYQ+8o158GyGTrMFJms9qh3CqTKvAqgqsTnkLI8sKu0028orqBhxNMFkFen0zGyg6epACD32pjVk58ngIErQ==", "dev": true }, "decompress-response": { @@ -33282,9 +33260,9 @@ "dev": true }, "json5": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.1.tgz", - "integrity": "sha512-1hqLFMSrGHRHxav9q9gNjJ5EXznIxGVO09xQRrwplcS8qs28pZ8s8hupZAmqDwZUmVZ2Qb2jnyPOWcDH8m8dlA==" + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", + "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==" }, "jsonc-parser": { "version": "3.2.0", @@ -33563,9 +33541,9 @@ "dev": true }, "loader-utils": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.3.tgz", - "integrity": "sha512-THWqIsn8QRnvLl0shHYVBN9syumU8pYWEHPTmkiVGd+7K5eFNVSY6AJhRvgGF70gg1Dz+l/k8WicvFCxdEs60A==", + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.4.tgz", + "integrity": "sha512-xXqpXoINfFhgua9xiqD8fPFHgkoq1mmmpE92WlDbm9rNRd/EbRb+Gqf908T2DMfuHjjJlksiK2RbHVOdD/MqSw==", "dev": true, "requires": { "big.js": "^5.2.2", @@ -33774,9 +33752,9 @@ }, "dependencies": { "http-cache-semantics": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.0.tgz", - "integrity": "sha512-carPklcUh7ROWRK7Cv27RPtdhYhUsela/ue5/jKzjegVvXDqM2ILE9Q2BGn9JZJh1g87cp56su/FgQSzcWS8cQ==", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.1.tgz", + "integrity": "sha512-er295DKPVsV82j5kw1Gjt+ADA/XYHsajl82cGNQG2eyoPkvgUhX+nDIyelzhIWbbsXP39EHcI6l5tYs2FYqYXQ==", "dev": true } } @@ -37482,9 +37460,9 @@ }, "dependencies": { "json5": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz", - "integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.2.tgz", + "integrity": "sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==", "dev": true, "requires": { "minimist": "^1.2.0" diff --git a/packages/core/package.json b/packages/core/package.json index 76c482c2..05cec4ca 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -43,8 +43,5 @@ "@svgr/plugin-jsx": "^6.5.1", "camelcase": "^6.2.0", "cosmiconfig": "^7.0.1" - }, - "devDependencies": { - "@types/svgo": "^3.0.0" } }