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

fix(kit, nuxt): always sort globby results #6029

Merged
merged 1 commit into from
Jul 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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