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
121121 // Build platform binaries
122122 // ---------------------------------------------------------------------------
123123
124+const EMBEDDED_WEB_UI_STUB = `const files: Record<string, string> | null = null;\n\nexport default files;\n`;
125+
124126 const buildBinaries = async (targets: Target[]) => {
125127 const meta = await readMetadata();
126128 const binaries: Record<string, string> = {};
@@ -143,7 +145,7 @@ const buildBinaries = async (targets: Target[]) => { · 16 unmodified lines
143145 console.log(`Building ${name}...`);
144146
145147 await Bun.build({
146− entrypoints: [join(cliRoot, "src/main.ts"), embeddedWebUIPath],
148+ entrypoints: [join(cliRoot, "src/main.ts")],
147149 minify: true,
148150 compile: {
149151 target: bunTarget(target) as any,
@@ -183,7 +185,7 @@ const buildBinaries = async (targets: Target[]) => { · 33 unmodified lines
183185
184186 return binaries;
185187 } finally {
186− await rm(embeddedWebUIPath, { force: true });
188+ await writeFile(embeddedWebUIPath, EMBEDDED_WEB_UI_STUB);
187189 }
188190 };
189191
apps/cli/src/embedded-web-ui.gen.d.ts+1−1
@@ -1,2 +1,2 @@
1−declare const files: Record<string, string>;
1+declare const files: Record<string, string> | null;
22 export default files;
apps/cli/src/embedded-web-ui.gen.ts+3−0
@@ -0,0 +1,3 @@
1+const files: Record<string, string> | null = null;
2+
3+export default files;
apps/cli/src/main.ts+1−4
@@ -40,10 +40,7 @@ const DEFAULT_PORT = 8788; · 39 unmodified lines
4040 const DEFAULT_BASE_URL = `http://localhost:${DEFAULT_PORT}`;
4141
4242 // Embedded web UI — baked into compiled binaries via `with { type: "file" }`
43−const embeddedWebUI: Record<string, string> | null =
44− await import("./embedded-web-ui.gen")
45− .then((m) => m.default as Record<string, string>)
46− .catch(() => null);
43+import embeddedWebUI from "./embedded-web-ui.gen";
4744
4845 // ---------------------------------------------------------------------------
4946 // Helpers