diff --git a/docs/PROGRESS.md b/docs/PROGRESS.md index c1460c15c..f4a2b264a 100644 --- a/docs/PROGRESS.md +++ b/docs/PROGRESS.md @@ -1518,3 +1518,5 @@ Verified against current majors, all green with no adapter code changes: `@bugse ### launch() with a missing app token no longer throws (#198, 2026-11-12) `launch(undefined)` on Node/Bun died with an opaque `TypeError ... reading 'length'` inside `hashAppToken`, crashing the host at startup. Every runtime composition root (`@bugsee/node` + bun, `@bugsee/electron` `launchMain`/`launchRenderer` (guard before any wiring; a bad-token renderer sends no hello and takes no page slot), `@bugsee/browser` + umbrella/electron-renderer, `@bugsee/vercel-edge` + cloudflare, `@bugsee/webworker`) now calls the shared `createDisabledClientForMissingToken` (`@bugsee/core` `app-token.ts`) first: a missing / empty / whitespace-only / non-string token reports ONE `Bugsee: the app token is missing ...` error through `onError` (else `console.warn`) and returns a DISABLED client (never started, `launch()` is a no-op, claims no carrier slot, so a later valid launch works; the browser one resolves it, `showReportDialog()` resolves `null`). `@bugsee/webview` is untouched (the native host owns the token; the JS side never uses it on the wire). Tests: `app-token.test.ts` + `launch-missing-token.test.ts` per entry. + +**Follow-up 2 (issue #11).** `sveltekit-e2e` now wires `sveltekit({ preprocess: [componentAnnotatePreprocessor()] })` (the `@bugsee/sveltekit` README Kit 3 call, with the plugin imported by path) and asserts the SSR HTML carries `data-bugsee-component` (mutation-checked: removing `preprocess` fails it). The plugin is imported from its built dist (the e2e builds it first) because Kit 3 re-loads `vite.config.ts` in a plain-Node post-build process that cannot resolve the workspace's extensionless TS source. The README nits were already fixed (#157). Only Rollup 5 (still prerelease, `5.0.0-2` on the `beta` tag) remains open: keep watching. diff --git a/packages/sveltekit-e2e/package.json b/packages/sveltekit-e2e/package.json index 2662d714b..e8af714e8 100644 --- a/packages/sveltekit-e2e/package.json +++ b/packages/sveltekit-e2e/package.json @@ -10,6 +10,7 @@ }, "dependencies": { "@bugsee/e2e-kit": "workspace:*", + "@bugsee/svelte-plugin-component-annotate": "workspace:*", "@bugsee/sveltekit": "workspace:*", "@bugsee/util": "workspace:*" }, diff --git a/packages/sveltekit-e2e/test/sveltekit.e2e.ts b/packages/sveltekit-e2e/test/sveltekit.e2e.ts index 3adf2833c..be6fc3a7c 100644 --- a/packages/sveltekit-e2e/test/sveltekit.e2e.ts +++ b/packages/sveltekit-e2e/test/sveltekit.e2e.ts @@ -71,6 +71,17 @@ describe('@bugsee/sveltekit — real SvelteKit boot e2e', () => { beforeAll(async () => { collector = await startMockCollector(); + const annotate = spawnSync( + 'pnpm', + ['--filter', '@bugsee/svelte-plugin-component-annotate', 'build'], + { + cwd: appDir, + encoding: 'utf8', + }, + ); + if (annotate.status !== 0) + throw new Error(`annotate build failed:\n${annotate.stdout}\n${annotate.stderr}`); + const build = spawnSync('pnpm', ['exec', 'vite', 'build'], { cwd: appDir, encoding: 'utf8' }); if (build.status !== 0) throw new Error(`vite build failed:\n${build.stdout}\n${build.stderr}`); @@ -101,6 +112,11 @@ describe('@bugsee/sveltekit — real SvelteKit boot e2e', () => { expect(html).toContain(' { + const html = await (await fetch(`${base}/`)).text(); + expect(html).toMatch(/