fix: sort readdir

This commit is contained in:
Ole Marius Løset 2023-11-17 23:10:47 +01:00
parent 31ada39904
commit 3c9361a32b

View File

@ -36,6 +36,9 @@ async function crawlUI(rootPath: string) {
withFileTypes: true,
})
// Sort to ensure consistent order across platforms
dir.sort()
const uiRegistry: Registry = []
for (const dirent of dir) {
@ -59,6 +62,9 @@ async function crawlExample(rootPath: string) {
withFileTypes: true,
})
// Sort to ensure consistent order across platforms
dir.sort()
const exampleRegistry: Registry = []
for (const dirent of dir) {
@ -99,6 +105,8 @@ async function buildUIRegistry(componentPath: string, componentName: string) {
const dir = await readdir(componentPath, {
withFileTypes: true,
})
// Sort to ensure consistent order across platforms
dir.sort()
const files: string[] = []
const dependencies = new Set<string>()