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

main
ts 66 lines 1.97 KB
Raw
1 import { frameworkSite, type FrameworkSiteProps } from "./FrameworkSite.ts";
2
3 /** The framework-integration package that drives the Waku build. */
4 export const WAKU_FRAMEWORK_SPECIFIER = "@alchemy.run/frontend-frameworks/waku";
5
6 /** The Node container deploy target for the Waku build. */
7 export const WAKU_NODE_TARGET_SPECIFIER = "@alchemy.run/frontend-frameworks/waku/node";
8
9 const wakuOptions = (props: WakuProps) =>
10 props.waku !== undefined ? { waku: props.waku } : undefined;
11
12 export interface WakuProps extends FrameworkSiteProps {
13 /**
14 * Serializable Waku config merged OVER the project's own
15 * `waku.config.*`.
16 */
17 waku?: {
18 /**
19 * Source directory, relative to `rootDir` (waku's `srcDir`).
20 * @default the project's `waku.config.*` value, or `"src"`
21 */
22 srcDir?: string;
23 /**
24 * Build output directory (waku's `distDir`).
25 * @default the project's `waku.config.*` value, or `"dist"`
26 */
27 distDir?: string;
28 /** Public base path the site deploys under (waku's `basePath`). */
29 basePath?: string;
30 };
31 }
32
33 /**
34 * Deploy a [Waku](https://waku.gg) application to Cloud Run: the RSC server in a
35 * Cloud Run container, static assets (SSG pages included) baked into the image.
36 * Prerendered pages are served extensionless (`/about`).
37 *
38 *
39 * ### Creating Waku Sites
40 * **Example:** Basic Waku App
41 * ```typescript
42 * const site = yield* GCP.Website.Waku("Web", {
43 * rootDir: "./app",
44 * });
45 * ```
46 *
47 * **Example:** Warm Instance with More Memory
48 * ```typescript
49 * const site = yield* GCP.Website.Waku("Web", {
50 * rootDir: "./app",
51 * scaling: { minInstanceCount: 1 },
52 * resources: { limits: { cpu: "1", memory: "1Gi" } },
53 * });
54 * ```
55 *
56 * @resource
57 * @product Website
58 */
59 export const Waku = (id: string, props: WakuProps = {}) =>
60 frameworkSite(id, props, {
61 name: "Waku",
62 framework: WAKU_FRAMEWORK_SPECIFIER,
63 target: WAKU_NODE_TARGET_SPECIFIER,
64 options: wakuOptions(props),
65 htmlHandling: "drop-trailing-slash",
66 });