From 2f2ca6d7b9bac83bbf0ca788dc02e7a9849f807e Mon Sep 17 00:00:00 2001 From: t Date: Wed, 7 Oct 2026 21:14:26 +0530 Subject: [PATCH] Link third-party deps into the reload-stress fixture #1600 made the fixture copy the framework packages instead of linking them, but the copies lost their hoisted dependencies, so on Bun the server could not load amaro (Bun has no built-in TS stripper) and the dev server never came up. The Bun matrix failed on every PR since. The fixture now links the repo's third-party packages beside the copies, as a real install would place them; only framework packages stay copied. Claude-Session: https://claude.ai/code/session_01SZ72LSPAo4NvYvBDSD6RLo --- test/bun/dev-reload-stress.mjs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/test/bun/dev-reload-stress.mjs b/test/bun/dev-reload-stress.mjs index 1c20ff91d..7d04b8282 100644 --- a/test/bun/dev-reload-stress.mjs +++ b/test/bun/dev-reload-stress.mjs @@ -23,7 +23,7 @@ */ import assert from 'node:assert/strict'; import { spawn } from 'node:child_process'; -import { mkdtempSync, writeFileSync, mkdirSync, rmSync, cpSync } from 'node:fs'; +import { mkdtempSync, writeFileSync, mkdirSync, rmSync, cpSync, readdirSync, symlinkSync } from 'node:fs'; import { tmpdir } from 'node:os'; import { basename, dirname, join, resolve } from 'node:path'; import { fileURLToPath } from 'node:url'; @@ -56,6 +56,14 @@ try { for (const p of ['core', 'server', 'cli']) { cpSync(join(ROOT, 'packages', p), join(dir, 'node_modules/@webjsdev', p), { recursive: true, dereference: true, filter: (src) => basename(src) !== 'test' }); } + // The copies need their third-party dependencies, which a real install puts + // next to them. Link the repo's hoisted ones (amaro, the TS stripper Bun + // needs, among them); a symlinked third-party package is harmless, only the + // framework packages have to be real copies. + for (const name of readdirSync(join(ROOT, 'node_modules'))) { + if (name === '@webjsdev' || name.startsWith('.')) continue; + symlinkSync(join(ROOT, 'node_modules', name), join(dir, 'node_modules', name)); + } // The CLI runs from the app's own node_modules, as in a real install: under // `bun --hot` an entry outside the app breaks dynamic `#` imports by itself,