diff --git a/eslint.config.js b/eslint.config.js index aea1e6a..81a5d45 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -1,5 +1,6 @@ import { default as firefoxicEslintConfig, globals } from "@firefoxic/eslint-config" +/** @type {import('eslint').Linter.Config[]} */ export default [ { languageOptions: { diff --git a/lib/index.js b/lib/index.js index fd310a2..48dd3c9 100644 --- a/lib/index.js +++ b/lib/index.js @@ -6,7 +6,7 @@ import { parse } from "node-html-parser" import PluginError from "plugin-error" import Vinyl from "vinyl" -const excessAttrs = [ +let excessAttrs = [ `enable-background`, `height`, `version`, @@ -16,7 +16,7 @@ const excessAttrs = [ `y`, ] -const xlink = `http://www.w3.org/1999/xlink` +const XLINK = `http://www.w3.org/1999/xlink` /** * Gulp plugin for combining SVG icons into a single file. @@ -25,11 +25,11 @@ const xlink = `http://www.w3.org/1999/xlink` */ export function stacksvg () { let isEmpty = true - const ids = {} - const namespaces = new Map([[`http://www.w3.org/2000/svg`, `xmlns`]]) - const stack = parse(``) - const rootSvg = stack.querySelector(`svg`) - const stream = new Transform({ objectMode: true }) + let ids = {} + let namespaces = new Map([[`http://www.w3.org/2000/svg`, `xmlns`]]) + let stack = parse(``) + let rootSvg = stack.querySelector(`svg`) + let stream = new Transform({ objectMode: true }) /** * Transform function for the plugin. @@ -47,12 +47,12 @@ export function stacksvg () { return cb() } - const iconDom = parse(file.contents.toString()).removeWhitespace() - const iconSvg = iconDom.querySelector(`svg`) + let iconDom = parse(file.contents.toString()).removeWhitespace() + let iconSvg = iconDom.querySelector(`svg`) isEmpty = false - const iconId = basename( + let iconId = basename( file.relative.split(sep).join(`_`).replace(/\s/g, `-`), extname(file.relative), ) @@ -64,9 +64,9 @@ export function stacksvg () { ids[iconId] = true iconSvg.setAttribute(`id`, iconId) - const viewBoxAttr = iconSvg.getAttribute(`viewBox`) - const widthAttr = iconSvg.getAttribute(`width`)?.replace(/[^0-9]/g, ``) - const heightAttr = iconSvg.getAttribute(`height`)?.replace(/[^0-9]/g, ``) + let viewBoxAttr = iconSvg.getAttribute(`viewBox`) + let widthAttr = iconSvg.getAttribute(`width`)?.replace(/[^0-9]/g, ``) + let heightAttr = iconSvg.getAttribute(`height`)?.replace(/[^0-9]/g, ``) if (!viewBoxAttr && widthAttr && heightAttr) { iconSvg.setAttribute(`viewBox`, `0 0 ${widthAttr} ${heightAttr}`) @@ -105,7 +105,7 @@ export function stacksvg () { } } - const attrs = iconSvg._attrs + let attrs = iconSvg._attrs for (let attrName in attrs) { if (attrName.startsWith(`xmlns`)) { @@ -118,7 +118,7 @@ export function stacksvg () { newNsAlias = namespaces.get(nsId).slice(6) changeNsAlias(iconDom, oldNsAlias, newNsAlias) } - } else if (nsId === xlink) { + } else if (nsId === XLINK) { newNsAlias = `` changeNsAlias(iconDom, oldNsAlias, newNsAlias) } else { @@ -165,7 +165,7 @@ export function stacksvg () { rootSvg.setAttribute(nsAttr, nsId) } - const file = new Vinyl({ path: `stack.svg`, contents: Buffer.from(stack.toString()) }) + let file = new Vinyl({ path: `stack.svg`, contents: Buffer.from(stack.toString()) }) this.push(file) diff --git a/package.json b/package.json index 1b24321..cff9b49 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,7 @@ "engines": { "node": "^18.18.2 || ^20.9.0" }, - "packageManager": "pnpm@9.1.0", + "packageManager": "pnpm@9.7.1", "dependencies": { "node-html-parser": "^6.1.13", "plugin-error": "^2.0.1", @@ -35,16 +35,16 @@ "test": "node --test", "pretest": "pnpm lint", "preversion": "pnpm test", - "version": "update-changelog && git add CHANGELOG.md", + "version": "update-changelog", "postversion": "pnpm publish", "postpublish": "git push --follow-tags" }, "devDependencies": { - "@firefoxic/eslint-config": "^1.0.0", - "@firefoxic/update-changelog": "^0.1.0", - "eslint": "^9.2.0", + "@firefoxic/eslint-config": "^3.0.0", + "@firefoxic/update-changelog": "^0.2.0", + "eslint": "^9.9.0", "gulp": "^5.0.0", - "husky": "^9.0.11" + "husky": "^9.1.4" }, "keywords": [ "gulp", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 9852708..dbb78ae 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -19,20 +19,20 @@ importers: version: 3.0.0 devDependencies: '@firefoxic/eslint-config': - specifier: ^1.0.0 - version: 1.0.0(eslint@9.2.0) + specifier: ^3.0.0 + version: 3.0.0(eslint@9.9.0) '@firefoxic/update-changelog': - specifier: ^0.1.0 - version: 0.1.0 + specifier: ^0.2.0 + version: 0.2.0 eslint: - specifier: ^9.2.0 - version: 9.2.0 + specifier: ^9.9.0 + version: 9.9.0 gulp: specifier: ^5.0.0 version: 5.0.0 husky: - specifier: ^9.0.11 - version: 9.0.11 + specifier: ^9.1.4 + version: 9.1.4 packages: @@ -42,26 +42,34 @@ packages: peerDependencies: eslint: ^6.0.0 || ^7.0.0 || >=8.0.0 - '@eslint-community/regexpp@4.10.0': - resolution: {integrity: sha512-Cu96Sd2By9mCNTx2iyKOmq10v22jUVQv0lQnlGNy16oE9589yE+QADPbrMGCkA51cKZSg3Pu/aTJVTGfL/qjUA==} + '@eslint-community/regexpp@4.11.0': + resolution: {integrity: sha512-G/M/tIiMrTAxEWRfLfQJMmGNX28IxBg4PBz8XqQhqUHLFI6TL2htpIB1iQCj144V5ee/JaKyT9/WZ0MGZWfA7A==} engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0} - '@eslint/eslintrc@3.0.2': - resolution: {integrity: sha512-wV19ZEGEMAC1eHgrS7UQPqsdEiCIbTKTasEfcXAigzoXICcqZSjBZEHlZwNVvKg6UBCjSlos84XiLqsRJnIcIg==} + '@eslint/config-array@0.17.1': + resolution: {integrity: sha512-BlYOpej8AQ8Ev9xVqroV7a02JK3SkBAaN9GfMMH9W6Ch8FlQlkjGw4Ir7+FgYwfirivAf4t+GtzuAxqfukmISA==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + + '@eslint/eslintrc@3.1.0': + resolution: {integrity: sha512-4Bfj15dVJdoy3RfZmmo86RK1Fwzn6SstsvK9JS+BaVKqC6QQQQyXekNaC+g+LKNgkQ+2VhGAzm6hO40AhMR3zQ==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@eslint/js@9.2.0': - resolution: {integrity: sha512-ESiIudvhoYni+MdsI8oD7skpprZ89qKocwRM2KEvhhBJ9nl5MRh7BXU5GTod7Mdygq+AUl+QzId6iWJKR/wABA==} + '@eslint/js@9.9.0': + resolution: {integrity: sha512-hhetes6ZHP3BlXLxmd8K2SNgkhNSi+UcecbnwWKwpP7kyi/uC75DJ1lOOBO3xrC4jyojtGE3YxKZPHfk4yrgug==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@firefoxic/eslint-config@1.0.0': - resolution: {integrity: sha512-5Kru1mXkDVYr+oQa/u7bqLEflb82KQvKIDr43z1x52bGVcCZW9wQC+WjG1FkRufEIy6svTWWw5Eiof0afvM5ag==} + '@eslint/object-schema@2.1.4': + resolution: {integrity: sha512-BsWiH1yFGjXXS2yvrf5LyuoSIIbPrGUWob917o+BTKuZ7qJdxX8aJLRxs1fS9n6r7vESrq1OUqb68dANcFXuQQ==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + + '@firefoxic/eslint-config@3.0.0': + resolution: {integrity: sha512-lR1OFs1l0R14zJDPM1UkWBTSj5DzZ+8Uw8YLlUNyiyLR6qcKE3xtkFM/PemaYdjt5pGGQnXTkr+y9NHdaLJw8A==} engines: {node: ^18.12 || >=20.9} peerDependencies: - eslint: ^9.2.0 + eslint: ^9.9.0 - '@firefoxic/update-changelog@0.1.0': - resolution: {integrity: sha512-VNmAKjmKHVTwktW6JICd3wYgdfQJOhmR/XsWubhmP9wg92dEyhDdxHu/9fssyKPLvQ8AWzLGkv6aKuUJdW2XkQ==} + '@firefoxic/update-changelog@0.2.0': + resolution: {integrity: sha512-gaErin6RQlelHAbq8wk5E1Lqr5kdoYfq1U5M+3bzkLcslvlHuGAY62K7kfXm+HT2jJCNuyesZIfQ4V4/g1GthQ==} engines: {node: ^18.12 || >=20.9} hasBin: true @@ -73,19 +81,12 @@ packages: resolution: {integrity: sha512-kjotm7XJrJ6v+7knhPaRgaT6q8F8K2jiafwYdNHLzmV0uGLuZY43FK6smNSHUPrhq5kX2slCUy+RGG/xGqmIKA==} engines: {node: '>=10.13.0'} - '@humanwhocodes/config-array@0.13.0': - resolution: {integrity: sha512-DZLEEqFWQFiyK6h5YIeynKx7JlvCYWL0cImfSRXZ9l4Sg2efkFGTuFf6vzXjK1cq6IYkU+Eg/JizXw+TD2vRNw==} - engines: {node: '>=10.10.0'} - '@humanwhocodes/module-importer@1.0.1': resolution: {integrity: sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==} engines: {node: '>=12.22'} - '@humanwhocodes/object-schema@2.0.3': - resolution: {integrity: sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA==} - - '@humanwhocodes/retry@0.2.4': - resolution: {integrity: sha512-Ttl/jHpxfS3st5sxwICYfk4pOH0WrLI1SpW283GgQL7sCWU7EHIOhX4b4fkIxr3tkfzwg8+FNojtzsIEE7Ecgg==} + '@humanwhocodes/retry@0.3.0': + resolution: {integrity: sha512-d2CGZR2o7fS6sWB7DG/3a95bGKQyHMACZ5aW8qGkkqQpUoZV6C0X7Pc7l4ZNMZkfNBf4VWNe9E1jRsf0G146Ew==} engines: {node: '>=18.18'} '@nodelib/fs.scandir@2.1.5': @@ -100,14 +101,14 @@ packages: resolution: {integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==} engines: {node: '>= 8'} - '@stylistic/eslint-plugin-js@1.8.1': - resolution: {integrity: sha512-c5c2C8Mos5tTQd+NWpqwEu7VT6SSRooAguFPMj1cp2RkTYl1ynKoXo8MWy3k4rkbzoeYHrqC2UlUzsroAN7wtQ==} - engines: {node: ^16.0.0 || >=18.0.0} + '@stylistic/eslint-plugin-js@2.6.4': + resolution: {integrity: sha512-kx1hS3xTvzxZLdr/DCU/dLBE++vcP97sHeEFX2QXhk1Ipa4K1rzPOLw1HCbf4mU3s+7kHP5eYpDe+QteEOFLug==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: eslint: '>=8.40.0' - '@types/eslint@8.56.10': - resolution: {integrity: sha512-Shavhk87gCtY2fhXDctcfS3e6FdxWkCx1iUZ9eEUbh7rTqlZT0/IzOkCOVt0fCjcFuZ9FPYfuezTBImfHCDBGQ==} + '@types/eslint@9.6.0': + resolution: {integrity: sha512-gi6WQJ7cHRgZxtkQEoyHMppPjq9Kxo5Tjn2prSKDSmZrCz8TZ3jSRCeTJm+WoM+oB0WG37bRqLzaaU3q7JypGg==} '@types/estree@1.0.5': resolution: {integrity: sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==} @@ -120,8 +121,8 @@ packages: peerDependencies: acorn: ^6.0.0 || ^7.0.0 || ^8.0.0 - acorn@8.11.3: - resolution: {integrity: sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==} + acorn@8.12.1: + resolution: {integrity: sha512-tcpGyI9zbizT9JbV6oYE477V6mTlXvvi0T0G3SNIYE2apm/G5huBa1+K89VGeovbg+jycCrfhl3ADxErOuO6Jg==} engines: {node: '>=0.4.0'} hasBin: true @@ -167,6 +168,9 @@ packages: resolution: {integrity: sha512-Obu/KE8FurfQRN6ODdHN9LuXqwC+JFIM9NRyZqJJ4ZfLJmIYN9Rg0/kb+wF70VV5+fJusTMQlJ1t5rF7J/ETdg==} engines: {node: '>= 10.13.0'} + b4a@1.6.6: + resolution: {integrity: sha512-5Tk1HLk6b6ctmjIkAcU/Ujv/1WqiDl0F0JdRCR80VsOcUlHcu7pWeWRlOqQLHfDEsVx9YH/aif5AG4ehoCtTmg==} + bach@2.0.1: resolution: {integrity: sha512-A7bvGMGiTOxGMpNupYl9HQTf0FFDNF4VCmks4PJpFyN1AX2pdKuxuwdvUz2Hu388wcgp+OvGFNsumBfFNkR7eg==} engines: {node: '>=10.13.0'} @@ -174,8 +178,8 @@ packages: balanced-match@1.0.2: resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} - bare-events@2.2.2: - resolution: {integrity: sha512-h7z00dWdG0PYOQEvChhOSWvOfkIKsdZGkWr083FgN/HyoQuebSew/cgirYqh9SCuy/hRvxc5Vy6Fw8xAmYHLkQ==} + bare-events@2.4.2: + resolution: {integrity: sha512-qMKFd2qG/36aA4GwvKq8MxnPgCQAmBWmSyLWsJcbn8v03wvIPQ/hG1Ms8bPzndZxMDoHpxez5VOS+gC9Yi24/Q==} base64-js@1.5.1: resolution: {integrity: sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==} @@ -193,8 +197,8 @@ packages: brace-expansion@1.1.11: resolution: {integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==} - braces@3.0.2: - resolution: {integrity: sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==} + braces@3.0.3: + resolution: {integrity: sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==} engines: {node: '>=8'} buffer@6.0.3: @@ -250,8 +254,8 @@ packages: resolution: {integrity: sha512-HTUrgRJ7r4dsZKU6GjmpfRK1O76h97Z8MfS1G0FozR+oF2kG6Vfe8JE6zwrkbxigziPHinCJ+gCPjA9EaBDtRw==} engines: {node: '>= 6'} - debug@4.3.4: - resolution: {integrity: sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==} + debug@4.3.6: + resolution: {integrity: sha512-O/09Bd4Z1fBrU4VzkhFqVgpPzaGbw6Sm9FEkBT1A/YBXQFGuuSxa1dN2nxgxS34JmKXqYx8CZAwEVoJFImUXIg==} engines: {node: '>=6.0'} peerDependencies: supports-color: '*' @@ -301,8 +305,12 @@ packages: resolution: {integrity: sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==} engines: {node: '>=10'} - eslint-scope@8.0.1: - resolution: {integrity: sha512-pL8XjgP4ZOmmwfFE8mEhSxA7ZY4C+LWyqjQ3o4yWkkmD0qcMT9kkW3zWHOczhWcjTSgqycYAgwSlXvZltv65og==} + eslint-plugin-prefer-let@4.0.0: + resolution: {integrity: sha512-X4ep5PMO1320HKaNC9DM5+p6XvOhwv+RcqGjhv3aiw9iAtHhiFtdIUB5l0Zya0iM22ys2BGKzrNI9Xpw/ZHooQ==} + engines: {node: '>=0.10.0'} + + eslint-scope@8.0.2: + resolution: {integrity: sha512-6E4xmrTw5wtxnLA5wYL3WDfhZ/1bUBGOXV0zQvVRDOtrR8D0p6W7fs3JweNYhwRYeGvd/1CKX2se0/2s7Q/nJA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} eslint-visitor-keys@3.4.3: @@ -313,21 +321,22 @@ packages: resolution: {integrity: sha512-OtIRv/2GyiF6o/d8K7MYKKbXrOUBIK6SfkIRM4Z0dY3w+LiQ0vy3F57m0Z71bjbyeiWFiHJ8brqnmE6H6/jEuw==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - eslint@9.2.0: - resolution: {integrity: sha512-0n/I88vZpCOzO+PQpt0lbsqmn9AsnsJAQseIqhZFI8ibQT0U1AkEKRxA3EVMos0BoHSXDQvCXY25TUjB5tr8Og==} + eslint@9.9.0: + resolution: {integrity: sha512-JfiKJrbx0506OEerjK2Y1QlldtBxkAlLxT5OEcRF8uaQ86noDe2k31Vw9rnSWv+MXZHj7OOUV/dA0AhdLFcyvA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} hasBin: true + peerDependencies: + jiti: '*' + peerDependenciesMeta: + jiti: + optional: true - espree@10.0.1: - resolution: {integrity: sha512-MWkrWZbJsL2UwnjxTX3gG8FneachS/Mwg7tdGXce011sJd5b0JG54vat5KHnfSBODZ3Wvzd2WnjxyzsRoVv+ww==} + espree@10.1.0: + resolution: {integrity: sha512-M1M6CpiE6ffoigIOWYO9UDP8TMUw9kqb21tf+08IgDYjCsOvCuDt4jQcZmoYxx+w7zlKw9/N0KXfto+I8/FrXA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - espree@9.6.1: - resolution: {integrity: sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - - esquery@1.5.0: - resolution: {integrity: sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==} + esquery@1.6.0: + resolution: {integrity: sha512-ca9pw9fomFcKPvFLXhBKUK90ZvGibiGOvRJNbjljY7s7uq/5YO4BOzcYtJqExdx99rF6aAcnRxHmcUHcz6sQsg==} engines: {node: '>=0.10'} esrecurse@4.3.0: @@ -375,8 +384,8 @@ packages: resolution: {integrity: sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==} engines: {node: '>=16.0.0'} - fill-range@7.0.1: - resolution: {integrity: sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==} + fill-range@7.1.1: + resolution: {integrity: sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==} engines: {node: '>=8'} find-up@5.0.0: @@ -454,8 +463,8 @@ packages: resolution: {integrity: sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==} engines: {node: '>=18'} - globals@15.1.0: - resolution: {integrity: sha512-926gJqg+4mkxwYKiFvoomM4J0kWESfk3qfTvRL2/oc/tK/eTDBbrfcKnSa2KtfdxB5onoL7D3A3qIHQFpd4+UA==} + globals@15.9.0: + resolution: {integrity: sha512-SmSKyLLKFbSr6rptvP8izbyxJL4ILwqO9Jg23UA0sDlGlu58V59D1//I3vlc0KJphVdUR7vMjHIplYnzBxorQA==} engines: {node: '>=18'} glogg@2.2.0: @@ -495,8 +504,8 @@ packages: resolution: {integrity: sha512-eSmmWE5bZTK2Nou4g0AI3zZ9rswp7GRKoKXS1BLUkvPviOqs4YTN1djQIqrXy9k5gEtdLPy86JjRwsNM9tnDcA==} engines: {node: '>=0.10.0'} - husky@9.0.11: - resolution: {integrity: sha512-AB6lFlbwwyIqMdHYhwPe+kjOC3Oc5P3nThEoW/AaO2BX3vJDjWPFxYLxokUZOo6RNX20He3AaT8sESs9NJcmEw==} + husky@9.1.4: + resolution: {integrity: sha512-bho94YyReb4JV7LYWRWxZ/xr6TtOTt8cMfmQ39MQYJ7f/YE268s3GdghGwi+y4zAeqewE5zYLvuhV0M0ijsDEA==} engines: {node: '>=18'} hasBin: true @@ -507,8 +516,8 @@ packages: ieee754@1.2.1: resolution: {integrity: sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==} - ignore@5.3.1: - resolution: {integrity: sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==} + ignore@5.3.2: + resolution: {integrity: sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==} engines: {node: '>= 4'} import-fresh@3.3.0: @@ -537,8 +546,9 @@ packages: resolution: {integrity: sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==} engines: {node: '>=8'} - is-core-module@2.13.1: - resolution: {integrity: sha512-hHrIjvZsftOsvKSn2TRYl63zvxsgE0K+0mYMoH6gD4omR5IWB2KynivBQczo3+wF1cCkjzvptnI9Q0sPU66ilw==} + is-core-module@2.15.0: + resolution: {integrity: sha512-Dd+Lb2/zvk9SKy1TGCt1wFJFo/MWBPMX5x7KcvLajWTGuomczdQX61PvY5yK6SVACwpoexWo81IfFyoKY2QnTA==} + engines: {node: '>= 0.4'} is-extglob@2.1.1: resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==} @@ -634,8 +644,8 @@ packages: resolution: {integrity: sha512-8y/eV9QQZCiyn1SprXSrCmqJN0yNRATe+PO8ztwqrvrbdRLA3eYJF0yaR0YayLWkMbsQSKWS9N2gPcGEc4UsZg==} engines: {node: '>=0.10.0'} - micromatch@4.0.5: - resolution: {integrity: sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==} + micromatch@4.0.7: + resolution: {integrity: sha512-LPP/3KorzCwBxfeUuZmaR6bG2kdeHSbe0P2tY3FLRU4vYrjYz5hI4QZwV0njUx3jeuKe67YukQ1LSPZBKDqO/Q==} engines: {node: '>=8.6'} minimatch@3.1.2: @@ -768,6 +778,10 @@ packages: resolution: {integrity: sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==} engines: {node: '>=0.10.0'} + requireindex@1.2.0: + resolution: {integrity: sha512-L9jEkOi3ASd9PYit2cwRfyppc9NoABujTP8/5gFcbERmo5jUoAKovIC3fsF17pkTnGsrByysqX+Kxd2OTNI1ww==} + engines: {node: '>=0.10.5'} + resolve-dir@1.0.1: resolution: {integrity: sha512-R7uiTjECzvOsWSfdM0QKFNBVFcK27aHOUwdvK53BcW8zqnGdYp0Fbj82cy54+2A4P2tFM22J5kRfe1R+lM/1yg==} engines: {node: '>=0.10.0'} @@ -823,8 +837,8 @@ packages: stream-exhaust@1.0.2: resolution: {integrity: sha512-b/qaq/GlBK5xaq1yrK9/zFcyRSTNxmcZwFLGSTG0mXgZl/4Z6GgiyYOXOvY7N3eEvFRAG1bkDRz5EPGSvPYQlw==} - streamx@2.16.1: - resolution: {integrity: sha512-m9QYj6WygWyWa3H1YY69amr4nVgy61xfjys7xO7kviL5rfIEc2naf+ewFiOA+aEJD7y0JO3h2GoiUv4TDwEGzQ==} + streamx@2.18.0: + resolution: {integrity: sha512-LLUC1TWdjVdn1weXGcSxyTR3T4+acB6tVGXT95y0nGbca4t4o/ng1wKAGTljm9VicuCVLvRlqFYXYy5GwgM7sQ==} string-width@4.2.3: resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==} @@ -855,6 +869,9 @@ packages: teex@1.0.1: resolution: {integrity: sha512-eYE6iEI62Ni1H8oIa7KlDU6uQBtqr4Eajni3wX7rpfXD8ysFx8z0+dri+KWEPWpBsxXfxu58x/0jvTVT1ekOSg==} + text-decoder@1.1.1: + resolution: {integrity: sha512-8zll7REEv4GDD3x4/0pW+ppIxSNs7H1J10IKFZsuOMscumCdM2a+toDGLPA3T+1+fLBql4zbt5z83GEQGGV5VA==} + text-table@0.2.0: resolution: {integrity: sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==} @@ -950,20 +967,28 @@ packages: snapshots: - '@eslint-community/eslint-utils@4.4.0(eslint@9.2.0)': + '@eslint-community/eslint-utils@4.4.0(eslint@9.9.0)': dependencies: - eslint: 9.2.0 + eslint: 9.9.0 eslint-visitor-keys: 3.4.3 - '@eslint-community/regexpp@4.10.0': {} + '@eslint-community/regexpp@4.11.0': {} - '@eslint/eslintrc@3.0.2': + '@eslint/config-array@0.17.1': + dependencies: + '@eslint/object-schema': 2.1.4 + debug: 4.3.6 + minimatch: 3.1.2 + transitivePeerDependencies: + - supports-color + + '@eslint/eslintrc@3.1.0': dependencies: ajv: 6.12.6 - debug: 4.3.4 - espree: 10.0.1 + debug: 4.3.6 + espree: 10.1.0 globals: 14.0.0 - ignore: 5.3.1 + ignore: 5.3.2 import-fresh: 3.3.0 js-yaml: 4.1.0 minimatch: 3.1.2 @@ -971,16 +996,19 @@ snapshots: transitivePeerDependencies: - supports-color - '@eslint/js@9.2.0': {} + '@eslint/js@9.9.0': {} + + '@eslint/object-schema@2.1.4': {} - '@firefoxic/eslint-config@1.0.0(eslint@9.2.0)': + '@firefoxic/eslint-config@3.0.0(eslint@9.9.0)': dependencies: - '@eslint/js': 9.2.0 - '@stylistic/eslint-plugin-js': 1.8.1(eslint@9.2.0) - eslint: 9.2.0 - globals: 15.1.0 + '@eslint/js': 9.9.0 + '@stylistic/eslint-plugin-js': 2.6.4(eslint@9.9.0) + eslint: 9.9.0 + eslint-plugin-prefer-let: 4.0.0 + globals: 15.9.0 - '@firefoxic/update-changelog@0.1.0': {} + '@firefoxic/update-changelog@0.2.0': {} '@gulpjs/messages@1.1.0': {} @@ -988,19 +1016,9 @@ snapshots: dependencies: is-negated-glob: 1.0.0 - '@humanwhocodes/config-array@0.13.0': - dependencies: - '@humanwhocodes/object-schema': 2.0.3 - debug: 4.3.4 - minimatch: 3.1.2 - transitivePeerDependencies: - - supports-color - '@humanwhocodes/module-importer@1.0.1': {} - '@humanwhocodes/object-schema@2.0.3': {} - - '@humanwhocodes/retry@0.2.4': {} + '@humanwhocodes/retry@0.3.0': {} '@nodelib/fs.scandir@2.1.5': dependencies: @@ -1014,16 +1032,15 @@ snapshots: '@nodelib/fs.scandir': 2.1.5 fastq: 1.17.1 - '@stylistic/eslint-plugin-js@1.8.1(eslint@9.2.0)': + '@stylistic/eslint-plugin-js@2.6.4(eslint@9.9.0)': dependencies: - '@types/eslint': 8.56.10 - acorn: 8.11.3 - escape-string-regexp: 4.0.0 - eslint: 9.2.0 - eslint-visitor-keys: 3.4.3 - espree: 9.6.1 + '@types/eslint': 9.6.0 + acorn: 8.12.1 + eslint: 9.9.0 + eslint-visitor-keys: 4.0.0 + espree: 10.1.0 - '@types/eslint@8.56.10': + '@types/eslint@9.6.0': dependencies: '@types/estree': 1.0.5 '@types/json-schema': 7.0.15 @@ -1032,11 +1049,11 @@ snapshots: '@types/json-schema@7.0.15': {} - acorn-jsx@5.3.2(acorn@8.11.3): + acorn-jsx@5.3.2(acorn@8.12.1): dependencies: - acorn: 8.11.3 + acorn: 8.12.1 - acorn@8.11.3: {} + acorn@8.12.1: {} ajv@6.12.6: dependencies: @@ -1078,6 +1095,8 @@ snapshots: dependencies: async-done: 2.0.0 + b4a@1.6.6: {} + bach@2.0.1: dependencies: async-done: 2.0.0 @@ -1086,7 +1105,7 @@ snapshots: balanced-match@1.0.2: {} - bare-events@2.2.2: + bare-events@2.4.2: optional: true base64-js@1.5.1: {} @@ -1106,9 +1125,9 @@ snapshots: balanced-match: 1.0.2 concat-map: 0.0.1 - braces@3.0.2: + braces@3.0.3: dependencies: - fill-range: 7.0.1 + fill-range: 7.1.1 buffer@6.0.3: dependencies: @@ -1125,7 +1144,7 @@ snapshots: chokidar@3.6.0: dependencies: anymatch: 3.1.3 - braces: 3.0.2 + braces: 3.0.3 glob-parent: 5.1.2 is-binary-path: 2.1.0 is-glob: 4.0.3 @@ -1175,7 +1194,7 @@ snapshots: css-what@6.1.0: {} - debug@4.3.4: + debug@4.3.6: dependencies: ms: 2.1.2 @@ -1218,7 +1237,11 @@ snapshots: escape-string-regexp@4.0.0: {} - eslint-scope@8.0.1: + eslint-plugin-prefer-let@4.0.0: + dependencies: + requireindex: 1.2.0 + + eslint-scope@8.0.2: dependencies: esrecurse: 4.3.0 estraverse: 5.3.0 @@ -1227,31 +1250,31 @@ snapshots: eslint-visitor-keys@4.0.0: {} - eslint@9.2.0: + eslint@9.9.0: dependencies: - '@eslint-community/eslint-utils': 4.4.0(eslint@9.2.0) - '@eslint-community/regexpp': 4.10.0 - '@eslint/eslintrc': 3.0.2 - '@eslint/js': 9.2.0 - '@humanwhocodes/config-array': 0.13.0 + '@eslint-community/eslint-utils': 4.4.0(eslint@9.9.0) + '@eslint-community/regexpp': 4.11.0 + '@eslint/config-array': 0.17.1 + '@eslint/eslintrc': 3.1.0 + '@eslint/js': 9.9.0 '@humanwhocodes/module-importer': 1.0.1 - '@humanwhocodes/retry': 0.2.4 + '@humanwhocodes/retry': 0.3.0 '@nodelib/fs.walk': 1.2.8 ajv: 6.12.6 chalk: 4.1.2 cross-spawn: 7.0.3 - debug: 4.3.4 + debug: 4.3.6 escape-string-regexp: 4.0.0 - eslint-scope: 8.0.1 + eslint-scope: 8.0.2 eslint-visitor-keys: 4.0.0 - espree: 10.0.1 - esquery: 1.5.0 + espree: 10.1.0 + esquery: 1.6.0 esutils: 2.0.3 fast-deep-equal: 3.1.3 file-entry-cache: 8.0.0 find-up: 5.0.0 glob-parent: 6.0.2 - ignore: 5.3.1 + ignore: 5.3.2 imurmurhash: 0.1.4 is-glob: 4.0.3 is-path-inside: 3.0.3 @@ -1266,19 +1289,13 @@ snapshots: transitivePeerDependencies: - supports-color - espree@10.0.1: + espree@10.1.0: dependencies: - acorn: 8.11.3 - acorn-jsx: 5.3.2(acorn@8.11.3) + acorn: 8.12.1 + acorn-jsx: 5.3.2(acorn@8.12.1) eslint-visitor-keys: 4.0.0 - espree@9.6.1: - dependencies: - acorn: 8.11.3 - acorn-jsx: 5.3.2(acorn@8.11.3) - eslint-visitor-keys: 3.4.3 - - esquery@1.5.0: + esquery@1.6.0: dependencies: estraverse: 5.3.0 @@ -1318,7 +1335,7 @@ snapshots: dependencies: flat-cache: 4.0.1 - fill-range@7.0.1: + fill-range@7.1.1: dependencies: to-regex-range: 5.0.1 @@ -1331,7 +1348,7 @@ snapshots: dependencies: detect-file: 1.0.0 is-glob: 4.0.3 - micromatch: 4.0.5 + micromatch: 4.0.7 resolve-dir: 1.0.1 fined@2.0.0: @@ -1360,7 +1377,7 @@ snapshots: fs-mkdirp-stream@2.0.1: dependencies: graceful-fs: 4.2.11 - streamx: 2.16.1 + streamx: 2.18.0 fsevents@2.3.3: optional: true @@ -1386,7 +1403,7 @@ snapshots: is-glob: 4.0.3 is-negated-glob: 1.0.0 normalize-path: 3.0.0 - streamx: 2.16.1 + streamx: 2.18.0 glob-watcher@6.0.0: dependencies: @@ -1409,7 +1426,7 @@ snapshots: globals@14.0.0: {} - globals@15.1.0: {} + globals@15.9.0: {} glogg@2.2.0: dependencies: @@ -1455,7 +1472,7 @@ snapshots: dependencies: parse-passwd: 1.0.0 - husky@9.0.11: {} + husky@9.1.4: {} iconv-lite@0.6.3: dependencies: @@ -1463,7 +1480,7 @@ snapshots: ieee754@1.2.1: {} - ignore@5.3.1: {} + ignore@5.3.2: {} import-fresh@3.3.0: dependencies: @@ -1487,7 +1504,7 @@ snapshots: dependencies: binary-extensions: 2.3.0 - is-core-module@2.13.1: + is-core-module@2.15.0: dependencies: hasown: 2.0.2 @@ -1564,9 +1581,9 @@ snapshots: map-cache@0.2.2: {} - micromatch@4.0.5: + micromatch@4.0.7: dependencies: - braces: 3.0.2 + braces: 3.0.3 picomatch: 2.3.1 minimatch@3.1.2: @@ -1686,6 +1703,8 @@ snapshots: require-directory@2.1.1: {} + requireindex@1.2.0: {} + resolve-dir@1.0.1: dependencies: expand-tilde: 2.0.2 @@ -1699,7 +1718,7 @@ snapshots: resolve@1.22.8: dependencies: - is-core-module: 2.13.1 + is-core-module: 2.15.0 path-parse: 1.0.7 supports-preserve-symlinks-flag: 1.0.0 @@ -1730,16 +1749,17 @@ snapshots: stream-composer@1.0.2: dependencies: - streamx: 2.16.1 + streamx: 2.18.0 stream-exhaust@1.0.2: {} - streamx@2.16.1: + streamx@2.18.0: dependencies: fast-fifo: 1.3.2 queue-tick: 1.0.1 + text-decoder: 1.1.1 optionalDependencies: - bare-events: 2.2.2 + bare-events: 2.4.2 string-width@4.2.3: dependencies: @@ -1769,7 +1789,11 @@ snapshots: teex@1.0.1: dependencies: - streamx: 2.16.1 + streamx: 2.18.0 + + text-decoder@1.1.1: + dependencies: + b4a: 1.6.6 text-table@0.2.0: {} @@ -1779,7 +1803,7 @@ snapshots: to-through@3.0.0: dependencies: - streamx: 2.16.1 + streamx: 2.18.0 type-check@0.4.0: dependencies: @@ -1822,7 +1846,7 @@ snapshots: normalize-path: 3.0.0 resolve-options: 2.0.0 stream-composer: 1.0.2 - streamx: 2.16.1 + streamx: 2.18.0 to-through: 3.0.0 value-or-function: 4.0.0 vinyl: 3.0.0 @@ -1833,7 +1857,7 @@ snapshots: convert-source-map: 2.0.0 graceful-fs: 4.2.11 now-and-later: 3.0.0 - streamx: 2.16.1 + streamx: 2.18.0 vinyl: 3.0.0 vinyl-contents: 2.0.0 diff --git a/test/index.js b/test/index.js index 48793b8..f4721da 100644 --- a/test/index.js +++ b/test/index.js @@ -7,7 +7,7 @@ import Vinyl from "vinyl" import { stacksvg } from "../lib/index.js" test(`Plugin should not create empty svg file`, () => { - const stream = stacksvg() + let stream = stacksvg() let isEmpty = true stream.on(`data`, () => { isEmpty = false }) @@ -20,11 +20,11 @@ test(`Plugin should not create empty svg file`, () => { }) test(`Plugin should correctly merge svg files`, () => { - const stream = stacksvg() + let stream = stacksvg() stream.on(`data`, (file) => { - const actual = file.contents.toString() - const expected = `` + let actual = file.contents.toString() + let expected = `` equal(actual, expected) }) @@ -43,11 +43,11 @@ test(`Plugin should correctly merge svg files`, () => { }) test(`Plugin should not include null`, () => { - const stream = stacksvg() + let stream = stacksvg() stream.on(`data`, (file) => { - const actual = file.contents.toString() - const expected = `` + let actual = file.contents.toString() + let expected = `` equal(actual, expected) }) @@ -66,11 +66,11 @@ test(`Plugin should not include null`, () => { }) test(`Plugin should not include invalid files`, () => { - const stream = stacksvg() + let stream = stacksvg() stream.on(`data`, (file) => { - const actual = file.contents.toString() - const expected = `` + let actual = file.contents.toString() + let expected = `` equal(actual, expected) }) @@ -89,7 +89,7 @@ test(`Plugin should not include invalid files`, () => { }) test(`Plugin should emit error if files have the same name`, () => { - const stream = stacksvg() + let stream = stacksvg() stream.on(`error`, (error) => { ok(error instanceof PluginError) @@ -109,7 +109,7 @@ test(`Plugin should emit error if files have the same name`, () => { }) test(`Plugin should generate stack.svg`, () => { - const stream = stacksvg() + let stream = stacksvg() stream.on(`data`, (file) => { equal(file.relative, `stack.svg`) @@ -129,11 +129,11 @@ test(`Plugin should generate stack.svg`, () => { }) test(`Plugin should replace the spaces with the hyphens`, () => { - const stream = stacksvg() + let stream = stacksvg() stream.on(`data`, (file) => { - const actual = file.contents.toString() - const expected = `` + let actual = file.contents.toString() + let expected = `` equal(actual, expected) }) @@ -147,11 +147,11 @@ test(`Plugin should replace the spaces with the hyphens`, () => { }) test(`Plugin should replace the directory separator with the underscore`, () => { - const stream = stacksvg() + let stream = stacksvg() stream.on(`data`, (file) => { - const actual = file.contents.toString() - const expected = `` + let actual = file.contents.toString() + let expected = `` equal(actual, expected) }) @@ -165,11 +165,11 @@ test(`Plugin should replace the directory separator with the underscore`, () => }) test(`Plugin should generate unique inner id`, () => { - const stream = stacksvg() + let stream = stacksvg() stream.on(`data`, (file) => { - const actual = file.contents.toString() - const expected = `` + let actual = file.contents.toString() + let expected = `` equal(actual, expected) }) @@ -188,11 +188,11 @@ test(`Plugin should generate unique inner id`, () => { }) test(`Plugin should include all different namespaces into final svg`, () => { - const stream = stacksvg() + let stream = stacksvg() stream.on(`data`, (file) => { - const actual = file.contents.toString() - const expected = `` + let actual = file.contents.toString() + let expected = `` equal(actual, expected) }) @@ -211,11 +211,11 @@ test(`Plugin should include all different namespaces into final svg`, () => { }) test(`Plugin should replace aliases of existing namespaces`, () => { - const stream = stacksvg() + let stream = stacksvg() stream.on(`data`, (file) => { - const actual = file.contents.toString() - const expected = `` + let actual = file.contents.toString() + let expected = `` equal(actual, expected) }) @@ -234,11 +234,11 @@ test(`Plugin should replace aliases of existing namespaces`, () => { }) test(`Plugin should rename duplicate aliases of different namespaces`, () => { - const stream = stacksvg() + let stream = stacksvg() stream.on(`data`, (file) => { - const actual = file.contents.toString() - const expected = `` + let actual = file.contents.toString() + let expected = `` equal(actual, expected) }) @@ -262,11 +262,11 @@ test(`Plugin should rename duplicate aliases of different namespaces`, () => { }) test(`Plugin should remove "http://www.w3.org/1999/xlink" namespace`, () => { - const stream = stacksvg() + let stream = stacksvg() stream.on(`data`, (file) => { - const actual = file.contents.toString() - const expected = `` + let actual = file.contents.toString() + let expected = `` equal(actual, expected) }) @@ -285,11 +285,11 @@ test(`Plugin should remove "http://www.w3.org/1999/xlink" namespace`, () => { }) test(`Plugin should not add unused namespaces`, () => { - const stream = stacksvg() + let stream = stacksvg() stream.on(`data`, (file) => { - const actual = file.contents.toString() - const expected = `` + let actual = file.contents.toString() + let expected = `` equal(actual, expected) })