Skip to content

Commit

Permalink
fix: Revert "refactor: replace globby with faster alternative (#1158)"
Browse files Browse the repository at this point in the history
This reverts commit 0f0b4b2.
  • Loading branch information
egoist committed Jul 22, 2024
1 parent 6e66f29 commit 2de6dd5
Show file tree
Hide file tree
Showing 5 changed files with 135 additions and 53 deletions.
4 changes: 1 addition & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,9 @@
"debug": "^4.3.5",
"esbuild": "^0.23.0",
"execa": "^5.1.1",
"fdir": "^6.1.1",
"globby": "^11.1.0",
"joycon": "^3.1.1",
"picocolors": "^1.0.1",
"picomatch": "^4.0.2",
"postcss-load-config": "^6.0.1",
"resolve-from": "^5.0.0",
"rollup": "^4.19.0",
Expand All @@ -75,7 +74,6 @@
"@types/debug": "4.1.12",
"@types/fs-extra": "11.0.4",
"@types/node": "20.14.11",
"@types/picomatch": "^3.0.0",
"@types/resolve": "1.20.6",
"flat": "6.0.1",
"fs-extra": "11.2.0",
Expand Down
138 changes: 124 additions & 14 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 2 additions & 8 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import path from 'node:path'
import fs from 'node:fs'
import { Worker } from 'node:worker_threads'
import glob from 'globby'
import { loadTsConfig } from 'bundle-require'
import execa from 'execa'
import { fdir } from 'fdir'
import picomatch from 'picomatch'
import kill from 'tree-kill'
import { version } from '../package.json'
import { PrettyError, handleError } from './errors'
Expand Down Expand Up @@ -119,12 +118,7 @@ const normalizeOptions = async (
}

if (Array.isArray(entry)) {
const matcher = picomatch(entry, { windows: process.platform === 'win32' })
options.entry = await new fdir()
.withRelativePaths()
.filter((file) => matcher(file))
.crawl(process.cwd())
.withPromise()
options.entry = await glob(entry)
// Ensure entry exists
if (!options.entry || options.entry.length === 0) {
throw new PrettyError(`Cannot find ${entry}`)
Expand Down
Loading

0 comments on commit 2de6dd5

Please sign in to comment.