Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[dependencies-replacement] Replace fast-glob with tinyglobby #232

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/wild-starfishes-report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@manypkg/tools": minor
---

Replace the `fast-glob` dependency with `tinyglobby`
4 changes: 2 additions & 2 deletions packages/tools/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hm, this change actually touches @manypkg/tools and not the CLI itself - that makes me way more worried about this change since tinyglobby might slightly differ in some cases from fast-glob

we might have to consider releasing v2 of this package some time in the future to support the upcoming Changesets v3 release, so maybe that would be the best time to revisit this? wdyt?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I was gonna raise that this change requires releasing new versions of @manypkg/tools and @manypkg/get-packages.

This change does lower the dependency count substantially (by the time everything else merges, it would be by about 30%). However I entirely understand that you don't want it rushed, so just let me know how to best support its eventual merge.

},
"devDependencies": {
"@types/jju": "^1.4.2",
Expand Down
6 changes: 4 additions & 2 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 glob from "fast-glob";
import { glob, globSync } from "tinyglobby";

import { Package, PackageJSON } from "./Tool";
import { readJsonSync } from "./utils";
Expand All @@ -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))
Expand Down Expand Up @@ -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))
Expand Down
15 changes: 14 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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==
Expand Down Expand Up @@ -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"
Expand Down
Loading