Skip to content

Commit

Permalink
switch to fast-glob
Browse files Browse the repository at this point in the history
  • Loading branch information
benmccann committed Jul 8, 2024
1 parent aec5096 commit 08a6695
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
2 changes: 1 addition & 1 deletion packages/tools/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"main": "dist/manypkg-tools.cjs.js",
"dependencies": {
"fs-extra": "^8.1.0",
"globby": "^11.0.0",
"fast-glob": "^3.3.2",
"jju": "^1.4.0",
"read-yaml-file": "^1.1.0"
},
Expand Down
8 changes: 3 additions & 5 deletions packages/tools/src/expandPackageGlobs.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import path from "path";
import fs from "fs-extra";
import globby from "globby";
import glob from "fast-glob";

import { Tool, Package, PackageJSON, Packages, MonorepoRoot } from "./Tool";

Expand All @@ -13,10 +13,9 @@ export async function expandPackageGlobs(
packageGlobs: string[],
directory: string
): Promise<Package[]> {
const relativeDirectories: string[] = await globby(packageGlobs, {
const relativeDirectories: string[] = await glob(packageGlobs, {
cwd: directory,
onlyDirectories: true,
expandDirectories: false,
ignore: ["**/node_modules"],
});
const directories = relativeDirectories
Expand Down Expand Up @@ -55,10 +54,9 @@ export function expandPackageGlobsSync(
packageGlobs: string[],
directory: string
): Package[] {
const relativeDirectories: string[] = globby.sync(packageGlobs, {
const relativeDirectories: string[] = glob.sync(packageGlobs, {
cwd: directory,
onlyDirectories: true,
expandDirectories: false,
ignore: ["**/node_modules"],
});
const directories = relativeDirectories
Expand Down
11 changes: 11 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6036,6 +6036,17 @@ fast-glob@^3.2.4:
merge2 "^1.3.0"
micromatch "^4.0.4"

fast-glob@^3.3.2:
version "3.3.2"
resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.3.2.tgz#a904501e57cfdd2ffcded45e99a54fef55e46129"
integrity sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==
dependencies:
"@nodelib/fs.stat" "^2.0.2"
"@nodelib/fs.walk" "^1.2.3"
glob-parent "^5.1.2"
merge2 "^1.3.0"
micromatch "^4.0.4"

fast-json-stable-stringify@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz#d5142c0caee6b1189f87d3a76111064f86c8bbf2"
Expand Down

0 comments on commit 08a6695

Please sign in to comment.