commit a232026885547ba8768a12824a830bd44c26815e
parent 598e763442185bf180afe23d9dcaa73d5d3e5524
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date: Sat, 26 Sep 2026 02:24:53 -0400
export: playwright.config.ts unlinks public/sw.js before copying the site worker
In a worktree public/sw.js is a symlink into the primary checkout, and
copyFileSync writes through it: a site-mode export e2e run in a worktree
replaced the primary's composed hub service worker with the site one
(release 9 C1b, FACTS 2026-09-25). rmSync first removes only the link.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Diffstat:
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/export/playwright.config.ts b/export/playwright.config.ts
@@ -42,9 +42,18 @@ const FIXTURE_SITE = path.join(TEST_SITES_DIR, "testsite", "site.json");
// left on disk. Stage it here (mirroring compose) so the service-worker test is
// deterministic on a clean checkout. The icons it caches need no staging: the
// `app/icons/[file]` and `app/favicon.ico` route handlers render them.
+//
+// Unlink before copying. In a git worktree `public/sw.js` is a symlink into
+// the primary checkout (the gitignored entries of `public/` are linked from
+// there), and copyFileSync writes THROUGH a link: a site-mode run in a worktree
+// replaced the primary's composed hub worker with the site one. Removing the
+// path first removes only the link, so the copy lands in this checkout.
const SW_SRC = path.resolve(process.cwd(), "service-worker", "site-sw.js");
const SW_DEST = path.resolve(process.cwd(), "public", "sw.js");
-if (fs.existsSync(SW_SRC)) fs.copyFileSync(SW_SRC, SW_DEST);
+if (fs.existsSync(SW_SRC)) {
+ fs.rmSync(SW_DEST, { force: true });
+ fs.copyFileSync(SW_SRC, SW_DEST);
+}
export default defineConfig({
testDir: "./e2e",