feat: upgrade to SvelteKit 3 and adapter-bun
Some checks failed
Test and deploy staging / staging (push) Failing after 43s
Some checks failed
Test and deploy staging / staging (push) Failing after 43s
Run the sveltekit-3 migration and finish its manual tasks:
- Move kit config into the sveltekit() Vite plugin; drop svelte.config.js
- Replace $lib with #lib subpath imports
- Declare env vars in src/env.ts and import them from $app/env/{private,public}
- Consolidate param matchers into src/params.ts
- Use error(status, message), Response.json, refreshAll and goto reset/shallow
- Fall back to a full page load when goto rejects a login return path
Switch from adapter-node to adapter-bun: the build script runs Vite under
Bun (the adapter requires it) and the image starts with `bun ./build`.
Runtime env names (PORT, BODY_SIZE_LIMIT, ADDRESS_HEADER, ...) are unchanged.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,15 +1,15 @@
|
||||
<script lang="ts">
|
||||
import '../app.css';
|
||||
import { onMount } from 'svelte';
|
||||
import { assets, resolve } from '$app/paths';
|
||||
import { dev } from '$app/environment';
|
||||
import { resolve, asset } from '$app/paths';
|
||||
import { dev } from '$app/env';
|
||||
import { page } from '$app/state';
|
||||
import { getSeo } from '$lib/seo';
|
||||
import CopyButton from '$lib/components/CopyButton.svelte';
|
||||
import ProjectIcon from '$lib/components/ProjectIcon.svelte';
|
||||
import { projects } from '$lib/projects';
|
||||
import { Button, buttonVariants } from '$lib/components/ui/button/index.js';
|
||||
import * as Sheet from '$lib/components/ui/sheet/index.js';
|
||||
import { getSeo } from '#lib/seo.js';
|
||||
import CopyButton from '#lib/components/CopyButton.svelte';
|
||||
import ProjectIcon from '#lib/components/ProjectIcon.svelte';
|
||||
import { projects } from '#lib/projects.js';
|
||||
import { Button, buttonVariants } from '#lib/components/ui/button/index.js';
|
||||
import * as Sheet from '#lib/components/ui/sheet/index.js';
|
||||
import ArrowRight from 'lucide-svelte/icons/arrow-right';
|
||||
import ChevronDown from 'lucide-svelte/icons/chevron-down';
|
||||
import ExternalLink from 'lucide-svelte/icons/external-link';
|
||||
@@ -179,7 +179,7 @@
|
||||
>
|
||||
<span class="h-7 w-7 overflow-hidden rounded-full bg-black"
|
||||
><img
|
||||
src="{assets}/favicon-32x32.png"
|
||||
src={asset('favicon-32x32.png')}
|
||||
alt=""
|
||||
width="32"
|
||||
height="32"
|
||||
@@ -199,7 +199,7 @@
|
||||
onpointerleave={handleProjectsPointerLeave}
|
||||
>
|
||||
<Button
|
||||
href={resolve('/projects')}
|
||||
href={resolve('projects')}
|
||||
variant={current(item.href) ? 'secondary' : 'ghost'}
|
||||
size="sm"
|
||||
class="cursor-pointer gap-1"
|
||||
@@ -217,7 +217,7 @@
|
||||
aria-label="Projects"
|
||||
>
|
||||
<a
|
||||
href={resolve('/projects')}
|
||||
href={resolve('projects')}
|
||||
class="flex items-center rounded-sm px-2 py-1.5 text-sm font-medium outline-none hover:bg-accent hover:text-accent-foreground focus-visible:bg-accent"
|
||||
>all projects <ArrowRight size={14} class="ml-auto" /></a
|
||||
>
|
||||
@@ -266,13 +266,13 @@
|
||||
title={`Theme: ${theme}`}>{@render themeIcon()}</Button
|
||||
>
|
||||
{#if data.user}
|
||||
<Button href={resolve('/account')} variant="outline" size="sm" class="max-w-36 truncate"
|
||||
<Button href={resolve('account')} variant="outline" size="sm" class="max-w-36 truncate"
|
||||
>{data.user.name}</Button
|
||||
>
|
||||
{:else}
|
||||
<Button
|
||||
href={resolve(
|
||||
`/login?returnTo=${encodeURIComponent(page.url.pathname + page.url.search)}`
|
||||
`login?returnTo=${encodeURIComponent(page.url.pathname + page.url.search)}`
|
||||
)}
|
||||
variant="outline"
|
||||
size="sm">sign in</Button
|
||||
@@ -322,20 +322,18 @@
|
||||
aria-label={`Theme: ${theme}. Switch mode`}>{@render themeIcon()}</Button
|
||||
>
|
||||
{#if data.user}
|
||||
<Button
|
||||
href={resolve('/account')}
|
||||
variant="outline"
|
||||
onclick={() => (menuOpen = false)}>account</Button
|
||||
<Button href={resolve('account')} variant="outline" onclick={() => (menuOpen = false)}
|
||||
>account</Button
|
||||
>
|
||||
<form method="POST" action="/logout">
|
||||
<Button type="submit" variant="outline">sign out</Button>
|
||||
</form>
|
||||
{:else}
|
||||
<Button href={resolve('/login')} variant="outline" onclick={() => (menuOpen = false)}
|
||||
<Button href={resolve('login')} variant="outline" onclick={() => (menuOpen = false)}
|
||||
>sign in</Button
|
||||
>
|
||||
<Button
|
||||
href={resolve('/register')}
|
||||
href={resolve('register')}
|
||||
variant="outline"
|
||||
onclick={() => (menuOpen = false)}>register</Button
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user