The best way to control Claude Code, Codex and more from any computer or phone
| 1 | import { frameworkSite, type FrameworkSiteProps } from "./FrameworkSite.ts"; |
| 2 | |
| 3 | /** The framework-integration package that drives the SvelteKit build. */ |
| 4 | export const SVELTEKIT_FRAMEWORK_SPECIFIER = "@alchemy.run/frontend-frameworks/sveltekit"; |
| 5 | |
| 6 | /** The Node container deploy target for the SvelteKit build. */ |
| 7 | export const SVELTEKIT_NODE_TARGET_SPECIFIER = "@alchemy.run/frontend-frameworks/sveltekit/node"; |
| 8 | |
| 9 | export interface SvelteKitProps extends FrameworkSiteProps { |
| 10 | /** |
| 11 | * SvelteKit configuration passed to the `sveltekit(config)` Vite plugin. |
| 12 | * The `adapter` field is injected by the Node deploy target and may not |
| 13 | * be set here. Must be JSON-serializable. |
| 14 | */ |
| 15 | kit?: Record<string, unknown>; |
| 16 | } |
| 17 | |
| 18 | /** |
| 19 | * Deploy a SvelteKit application to Fly: kit's SSR server on a Machine, |
| 20 | * static assets baked into the image, served assets-first then the |
| 21 | * framework handler. |
| 22 | * |
| 23 | * |
| 24 | * ### Creating SvelteKit Sites |
| 25 | * **Example:** Basic SvelteKit App |
| 26 | * ```typescript |
| 27 | * const site = yield* Fly.Website.SvelteKit("Web", { |
| 28 | * rootDir: "./app", |
| 29 | * }); |
| 30 | * ``` |
| 31 | * |
| 32 | * **Example:** Custom Domain |
| 33 | * ```typescript |
| 34 | * const site = yield* Fly.Website.SvelteKit("Web", { |
| 35 | * rootDir: "./app", |
| 36 | * domain: "app.example.com", |
| 37 | * }); |
| 38 | * ``` |
| 39 | * |
| 40 | * @resource |
| 41 | * @product Website |
| 42 | */ |
| 43 | export const SvelteKit = (id: string, props: SvelteKitProps = {}) => |
| 44 | frameworkSite(id, props, { |
| 45 | name: "SvelteKit", |
| 46 | framework: SVELTEKIT_FRAMEWORK_SPECIFIER, |
| 47 | target: SVELTEKIT_NODE_TARGET_SPECIFIER, |
| 48 | options: props.kit ? { kit: props.kit } : undefined, |
| 49 | }); |