This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { getApiV1UserOptions } from '$lib/api/client/@tanstack/svelte-query.gen.js'; | |
import { getLoadContext } from '$lib/load-context.js'; | |
export const load = async (event) => { | |
const { queryClient, fetch } = getLoadContext(event); | |
await queryClient.prefetchQuery( | |
getApiV1UserOptions({ | |
fetch, | |
}), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { resolveRoute } from '$app/paths'; | |
import type RouteMetadata from '$lib/../../.svelte-kit/types/route_meta_data.json'; | |
type RouteMetadata = typeof RouteMetadata; | |
// eslint-disable-next-line @typescript-eslint/ban-types | |
type Prettify<T> = { [K in keyof T]: T[K] } & {}; | |
type ParseParam<T extends string> = T extends `...${infer Name}` ? Name : T; | |
type ParseParams<T extends string> = T extends `${infer A}[[${infer Param}]]${infer B}` | |
? ParseParams<A> & { [K in ParseParam<Param>]?: string } & ParseParams<B> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function lucideSvelteImportOptimizer(): Plugin { | |
return { | |
name: 'vite-plugin-lucide-svelte-optimizer', | |
transform(code, id) { | |
const ms = new MagicString(code, { filename: id }); | |
ms.replace( | |
/([ \t]*)import\s+\{(.*?)\}\s+from\s+['"]lucide-svelte['"];?/g, | |
(match, whitespace: string, importNames: string) => { | |
const hasSemi = match.endsWith(';'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { sse } from '$lib'; | |
import type { RequestHandler } from './$types'; | |
export const GET: RequestHandler = async () => { | |
return sse<number>(async ({ write, onClose }) => { | |
const id = setInterval(() => { | |
write({ data: Date.now() }); | |
}, 1000); | |
onClose(() => { |