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

chore: switch from globby to tinyglobby #455

Open
wants to merge 1 commit 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
2 changes: 1 addition & 1 deletion packages/node-plop/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,13 @@
"@types/inquirer": "^9.0.7",
"change-case": "^5.3.0",
"del": "^7.1.0",
"globby": "^14.0.0",
"handlebars": "^4.7.8",
"inquirer": "^9.2.12",
"isbinaryfile": "^5.0.0",
"lodash.get": "^4.4.2",
"mkdirp": "^3.0.1",
"resolve": "^1.22.8",
"tinyglobby": "^0.2.9",
"title-case": "^4.2.0"
}
}
4 changes: 2 additions & 2 deletions packages/node-plop/src/actions/addMany.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import path from "path";
import fs from "fs";
import { globbySync } from "globby";
import { globSync } from "tinyglobby";
import actionInterfaceTest from "./_common-action-interface-check.js";
import addFile from "./_common-action-add-file.js";
import { normalizePath } from "./_common-action-utils.js";
Expand Down Expand Up @@ -64,7 +64,7 @@ export default async function (data, userConfig, plop) {

function resolveTemplateFiles(templateFilesGlob, basePath, globOptions, plop) {
globOptions = Object.assign({ cwd: plop.getPlopfilePath() }, globOptions);
return globbySync(
return globSync(
templateFilesGlob,
Object.assign({ braceExpansion: false }, globOptions),
)
Expand Down
5 changes: 1 addition & 4 deletions packages/node-plop/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,7 @@ import inquirer, {

type Inquirer = typeof inquirer;

// @types/globby doesn't export types for GlobOptions, so we have to work a little bit to extract them:
// GlobOptions is the second parameter of the sync function, which can be extracted with the Parameters<T> type
import { globbySync } from "globby";
type GlobOptions = Parameters<typeof globbySync>[1];
import { type GlobOptions } from "tinyglobby";
import { HelperDelegate as HelperFunction } from "handlebars";

export interface IncludeDefinitionConfig {
Expand Down
86 changes: 30 additions & 56 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1107,13 +1107,6 @@ __metadata:
languageName: node
linkType: hard

"@sindresorhus/merge-streams@npm:^1.0.0":
version: 1.0.0
resolution: "@sindresorhus/merge-streams@npm:1.0.0"
checksum: 453c2a28164113a5ec4fd23ba636e291a4112f6ee9e91cd5476b9a96e0fc9ee5ff40d405fe81bbf284c9773b7ed718a3a0f31df7895a0efd413b1f9775d154fe
languageName: node
linkType: hard

"@tootallnate/once@npm:2":
version: 2.0.0
resolution: "@tootallnate/once@npm:2.0.0"
Expand Down Expand Up @@ -3369,19 +3362,6 @@ __metadata:
languageName: node
linkType: hard

"fast-glob@npm:^3.3.2":
version: 3.3.2
resolution: "fast-glob@npm:3.3.2"
dependencies:
"@nodelib/fs.stat": "npm:^2.0.2"
"@nodelib/fs.walk": "npm:^1.2.3"
glob-parent: "npm:^5.1.2"
merge2: "npm:^1.3.0"
micromatch: "npm:^4.0.4"
checksum: 222512e9315a0efca1276af9adb2127f02105d7288fa746145bf45e2716383fb79eb983c89601a72a399a56b7c18d38ce70457c5466218c5f13fad957cee16df
languageName: node
linkType: hard

"fast-json-stable-stringify@npm:^2.0.0":
version: 2.1.0
resolution: "fast-json-stable-stringify@npm:2.1.0"
Expand All @@ -3405,6 +3385,18 @@ __metadata:
languageName: node
linkType: hard

"fdir@npm:^6.4.0":
version: 6.4.0
resolution: "fdir@npm:6.4.0"
peerDependencies:
picomatch: ^3 || ^4
peerDependenciesMeta:
picomatch:
optional: true
checksum: e45d7c5d349ef4a4835c788944dae7ac5de7aab159511bc3ce8bc62164d4a25cb915c6d2f400886a9ed6f9d9cf38de394b71cb73935408c90eeafa0a8f6cc377
languageName: node
linkType: hard

"figures@npm:^1.3.5, figures@npm:^1.4.0":
version: 1.7.0
resolution: "figures@npm:1.7.0"
Expand Down Expand Up @@ -3986,20 +3978,6 @@ __metadata:
languageName: node
linkType: hard

"globby@npm:^14.0.0":
version: 14.0.0
resolution: "globby@npm:14.0.0"
dependencies:
"@sindresorhus/merge-streams": "npm:^1.0.0"
fast-glob: "npm:^3.3.2"
ignore: "npm:^5.2.4"
path-type: "npm:^5.0.0"
slash: "npm:^5.1.0"
unicorn-magic: "npm:^0.1.0"
checksum: 6e7d84bbc69d8d21a07507af090998c6546c385702a350ff14f6fb08207f90ed40bd41c7b19c11a23851c3b86666e79503373e0f8b400a91a29b13952b1e960c
languageName: node
linkType: hard

"gopd@npm:^1.0.1":
version: 1.0.1
resolution: "gopd@npm:1.0.1"
Expand Down Expand Up @@ -5883,14 +5861,14 @@ __metadata:
change-case: "npm:^5.3.0"
del: "npm:^7.1.0"
dtslint: "npm:^4.2.1"
globby: "npm:^14.0.0"
handlebars: "npm:^4.7.8"
inquirer: "npm:^9.2.12"
isbinaryfile: "npm:^5.0.0"
lodash.get: "npm:^4.4.2"
mkdirp: "npm:^3.0.1"
plop-pack-fancy-comments: "npm:^0.2.1"
resolve: "npm:^1.22.8"
tinyglobby: "npm:^0.2.9"
title-case: "npm:^4.2.0"
typescript: "npm:^5.3.3"
vitest: "npm:^1.1.0"
Expand Down Expand Up @@ -6452,13 +6430,6 @@ __metadata:
languageName: node
linkType: hard

"path-type@npm:^5.0.0":
version: 5.0.0
resolution: "path-type@npm:5.0.0"
checksum: 15ec24050e8932c2c98d085b72cfa0d6b4eeb4cbde151a0a05726d8afae85784fc5544f733d8dfc68536587d5143d29c0bd793623fad03d7e61cc00067291cd5
languageName: node
linkType: hard

"pathe@npm:^1.1.0, pathe@npm:^1.1.1":
version: 1.1.1
resolution: "pathe@npm:1.1.1"
Expand Down Expand Up @@ -6494,6 +6465,13 @@ __metadata:
languageName: node
linkType: hard

"picomatch@npm:^4.0.2":
version: 4.0.2
resolution: "picomatch@npm:4.0.2"
checksum: ce617b8da36797d09c0baacb96ca8a44460452c89362d7cb8f70ca46b4158ba8bc3606912de7c818eb4a939f7f9015cef3c766ec8a0c6bfc725fdc078e39c717
languageName: node
linkType: hard

"pidtree@npm:0.6.0":
version: 0.6.0
resolution: "pidtree@npm:0.6.0"
Expand Down Expand Up @@ -7360,13 +7338,6 @@ __metadata:
languageName: node
linkType: hard

"slash@npm:^5.1.0":
version: 5.1.0
resolution: "slash@npm:5.1.0"
checksum: 2c41ec6fb1414cd9bba0fa6b1dd00e8be739e3fe85d079c69d4b09ca5f2f86eafd18d9ce611c0c0f686428638a36c272a6ac14799146a8295f259c10cc45cde4
languageName: node
linkType: hard

"slice-ansi@npm:^4.0.0":
version: 4.0.0
resolution: "slice-ansi@npm:4.0.0"
Expand Down Expand Up @@ -7931,6 +7902,16 @@ __metadata:
languageName: node
linkType: hard

"tinyglobby@npm:^0.2.9":
version: 0.2.9
resolution: "tinyglobby@npm:0.2.9"
dependencies:
fdir: "npm:^6.4.0"
picomatch: "npm:^4.0.2"
checksum: 4570dacefa7f7371f49e52c8e4b7c4638d2cab9ee2903e1142c3eff4cfe71d1b8ab6cc55f65590a3232c27f8c0bcec794e4c2f02a4370fc79f3f4f026b5d84e7
languageName: node
linkType: hard

"tinypool@npm:^0.8.1":
version: 0.8.1
resolution: "tinypool@npm:0.8.1"
Expand Down Expand Up @@ -8388,13 +8369,6 @@ __metadata:
languageName: node
linkType: hard

"unicorn-magic@npm:^0.1.0":
version: 0.1.0
resolution: "unicorn-magic@npm:0.1.0"
checksum: 9b4d0e9809807823dc91d0920a4a4c0cff2de3ebc54ee87ac1ee9bc75eafd609b09d1f14495e0173aef26e01118706196b6ab06a75fe0841028b3983a8af313f
languageName: node
linkType: hard

"unique-filename@npm:^3.0.0":
version: 3.0.0
resolution: "unique-filename@npm:3.0.0"
Expand Down