Skip to content

Commit 601899c

Browse files
committed
refactor: migrate fast-glob to tinyglobby
1 parent 9063125 commit 601899c

File tree

3 files changed

+9
-10
lines changed

3 files changed

+9
-10
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,9 @@
6060
},
6161
"dependencies": {
6262
"ast-kit": "^2.1.2",
63-
"fast-glob": "^3.3.3",
6463
"magic-string": "^0.30.19",
6564
"picomatch": "^4.0.3",
65+
"tinyglobby": "^0.2.15",
6666
"unplugin": "^2.3.10",
6767
"unplugin-replace": "^0.6.1"
6868
},

pnpm-lock.yaml

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/core/enum.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ import { spawnSync } from 'node:child_process'
33
import { readFileSync } from 'node:fs'
44
import path from 'node:path'
55
import { babelParse, getLang, isTs } from 'ast-kit'
6-
import fg from 'fast-glob'
76
import picomatch from 'picomatch'
7+
import { globSync } from 'tinyglobby'
88
import type { OptionsResolved } from './options'
99
import type { Expression, PrivateName } from '@babel/types'
1010

@@ -217,11 +217,10 @@ export function scanEnums(options: ScanOptions): EnumData {
217217
*/
218218
export function scanFiles(options: ScanOptions): string[] {
219219
if (options.scanMode === 'fs') {
220-
return fg
221-
.sync(options.scanPattern, {
222-
cwd: options.scanDir,
223-
})
224-
.map((file) => path.resolve(options.scanDir, file))
220+
return globSync(options.scanPattern, {
221+
cwd: options.scanDir,
222+
expandDirectories: false,
223+
}).map((file) => path.resolve(options.scanDir, file))
225224
} else {
226225
const { stdout, stderr, status } = spawnSync(
227226
'git',

0 commit comments

Comments
 (0)