refactor: $app/stores → $app/state, legacy stores → runes

Codemod-driven migration of 55 .svelte files from the deprecated
$app/stores module to the rune-based $app/state ($page.x → page.x,
no auto-subscription wrapper). Two custom writable() stores converted
to .svelte.ts factory functions matching the existing theme store
pattern, with consumers updated to use .value getters and the explicit
.set() method.

UserHeader.svelte's login link now guards page.url.search behind
the browser flag — search-param access throws during prerender, and
this defensive change unblocks future prerender adoption on any page
that includes the header.
This commit is contained in:
2026-04-29 22:31:16 +02:00
parent e5d218820b
commit 3cd2a678a6
62 changed files with 255 additions and 178 deletions
@@ -2,7 +2,7 @@
import { resolve } from '$app/paths';
import { onMount } from 'svelte';
import { goto } from '$app/navigation';
import { page } from '$app/stores';
import { page } from '$app/state';
import ProfilePicture from './ProfilePicture.svelte';
import EditButton from '$lib/components/EditButton.svelte';
import { getCategoryEmoji } from '$lib/utils/categories';
@@ -13,9 +13,9 @@
let { paymentId, onclose, onpaymentDeleted } = $props();
// Get session from page store
let session = $derived($page.data?.session);
let session = $derived(page.data?.session);
const lang = $derived(detectCospendLang($page.url.pathname));
const lang = $derived(detectCospendLang(page.url.pathname));
const root = $derived(cospendRoot(lang));
const loc = $derived(locale(lang));