From 77ec929f7d80f845f31d5822eb5e4cc8c9b1cef9 Mon Sep 17 00:00:00 2001 From: Claas Augner <495429+caugner@users.noreply.github.com> Date: Wed, 15 May 2024 05:51:38 -0700 Subject: [PATCH] fix(build): sort build.json content (#11124) * chore(build): type BuildMetadata * fix(build): sort build.json content --- build/cli.ts | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/build/cli.ts b/build/cli.ts index dff23999ed30..cc9881530775 100644 --- a/build/cli.ts +++ b/build/cli.ts @@ -54,7 +54,17 @@ interface GlobalMetadata { } interface BuildMetadata { - [locale: string]: any; + [locale: string]: { + baseline?: { + total: number; + high: number; + highPaths: string[]; + low: number; + lowPaths: string[]; + not: number; + notPaths: string[]; + }; + }; } async function buildDocumentInteractive( @@ -376,6 +386,13 @@ async function buildDocuments( ); for (const [locale, meta] of Object.entries(buildMetadata)) { + if (meta.baseline) { + // Sort to avoid build difference. + meta.baseline.highPaths.sort(); + meta.baseline.lowPaths.sort(); + meta.baseline.notPaths.sort(); + } + // have to write per-locale because we build each locale concurrently fs.writeFileSync( path.join(BUILD_OUT_ROOT, locale.toLowerCase(), "build.json"),