Files
poli0981andClaude Opus 5.5 0f600a99aa build(web): migrate to SvelteKit 3 and adapter-static 4
@sveltejs/kit 2.70.3 -> 3.1.0, @sveltejs/adapter-static 3.0.10 -> 4.0.0.
Closes GHSA-27mw-82g8-phjj and GHSA-pfhg-q3qv-9q6r (dismissed in v4.4.1
as not applicable), and drops the cookie override kit 2 needed: npm audit
reports nothing.

- Config: svelte.config.js is refused by kit 3. Its options are now
  sveltekitConfig(tauri) in build/sveltekit-config.ts, passed by
  vite.config.ts as sveltekit(sveltekitConfig(IS_TAURI)), with tests for
  both CSP flavours, paths.relative, the sitemap entry and the prerender
  404 handler. The unused, now-deprecated "@" alias and typescript.config
  hook are gone; tsconfig.json extends $app/tsconfig and owns `include`.
- $lib -> #lib (package.json imports), with .js on module imports.
  tsconfig repeats the mapping in `paths`: svelte-check --tsgo only maps
  .svelte imports through `paths`, and without it every #lib component
  fell back to the *.svelte shim (props unchecked; proven with a planted
  error).
- Param matchers: src/params/legaldoc.ts -> src/params.ts (defineParams).
  vite build imports that file with Node's own import(), so it imports
  #lib/legal.ts and legal.ts imports ./schema.ts by their real names.
- PWA: @vite-pwa/sveltekit never supported kit 3 and wrote the worker when
  the SERVER build closed, which kit 3's environment build does first.
  build/pwa.ts wires vite-plugin-pwa in a buildApp hook after kit's
  prerender and before its adapter, with the same globs and URL mapping.
- goto options renamed (replace, reset: false, refreshAll); the /games
  filter write is a shallow goto; a legacy /#/ path that matches no route
  falls back to location.replace (kit 3's goto rejects it). Hook types
  from @sveltejs/kit/hooks; the client handleError returns nothing to keep
  kit's message.
- runed 0.35 (bits-ui) peers kit ^2: overridden to our kit, as for
  echarts-wordcloud.

Verified against a kit 2 build of the same commit: same 11,037 files bar
hashed chunks, same non-immutable precache URLs, navigateFallback "/",
identical CSP per page (hashes masked), manifest and sitemap byte-equal,
same visible text.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-26 14:35:49 +07:00
..