@devries-cameron20 / t3code Mirror · read-only
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 21, 06:00 UTC

main
ts 58 lines 1.99 KB
Raw
1 import * as Namespace from "alchemy/Namespace";
2 import { makeFrameworkSite, type FrameworkSiteProps } from "./FrameworkSite.ts";
3
4 /** The framework-integration package that drives the SvelteKit build. */
5 export const SVELTEKIT_FRAMEWORK_SPECIFIER = "@alchemy.run/frontend-frameworks/sveltekit";
6
7 /** The Node container deploy target for the SvelteKit build. */
8 export const SVELTEKIT_NODE_TARGET_SPECIFIER = "@alchemy.run/frontend-frameworks/sveltekit/node";
9
10 export interface SvelteKitProps extends FrameworkSiteProps {
11 /**
12 * SvelteKit configuration passed to the `sveltekit(config)` Vite plugin
13 * (kit v3 takes its config in memory — a `svelte.config.js` on disk is an
14 * upstream error). The `adapter` field is injected by the Node deploy
15 * target and may not be set here. Must be JSON-serializable (it persists
16 * in state).
17 */
18 kit?: Record<string, unknown>;
19 }
20
21 /**
22 * Deploy a SvelteKit application to Railway: kit's SSR server plus
23 * prerendered assets on one `Railway.Service`. The Node deploy target
24 * injects an in-memory kit adapter; do not set `adapter` in `kit`.
25 *
26 * During `alchemy dev` the site is SvelteKit's own dev server and no cloud
27 * resources are created. `Alchemy.remote()` opts back into the live
28 * Service path.
29 *
30 * ### Creating SvelteKit Sites
31 * **Example:** Basic SvelteKit App
32 * ```typescript
33 * const site = yield* Railway.Website.SvelteKit("Web", {
34 * rootDir: "./app",
35 * });
36 * ```
37 *
38 * ### Server Configuration
39 * **Example:** Process Environment
40 * ```typescript
41 * const site = yield* Railway.Website.SvelteKit("Web", {
42 * rootDir: "./app",
43 * env: {
44 * API_BASE: "https://api.example.com",
45 * },
46 * });
47 * ```
48 *
49 * @resource
50 * @product Website
51 */
52 export const SvelteKit = (id: string, props: SvelteKitProps = {}) =>
53 makeFrameworkSite(id, props, {
54 name: "SvelteKit",
55 framework: SVELTEKIT_FRAMEWORK_SPECIFIER,
56 target: SVELTEKIT_NODE_TARGET_SPECIFIER,
57 options: props.kit ? { kit: props.kit } : undefined,
58 }).pipe(Namespace.push(id));