Skip to content

Beautiful, AI-native markdown IDE and LLM wiki

fix(open-knowledge): honor OK_TEST_SKIP_I18N_COMPILE in predev (#1879)

Nick Gomez12b7eda15379
diff --git a/packages/app/package.json b/packages/app/package.json
index 039bb03fe..b6c4fd0ef 100644
--- a/packages/app/package.json
+++ b/packages/app/package.json
@@ -5,7 +5,7 @@
"private": true,
"type": "module",
"scripts": {
- "predev": "turbo run build --filter=@inkeep/open-knowledge-core --filter=@inkeep/open-knowledge-server && bun run i18n:compile",
+ "predev": "turbo run build --filter=@inkeep/open-knowledge-core --filter=@inkeep/open-knowledge-server && sh scripts/i18n-compile-unless-skipped.sh",
"dev": "vite",
"build": "bun run i18n:compile && tsc --noEmit && vite build",
"typecheck": "tsc --noEmit",
diff --git a/packages/app/tests/integration/e2e-stop-rules.test.ts b/packages/app/tests/integration/e2e-stop-rules.test.ts
index 1e49758b9..d63f57801 100644
--- a/packages/app/tests/integration/e2e-stop-rules.test.ts
+++ b/packages/app/tests/integration/e2e-stop-rules.test.ts
@@ -429,4 +429,29 @@ describe('E2E STOP rule — zero allowlist', () => {
);
}
});
+
+ test('predev routes i18n compile through the OK_TEST_SKIP_I18N_COMPILE guard (not a direct compile)', () => {
+ const pkgPath = join(__dirname, '..', '..', 'package.json');
+ const pkg = JSON.parse(readFileSync(pkgPath, 'utf-8')) as {
+ scripts?: Record<string, string>;
+ };
+ const predev = pkg.scripts?.predev ?? '';
+ const errors: string[] = [];
+ if (!predev.includes('i18n-compile-unless-skipped.sh')) {
+ errors.push(
+ 'packages/app/package.json "predev" must route the i18n compile through ' +
+ 'scripts/i18n-compile-unless-skipped.sh (the OK_TEST_SKIP_I18N_COMPILE guard).',
+ );
+ }
+ if (/\b(?:bun run i18n:compile|lingui compile)\b/.test(predev)) {
+ errors.push(
+ 'packages/app/package.json "predev" invokes the i18n compile directly, bypassing the ' +
+ 'OK_TEST_SKIP_I18N_COMPILE guard — every concurrent e2e dev-server boot then rewrites ' +
+ 'src/locales/<locale>/messages.json and Vite full-page-reloads running tests mid-evaluate.',
+ );
+ }
+ if (errors.length > 0) {
+ throw new Error(`${errors.join('\n')}\nFound predev:\n ${predev}`);
+ }
+ });
});