Skip to content

Commit

Permalink
switch to fast-glob to remove 6 dependencies (#214)
Browse files Browse the repository at this point in the history
  • Loading branch information
benmccann committed Aug 9, 2024
1 parent 18c0ce3 commit 66cdbc0
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 6 deletions.
5 changes: 5 additions & 0 deletions .changeset/angry-houses-kiss.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@manypkg/tools": patch
---

Replace `globby` with `fast-glob` to remove extra dependencies
2 changes: 1 addition & 1 deletion packages/tools/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"license": "MIT",
"main": "dist/manypkg-tools.cjs.js",
"dependencies": {
"globby": "^11.0.0",
"fast-glob": "^3.3.2",
"jju": "^1.4.0",
"js-yaml": "^4.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 fsp from "fs/promises";
import globby from "globby";
import glob from "fast-glob";

import { Package, PackageJSON } from "./Tool";
import { readJsonSync } from "./utils";
Expand All @@ -14,10 +14,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 @@ -56,10 +55,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 @@ -6046,6 +6046,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 66cdbc0

Please sign in to comment.