History

fix embedded web ui release smoke

Rhys Sullivan committed 7 months agov1.4.0-beta.5

Commit 2365bf51 parent fa61e979 files · +83 −15Browse files

Showing the changes to apps/cli/src (4 of 9 files). Show all

Unified · Split

4 files
  1. apps/cli/src/build.ts +4 −2
  2. apps/cli/src/embedded-web-ui.gen.d.ts +1 −1
  3. apps/cli/src/embedded-web-ui.gen.ts +3 −0
  4. apps/cli/src/main.ts +1 −4
apps/cli/src/build.ts+4−2
@@ -121,6 +121,8 @@ const createEmbeddedWebUISource = async () => { · 120 unmodified lines
121// Build platform binaries121// Build platform binaries
122// ---------------------------------------------------------------------------122// ---------------------------------------------------------------------------
123 123
124const EMBEDDED_WEB_UI_STUB = `const files: Record<string, string> | null = null;\n\nexport default files;\n`;
125
124const buildBinaries = async (targets: Target[]) => {126const buildBinaries = async (targets: Target[]) => {
125 const meta = await readMetadata();127 const meta = await readMetadata();
126 const binaries: Record<string, string> = {};128 const binaries: Record<string, string> = {};
@@ -143,7 +145,7 @@ const buildBinaries = async (targets: Target[]) => { · 16 unmodified lines
143 console.log(`Building ${name}...`);145 console.log(`Building ${name}...`);
144 146
145 await Bun.build({147 await Bun.build({
146 entrypoints: [join(cliRoot, "src/main.ts"), embeddedWebUIPath],148 entrypoints: [join(cliRoot, "src/main.ts")],
147 minify: true,149 minify: true,
148 compile: {150 compile: {
149 target: bunTarget(target) as any,151 target: bunTarget(target) as any,
@@ -183,7 +185,7 @@ const buildBinaries = async (targets: Target[]) => { · 33 unmodified lines
183 185
184 return binaries;186 return binaries;
185 } finally {187 } finally {
186 await rm(embeddedWebUIPath, { force: true });188 await writeFile(embeddedWebUIPath, EMBEDDED_WEB_UI_STUB);
187 }189 }
188};190};
189 191
apps/cli/src/embedded-web-ui.gen.d.ts+1−1
@@ -1,2 +1,2 @@
1declare const files: Record<string, string>;1declare const files: Record<string, string> | null;
2export default files;2export default files;
apps/cli/src/embedded-web-ui.gen.ts+3−0
@@ -0,0 +1,3 @@
1const files: Record<string, string> | null = null;
2
3export default files;
apps/cli/src/main.ts+1−4
@@ -40,10 +40,7 @@ const DEFAULT_PORT = 8788; · 39 unmodified lines
40const DEFAULT_BASE_URL = `http://localhost:${DEFAULT_PORT}`;40const DEFAULT_BASE_URL = `http://localhost:${DEFAULT_PORT}`;
41 41
42// Embedded web UI — baked into compiled binaries via `with { type: "file" }`42// Embedded web UI — baked into compiled binaries via `with { type: "file" }`
43const embeddedWebUI: Record<string, string> | null =43import embeddedWebUI from "./embedded-web-ui.gen";
44 await import("./embedded-web-ui.gen")
45 .then((m) => m.default as Record<string, string>)
46 .catch(() => null);
47 44
48// ---------------------------------------------------------------------------45// ---------------------------------------------------------------------------
49// Helpers46// Helpers