Skip to content

Commit ca0eb3e

Browse files
committed
chore: wip
1 parent e8890da commit ca0eb3e

File tree

4 files changed

+11
-178
lines changed

4 files changed

+11
-178
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ logs
1010
node_modules
1111
temp
1212
docs/.vitepress/cache
13+
pantry

.zed/settings.json

Lines changed: 0 additions & 139 deletions
This file was deleted.

package.json

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,9 @@
6464
"example:dead-letter-queue": "bun examples/dead-letter-queue.ts"
6565
},
6666
"devDependencies": {
67-
"@stacksjs/docs": "^0.70.23",
67+
"@stacksjs/bunpress": "^0.1.1",
6868
"@types/bun": "^1.3.9",
69-
"better-dx": "^0.2.6",
70-
"fast-glob": "^3.3.3"
71-
},
72-
"overrides": {
73-
"unconfig": "0.3.10"
69+
"better-dx": "^0.2.6"
7470
},
7571
"git-hooks": {
7672
"pre-commit": {

packages/bun-queue/src/commands/script-loader.ts

Lines changed: 8 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import { promisify } from 'node:util'
88
const readFile = promisify(fs.readFile)
99
const readdir = promisify(fs.readdir)
1010

11-
const GlobOptions = { dot: true, silent: false }
1211
const IncludeRegex = /^-{2,3}[ \t]*@include[ \t]+(["'])(.+?)\1[; \t\n]*$/m
1312
const EmptyLineRegex = /^\s*[\r\n]/gm
1413

@@ -195,41 +194,17 @@ export class ScriptLoader {
195194
throw new ScriptLoaderError(msg, file.path, stack, pos.line, pos.column)
196195
}
197196

198-
const minimatch = await import('minimatch')
199-
200-
if (!minimatch) {
201-
console.warn('Install minimatch as dev-dependency')
202-
}
203-
204-
const Minimatch = minimatch.Minimatch || class Empty {}
205-
206-
const fg = await import('fast-glob')
207-
208-
if (!fg) {
209-
console.warn('Install fast-glob as dev-dependency')
210-
}
211-
212-
const nonOp = () => {
213-
return ['']
197+
const hasFilenamePattern = (filePath: string): boolean => {
198+
return /[*?[\]{}]/.test(filePath)
214199
}
215-
const glob = (fg as any)?.default.glob || nonOp
216-
217-
const hasMagic = (pattern: string | string[]): boolean => {
218-
if (!Array.isArray(pattern)) {
219-
pattern = [pattern]
220-
}
221-
for (const p of pattern) {
222-
if ((new Minimatch(p, GlobOptions) as any).hasMagic()) {
223-
return true
224-
}
225-
}
226-
return false
227-
}
228-
229-
const hasFilenamePattern = (path: string) => hasMagic(path)
230200

231201
async function getFilenamesByPattern(pattern: string): Promise<string[]> {
232-
return glob(pattern, { dot: true })
202+
const glob = new Bun.Glob(pattern)
203+
const results: string[] = []
204+
for await (const match of glob.scan({ dot: true })) {
205+
results.push(match)
206+
}
207+
return results
233208
}
234209

235210
let res

0 commit comments

Comments
 (0)