From 075f91d1a245ebc0205dd8e66cb4399f7b9c8f14 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 1 Apr 2026 02:20:49 +0000 Subject: [PATCH 1/2] Initial plan From 84b1c5a6e7396dc8649584e25fa9cfc9d690808b Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 1 Apr 2026 02:28:33 +0000 Subject: [PATCH 2/2] Fix page service worker asset injection Agent-Logs-Url: https://github.com/scaryrawr/sl/sessions/bc1a3f14-013c-480a-9a0c-5af5d31dc970 Co-authored-by: scaryrawr <661373+scaryrawr@users.noreply.github.com> --- apps/page/src/service-worker-build.test.ts | 16 ++++++++++++++++ apps/page/src/service-worker.ts | 2 +- 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 apps/page/src/service-worker-build.test.ts diff --git a/apps/page/src/service-worker-build.test.ts b/apps/page/src/service-worker-build.test.ts new file mode 100644 index 00000000..5d553180 --- /dev/null +++ b/apps/page/src/service-worker-build.test.ts @@ -0,0 +1,16 @@ +import { readFile } from 'node:fs/promises'; +import path from 'node:path'; + +import { describe, expect, test } from 'bun:test'; + +const SERVICE_WORKER_PATH = path.join(import.meta.dir, 'service-worker.ts'); +const WASM_PLACEHOLDER = '// WASM_PLACEHOLDER - will be replaced at build time'; + +describe('service worker build integration', () => { + test('keeps the asset list valid when injecting the wasm filename', async () => { + const serviceWorkerContent = await readFile(SERVICE_WORKER_PATH, 'utf8'); + const builtServiceWorkerContent = serviceWorkerContent.replace(WASM_PLACEHOLDER, '`${BASE_PATH}/websl_bg.wasm`,'); + + expect(builtServiceWorkerContent).toMatch(/`\$\{BASE_PATH\}\/manifest\.json`,\s+`\$\{BASE_PATH\}\/websl_bg\.wasm`,/); + }); +}); diff --git a/apps/page/src/service-worker.ts b/apps/page/src/service-worker.ts index 58fa1be5..cd3ee2ff 100644 --- a/apps/page/src/service-worker.ts +++ b/apps/page/src/service-worker.ts @@ -26,7 +26,7 @@ const ASSETS_TO_CACHE = [ `${BASE_PATH}/favicon.svg`, `${BASE_PATH}/index.js`, `${BASE_PATH}/embed.js`, - `${BASE_PATH}/manifest.json` + `${BASE_PATH}/manifest.json`, // WASM_PLACEHOLDER - will be replaced at build time ];