From b5ed145023dcb6bba1f34bd433b73e9785fce8d3 Mon Sep 17 00:00:00 2001 From: Ivan Tanev Date: Wed, 16 Oct 2024 00:10:58 +0300 Subject: [PATCH 1/2] Replace fast-glob with tinyglobby --- packages/tools/package.json | 4 ++-- packages/tools/src/expandPackageGlobs.ts | 6 ++++-- yarn.lock | 15 ++++++++++++++- 3 files changed, 20 insertions(+), 5 deletions(-) diff --git a/packages/tools/package.json b/packages/tools/package.json index 6a1e5d2..6bd2f03 100644 --- a/packages/tools/package.json +++ b/packages/tools/package.json @@ -9,9 +9,9 @@ "license": "MIT", "main": "dist/manypkg-tools.cjs.js", "dependencies": { - "fast-glob": "^3.3.2", "jju": "^1.4.0", - "js-yaml": "^4.1.0" + "js-yaml": "^4.1.0", + "tinyglobby": "^0.2.9" }, "devDependencies": { "@types/jju": "^1.4.2", diff --git a/packages/tools/src/expandPackageGlobs.ts b/packages/tools/src/expandPackageGlobs.ts index f9f3097..0aedb44 100644 --- a/packages/tools/src/expandPackageGlobs.ts +++ b/packages/tools/src/expandPackageGlobs.ts @@ -1,6 +1,6 @@ import path from "path"; import fsp from "fs/promises"; -import glob from "fast-glob"; +import { glob, globSync } from "tinyglobby"; import { Package, PackageJSON } from "./Tool"; import { readJsonSync } from "./utils"; @@ -18,6 +18,7 @@ export async function expandPackageGlobs( cwd: directory, onlyDirectories: true, ignore: ["**/node_modules"], + expandDirectories: false, }); const directories = relativeDirectories .map((p) => path.resolve(directory, p)) @@ -55,10 +56,11 @@ export function expandPackageGlobsSync( packageGlobs: string[], directory: string ): Package[] { - const relativeDirectories: string[] = glob.sync(packageGlobs, { + const relativeDirectories: string[] = globSync(packageGlobs, { cwd: directory, onlyDirectories: true, ignore: ["**/node_modules"], + expandDirectories: false, }); const directories = relativeDirectories .map((p) => path.resolve(directory, p)) diff --git a/yarn.lock b/yarn.lock index ea26824..33de7a7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6172,6 +6172,11 @@ fbjs@^1.0.0: setimmediate "^1.0.5" ua-parser-js "^0.7.18" +fdir@^6.4.0: + version "6.4.0" + resolved "https://registry.yarnpkg.com/fdir/-/fdir-6.4.0.tgz#8e80ab4b18a2ac24beebf9d20d71e1bc2627dbae" + integrity sha512-3oB133prH1o4j/L5lLW7uOCF1PlD+/It2L0eL/iAqWMB91RBbqTewABqxhj0ibBd90EEmWZq7ntIWzVaWcXTGQ== + figgy-pudding@^3.5.1: version "3.5.1" resolved "https://registry.yarnpkg.com/figgy-pudding/-/figgy-pudding-3.5.1.tgz#862470112901c727a0e495a80744bd5baa1d6790" @@ -11424,7 +11429,7 @@ picomatch@^2.2.2, picomatch@^2.2.3, picomatch@^2.3.1: resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42" integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== -picomatch@^4.0.1: +picomatch@^4.0.1, picomatch@^4.0.2: version "4.0.2" resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-4.0.2.tgz#77c742931e8f3b8820946c76cd0c1f13730d1dab" integrity sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg== @@ -14199,6 +14204,14 @@ timsort@^0.3.0: resolved "https://registry.yarnpkg.com/timsort/-/timsort-0.3.0.tgz#405411a8e7e6339fe64db9a234de11dc31e02bd4" integrity sha1-QFQRqOfmM5/mTbmiNN4R3DHgK9Q= +tinyglobby@^0.2.9: + version "0.2.9" + resolved "https://registry.yarnpkg.com/tinyglobby/-/tinyglobby-0.2.9.tgz#6baddd1b0fe416403efb0dd40442c7d7c03c1c66" + integrity sha512-8or1+BGEdk1Zkkw2ii16qSS7uVrQJPre5A9o/XkWPATkk23FZh/15BKFxPnlTy6vkljZxLqYCzzBMj30ZrSvjw== + dependencies: + fdir "^6.4.0" + picomatch "^4.0.2" + title-case@^2.1.0: version "2.1.1" resolved "https://registry.yarnpkg.com/title-case/-/title-case-2.1.1.tgz#3e127216da58d2bc5becf137ab91dae3a7cd8faa" From 964ccdcbff836374d5c211b737d0071de876040c Mon Sep 17 00:00:00 2001 From: Ivan Tanev Date: Wed, 16 Oct 2024 00:13:51 +0300 Subject: [PATCH 2/2] changeset --- .changeset/wild-starfishes-report.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/wild-starfishes-report.md diff --git a/.changeset/wild-starfishes-report.md b/.changeset/wild-starfishes-report.md new file mode 100644 index 0000000..66105d5 --- /dev/null +++ b/.changeset/wild-starfishes-report.md @@ -0,0 +1,5 @@ +--- +"@manypkg/tools": minor +--- + +Replace the `fast-glob` dependency with `tinyglobby`