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

This commit is contained in:
Anthony Fu 2022-07-21 18:46:50 +08:00 committed by GitHub
parent fa8b0f7c79
commit b4b98041f0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 3 deletions

View File

@ -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()
}

View File

@ -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)) {

View File

@ -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[] = []