feat(config): add shared browser cookie policy
Quality / quality (ubuntu-latest) (push) Failing after 9m46s
Quality / quality (windows-latest) (push) Canceled after 0s

This commit is contained in:
2026-08-12 21:53:07 +05:30
parent a0dab308f0
commit 5de792f359
15 changed files with 198 additions and 22 deletions
+12 -2
View File
@@ -44,6 +44,7 @@ import {
bundleCss,
renderStyles,
resolveThemeConfig,
resolveBrowserCookieOptions,
renderActiveThemeCss,
renderThemeCss,
renderThemeRuntime,
@@ -493,7 +494,7 @@ export async function runBuild(appRoot: string): Promise<void> {
console.log(`✓ Controllers: ${controllersPath}`);
// 1a) Theme tokens + client switcher (always emitted; built-in light/dark).
const theme = resolveThemeConfig(config.theme);
const theme = resolveThemeConfig(config.theme, config.cookies);
const themeCss = renderThemeCss(theme);
const themeJs = renderThemeRuntime(theme);
writeFileSync(join(distDir, "theme.css"), themeCss, "utf8");
@@ -541,8 +542,17 @@ export async function runBuild(appRoot: string): Promise<void> {
// 1a4) i18n: bake locale messages into the manifest (opt-in via app/locales).
const localeMessages = loadLocales(join(appDir, "locales"));
const i18nConfig = config.i18n
? {
...config.i18n,
cookie: {
...resolveBrowserCookieOptions(config.cookies, "language"),
...(config.i18n.cookie ?? {}),
},
}
: undefined;
const i18n = Object.keys(localeMessages).length
? resolveI18n(localeMessages, config.i18n)
? resolveI18n(localeMessages, i18nConfig)
: undefined;
if (i18n) console.log(`✓ i18n: ${i18n.langs.length} locales (default: ${i18n.default})`);