From 37253e3326ecb9f266ad7fb4ed0936b8ae92ae77 Mon Sep 17 00:00:00 2001 From: Ben McCann <322311+benmccann@users.noreply.github.com> Date: Mon, 2 Dec 2024 10:12:06 -0800 Subject: [PATCH] refactor: switch from fast-glob to tinyglobby --- package-lock.json | 7 ++----- package.json | 4 ++-- src/index.js | 10 +++++----- 3 files changed, 9 insertions(+), 12 deletions(-) diff --git a/package-lock.json b/package-lock.json index bbc8bda..bbbfdb4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,12 +9,12 @@ "version": "12.0.2", "license": "MIT", "dependencies": { - "fast-glob": "^3.3.2", "glob-parent": "^6.0.1", "globby": "^14.0.1", "normalize-path": "^3.0.0", "schema-utils": "^4.2.0", - "serialize-javascript": "^6.0.2" + "serialize-javascript": "^6.0.2", + "tinyglobby": "^0.2.10" }, "devDependencies": { "@babel/cli": "^7.24.6", @@ -15561,7 +15561,6 @@ "version": "0.2.10", "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.10.tgz", "integrity": "sha512-Zc+8eJlFMvgatPZTl6A9L/yht8QqdmUNtURHaKZLmKBE12hNPSrqNkUp2cs3M/UKmNVVAMFQYSjYIVHDjW5zew==", - "dev": true, "license": "MIT", "dependencies": { "fdir": "^6.4.2", @@ -15575,7 +15574,6 @@ "version": "6.4.2", "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.4.2.tgz", "integrity": "sha512-KnhMXsKSPZlAhp7+IjUkRZKPb4fUyccpDrdFXbi4QL1qkmFh9kVY09Yox+n4MaOb3lHZ1Tv829C3oaaXoMYPDQ==", - "dev": true, "license": "MIT", "peerDependencies": { "picomatch": "^3 || ^4" @@ -15590,7 +15588,6 @@ "version": "4.0.2", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.2.tgz", "integrity": "sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==", - "dev": true, "license": "MIT", "engines": { "node": ">=12" diff --git a/package.json b/package.json index effeb05..8ae45df 100644 --- a/package.json +++ b/package.json @@ -49,12 +49,12 @@ "webpack": "^5.1.0" }, "dependencies": { - "fast-glob": "^3.3.2", "glob-parent": "^6.0.1", "globby": "^14.0.1", "normalize-path": "^3.0.0", "schema-utils": "^4.2.0", - "serialize-javascript": "^6.0.2" + "serialize-javascript": "^6.0.2", + "tinyglobby": "^0.2.10" }, "devDependencies": { "@babel/cli": "^7.24.6", diff --git a/src/index.js b/src/index.js index 250933d..830d933 100644 --- a/src/index.js +++ b/src/index.js @@ -25,9 +25,9 @@ const getSerializeJavascript = memoize(() => require("serialize-javascript"), ); -const getFastGlob = memoize(() => +const getTinyGlobby = memoize(() => // eslint-disable-next-line global-require - require("fast-glob"), + require("tinyglobby"), ); const getGlobby = memoize(async () => { @@ -359,7 +359,7 @@ class CopyPlugin { pattern.context = absoluteFrom; glob = path.posix.join( - getFastGlob().escapePath( + getTinyGlobby().escapePath( getNormalizePath()(path.resolve(absoluteFrom)), ), "**/*", @@ -376,7 +376,7 @@ class CopyPlugin { logger.debug(`added '${absoluteFrom}' as a file dependency`); pattern.context = path.dirname(absoluteFrom); - glob = getFastGlob().escapePath( + glob = getTinyGlobby().escapePath( getNormalizePath()(path.resolve(absoluteFrom)), ); @@ -397,7 +397,7 @@ class CopyPlugin { glob = path.isAbsolute(originalFrom) ? originalFrom : path.posix.join( - getFastGlob().escapePath( + getTinyGlobby().escapePath( getNormalizePath()(path.resolve(pattern.context)), ), originalFrom,