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

main
ts 63 lines 1.85 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 Waku build. */
5 export const WAKU_FRAMEWORK_SPECIFIER = "@alchemy.run/frontend-frameworks/waku";
6
7 /** The Node container deploy target for the Waku build. */
8 export const WAKU_NODE_TARGET_SPECIFIER = "@alchemy.run/frontend-frameworks/waku/node";
9
10 const wakuOptions = (props: WakuProps) =>
11 props.waku !== undefined ? { waku: props.waku } : undefined;
12
13 export interface WakuProps extends FrameworkSiteProps {
14 /**
15 * Serializable Waku config merged OVER the project's own
16 * `waku.config.*`.
17 */
18 waku?: {
19 srcDir?: string;
20 distDir?: string;
21 basePath?: string;
22 };
23 }
24
25 /**
26 * Deploy a [Waku](https://waku.gg) application to Railway: the RSC server
27 * plus SSG pages on one `Railway.Service`. The Node deploy target selects
28 * waku's `node` adapter; do not set `unstable_adapter`. SSG pages are
29 * served extensionless (`/about`).
30 *
31 * During `alchemy dev` the site is Waku's own dev server and no cloud
32 * resources are created. `Alchemy.remote()` opts back into the live
33 * Service path.
34 *
35 * ### Creating Waku Sites
36 * **Example:** Basic Waku App
37 * ```typescript
38 * const site = yield* Railway.Website.Waku("Web", {
39 * rootDir: "./app",
40 * });
41 * ```
42 *
43 * ### Server Configuration
44 * **Example:** Process Environment
45 * ```typescript
46 * const site = yield* Railway.Website.Waku("Web", {
47 * rootDir: "./app",
48 * env: {
49 * API_BASE: "https://api.example.com",
50 * },
51 * });
52 * ```
53 *
54 * @resource
55 * @product Website
56 */
57 export const Waku = (id: string, props: WakuProps = {}) =>
58 makeFrameworkSite(id, props, {
59 name: "Waku",
60 framework: WAKU_FRAMEWORK_SPECIFIER,
61 target: WAKU_NODE_TARGET_SPECIFIER,
62 options: wakuOptions(props),
63 }).pipe(Namespace.push(id));