Skip to content

Commit 47fba3f

Browse files
committed
serve embedded web assets directly
1 parent 2365bf5 commit 47fba3f

6 files changed

Lines changed: 22 additions & 8 deletions

File tree

‎.changeset/pre.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
"green-bobcats-shop",
3030
"kind-cycles-hang",
3131
"ripe-yaks-sniff",
32+
"tame-snakes-taste",
3233
"tiny-melons-jump"
3334
]
3435
}

‎.changeset/tame-snakes-taste.md‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"executor": patch
3+
---
4+
5+
Fix embedded web asset serving in compiled binaries by serving Bun embedded files directly, and extend the release smoke test to verify root HTML plus JS/CSS asset responses.

‎apps/cli/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "executor",
3-
"version": "1.4.0-beta.5",
3+
"version": "1.4.0-beta.6",
44
"private": true,
55
"type": "module",
66
"bin": {

‎apps/cli/src/main.ts‎

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -151,12 +151,9 @@ const serveStatic = async (pathname: string): Promise<Response | null> => {
151151
const match = embeddedWebUI[key] ?? embeddedWebUI["index.html"] ?? null;
152152
if (!match) return null;
153153
const file = Bun.file(match);
154-
if (await file.exists()) {
155-
return new Response(file, {
156-
headers: { "content-type": file.type || "application/octet-stream" },
157-
});
158-
}
159-
return null;
154+
return new Response(file, {
155+
headers: { "content-type": file.type || "application/octet-stream" },
156+
});
160157
}
161158

162159
// Dev mode: serve from apps/web/dist on disk

‎bun.lock‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎tests/release-bootstrap-smoke.test.ts‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,17 @@ describe("release bootstrap smoke", () => {
208208
const rootHtml = await rootResponse!.text();
209209
expect(rootHtml.toLowerCase()).toContain("<html");
210210

211+
const assetJs = rootHtml.match(/src="([^"]+\.js)"/)?.[1];
212+
const assetCss = rootHtml.match(/href="([^"]+\.css)"/)?.[1];
213+
expect(assetJs, rootHtml).toBeDefined();
214+
expect(assetCss, rootHtml).toBeDefined();
215+
216+
const assetJsResponse = await fetch(`http://127.0.0.1:${webPort}${assetJs}`);
217+
expect(assetJsResponse.status, `${webStdout}\n${webStderr}`).toBe(200);
218+
219+
const assetCssResponse = await fetch(`http://127.0.0.1:${webPort}${assetCss}`);
220+
expect(assetCssResponse.status, `${webStdout}\n${webStderr}`).toBe(200);
221+
211222
const docsResponse = await fetch(`http://127.0.0.1:${webPort}/docs`);
212223
expect(docsResponse.status, `${webStdout}\n${webStderr}`).toBe(200);
213224

0 commit comments

Comments
 (0)