GitNexus/gitnexus-web/test
Gergő Magyar f4da8a0874
chore(web): bump vite 7.3.2 -> 8.0.10 + vitest 4 (iter 3 of 3) (#1063)
Final step of the iterative vite 5 -> 8 migration. This is the
substantive hop: Rolldown replaces Rollup, Oxc replaces esbuild,
Lightning CSS replaces esbuild for CSS, and vitest jumps to v4 (vitest
3 only peers with vite ^5||^6||^7).

Dep changes (gitnexus-web/package.json):
- vite ^7.3.2 -> ^8.0.10
- vitest ^3.2.4 -> ^4.1.5
- @vitest/coverage-v8 ^3.2.4 -> ^4.1.5
- @tailwindcss/vite ^4.1.18 -> ^4.2.4 (vite ^8 peer support starts at 4.2.2)
- tailwindcss ^4.2.2 -> ^4.2.4 (match the vite plugin minor)
- @vitejs/plugin-react already at 5.2.0 from iter 2 (vite ^8 peer included)

Test fix (heartbeat.test.ts):
- vitest 4 enforces [[Construct]] on mock implementations used with `new`.
  The arrow function passed to .mockImplementation() in the EventSource
  stub is now rejected with "() => { ... } is not a constructor". Switched
  to a regular function declaration, which restores constructor semantics
  without changing test behaviour. All 7 heartbeat tests pass again.

Coverage threshold tune (vitest.config.ts):
- vitest 4 ships AST-aware coverage remapping by default, which measures
  reachable code more accurately than the legacy istanbul-style mapping.
  Same 220 tests now report 9.44%/4.47%/7.24%/9.58% instead of just over
  10% on each axis. Lowered thresholds to 9/4/7/9 to keep them as soft
  regression floors rather than coverage targets. No tests removed.

What we deliberately did NOT change:
- vite.config.ts: the five resolve.alias entries (mermaid, anthropic deep
  import, gitnexus-shared, @, @shared) all keep working under Rolldown.
  server.fs.allow: ['..'] is unchanged in v8. The mermaid alias is
  arguably MORE important now because vite 8.0.10 explicitly removed
  format-sniffing module resolution from the JS resolver.
- engines.node: vite 8 has the same Node floor as vite 7
  (^20.19.0 || >=22.12.0), already set in iter 2.
- CI setup-node pin: already at 20.19.0 from iter 2.

Verified locally (Node v22.14.0):
- npm install: clean (+11 / -55 / 27 changed; size shrinks because vite 8
  bundles deps internally), no ERESOLVE on @tailwindcss/vite
- npx tsc -b --noEmit: clean
- npm test: 220/220 pass, 1.80s (~21x faster than vite 7's 3.05s)
- npm run test:coverage: passes new thresholds
- npm run build: clean, **539ms** with Rolldown (vs 11.41s on vite 7,
  ~21x speedup), bundle ~1% smaller than vite 7

Closes the iterative vite 5 -> 8 series (#1061 vite 6, #1062 vite 7,
this PR vite 8). Supersedes Dependabot #1040.

Made-with: Cursor
2026-04-24 14:16:45 +01:00
..
fixtures feat: configure prettier with pre-commit hook (#563) 2026-03-28 14:58:04 +00:00
unit chore(web): bump vite 7.3.2 -> 8.0.10 + vitest 4 (iter 3 of 3) (#1063) 2026-04-24 14:16:45 +01:00
setup.ts ci: E2E workflow, web typecheck job, pre-commit hook, test suite (#486) 2026-03-24 06:01:08 +00:00