From fe84b3525a38d5f3e5838344f20bb7ed44d0d358 Mon Sep 17 00:00:00 2001 From: Greg Pabian <35925521+grzpab@users.noreply.github.com> Date: Thu, 25 Jan 2024 12:50:52 +0100 Subject: [PATCH] chore: CDMD-2418 replace node-glob with fast-glob --- builder/index.ts | 4 +- builder/package.json | 2 +- .../generate-url-patterns/test/test.ts | 12 +- codemods/next-i18next/copy-keys/test/test.ts | 4 +- .../13/app-directory-boilerplate/test/test.ts | 24 ++-- .../next/13/remove-next-export/test/test.ts | 16 +-- pnpm-lock.yaml | 126 ++++-------------- utilities/index.ts | 7 +- utilities/package.json | 2 +- 9 files changed, 64 insertions(+), 133 deletions(-) diff --git a/builder/index.ts b/builder/index.ts index 132eb584..a2d9f88a 100644 --- a/builder/index.ts +++ b/builder/index.ts @@ -12,7 +12,7 @@ import { writeFile, } from 'node:fs/promises'; import { createHash } from 'node:crypto'; -import { globSync } from 'glob'; +import glob from 'fast-glob'; import * as S from '@effect/schema/Schema'; import { constants } from 'node:fs'; import { deflate } from 'node:zlib'; @@ -128,7 +128,7 @@ const build = async () => { const codemodsDirectoryPath = join(cwd, './codemods'); - const configFilePaths = globSync('./**/config.json', { + const configFilePaths = await glob('./**/config.json', { cwd: codemodsDirectoryPath, dot: false, ignore: ['**/node_modules/**', '**/build/**'], diff --git a/builder/package.json b/builder/package.json index d5756eea..142c62d7 100644 --- a/builder/package.json +++ b/builder/package.json @@ -3,7 +3,7 @@ "type": "module", "dependencies": { "@effect/schema": "^0.48.4", - "glob": "^10.3.10", + "fast-glob": "3.3.2", "tar": "^6.2.0" }, "devDependencies": { diff --git a/codemods/cal.com/generate-url-patterns/test/test.ts b/codemods/cal.com/generate-url-patterns/test/test.ts index 41f03654..ae513a37 100644 --- a/codemods/cal.com/generate-url-patterns/test/test.ts +++ b/codemods/cal.com/generate-url-patterns/test/test.ts @@ -54,9 +54,9 @@ const removeWhitespaces = ( describe('generate-url-patterns', function () { it('should build correct files', async function () { const [ - turboJsonCommand, - middlewareTsCommand, abTestMiddlewareTsCommand, + middlewareTsCommand, + turboJsonCommand, ] = await transform( { '/opt/project/turbo.json': JSON.stringify({ @@ -150,12 +150,12 @@ describe('generate-url-patterns', function () { "/noSegment", "/future/noSegment/", - "/dynamicSegment/:a", - "/future/dynamicSegment/:a/", - "/catchAllDynamicSegments/:d+", "/future/catchAllDynamicSegments/:d+/", + "/dynamicSegment/:a", + "/future/dynamicSegment/:a/", + "/dynamicSegment/:b/:c", "/future/dynamicSegment/:b/:c/", @@ -169,7 +169,7 @@ describe('generate-url-patterns', function () { }); it('should support generateAsPageGroup option', async function () { - const [turboJsonCommand, abTestMiddlewareTsCommand] = await transform( + const [abTestMiddlewareTsCommand, turboJsonCommand] = await transform( { '/opt/project/turbo.json': JSON.stringify({ globalEnv: ['OTHER_ENVVAR'], diff --git a/codemods/next-i18next/copy-keys/test/test.ts b/codemods/next-i18next/copy-keys/test/test.ts index f6563c35..05413002 100644 --- a/codemods/next-i18next/copy-keys/test/test.ts +++ b/codemods/next-i18next/copy-keys/test/test.ts @@ -43,7 +43,7 @@ describe('next-i18n copy keys', function () { } `; - const [upsertEnDataCommand, upsertDeDataCommand] = await transform( + const [upsertDeDataCommand, upsertEnDataCommand] = await transform( { '/opt/project/public/static/locales/en/common.json': EN_COMMON_JSON, @@ -113,7 +113,7 @@ describe('next-i18n copy keys', function () { } `; - const [upsertEnDataCommand, upsertDeDataCommand] = await transform( + const [upsertDeDataCommand, upsertEnDataCommand] = await transform( { '/opt/project/public/static/locales/en/common.json': EN_COMMON_JSON, diff --git a/codemods/next/13/app-directory-boilerplate/test/test.ts b/codemods/next/13/app-directory-boilerplate/test/test.ts index 1a76bb30..283fb840 100644 --- a/codemods/next/13/app-directory-boilerplate/test/test.ts +++ b/codemods/next/13/app-directory-boilerplate/test/test.ts @@ -474,7 +474,7 @@ describe('next 13 app-directory-boilerplate', function () { } `; - const [upsertLayoutCommand, upsertLayoutClientComponentCommand] = + const [, , upsertLayoutCommand, upsertLayoutClientComponentCommand] = await transform({ '/opt/project/pages/_app.tsx': _app, '/opt/project/pages/_document.tsx': _document, @@ -567,7 +567,7 @@ describe('next 13 app-directory-boilerplate', function () { } `; - const [upsertLayoutCommand, upsertLayoutClientComponentCommand] = + const [, , upsertLayoutCommand, upsertLayoutClientComponentCommand] = await transform({ '/opt/project/pages/_app.tsx': _app, '/opt/project/pages/_document.tsx': _document, @@ -640,13 +640,19 @@ describe('next 13 app-directory-boilerplate', function () { } `; - // eslint-disable-next-line @typescript-eslint/no-unused-vars - const [upsertLayoutCommand, , upsertPageCommand, _, deleteFileCommand] = - await transform({ - '/opt/project/pages/index.tsx': index, - '/opt/project/pages/_document.tsx': '', - '/opt/project/pages/_app.tsx': '', - }); + const [ + , + , + upsertLayoutCommand, + , + upsertPageCommand, + , + deleteFileCommand, + ] = await transform({ + '/opt/project/pages/index.tsx': index, + '/opt/project/pages/_document.tsx': '', + '/opt/project/pages/_app.tsx': '', + }); deepStrictEqual(upsertLayoutCommand?.kind, 'upsertFile'); deepStrictEqual( diff --git a/codemods/next/13/remove-next-export/test/test.ts b/codemods/next/13/remove-next-export/test/test.ts index d41da835..3c12bc23 100644 --- a/codemods/next/13/remove-next-export/test/test.ts +++ b/codemods/next/13/remove-next-export/test/test.ts @@ -81,13 +81,13 @@ describe('next 13 remove-next-export', function () { }, { kind: 'upsertFile', - path: '/opt/project/pages/script_c.sh', - data: '\n', + path: '/opt/project/pages/README.md', + data: '\n# Header\n', }, { + data: '\nmodule.exports = {\n\tdistDir: \'out\',\n output: "export"\n}', kind: 'upsertFile', - path: '/opt/project/pages/script_b.sh', - data: '\nnpm run next build\n', + path: '/opt/project/pages/next.config.js', }, { kind: 'upsertFile', @@ -95,14 +95,14 @@ describe('next 13 remove-next-export', function () { data: '\nnode_modules/.bin/next build\n', }, { - data: '\nmodule.exports = {\n\tdistDir: \'out\',\n output: "export"\n}', kind: 'upsertFile', - path: '/opt/project/pages/next.config.js', + path: '/opt/project/pages/script_b.sh', + data: '\nnpm run next build\n', }, { kind: 'upsertFile', - path: '/opt/project/pages/README.md', - data: '\n# Header\n', + path: '/opt/project/pages/script_c.sh', + data: '\n', }, ]); }); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index fb4fcb60..ec62fc0e 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -59,9 +59,9 @@ importers: '@effect/schema': specifier: ^0.48.4 version: 0.48.4(effect@2.0.0-next.55)(fast-check@3.15.0) - glob: - specifier: ^10.3.10 - version: 10.3.10 + fast-glob: + specifier: 3.3.2 + version: 3.3.2 tar: specifier: ^6.2.0 version: 6.2.0 @@ -4221,9 +4221,9 @@ importers: '@intuita-inc/filemod': specifier: 2.0.0 version: 2.0.0 - glob: - specifier: 10.3.10 - version: 10.3.10 + fast-glob: + specifier: 3.3.2 + version: 3.3.2 jscodeshift: specifier: ^0.15.1 version: 0.15.1 @@ -6247,18 +6247,6 @@ packages: /@intuita-inc/filemod@2.0.0: resolution: {integrity: sha512-fGFJ5gfX2NQi2ugqEcxClCplj8jVPYO1YIvOJLNVv9vSb/mNvHkuT6HC//Q3knVe7I0KJ2LkxaUZDs//ElAelA==} - /@isaacs/cliui@8.0.2: - resolution: {integrity: sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==} - engines: {node: '>=12'} - dependencies: - string-width: 5.1.2 - string-width-cjs: /string-width@4.2.3 - strip-ansi: 7.1.0 - strip-ansi-cjs: /strip-ansi@6.0.1 - wrap-ansi: 8.1.0 - wrap-ansi-cjs: /wrap-ansi@7.0.0 - dev: false - /@istanbuljs/schema@0.1.3: resolution: {integrity: sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==} engines: {node: '>=8'} @@ -6321,12 +6309,10 @@ packages: dependencies: '@nodelib/fs.stat': 2.0.5 run-parallel: 1.2.0 - dev: true /@nodelib/fs.stat@2.0.5: resolution: {integrity: sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==} engines: {node: '>= 8'} - dev: true /@nodelib/fs.walk@1.2.8: resolution: {integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==} @@ -6334,21 +6320,13 @@ packages: dependencies: '@nodelib/fs.scandir': 2.1.5 fastq: 1.15.0 - dev: true - - /@pkgjs/parseargs@0.11.0: - resolution: {integrity: sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==} - engines: {node: '>=14'} - requiresBuild: true - dev: false - optional: true /@pkgr/utils@2.4.2: resolution: {integrity: sha512-POgTXhjrTfbTV63DiFXav4lBHiICLKKwDeaKn9Nphwj7WH6m0hMMCaJkMyRWjgtPFyRKRVoMXXjczsTQRDEhYw==} engines: {node: ^12.20.0 || ^14.18.0 || >=16.0.0} dependencies: cross-spawn: 7.0.3 - fast-glob: 3.3.0 + fast-glob: 3.3.2 is-glob: 4.0.3 open: 9.1.0 picocolors: 1.0.0 @@ -6496,7 +6474,7 @@ packages: /@ts-morph/common@0.20.0: resolution: {integrity: sha512-7uKjByfbPpwuzkstL3L5MQyuXPSKdoNG93Fmi2JoDcTf3pEP731JdRFAduRVkOs8oqxPsXKA+ScrWkdQ8t/I+Q==} dependencies: - fast-glob: 3.3.0 + fast-glob: 3.3.2 minimatch: 7.4.6 mkdirp: 2.1.6 path-browserify: 1.0.1 @@ -6859,6 +6837,7 @@ packages: /ansi-regex@6.0.1: resolution: {integrity: sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==} engines: {node: '>=12'} + dev: true /ansi-styles@3.2.1: resolution: {integrity: sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==} @@ -6880,6 +6859,7 @@ packages: /ansi-styles@6.2.1: resolution: {integrity: sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==} engines: {node: '>=12'} + dev: true /arg@4.1.3: resolution: {integrity: sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==} @@ -7062,6 +7042,7 @@ packages: resolution: {integrity: sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==} dependencies: balanced-match: 1.0.2 + dev: true /braces@3.0.2: resolution: {integrity: sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==} @@ -7275,6 +7256,7 @@ packages: path-key: 3.1.1 shebang-command: 2.0.0 which: 2.0.2 + dev: true /debug@4.3.4: resolution: {integrity: sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==} @@ -7383,6 +7365,7 @@ packages: /eastasianwidth@0.2.0: resolution: {integrity: sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==} + dev: true /effect@2.0.0-next.55: resolution: {integrity: sha512-kNOB/HaDSdaFSDVXK2gyf4XcTKbKKlllyoS871uDyoJskcc+024sSOHnNioXZPgkqaz55a3mad4DFfLUIETwYQ==} @@ -7405,6 +7388,7 @@ packages: /emoji-regex@9.2.2: resolution: {integrity: sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==} + dev: true /es-abstract@1.22.1: resolution: {integrity: sha512-ioRRcXMO6OFyRpyzV3kE1IIBd4WG5/kltnzdxSCqoP8CMGs/Li+M1uF5o7lOkZVFjDs+NLesthnF66Pg/0q0Lw==} @@ -7810,8 +7794,8 @@ packages: resolution: {integrity: sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw==} dev: true - /fast-glob@3.3.0: - resolution: {integrity: sha512-ChDuvbOypPuNjO8yIDf36x7BlZX1smcUMTTcyoIjycexOxd6DFsKsg21qVBzEmr3G7fUKIRy2/psii+CIUt7FA==} + /fast-glob@3.3.2: + resolution: {integrity: sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==} engines: {node: '>=8.6.0'} dependencies: '@nodelib/fs.stat': 2.0.5 @@ -7819,7 +7803,6 @@ packages: glob-parent: 5.1.2 merge2: 1.4.1 micromatch: 4.0.5 - dev: true /fast-json-stable-stringify@2.1.0: resolution: {integrity: sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==} @@ -7833,7 +7816,6 @@ packages: resolution: {integrity: sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==} dependencies: reusify: 1.0.4 - dev: true /file-entry-cache@6.0.1: resolution: {integrity: sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==} @@ -7891,14 +7873,6 @@ packages: dependencies: is-callable: 1.2.7 - /foreground-child@3.1.1: - resolution: {integrity: sha512-TMKDUnIte6bfb5nWv7V/caI169OHgvwjb7V4WkeUvbQQdjr5rWKqHFiKWb/fcOwB+CzBT+qbWjvj+DVwRskpIg==} - engines: {node: '>=14'} - dependencies: - cross-spawn: 7.0.3 - signal-exit: 4.0.2 - dev: false - /fs-minipass@2.1.0: resolution: {integrity: sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==} engines: {node: '>= 8'} @@ -7988,7 +7962,6 @@ packages: engines: {node: '>= 6'} dependencies: is-glob: 4.0.3 - dev: true /glob-parent@6.0.2: resolution: {integrity: sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==} @@ -7997,18 +7970,6 @@ packages: is-glob: 4.0.3 dev: true - /glob@10.3.10: - resolution: {integrity: sha512-fa46+tv1Ak0UPK1TOy/pZrIybNNt4HCv7SDzwyfiOZkvZLEbjsZkJBPtDHVshZjbecAoAGSC20MjLDG/qr679g==} - engines: {node: '>=16 || 14 >=14.17'} - hasBin: true - dependencies: - foreground-child: 3.1.1 - jackspeak: 2.3.6 - minimatch: 9.0.3 - minipass: 6.0.2 - path-scurry: 1.10.1 - dev: false - /glob@7.2.3: resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==} dependencies: @@ -8043,7 +8004,7 @@ packages: dependencies: array-union: 2.1.0 dir-glob: 3.0.1 - fast-glob: 3.3.0 + fast-glob: 3.3.2 ignore: 5.2.4 merge2: 1.4.1 slash: 3.0.0 @@ -8252,7 +8213,6 @@ packages: /is-extglob@2.1.1: resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==} engines: {node: '>=0.10.0'} - dev: true /is-fullwidth-code-point@3.0.0: resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==} @@ -8275,7 +8235,6 @@ packages: engines: {node: '>=0.10.0'} dependencies: is-extglob: 2.1.1 - dev: true /is-hexadecimal@2.0.1: resolution: {integrity: sha512-DgZQp241c8oO6cA1SbTEWiXeoxV42vlcJxgH+B3hi1AiqqKruZR3ZGF8In3fj4+/y/7rHvlOZLZtgJ/4ttYGZg==} @@ -8390,6 +8349,7 @@ packages: /isexe@2.0.0: resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==} + dev: true /isobject@3.0.1: resolution: {integrity: sha512-WhB9zCku7EGTj/HQQRz5aUQEUeoQZH2bWcltRErOpymJ4boYE6wL9Tbr23krRPSZ+C5zqNSrSw+Cc7sZZ4b7vg==} @@ -8428,15 +8388,6 @@ packages: istanbul-lib-report: 3.0.1 dev: true - /jackspeak@2.3.6: - resolution: {integrity: sha512-N3yCS/NegsOBokc8GAdM8UcmfsKiSS8cipheD/nivzr700H+nsMOxJjQnvwOcRYVuFkdH0wGUvW2WbXGmrZGbQ==} - engines: {node: '>=14'} - dependencies: - '@isaacs/cliui': 8.0.2 - optionalDependencies: - '@pkgjs/parseargs': 0.11.0 - dev: false - /js-tokens@4.0.0: resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} @@ -8683,11 +8634,6 @@ packages: get-func-name: 2.0.2 dev: true - /lru-cache@10.0.0: - resolution: {integrity: sha512-svTf/fzsKHffP42sujkO/Rjs37BCIsQVRCeNYIm9WN8rgT7ffoUnRtZCqU+6BqcSBdv8gwJeTz8knJpgACeQMw==} - engines: {node: 14 || >=16.14} - dev: false - /lru-cache@5.1.1: resolution: {integrity: sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==} dependencies: @@ -8857,7 +8803,6 @@ packages: /merge2@1.4.1: resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==} engines: {node: '>= 8'} - dev: true /micromark-core-commonmark@2.0.0: resolution: {integrity: sha512-jThOz/pVmAYUtkroV3D5c1osFXAMv9e0ypGDOIZuCeAe91/sD6BoE2Sjzt30yuXtwOYUmySOhMas/PVyh02itA==} @@ -9150,13 +9095,6 @@ packages: brace-expansion: 2.0.1 dev: true - /minimatch@9.0.3: - resolution: {integrity: sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==} - engines: {node: '>=16 || 14 >=14.17'} - dependencies: - brace-expansion: 2.0.1 - dev: false - /minipass@3.3.6: resolution: {integrity: sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==} engines: {node: '>=8'} @@ -9174,11 +9112,6 @@ packages: engines: {node: '>=8'} dev: false - /minipass@6.0.2: - resolution: {integrity: sha512-MzWSV5nYVT7mVyWCwn2o7JH13w2TBRmmSqSRCKzTw+lmft9X4z+3wjvs06Tzijo5z4W/kahUCDpRXTF+ZrmF/w==} - engines: {node: '>=16 || 14 >=14.17'} - dev: false - /minizlib@2.1.2: resolution: {integrity: sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==} engines: {node: '>= 8'} @@ -9446,6 +9379,7 @@ packages: /path-key@3.1.1: resolution: {integrity: sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==} engines: {node: '>=8'} + dev: true /path-key@4.0.0: resolution: {integrity: sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==} @@ -9456,14 +9390,6 @@ packages: resolution: {integrity: sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==} dev: true - /path-scurry@1.10.1: - resolution: {integrity: sha512-MkhCqzzBEpPvxxQ71Md0b1Kk51W01lrYvlMzSUaIzNsODdd7mqhiimSZlr+VegAz5Z6Vzt9Xg2ttE//XBhH3EQ==} - engines: {node: '>=16 || 14 >=14.17'} - dependencies: - lru-cache: 10.0.0 - minipass: 6.0.2 - dev: false - /path-to-regexp@1.8.0: resolution: {integrity: sha512-n43JRhlUKUAlibEJhPeir1ncUID16QnEjNpwzNdO3Lm4ywrBpBZ5oLD0I6br9evr1Y9JTqwRtAh7JLoOzAQdVA==} dependencies: @@ -9573,7 +9499,6 @@ packages: /queue-microtask@1.2.3: resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} - dev: true /quill-delta@5.1.0: resolution: {integrity: sha512-X74oCeRI4/p0ucjb5Ma8adTXd9Scumz367kkMK5V/IatcX6A0vlgLgKbzXWy5nZmCGeNJm2oQX0d2Eqj+ZIlCA==} @@ -9714,7 +9639,6 @@ packages: /reusify@1.0.4: resolution: {integrity: sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==} engines: {iojs: '>=1.0.0', node: '>=0.10.0'} - dev: true /rfdc@1.3.0: resolution: {integrity: sha512-V2hovdzFbOi77/WajaSMXk2OLm+xNIeQdMMuB7icj7bk6zi2F8GGAxigcnDFpJHbNyNcgyJDiP+8nOrY5cZGrA==} @@ -9765,7 +9689,6 @@ packages: resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==} dependencies: queue-microtask: 1.2.3 - dev: true /rxjs@7.8.1: resolution: {integrity: sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg==} @@ -9818,10 +9741,12 @@ packages: engines: {node: '>=8'} dependencies: shebang-regex: 3.0.0 + dev: true /shebang-regex@3.0.0: resolution: {integrity: sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==} engines: {node: '>=8'} + dev: true /side-channel@1.0.4: resolution: {integrity: sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==} @@ -9838,11 +9763,6 @@ packages: /signal-exit@3.0.7: resolution: {integrity: sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==} - /signal-exit@4.0.2: - resolution: {integrity: sha512-MY2/qGx4enyjprQnFaZsHib3Yadh3IXyV2C321GY0pjGfVBu4un0uDJkwgdxqO+Rdx8JMT8IfJIRwbYVz3Ob3Q==} - engines: {node: '>=14'} - dev: false - /signal-exit@4.1.0: resolution: {integrity: sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==} engines: {node: '>=14'} @@ -9927,6 +9847,7 @@ packages: eastasianwidth: 0.2.0 emoji-regex: 9.2.2 strip-ansi: 7.1.0 + dev: true /string.prototype.matchall@4.0.8: resolution: {integrity: sha512-6zOCOcJ+RJAQshcTvXPHoxoQGONa3e/Lqx90wUA+wEzX78sg5Bo+1tQo4N0pohS0erG9qtCqJDjNCQBjeWVxyg==} @@ -9984,6 +9905,7 @@ packages: engines: {node: '>=12'} dependencies: ansi-regex: 6.0.1 + dev: true /strip-final-newline@2.0.0: resolution: {integrity: sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==} @@ -10734,6 +10656,7 @@ packages: hasBin: true dependencies: isexe: 2.0.0 + dev: true /why-is-node-running@2.2.2: resolution: {integrity: sha512-6tSwToZxTOcotxHeA+qGCq1mVzKR3CwcJGmVcY+QE8SHy6TnpFnh8PAvPNHYr7EcuVeG0QSMxtYCuO1ta/G/oA==} @@ -10760,6 +10683,7 @@ packages: ansi-styles: 6.2.1 string-width: 5.1.2 strip-ansi: 7.1.0 + dev: true /wrappy@1.0.2: resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} diff --git a/utilities/index.ts b/utilities/index.ts index d6561fac..08c33e47 100644 --- a/utilities/index.ts +++ b/utilities/index.ts @@ -6,7 +6,7 @@ import { PathAPI, UnifiedFileSystem, } from '@intuita-inc/filemod'; -import { FSOption, GlobOptionsWithFileTypesUnset, glob } from 'glob'; +import { FileSystemAdapter, glob } from 'fast-glob'; import jscodeshift, { API } from 'jscodeshift'; import { createHash } from 'node:crypto'; import { basename, dirname, join } from 'node:path'; @@ -57,8 +57,9 @@ export const buildGlobWrapper = absolute: true, cwd: globArguments.currentWorkingDirectory, ignore: globArguments.excludePatterns.slice(), - fs: fileSystem as unknown as FSOption, - } satisfies GlobOptionsWithFileTypesUnset); + fs: fileSystem as Partial, + onlyFiles: true, + }); }; export const buildReadDirectory = diff --git a/utilities/package.json b/utilities/package.json index bc0a12ed..d4c8106b 100644 --- a/utilities/package.json +++ b/utilities/package.json @@ -9,6 +9,6 @@ "dependencies": { "jscodeshift": "^0.15.1", "@intuita-inc/filemod": "2.0.0", - "glob": "10.3.10" + "fast-glob": "3.3.2" } }