Skip to content

Commit

Permalink
fix: revert #396, move back to fast-glob
Browse files Browse the repository at this point in the history
  • Loading branch information
antfu committed Dec 10, 2024
1 parent fcf6a21 commit 7bc76c5
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
"acorn": "catalog:",
"escape-string-regexp": "catalog:",
"estree-walker": "catalog:",
"fast-glob": "catalog:",
"local-pkg": "catalog:",
"magic-string": "catalog:",
"mlly": "catalog:",
Expand All @@ -57,7 +58,6 @@
"pkg-types": "catalog:",
"scule": "catalog:",
"strip-literal": "catalog:",
"tinyglobby": "catalog:",
"unplugin": "catalog:"
},
"devDependencies": {
Expand Down
1 change: 1 addition & 0 deletions pnpm-workspace.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ catalog:
escape-string-regexp: ^5.0.0
eslint: ^9.16.0
estree-walker: ^3.0.3
fast-glob: ^3.3.2
h3: ^1.13.0
jquery: ^3.7.1
lit: ^3.2.1
Expand Down
5 changes: 3 additions & 2 deletions src/node/scan-dirs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ import { existsSync } from 'node:fs'
import { readFile } from 'node:fs/promises'
import process from 'node:process'
import { fileURLToPath } from 'node:url'
import fg from 'fast-glob'
import { findExports, findTypeExports, resolve as mllyResolve } from 'mlly'
import { basename, dirname, join, normalize, parse as parsePath, resolve } from 'pathe'
import pm from 'picomatch'
import { camelCase } from 'scule'
import { glob } from 'tinyglobby'

const FileExtensionLookup = [
'mts',
Expand Down Expand Up @@ -50,13 +50,14 @@ export function normalizeScanDirs(dirs: (string | ScanDir)[], options?: ScanDirE

export async function scanFilesFromDir(dir: ScanDir | ScanDir[], options?: ScanDirExportsOptions) {
const dirGlobs = (Array.isArray(dir) ? dir : [dir]).map(i => i.glob)
const files = (await glob(
const files = (await fg(
dirGlobs,
{
absolute: true,
cwd: options?.cwd || process.cwd(),
onlyFiles: true,
followSymbolicLinks: true,
unique: true,
},
))
.map(i => normalize(i))
Expand Down

0 comments on commit 7bc76c5

Please sign in to comment.