diff --git a/.changeset/replace-glob-with-tinyglobby.md b/.changeset/replace-glob-with-tinyglobby.md new file mode 100644 index 000000000000..5ccca8a19142 --- /dev/null +++ b/.changeset/replace-glob-with-tinyglobby.md @@ -0,0 +1,7 @@ +--- +"create-cloudflare": patch +"@cloudflare/pages-shared": patch +--- + +Replace `glob` with `tinyglobby` in build tooling. Remove unused `glob` +dependency from pages-shared. diff --git a/packages/create-cloudflare/package.json b/packages/create-cloudflare/package.json index b95775d1159e..70acdea9ea51 100644 --- a/packages/create-cloudflare/package.json +++ b/packages/create-cloudflare/package.json @@ -70,7 +70,7 @@ "execa": "^7.1.1", "exit-hook": "2.2.1", "get-port": "^7.1.0", - "glob": "^10.3.3", + "tinyglobby": "catalog:default", "haikunator": "^2.1.2", "indent-string": "^5.0.0", "jsonc-parser": "catalog:default", diff --git a/packages/create-cloudflare/scripts/build.ts b/packages/create-cloudflare/scripts/build.ts index b08aebbc67bd..6f691b402fd1 100644 --- a/packages/create-cloudflare/scripts/build.ts +++ b/packages/create-cloudflare/scripts/build.ts @@ -1,6 +1,6 @@ import { cp } from "fs/promises"; import { build, BuildOptions, context } from "esbuild"; -import * as glob from "glob"; +import { globSync } from "tinyglobby"; const run = async () => { const argv = process.argv.slice(2); @@ -28,7 +28,7 @@ const run = async () => { // The latter has been added to the project's .gitignore file // This renaming will be reversed when each template is used // We can continue to author ".gitignore" files in each template - for (const filepath of glob.sync("templates*/**/.gitignore")) { + for (const filepath of globSync("templates*/**/.gitignore")) { await cp(filepath, filepath.replace(".gitignore", "__dot__gitignore")); } }; diff --git a/packages/pages-shared/package.json b/packages/pages-shared/package.json index 531edccb2479..e358f42fd115 100644 --- a/packages/pages-shared/package.json +++ b/packages/pages-shared/package.json @@ -33,7 +33,6 @@ "concurrently": "^8.2.2", "esbuild": "catalog:default", "eslint": "catalog:default", - "glob": "^10.4.5", "html-rewriter-wasm": "^0.4.1", "typescript": "catalog:default", "vitest": "catalog:default" diff --git a/packages/vite-plugin-cloudflare/package.json b/packages/vite-plugin-cloudflare/package.json index aa2527114a23..d75960ed178e 100644 --- a/packages/vite-plugin-cloudflare/package.json +++ b/packages/vite-plugin-cloudflare/package.json @@ -66,7 +66,7 @@ "mlly": "^1.7.4", "picocolors": "^1.1.1", "semver": "^7.7.1", - "tinyglobby": "^0.2.12", + "tinyglobby": "catalog:default", "tree-kill": "catalog:default", "tsdown": "0.16.3", "typescript": "catalog:default", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index e00d07c28a8a..72f4ce96fe0a 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -51,6 +51,9 @@ catalogs: smol-toml: specifier: ^1.5.2 version: 1.5.2 + tinyglobby: + specifier: ^0.2.12 + version: 0.2.15 tree-kill: specifier: ^1.2.2 version: 1.2.2 @@ -1889,9 +1892,6 @@ importers: get-port: specifier: ^7.1.0 version: 7.1.0 - glob: - specifier: ^10.3.3 - version: 10.4.5 haikunator: specifier: ^2.1.2 version: 2.1.2 @@ -1916,6 +1916,9 @@ importers: smol-toml: specifier: catalog:default version: 1.5.2 + tinyglobby: + specifier: catalog:default + version: 0.2.15 tree-kill: specifier: catalog:default version: 1.2.2 @@ -2432,9 +2435,6 @@ importers: eslint: specifier: catalog:default version: 9.39.1(jiti@2.6.1) - glob: - specifier: ^10.4.5 - version: 10.4.5 html-rewriter-wasm: specifier: ^0.4.1 version: 0.4.1 @@ -2653,8 +2653,8 @@ importers: specifier: ^7.7.1 version: 7.7.3 tinyglobby: - specifier: ^0.2.12 - version: 0.2.12 + specifier: catalog:default + version: 0.2.15 tree-kill: specifier: catalog:default version: 1.2.2 @@ -4494,12 +4494,12 @@ importers: eslint: specifier: catalog:default version: 9.39.1(jiti@2.6.1) - glob: - specifier: ^11.0.3 - version: 11.0.3 semver: specifier: ^7.7.1 version: 7.7.3 + tinyglobby: + specifier: catalog:default + version: 0.2.15 ts-dedent: specifier: ^2.2.0 version: 2.2.0 @@ -6877,14 +6877,6 @@ packages: '@types/node': optional: true - '@isaacs/balanced-match@4.0.1': - resolution: {integrity: sha512-yzMTt9lEb8Gv7zRioUilSglI0c0smZ9k5D65677DLWLtWJaXIS3CqcGyUFByYKlnUj6TkjLVs54fBl6+TiGQDQ==} - engines: {node: 20 || >=22} - - '@isaacs/brace-expansion@5.0.0': - resolution: {integrity: sha512-ZT55BDLV0yv0RBm2czMiZ+SqCGO7AvmOM3G/w2xhVPH+te0aKgFjmBvGlL1dH+ql2tgGO3MVrbb3jCKyvpgnxA==} - engines: {node: 20 || >=22} - '@isaacs/cliui@8.0.2': resolution: {integrity: sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==} engines: {node: '>=12'} @@ -10678,14 +10670,6 @@ packages: fd-slicer@1.1.0: resolution: {integrity: sha512-cE1qsB/VwyQozZ+q1dGxR8LBYNZeofhEdUNGSMbQD3Gw2lAzX9Zb3uIU6Ebc/Fmyjo9AWWfnn0AUCHqtevs/8g==} - fdir@6.4.3: - resolution: {integrity: sha512-PMXmW2y1hDDfTSRc9gaXIuCCRpuoz3Kaz8cUelp3smouvfT632ozg2vrT6lJsHKKOF59YLbOGfAWGUcKEfRMQw==} - peerDependencies: - picomatch: ^3 || ^4 - peerDependenciesMeta: - picomatch: - optional: true - fdir@6.5.0: resolution: {integrity: sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==} engines: {node: '>=12.0.0'} @@ -10944,12 +10928,6 @@ packages: deprecated: Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me hasBin: true - glob@11.0.3: - resolution: {integrity: sha512-2Nim7dha1KVkaiF4q6Dj+ngPPMdfvLJEOpZk/jKiUAkqKebpGAWQXAq9z1xu9HKu5lWfqw/FASuccEjyznjPaA==} - engines: {node: 20 || >=22} - deprecated: Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me - hasBin: true - glob@7.2.3: resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==} deprecated: Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me @@ -11537,10 +11515,6 @@ packages: jackspeak@3.4.3: resolution: {integrity: sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==} - jackspeak@4.1.1: - resolution: {integrity: sha512-zptv57P3GpL+O0I7VdMJNBZCu+BPHVQUk55Ft8/QCJjTVxrnJHuVuX/0Bl2A6/+2oyR/ZMEuFKwmzqqZ/U5nPQ==} - engines: {node: 20 || >=22} - javascript-time-ago@2.5.7: resolution: {integrity: sha512-EGvh6K4hpJz0S0aZinbW2EfXDqT/JBB84HfMOFDTzGg7yjpjql9feSgtlG1JQ6b6/NkIxl+PoKSUTEMsatTuTg==} @@ -11972,10 +11946,6 @@ packages: lru-cache@10.4.3: resolution: {integrity: sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==} - lru-cache@11.1.0: - resolution: {integrity: sha512-QIXZUBJUx+2zHUdQujWejBkcD9+cs94tLn0+YL8UrCh+D5sCXZ4c7LaEH48pNwRY3MLDgqUFyhlCyjJPf1WP0A==} - engines: {node: 20 || >=22} - lru-cache@5.1.1: resolution: {integrity: sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==} @@ -12113,10 +12083,6 @@ packages: engines: {node: '>=18.0.0'} hasBin: true - minimatch@10.0.3: - resolution: {integrity: sha512-IPZ167aShDZZUMdRk66cyQAW3qr0WzbHkPdMYa8bzZhlHhO3jALbKdxcaak7W9FfT2rZNpQuUu4Od7ILEpXSaw==} - engines: {node: 20 || >=22} - minimatch@3.0.8: resolution: {integrity: sha512-6FsRAQsxQ61mw+qP1ZzbL9Bc78x2p5OqNgNpnoAFLTrX8n5Kxph0CsnhmKKNXTWjXqU5L0pGPR7hYk+XWZr60Q==} @@ -12575,10 +12541,6 @@ 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.12: resolution: {integrity: sha512-RA1GjUVMnvYFxuqovrEqZoxxW5NUZqbwKtYz/Tt7nXerk0LbLblQmrsgdeOxV5SFHf0UDggjS/bSeOZwt1pmEQ==} @@ -12676,10 +12638,6 @@ packages: resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} engines: {node: '>=8.6'} - picomatch@4.0.2: - resolution: {integrity: sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==} - engines: {node: '>=12'} - picomatch@4.0.3: resolution: {integrity: sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==} engines: {node: '>=12'} @@ -14075,10 +14033,6 @@ packages: resolution: {integrity: sha512-W/KYk+NFhkmsYpuHq5JykngiOCnxeVL8v8dFnqxSD8qEEdRfXk1SDM6JzNqcERbcGYj9tMrDQBYV9cjgnunFIg==} engines: {node: '>=18'} - tinyglobby@0.2.12: - resolution: {integrity: sha512-qkf4trmKSIiMTs/E63cxH+ojC2unam7rJ0WrauAzpT3ECNTxGRMlaXxVbfxMUC/w0LaYk6jQ4y/nGR9uBO3tww==} - engines: {node: '>=12.0.0'} - tinyglobby@0.2.15: resolution: {integrity: sha512-j2Zq4NyQYG5XMST4cbs02Ak8iJUdxRM0XI5QyxXuZOzKOINmWurp3smXu3y5wDcJrptwpSjgXHzIQxR0omXljQ==} engines: {node: '>=12.0.0'} @@ -16437,7 +16391,7 @@ snapshots: devalue: 5.3.2 miniflare: 4.20251210.0 semver: 7.7.3 - vitest: 3.2.3(@types/debug@4.1.12)(@types/node@20.19.9)(@vitest/ui@3.2.3)(jiti@2.6.1)(lightningcss@1.30.2)(msw@2.12.0(@types/node@20.19.9)(typescript@5.8.3))(supports-color@9.2.2)(tsx@4.21.0)(yaml@2.8.1) + vitest: 3.2.3(@types/debug@4.1.12)(@types/node@20.19.9)(@vitest/ui@3.2.3)(jiti@2.6.1)(lightningcss@1.30.2)(msw@2.12.0(@types/node@20.19.9)(typescript@5.9.3))(tsx@4.21.0)(yaml@2.8.1) wrangler: 4.54.0(@cloudflare/workers-types@4.20260305.0) zod: 3.25.76 transitivePeerDependencies: @@ -17514,12 +17468,6 @@ snapshots: optionalDependencies: '@types/node': 20.19.9 - '@isaacs/balanced-match@4.0.1': {} - - '@isaacs/brace-expansion@5.0.0': - dependencies: - '@isaacs/balanced-match': 4.0.1 - '@isaacs/cliui@8.0.2': dependencies: string-width: 5.1.2 @@ -22147,10 +22095,6 @@ snapshots: dependencies: pend: 1.2.0 - fdir@6.4.3(picomatch@4.0.2): - optionalDependencies: - picomatch: 4.0.2 - fdir@6.5.0(picomatch@4.0.3): optionalDependencies: picomatch: 4.0.3 @@ -22475,15 +22419,6 @@ snapshots: package-json-from-dist: 1.0.0 path-scurry: 1.11.1 - glob@11.0.3: - dependencies: - foreground-child: 3.3.1 - jackspeak: 4.1.1 - minimatch: 10.0.3 - minipass: 7.1.2 - package-json-from-dist: 1.0.0 - path-scurry: 2.0.0 - glob@7.2.3: dependencies: fs.realpath: 1.0.0 @@ -23037,10 +22972,6 @@ snapshots: optionalDependencies: '@pkgjs/parseargs': 0.11.0 - jackspeak@4.1.1: - dependencies: - '@isaacs/cliui': 8.0.2 - javascript-time-ago@2.5.7: dependencies: relative-time-format: 1.1.4 @@ -23420,8 +23351,6 @@ snapshots: lru-cache@10.4.3: {} - lru-cache@11.1.0: {} - lru-cache@5.1.1: dependencies: yallist: 3.1.1 @@ -23534,10 +23463,6 @@ snapshots: - bufferutil - utf-8-validate - minimatch@10.0.3: - dependencies: - '@isaacs/brace-expansion': 5.0.0 - minimatch@3.0.8: dependencies: brace-expansion: 1.1.11 @@ -24050,11 +23975,6 @@ snapshots: lru-cache: 10.4.3 minipass: 7.1.2 - path-scurry@2.0.0: - dependencies: - lru-cache: 11.1.0 - minipass: 7.1.2 - path-to-regexp@0.1.12: {} path-to-regexp@6.3.0: {} @@ -24139,8 +24059,6 @@ snapshots: picomatch@2.3.1: {} - picomatch@4.0.2: {} - picomatch@4.0.3: {} pify@3.0.0: {} @@ -25797,11 +25715,6 @@ snapshots: tinyexec@1.0.2: {} - tinyglobby@0.2.12: - dependencies: - fdir: 6.4.3(picomatch@4.0.2) - picomatch: 4.0.2 - tinyglobby@0.2.15: dependencies: fdir: 6.5.0(picomatch@4.0.3) @@ -26231,7 +26144,7 @@ snapshots: rollup: 4.30.1 rollup-plugin-dts: 6.1.1(rollup@4.30.1)(typescript@5.8.3) scule: 1.3.0 - tinyglobby: 0.2.12 + tinyglobby: 0.2.15 untyped: 1.5.2 optionalDependencies: typescript: 5.8.3 diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 7795d5cad087..4646e234c322 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -37,6 +37,7 @@ catalog: eslint: "^9.39.1" jsonc-parser: "^3.2.0" smol-toml: "^1.5.2" + tinyglobby: "^0.2.12" "tree-kill": "^1.2.2" # CAUTION: Most usage of @cloudflare/vitest-pool-workers in this mono repo should use workspace:* instead of this catalog version # However, some packages (pages-shared, workers-shared, etc...) need to be tested using vitest-pool-workers but are themselves diff --git a/tools/deployments/validate-package-dependencies.ts b/tools/deployments/validate-package-dependencies.ts index 3fa63d47db1c..5c25dbb57692 100644 --- a/tools/deployments/validate-package-dependencies.ts +++ b/tools/deployments/validate-package-dependencies.ts @@ -15,7 +15,7 @@ import { existsSync, readFileSync } from "node:fs"; import { dirname, resolve } from "node:path"; -import { glob } from "glob"; +import { glob } from "tinyglobby"; export interface PackageJSON { name: string; diff --git a/tools/deployments/validate-private-packages.ts b/tools/deployments/validate-private-packages.ts index c096ed37283b..26c4be71cd95 100644 --- a/tools/deployments/validate-private-packages.ts +++ b/tools/deployments/validate-private-packages.ts @@ -1,6 +1,6 @@ import { readFileSync } from "node:fs"; import { dirname, resolve } from "node:path"; -import { glob } from "glob"; +import { glob } from "tinyglobby"; import type { PackageJSON } from "./validate-fixtures"; if (require.main === module) { diff --git a/tools/e2e/runIndividualE2EFiles.ts b/tools/e2e/runIndividualE2EFiles.ts index af50a2916ee4..b0252fb2c9bf 100644 --- a/tools/e2e/runIndividualE2EFiles.ts +++ b/tools/e2e/runIndividualE2EFiles.ts @@ -2,7 +2,7 @@ import assert from "node:assert"; import { execSync } from "node:child_process"; import { statSync } from "node:fs"; import path from "node:path"; -import { globIterateSync } from "glob"; +import { globSync } from "tinyglobby"; import type { ExecSyncOptionsWithBufferEncoding } from "node:child_process"; // Turbo only supports caching on the individual task level, but for Wrangler's @@ -34,13 +34,9 @@ const command = const wranglerPath = path.join(__dirname, "../../packages/wrangler"); assert(statSync(wranglerPath).isDirectory()); -let tests = Array.from( - globIterateSync("e2e/**/*.test.ts", { - cwd: wranglerPath, - // Return `/` delimited paths, even on Windows. - posix: true, - }) -); +let tests = globSync("e2e/**/*.test.ts", { + cwd: wranglerPath, +}); const failedTest = new Set(); diff --git a/tools/package.json b/tools/package.json index 319b26c5ab79..e5bf09e0cb1c 100644 --- a/tools/package.json +++ b/tools/package.json @@ -19,8 +19,8 @@ "@typescript-eslint/parser": "catalog:default", "empathic": "^2.0.0", "eslint": "catalog:default", - "glob": "^11.0.3", "semver": "^7.7.1", + "tinyglobby": "catalog:default", "ts-dedent": "^2.2.0", "undici": "catalog:default", "wrangler": "workspace:*"