From 3c9361a32b69fed07f3a56d6cf5df6cc0a9ebdf6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ole=20Marius=20L=C3=B8set?= Date: Fri, 17 Nov 2023 23:10:47 +0100 Subject: [PATCH] fix: sort readdir --- apps/www/src/lib/registry/registry.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/apps/www/src/lib/registry/registry.ts b/apps/www/src/lib/registry/registry.ts index 77a69b7b..e79e1a6e 100644 --- a/apps/www/src/lib/registry/registry.ts +++ b/apps/www/src/lib/registry/registry.ts @@ -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()