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

main
ts 54 lines 1.8 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 * The `adapter` field is injected by the Node deploy target and may not
14 * be set here. Must be JSON-serializable (it persists in state).
15 */
16 kit?: Record<string, unknown>;
17 }
18
19 /**
20 * Deploy a SvelteKit application to a Hetzner Cloud Server: kit's SSR
21 * server as a systemd unit on port 3000, static assets (prerendered
22 * pages included) baked into the unit.
23 *
24 * The build runs through `@alchemy.run/frontend-frameworks/sveltekit` with
25 * the `@alchemy.run/frontend-frameworks/sveltekit/node` deploy target.
26 *
27 *
28 * ### Creating SvelteKit Sites
29 * **Example:** Basic SvelteKit App
30 * ```typescript
31 * const site = yield* Hetzner.Website.SvelteKit("Web", {
32 * rootDir: "./app",
33 * });
34 * ```
35 *
36 * **Example:** Custom Domain
37 * ```typescript
38 * const site = yield* Hetzner.Website.SvelteKit("Web", {
39 * rootDir: "./app",
40 * domain: "app.example.com",
41 * zone,
42 * });
43 * ```
44 *
45 * @resource
46 * @product Website
47 */
48 export const SvelteKit = (id: string, props: SvelteKitProps = {}) =>
49 makeFrameworkSite(id, props, {
50 name: "SvelteKit",
51 framework: SVELTEKIT_FRAMEWORK_SPECIFIER,
52 target: SVELTEKIT_NODE_TARGET_SPECIFIER,
53 options: props.kit ? { kit: props.kit } : undefined,
54 }).pipe(Namespace.push(id));