Files
pbakaus_impeccable/tests/framework-fixtures/tanstack-router-vite/fixture.json
T
Paul BakausandClaude Fable 5 4cd5ea7547 Add TanStack Router + Start support to live mode
Live mode had no TanStack coverage: a TanStack Start user hit disconnects
and static previews because there is no static index.html to inject and no
adapter for the SSR root document.

- New tanstack-adapter.mjs, modeled on the SvelteKit/Nuxt adapters: detects
  a TanStack Start project (@tanstack/react-start + src/routes/__root.tsx)
  and patches the __root document to mount a generated dev-only React
  component (src/impeccable/ImpeccableLiveRoot) that appends the live bundle
  on the client after hydration, carrying the ?token= param via
  buildLiveScriptSrc. Patch/unpatch round-trips byte-for-byte and is
  idempotent; refuses to clobber an unmanaged file at the component path.
- Wire detection into live-inject.mjs (insert + remove + gitignore),
  ordered so SvelteKit/Nuxt win and a plain TanStack Router SPA falls
  through to the baseline Vite index.html path.
- tanstack-router-vite fixture (baseline, no adapter) and tanstack-start
  fixture (SSR adapter), both with runtime blocks. Both pass the full
  live-e2e cycle (handshake, steer, pick, Go, cycle, accept, carbonize,
  reloadProbe).
- Unit tests for detection + patch round-trip + apply/remove; tanstack-start
  branches in framework-fixtures.test.mjs; live.md framework table + adapter note.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-22 22:49:44 -07:00

50 lines
1.3 KiB
JSON

{
"name": "Vite 8 + TanStack Router (code-based SPA)",
"config": {
"files": ["index.html"],
"insertBefore": "</body>",
"commentSyntax": "html"
},
"sourceFiles": [
"index.html",
"src/main.jsx",
"src/routes/Home.jsx",
"src/routes/About.jsx",
"src/styles.css",
"vite.config.js"
],
"generatedFiles": [],
"wrapCases": [
{
"name": "wraps About hero in routes/About.jsx",
"args": { "classes": "hero-title", "tag": "h1" },
"expectedFile": "src/routes/About.jsx"
}
],
"runtime": {
"styling": "plain-css",
"install": ["npm", "install", "--no-audit", "--no-fund", "--loglevel=error"],
"devCommand": ["npx", "vite", "--host", "127.0.0.1"],
"readyPattern": "Local:\\s+https?://[^:]+:(\\d+)",
"readyTimeoutMs": 120000,
"preActions": [
{ "type": "click", "selector": "[data-testid='nav-about']" },
{ "type": "wait", "selector": "h1.hero-title" }
],
"reloadProbe": {
"preActions": [
{ "type": "click", "selector": "[data-testid='nav-about']" },
{ "type": "wait", "selector": "h1.hero-title" }
],
"expectSelector": "h1.hero-title"
},
"probe": {
"expectLiveInit": true,
"expectConsoleClean": true
},
"steer": {
"sourceFile": "src/routes/About.jsx"
}
}
}