feat: add safe project upgrades and production performance fixes
This commit is contained in:
@@ -19,7 +19,7 @@ import { compileWireFile } from "@wrnexus/compiler";
|
||||
import {
|
||||
loadAppConfig,
|
||||
headToString,
|
||||
renderFontHead,
|
||||
renderProductionFontHead,
|
||||
findStyleEntry,
|
||||
renderStyles,
|
||||
resolveThemeConfig,
|
||||
@@ -124,8 +124,10 @@ export async function runBuild(appRoot: string): Promise<void> {
|
||||
// 1a2) Wire UI stylesheet (all component classes, themed via tokens).
|
||||
const uiStyles = uiCss();
|
||||
writeFileSync(join(distDir, "ui.css"), uiStyles, "utf8");
|
||||
const frameworkStyles = `${themeCss}\n${uiStyles}`;
|
||||
writeFileSync(join(distDir, "framework.css"), frameworkStyles, "utf8");
|
||||
assetHash.update(uiStyles);
|
||||
console.log(`✓ UI: dist/ui.css`);
|
||||
console.log(`✓ UI: dist/ui.css + framework.css`);
|
||||
|
||||
// 1a3) Validation: bake schema descriptors into the client script.
|
||||
const descriptors: Record<string, SchemaDescriptor> = {};
|
||||
@@ -164,7 +166,7 @@ export async function runBuild(appRoot: string): Promise<void> {
|
||||
console.log(`✓ Styles: ${join(distDir, "styles.css")}`);
|
||||
}
|
||||
const assetVersion = assetHash.digest("hex").slice(0, 12);
|
||||
const headStr = [renderFontHead(config.fonts), headToString(config.head)]
|
||||
const headStr = [await renderProductionFontHead(config.fonts), headToString(config.head)]
|
||||
.filter(Boolean)
|
||||
.join("\n ");
|
||||
|
||||
@@ -232,6 +234,7 @@ await createProductionServer(
|
||||
themeJsPath: join(import.meta.dir, "theme.js"),
|
||||
theme: ${JSON.stringify(theme)},
|
||||
uiCssPath: join(import.meta.dir, "ui.css"),
|
||||
frameworkCssPath: join(import.meta.dir, "framework.css"),
|
||||
schemasJs: ${JSON.stringify(schemasJs)},
|
||||
i18n: ${i18n ? JSON.stringify(i18n) : "undefined"},
|
||||
db: ${config.db ? JSON.stringify(config.db) : "undefined"},
|
||||
|
||||
Reference in New Issue
Block a user