diff --git a/.github/workflows/svelte-check.yml b/.github/workflows/svelte-check.yml index 2db0415a..fa98d2ce 100644 --- a/.github/workflows/svelte-check.yml +++ b/.github/workflows/svelte-check.yml @@ -8,7 +8,7 @@ on: - ".github/svelte-check-matcher.json" - "frontend/package.json" - "frontend/tsconfig.json" - - "frontend/svelte.config.js" + - "frontend/vite.config.ts" pull_request: branches: [main, breaking/**] paths: @@ -16,7 +16,7 @@ on: - ".github/svelte-check-matcher.json" - "frontend/package.json" - "frontend/tsconfig.json" - - "frontend/svelte.config.js" + - "frontend/vite.config.ts" workflow_dispatch: permissions: diff --git a/AGENTS.md b/AGENTS.md index d2c5b4ea..79cfd9b8 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -54,10 +54,9 @@ cd ../.. && pnpm test # = playwright test in tests/ ## Frontend (SvelteKit) - **Svelte 5 runes only:** `$state`, `$derived`, `$props`, `$bindable`. No `export let`. Event - modifiers are gone — use `preventDefault` from `$lib/utils/event-util` (`onsubmit={preventDefault(fn)}`). -- **Forms:** use the custom `createForm(schema, initial)` from `$lib/utils/form-util.ts` with - `form-input.svelte`. The vendored shadcn formsnap/superforms wrappers exist but app forms don't - use them — match the surrounding file. Import zod as `import { z } from 'zod/v4'`. + modifiers are gone — use `preventDefault` from `#lib/utils/event-util.ts` (`onsubmit={preventDefault(fn)}`). +- **Forms:** use the custom `createForm(schema, initial)` from `#lib/utils/form-util.ts` with + `form-input.svelte` — match the surrounding file. Import zod as `import { z } from 'zod/v4'`. ## Coding Style Guidelines diff --git a/frontend/components.json b/frontend/components.json index cb523fda..082e8891 100644 --- a/frontend/components.json +++ b/frontend/components.json @@ -5,11 +5,11 @@ "baseColor": "neutral" }, "aliases": { - "components": "$lib/components", - "utils": "$lib/utils/style", - "ui": "$lib/components/ui", - "hooks": "$lib/hooks", - "lib": "$lib" + "components": "#lib/components", + "utils": "#lib/utils/style.ts", + "ui": "#lib/components/ui", + "hooks": "#lib/hooks", + "lib": "#lib" }, "typescript": true, "registry": "https://shadcn-svelte.com/registry", diff --git a/frontend/package.json b/frontend/package.json index 2fd902c0..794b7ecc 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -27,7 +27,6 @@ "date-fns": "^4.2.1", "qrcode": "^1.5.4", "runed": "^0.37.1", - "sveltekit-superforms": "^2.30.1", "tailwind-merge": "^3.6.0", "zod": "^4.4.3" }, @@ -38,8 +37,8 @@ "@inlang/plugin-message-format": "^4.4.0", "@internationalized/date": "^3.12.1", "@lucide/svelte": "^1.16.0", - "@sveltejs/adapter-static": "^3.0.10", - "@sveltejs/kit": "^2.60.1", + "@sveltejs/adapter-static": "^4.0.0", + "@sveltejs/kit": "^3.0.0", "@sveltejs/vite-plugin-svelte": "^7.1.2", "@types/node": "^25.9.0", "@types/qrcode": "^1.5.6", @@ -47,7 +46,6 @@ "eslint": "^10.4.0", "eslint-config-prettier": "^10.1.8", "eslint-plugin-svelte": "^3.17.1", - "formsnap": "^2.0.1", "globals": "^17.6.0", "mode-watcher": "^1.1.0", "prettier": "^3.8.3", @@ -56,8 +54,8 @@ "rollup": "^4.63.3", "rollup-plugin-sbom": "4.0.0", "shadcn-svelte": "^1.3.0", - "svelte": "^5.55.8", - "svelte-check": "^4.4.8", + "svelte": "^5.57.1", + "svelte-check": "^4.7.6", "svelte-sonner": "^1.1.1", "tailwind-variants": "^3.2.2", "tailwindcss": "^4.3.0", @@ -65,5 +63,8 @@ "typescript": "^6.0.3", "typescript-eslint": "^8.59.4", "vite": "^8.0.16" + }, + "imports": { + "#lib/*": "./src/lib/*" } } diff --git a/frontend/src/app.d.ts b/frontend/src/app.d.ts index 342b5eba..3f8acc34 100644 --- a/frontend/src/app.d.ts +++ b/frontend/src/app.d.ts @@ -4,7 +4,6 @@ declare global { namespace App { interface Error { message: string; - status?: number; } // interface Locals {} // interface PageData {} diff --git a/frontend/src/hooks.client.ts b/frontend/src/hooks.client.ts index 0e2a9f3f..d40119d3 100644 --- a/frontend/src/hooks.client.ts +++ b/frontend/src/hooks.client.ts @@ -1,21 +1,22 @@ -import type { HandleClientError } from '@sveltejs/kit'; +import type { HandleClientError } from '@sveltejs/kit/hooks'; import { isAxiosError } from 'axios'; -import { getAxiosErrorMessage, getAxiosErrorRequestId } from '$lib/utils/error-util'; +import { getAxiosErrorMessage, getAxiosErrorRequestId } from '#lib/utils/error-util.ts'; -export const handleError: HandleClientError = async ({ error, message, status }) => { +export const handleError: HandleClientError = ({ kind, error }) => { + // Preserve safe application and framework errors, including their status codes + if (kind !== 'unknown') return error; + + // Retain API error messages and request IDs for failed backend requests if (isAxiosError(error)) { - message = getAxiosErrorMessage(error, message); - status = error.response?.status || status; + const message = getAxiosErrorMessage(error); + const status = error.response?.status || 500; console.error( `Axios error: ${error.request?.path ?? 'unknown path'} - ${getAxiosErrorMessage(error, error.message)}`, { requestId: getAxiosErrorRequestId(error) } ); - } else { - console.error(error); + return { message, status }; } - return { - message, - status - }; + // Keep SvelteKit's generic response for unexpected errors while logging the cause + console.error(error); }; diff --git a/frontend/src/lib/components/api-access-cell.svelte b/frontend/src/lib/components/api-access-cell.svelte index 4973c76d..416aa42e 100644 --- a/frontend/src/lib/components/api-access-cell.svelte +++ b/frontend/src/lib/components/api-access-cell.svelte @@ -1,5 +1,5 @@ -{#if navigating.to} +{#if navigating.to && !navigating.shallow}
{/if} diff --git a/frontend/src/lib/components/oidc-client-avatar.svelte b/frontend/src/lib/components/oidc-client-avatar.svelte index 53e2f92c..4ffef648 100644 --- a/frontend/src/lib/components/oidc-client-avatar.svelte +++ b/frontend/src/lib/components/oidc-client-avatar.svelte @@ -1,8 +1,8 @@ diff --git a/frontend/src/lib/components/ui/alert-dialog/alert-dialog-action.svelte b/frontend/src/lib/components/ui/alert-dialog/alert-dialog-action.svelte index 946a1870..d79f2be8 100644 --- a/frontend/src/lib/components/ui/alert-dialog/alert-dialog-action.svelte +++ b/frontend/src/lib/components/ui/alert-dialog/alert-dialog-action.svelte @@ -4,8 +4,8 @@ buttonVariants, type ButtonVariant, type ButtonSize - } from '$lib/components/ui/button/index.js'; - import { cn } from '$lib/utils/style.js'; + } from '#lib/components/ui/button/index.js'; + import { cn } from '#lib/utils/style.js'; let { ref = $bindable(null), diff --git a/frontend/src/lib/components/ui/alert-dialog/alert-dialog-cancel.svelte b/frontend/src/lib/components/ui/alert-dialog/alert-dialog-cancel.svelte index f3089db6..61f9f18f 100644 --- a/frontend/src/lib/components/ui/alert-dialog/alert-dialog-cancel.svelte +++ b/frontend/src/lib/components/ui/alert-dialog/alert-dialog-cancel.svelte @@ -4,8 +4,8 @@ buttonVariants, type ButtonVariant, type ButtonSize - } from '$lib/components/ui/button/index.js'; - import { cn } from '$lib/utils/style.js'; + } from '#lib/components/ui/button/index.js'; + import { cn } from '#lib/utils/style.js'; let { ref = $bindable(null), diff --git a/frontend/src/lib/components/ui/alert-dialog/alert-dialog-content.svelte b/frontend/src/lib/components/ui/alert-dialog/alert-dialog-content.svelte index 805a9331..7b43c00a 100644 --- a/frontend/src/lib/components/ui/alert-dialog/alert-dialog-content.svelte +++ b/frontend/src/lib/components/ui/alert-dialog/alert-dialog-content.svelte @@ -2,7 +2,7 @@ import { AlertDialog as AlertDialogPrimitive } from 'bits-ui'; import AlertDialogPortal from './alert-dialog-portal.svelte'; import AlertDialogOverlay from './alert-dialog-overlay.svelte'; - import { cn, type WithoutChild, type WithoutChildrenOrChild } from '$lib/utils/style.js'; + import { cn, type WithoutChild, type WithoutChildrenOrChild } from '#lib/utils/style.js'; import type { ComponentProps } from 'svelte'; let { diff --git a/frontend/src/lib/components/ui/alert-dialog/alert-dialog-description.svelte b/frontend/src/lib/components/ui/alert-dialog/alert-dialog-description.svelte index 3d6ede31..3930f40f 100644 --- a/frontend/src/lib/components/ui/alert-dialog/alert-dialog-description.svelte +++ b/frontend/src/lib/components/ui/alert-dialog/alert-dialog-description.svelte @@ -1,6 +1,6 @@ - - diff --git a/frontend/src/lib/components/ui/form/form-description.svelte b/frontend/src/lib/components/ui/form/form-description.svelte deleted file mode 100644 index 2f4f642e..00000000 --- a/frontend/src/lib/components/ui/form/form-description.svelte +++ /dev/null @@ -1,17 +0,0 @@ - - -