From e8c70af6d9b0484cf412f120a136ceb370e4e2fa Mon Sep 17 00:00:00 2001 From: Calypso Bot Date: Thu, 24 Oct 2024 18:48:12 +0200 Subject: [PATCH] Update dependency svgicons2svgfont to v14 (#39893) * Update dependency svgicons2svgfont to v14 * Update svg-to-font for new svgicons2svgfont version --------- Co-authored-by: Renovate Bot Co-authored-by: Brad Jorsch --- pnpm-lock.yaml | 117 ++++++++++++++---- .../changelog/renovate-svgicons2svgfont-14.x | 4 + .../js-packages/social-logos/package.json | 2 +- projects/js-packages/social-logos/tools/build | 2 +- .../tools/{svg-to-font.js => svg-to-font.mjs} | 26 ++-- 5 files changed, 111 insertions(+), 40 deletions(-) create mode 100644 projects/js-packages/social-logos/changelog/renovate-svgicons2svgfont-14.x rename projects/js-packages/social-logos/tools/{svg-to-font.js => svg-to-font.mjs} (86%) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index d20a403bb87c6..573fa8ff3aeff 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1343,8 +1343,8 @@ importers: specifier: ^6.0.3 version: 6.0.3 svgicons2svgfont: - specifier: ^12.0.0 - version: 12.0.0 + specifier: ^14.0.0 + version: 14.0.2 svgo: specifier: ^3.3.2 version: 3.3.2 @@ -7461,6 +7461,9 @@ packages: '@types/retry@0.12.0': resolution: {integrity: sha512-wWKOClTTiizcZhXnPY4wikVAwmdYHp8q6DmC+EJUzAMsycb7HB32Kh9RN4+0gExjmPmZSAQjgURXIGATPegAvA==} + '@types/sax@1.2.7': + resolution: {integrity: sha512-rO73L89PJxeYM3s3pPPjiPgVVcymqU490g0YO5n5By0k2Erzj6tay/4lr1CHAAU4JyOWd1rpQ8bCf6cZfHU96A==} + '@types/seed-random@2.2.4': resolution: {integrity: sha512-M4wSiHb23w6oRFo69SrjWiYMXocfhRyzX5kuGkAJmLrYJDD//8zmhsY+9t6t87RLYhyIcE4h3feYwqOFdaslHw==} @@ -10096,15 +10099,15 @@ packages: engines: {node: '>=16 || 14 >=14.18'} hasBin: true + glob@11.0.0: + resolution: {integrity: sha512-9UiX/Bl6J2yaBbxKoEBRm4Cipxgok8kQYcOPEhScPwebu2I0HoQOuYdIO6S3hLuWoZgpDpwQZMzTFxgpkyT76g==} + engines: {node: 20 || >=22} + hasBin: true + 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 - global-modules@0.2.3: resolution: {integrity: sha512-JeXuCbvYzYXcwE6acL9V2bAOeSIGl4dD+iwLY9iUx2VBJJ80R18HCn+JCwHM9Oegdfya3lEkGCdaRkSyc10hDA==} engines: {node: '>=0.10.0'} @@ -10680,6 +10683,10 @@ packages: jackspeak@3.4.3: resolution: {integrity: sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==} + jackspeak@4.0.2: + resolution: {integrity: sha512-bZsjR/iRjl1Nk1UkjGpAzLNfQtzuijhn2g+pbZb98HQ1Gk8vM9hfbxeMBP+M2/UUdwj0RqGG3mlvk2MsAqwvEw==} + engines: {node: 20 || >=22} + jake@10.9.2: resolution: {integrity: sha512-2P4SQ0HrLQ+fw6llpLnOaGAvN2Zu6778SJMrCUwns4fOoG9ayrTiZk3VV8sCPkVZF8ab0zksVpS8FDY5pRCNBA==} engines: {node: '>=10'} @@ -11165,6 +11172,10 @@ packages: lru-cache@10.4.3: resolution: {integrity: sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==} + lru-cache@11.0.1: + resolution: {integrity: sha512-CgeuL5uom6j/ZVrg7G/+1IXqRY8JXX4Hghfy5YE0EhoYQWvndP1kufu58cmZLNIDKnRhZrXfdS9urVWx98AipQ==} + engines: {node: 20 || >=22} + lru-cache@5.1.1: resolution: {integrity: sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==} @@ -11423,6 +11434,10 @@ packages: peerDependencies: webpack: ^5.0.0 + minimatch@10.0.1: + resolution: {integrity: sha512-ethXTt3SGGR+95gudmqJ1eNhRO7eGEGIgYA9vnPatK4/etz2MEVDno5GMCibdMTuBMyElzIlgxMna3K94XDIDQ==} + engines: {node: 20 || >=22} + minimatch@3.1.2: resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==} @@ -11731,6 +11746,9 @@ packages: resolution: {integrity: sha512-whdkPIooSu/bASggZ96BWVvZTRMOFxnyUG5PnTSGKoJE2gd5mbVNmR2Nj20QFzxYYgAXpoqC+AiXzl+UMRh7zQ==} engines: {node: '>=8'} + package-json-from-dist@1.0.1: + resolution: {integrity: sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==} + param-case@3.0.4: resolution: {integrity: sha512-RXlj7zCYokReqWpOPH9oYivUzLYZ5vAPIfEmCTNViosC78F8F0H9y7T7gG2M39ymgutxF5gcFEsyZQSph9Bp3A==} @@ -11815,6 +11833,10 @@ packages: resolution: {integrity: sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==} engines: {node: '>=16 || 14 >=14.18'} + path-scurry@2.0.0: + resolution: {integrity: sha512-ypGJsmGtdXUOeM5u93TyeIEfEhM6s+ljAhrk5vAvSx8uyY/02OvrZnA0YNGUrPXfpJMgI1ODd3nwz8Npx4O4cg==} + engines: {node: 20 || >=22} + path-to-regexp@0.1.10: resolution: {integrity: sha512-7lf7qcQidTku0Gu3YDPc8DJ1q7OOucfa/BSsIwjuh56VU7katFvuM8hULfkwB3Fns/rsVF7PwPKVw1sl5KQS9w==} @@ -13315,17 +13337,17 @@ packages: svg-parser@2.0.4: resolution: {integrity: sha512-e4hG1hRwoOdRb37cIMSgzNsxyzKfayW6VOflrwvR+/bzrkyxY/31WkbgnQpgtrNp1SdpJvpUAGTa/ZoiPNDuRQ==} - svg-pathdata@6.0.3: - resolution: {integrity: sha512-qsjeeq5YjBZ5eMdFuUa4ZosMLxgr5RZ+F+Y1OrDhuOCEInRMA3x74XdBtggJcj9kOeInz0WE+LgCPDkZFlBYJw==} - engines: {node: '>=12.0.0'} + svg-pathdata@7.1.0: + resolution: {integrity: sha512-wrvKHXZSYZyODOj5E1l1bMTIo8sR7YCH0E4SA8IgLgMsZq4RypslpYvNSsrdg4ThD6du2KWPyVeKinkqUelGhg==} + engines: {node: '>=20.11.1'} svg2ttf@6.0.3: resolution: {integrity: sha512-CgqMyZrbOPpc+WqH7aga4JWkDPso23EgypLsbQ6gN3uoPWwwiLjXvzgrwGADBExvCRJrWFzAeK1bSoSpE7ixSQ==} hasBin: true - svgicons2svgfont@12.0.0: - resolution: {integrity: sha512-fjyDkhiG0M1TPBtZzD12QV3yDcG2fUgiqHPOCYzf7hHE40Hl3GhnE6P1njsJCCByhwM7MiufyDW3L7IOR5dg9w==} - engines: {node: '>=16.15.0'} + svgicons2svgfont@14.0.2: + resolution: {integrity: sha512-NwbAbOMZvLN/3ycAnaDA8RRbovgtjoVqjW6bnGVaNHTG3dcnNLwRXGD/e11V37Tv48SlAjBTEWCNJRf+qdS1nA==} + engines: {node: '>=20.11.1'} hasBin: true svgo@3.3.2: @@ -13493,6 +13515,10 @@ packages: resolution: {integrity: sha512-l7FvfAHlcmulp8kr+flpQZmVwtu7nfRV7NZujtN0OqES8EL4O4e0qqzL0DC5gAvx/ZC/9lk6rhcUwYvkBnBnYA==} engines: {node: '>=12'} + transformation-matrix-js@2.7.6: + resolution: {integrity: sha512-1CxDIZmCQ3vA0GGnkdMQqxUXVm3xXAFmglPYRS1hr37LzSg22TC7QAWOT38OmdUvMEs/rqcnkFoAsqvzdiluDg==} + deprecated: Package no longer supported. Contact support@npmjs.com for more info. + tree-kill@1.2.2: resolution: {integrity: sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A==} hasBin: true @@ -14157,6 +14183,10 @@ packages: yauzl@2.10.0: resolution: {integrity: sha512-p4a9I6X6nu6IhoGmBqAcbJy1mlC4j27vEPZX9F4L4/vZT3Lyq1VkFHw/V/PUcB9Buo+DG3iHkT0x3Qya58zc3g==} + yerror@8.0.0: + resolution: {integrity: sha512-FemWD5/UqNm8ffj8oZIbjWXIF2KE0mZssggYpdaQkWDDgXBQ/35PNIxEuz6/YLn9o0kOxDBNJe8x8k9ljD7k/g==} + engines: {node: '>=18.16.0'} + yjs@13.6.19: resolution: {integrity: sha512-GNKw4mEUn5yWU2QPHRx8jppxmCm9KzbBhB4qJLUJFiiYD0g/tDVgXQ7aPkyh01YO28kbs2J/BEbWBagjuWyejw==} engines: {node: '>=16.0.0', npm: '>=8.0.0'} @@ -17411,6 +17441,10 @@ snapshots: '@types/retry@0.12.0': {} + '@types/sax@1.2.7': + dependencies: + '@types/node': 20.16.10 + '@types/seed-random@2.2.4': {} '@types/semver@7.5.8': {} @@ -22003,6 +22037,15 @@ snapshots: minipass: 7.1.2 path-scurry: 1.11.1 + glob@11.0.0: + dependencies: + foreground-child: 3.3.0 + jackspeak: 4.0.2 + minimatch: 10.0.1 + minipass: 7.1.2 + package-json-from-dist: 1.0.1 + path-scurry: 2.0.0 + glob@7.2.3: dependencies: fs.realpath: 1.0.0 @@ -22012,14 +22055,6 @@ snapshots: once: 1.4.0 path-is-absolute: 1.0.1 - glob@8.1.0: - dependencies: - fs.realpath: 1.0.0 - inflight: 1.0.6 - inherits: 2.0.4 - minimatch: 5.1.0 - once: 1.4.0 - global-modules@0.2.3: dependencies: global-prefix: 0.1.5 @@ -22607,6 +22642,10 @@ snapshots: optionalDependencies: '@pkgjs/parseargs': 0.11.0 + jackspeak@4.0.2: + dependencies: + '@isaacs/cliui': 8.0.2 + jake@10.9.2: dependencies: async: 3.2.6 @@ -23389,6 +23428,8 @@ snapshots: lru-cache@10.4.3: {} + lru-cache@11.0.1: {} + lru-cache@5.1.1: dependencies: yallist: 3.1.1 @@ -23817,6 +23858,10 @@ snapshots: tapable: 2.2.1 webpack: 5.94.0(webpack-cli@4.9.1) + minimatch@10.0.1: + dependencies: + brace-expansion: 2.0.1 + minimatch@3.1.2: dependencies: brace-expansion: 1.1.11 @@ -24135,6 +24180,8 @@ snapshots: lodash.flattendeep: 4.4.0 release-zalgo: 1.0.0 + package-json-from-dist@1.0.1: {} + param-case@3.0.4: dependencies: dot-case: 3.0.4 @@ -24212,6 +24259,11 @@ snapshots: lru-cache: 10.4.3 minipass: 7.1.2 + path-scurry@2.0.0: + dependencies: + lru-cache: 11.0.1 + minipass: 7.1.2 + path-to-regexp@0.1.10: {} path-to-regexp@1.9.0: @@ -25848,7 +25900,9 @@ snapshots: svg-parser@2.0.4: {} - svg-pathdata@6.0.3: {} + svg-pathdata@7.1.0: + dependencies: + yerror: 8.0.0 svg2ttf@6.0.3: dependencies: @@ -25859,12 +25913,19 @@ snapshots: microbuffer: 1.0.0 svgpath: 2.6.0 - svgicons2svgfont@12.0.0: + svgicons2svgfont@14.0.2: dependencies: - commander: 9.3.0 - glob: 8.1.0 + '@types/sax': 1.2.7 + commander: 12.1.0 + debug: 4.3.7 + glob: 11.0.0 + punycode: 2.3.1 sax: 1.4.1 - svg-pathdata: 6.0.3 + svg-pathdata: 7.1.0 + transformation-matrix-js: 2.7.6 + yerror: 8.0.0 + transitivePeerDependencies: + - supports-color svgo@3.3.2: dependencies: @@ -26027,6 +26088,8 @@ snapshots: dependencies: punycode: 2.3.1 + transformation-matrix-js@2.7.6: {} + tree-kill@1.2.2: {} triple-beam@1.4.1: {} @@ -26783,6 +26846,8 @@ snapshots: buffer-crc32: 0.2.13 fd-slicer: 1.1.0 + yerror@8.0.0: {} + yjs@13.6.19: dependencies: lib0: 0.2.98 diff --git a/projects/js-packages/social-logos/changelog/renovate-svgicons2svgfont-14.x b/projects/js-packages/social-logos/changelog/renovate-svgicons2svgfont-14.x new file mode 100644 index 0000000000000..c47cb18e82997 --- /dev/null +++ b/projects/js-packages/social-logos/changelog/renovate-svgicons2svgfont-14.x @@ -0,0 +1,4 @@ +Significance: patch +Type: changed + +Updated package dependencies. diff --git a/projects/js-packages/social-logos/package.json b/projects/js-packages/social-logos/package.json index c8ed32af63311..862f576b7ace7 100644 --- a/projects/js-packages/social-logos/package.json +++ b/projects/js-packages/social-logos/package.json @@ -38,7 +38,7 @@ "@types/react-dom": "18.3.0", "glob": "10.4.1", "svg2ttf": "^6.0.3", - "svgicons2svgfont": "^12.0.0", + "svgicons2svgfont": "^14.0.0", "svgo": "^3.3.2", "svgstore": "^3.0.1", "typescript": "5.0.4", diff --git a/projects/js-packages/social-logos/tools/build b/projects/js-packages/social-logos/tools/build index 33c3adcdac5ca..eee9aed604e9d 100755 --- a/projects/js-packages/social-logos/tools/build +++ b/projects/js-packages/social-logos/tools/build @@ -20,7 +20,7 @@ if ./tools/clean && # Disabling this for now until we figure out the proper place for it. # ./tools/svg-to-php && ./tools/svg-to-sprite.js && -./tools/svg-to-font.js && +./tools/svg-to-font.mjs && ./tools/svg-to-react-data.js && ./tools/build-react; then echo 'Build complete.' diff --git a/projects/js-packages/social-logos/tools/svg-to-font.js b/projects/js-packages/social-logos/tools/svg-to-font.mjs similarity index 86% rename from projects/js-packages/social-logos/tools/svg-to-font.js rename to projects/js-packages/social-logos/tools/svg-to-font.mjs index 8e6dee559bad0..ca95004e5f640 100755 --- a/projects/js-packages/social-logos/tools/svg-to-font.js +++ b/projects/js-packages/social-logos/tools/svg-to-font.mjs @@ -1,4 +1,15 @@ #!/usr/bin/env node + +import { spawnSync } from 'child_process'; +import fs from 'fs'; +import path from 'path'; +import process from 'process'; +import { fileURLToPath } from 'url'; +import { glob } from 'glob'; +import svg2ttf from 'svg2ttf'; +import { SVGIcons2SVGFontStream } from 'svgicons2svgfont'; +import wawoff2 from 'wawoff2'; + /* eslint-disable no-console */ const svgDir = 'build/svg-clean'; const srcSvgDir = 'src/svg'; @@ -7,17 +18,8 @@ const destFontDir = 'build/font'; const cssFile = destFontDir + '/social-logos.css'; const woff2FontFile = destFontDir + '/social-logos.woff2'; -const { spawnSync } = require( 'child_process' ); -const fs = require( 'fs' ); -const path = require( 'path' ); -const process = require( 'process' ); -const { glob } = require( 'glob' ); -const svg2ttf = require( 'svg2ttf' ); -const SVGIcons2SVGFontStream = require( 'svgicons2svgfont' ); -const wawoff2 = require( 'wawoff2' ); - // Start in the right folder. -const rootDir = __dirname + '/..'; +const rootDir = fileURLToPath( new URL( '..', import.meta.url ) ); process.chdir( rootDir ); const getCodepoint = name => { @@ -93,7 +95,7 @@ ${ cssCodepoints }*/`; // Make destination dir as needed. fs.mkdirSync( destFontDir, { recursive: true } ); -const codepoints = require( path.resolve( codepointsFile ) ); +const codepoints = JSON.parse( fs.readFileSync( path.resolve( codepointsFile ) ) ); let maxCodepoint = Math.max( ...Object.values( codepoints ) ); let fontBuffer = Buffer.alloc( 0 ); @@ -109,7 +111,7 @@ const fontStream = new SVGIcons2SVGFontStream( { fontStream .on( 'data', data => { // This concats to the font buffer each time a glyph is written. - fontBuffer = Buffer.concat( [ fontBuffer, data ] ); + fontBuffer = Buffer.concat( [ fontBuffer, Buffer.from( data ) ] ); } ) .on( 'finish', async function () { const woff2Buffer = await svg2woff2( fontBuffer );