diff --git a/.gitignore b/.gitignore index 132725d27..fe011fcaa 100644 --- a/.gitignore +++ b/.gitignore @@ -54,6 +54,7 @@ next-env.d.ts # scripts/generate-sw-version.mjs; loaded by public/sw.js to key # the cache-version baseline. /public/sw-version.js +/public/i18n/ # v1.4.27 B3 — MaxMind GeoLite2 databases are fetched at build time # via `scripts/fetch-geolite2.sh`. Too large for git; license key diff --git a/e2e/utils/mock-mood-insights.ts b/e2e/utils/mock-mood-insights.ts index e8dc21e8e..36fe5c144 100644 --- a/e2e/utils/mock-mood-insights.ts +++ b/e2e/utils/mock-mood-insights.ts @@ -113,7 +113,10 @@ export async function mockMoodInsights(page: Page): Promise { await route.fulfill({ status: 200, contentType: "application/json", - body: JSON.stringify({ data: CORRELATION_DISCOVERY_PAYLOAD, error: null }), + body: JSON.stringify({ + data: CORRELATION_DISCOVERY_PAYLOAD, + error: null, + }), }); }); } diff --git a/package.json b/package.json index 367972474..f20ef9ccc 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,8 @@ "scripts": { "prepare": "lefthook install || echo 'lefthook install skipped (no git repo or binary unavailable)'", "dev": "next dev", - "prebuild": "node scripts/generate-sw-version.mjs", + "predev": "node scripts/generate-i18n-boot.mjs", + "prebuild": "node scripts/generate-sw-version.mjs && node scripts/generate-i18n-boot.mjs", "build": "next build", "analyze": "ANALYZE=1 next build", "bundle-report": "node scripts/check-bundle-budget.mjs", diff --git a/scripts/check-bundle-budget.mjs b/scripts/check-bundle-budget.mjs index 713dfb116..d38c17174 100644 --- a/scripts/check-bundle-budget.mjs +++ b/scripts/check-bundle-budget.mjs @@ -150,7 +150,9 @@ const budget = existsSync(BUDGET_PATH) console.log(`shared baseline (rootMainFiles): ${fmt(rootGz)} gz`); console.log(`all client chunks: ${fmt(totalGz)} gz`); -console.log(`largest chunk: ${fmt(largest.gz)} gz ${largest.file}`); +console.log( + `largest chunk: ${fmt(largest.gz)} gz ${largest.file}`, +); console.log(`recharts-fingerprint chunks: ${rechartsChunks}`); console.log(""); diff --git a/scripts/generate-i18n-boot.mjs b/scripts/generate-i18n-boot.mjs new file mode 100644 index 000000000..74bd331c0 --- /dev/null +++ b/scripts/generate-i18n-boot.mjs @@ -0,0 +1,52 @@ +#!/usr/bin/env node +/** + * Generate the locale-catalog boot scripts (`public/i18n/.js`). + * + * The root layout emits `