From c3eb826ce2e1b111f001dad36798e578226e32da Mon Sep 17 00:00:00 2001 From: SukkaW Date: Mon, 16 Dec 2024 22:02:19 +0800 Subject: [PATCH] chore(#331): drop `is-glob` --- package.json | 2 -- src/index.ts | 14 ++++++++------ yarn.lock | 9 --------- 3 files changed, 8 insertions(+), 17 deletions(-) diff --git a/package.json b/package.json index 3446a45..99e46a4 100644 --- a/package.json +++ b/package.json @@ -81,7 +81,6 @@ "enhanced-resolve": "^5.15.0", "get-tsconfig": "^4.7.5", "is-bun-module": "^1.0.2", - "is-glob": "^4.0.3", "stable-hash": "^0.0.4", "tinyglobby": "^0.2.10" }, @@ -94,7 +93,6 @@ "@mozilla/glean": "^3.0.0", "@pkgr/rollup": "^4.1.3", "@types/debug": "^4.1.12", - "@types/is-glob": "^4.0.4", "@types/node": "^18.19.67", "@types/unist": "^2.0.11", "dummy.js": "link:dummy.js", diff --git a/src/index.ts b/src/index.ts index 85b3941..6473283 100644 --- a/src/index.ts +++ b/src/index.ts @@ -9,9 +9,8 @@ import { createPathsMatcher, getTsconfig } from 'get-tsconfig' import type { TsConfigResult } from 'get-tsconfig' import type { Version } from 'is-bun-module' import { isBunModule } from 'is-bun-module' -import isGlob from 'is-glob' import stableHashExports from 'stable-hash' -import { globSync } from 'tinyglobby' +import { globSync, isDynamicPattern } from 'tinyglobby' // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- esmodule interop const stableHash = stableHashExports.default || stableHashExports @@ -390,10 +389,13 @@ function initMappers(options: InternalResolverOptions) { // turn glob patterns into paths const projectPaths = [ ...new Set([ - ...configPaths.filter(path => !isGlob(path)), - ...globSync([...configPaths.filter(path => isGlob(path)), ...ignore], { - expandDirectories: false, - }), + ...configPaths.filter(path => !isDynamicPattern(path)), + ...globSync( + [...configPaths.filter(path => isDynamicPattern(path)), ...ignore], + { + expandDirectories: false, + }, + ), ]), ] diff --git a/yarn.lock b/yarn.lock index 1b7d644..073b6a8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3648,13 +3648,6 @@ __metadata: languageName: node linkType: hard -"@types/is-glob@npm:^4.0.4": - version: 4.0.4 - resolution: "@types/is-glob@npm:4.0.4" - checksum: c790125e2d133d15c9783f6468995841cb06b5634b5c7b30aa32d23129f19d7dc271ec1a904bea4ca1e6a5ba19218a6602753d558f343b4fb8402fed25d17219 - languageName: node - linkType: hard - "@types/json-schema@npm:^7.0.9": version: 7.0.15 resolution: "@types/json-schema@npm:7.0.15" @@ -6158,7 +6151,6 @@ __metadata: "@nolyfill/is-core-module": "npm:1.0.39" "@pkgr/rollup": "npm:^4.1.3" "@types/debug": "npm:^4.1.12" - "@types/is-glob": "npm:^4.0.4" "@types/node": "npm:^18.19.67" "@types/unist": "npm:^2.0.11" debug: "npm:^4.3.7" @@ -6170,7 +6162,6 @@ __metadata: eslint-plugin-import-x: "npm:^4.5.0" get-tsconfig: "npm:^4.7.5" is-bun-module: "npm:^1.0.2" - is-glob: "npm:^4.0.3" lint-staged: "npm:^13.3.0" npm-run-all2: "npm:^5.0.2" prettier: "npm:^2.8.8"