Skip to content
This repository has been archived by the owner on Apr 6, 2023. It is now read-only.

Commit

Permalink
fix: stable globby scan
Browse files Browse the repository at this point in the history
  • Loading branch information
antfu committed Jul 21, 2022
1 parent 92269dd commit 12cdb66
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/kit/src/resolve.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,5 +148,5 @@ async function existsSensitive (path: string) {

export async function resolveFiles (path: string, pattern: string | string[]) {
const files = await globby(pattern, { cwd: path, followSymbolicLinks: true })
return files.map(p => resolve(path, p)).filter(p => !isIgnored(p))
return files.map(p => resolve(path, p)).filter(p => !isIgnored(p)).sort()
}
3 changes: 2 additions & 1 deletion packages/nuxt/src/components/scan.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ export async function scanComponents (dirs: ComponentsDir[], srcDir: string): Pr
// A map from resolved path to component name (used for making duplicate warning message)
const resolvedNames = new Map<string, string>()

for (const _file of await globby(dir.pattern!, { cwd: dir.path, ignore: dir.ignore })) {
const files = (await globby(dir.pattern!, { cwd: dir.path, ignore: dir.ignore })).sort()
for (const _file of files) {
const filePath = join(dir.path, _file)

if (scannedPaths.find(d => filePath.startsWith(d)) || isIgnored(filePath)) {
Expand Down
2 changes: 1 addition & 1 deletion scripts/bump-edge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ type Package = ThenArg<ReturnType<typeof loadPackage>>

async function loadWorkspace (dir: string) {
const workspacePkg = await loadPackage(dir)
const pkgDirs = await globby(workspacePkg.data.workspaces || [], { onlyDirectories: true })
const pkgDirs = (await globby(workspacePkg.data.workspaces || [], { onlyDirectories: true })).sort()

const packages: Package[] = []

Expand Down

0 comments on commit 12cdb66

Please sign in to comment.