The best way to control Claude Code, Codex and more from any computer or phone
| 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 a Hetzner Cloud Server: |
| 27 | * the RSC server as a systemd unit on port 3000, static assets (SSG |
| 28 | * pages included) baked into the unit. Prerendered pages are served |
| 29 | * extensionless (`/about` not `/about/`). |
| 30 | * |
| 31 | * |
| 32 | * ### Creating Waku Sites |
| 33 | * **Example:** Basic Waku App |
| 34 | * ```typescript |
| 35 | * const site = yield* Hetzner.Website.Waku("Web", { |
| 36 | * rootDir: "./app", |
| 37 | * }); |
| 38 | * ``` |
| 39 | * |
| 40 | * **Example:** Custom Domain |
| 41 | * ```typescript |
| 42 | * const site = yield* Hetzner.Website.Waku("Web", { |
| 43 | * rootDir: "./app", |
| 44 | * domain: "app.example.com", |
| 45 | * zone, |
| 46 | * }); |
| 47 | * ``` |
| 48 | * |
| 49 | * @resource |
| 50 | * @product Website |
| 51 | */ |
| 52 | export const Waku = (id: string, props: WakuProps = {}) => |
| 53 | makeFrameworkSite(id, props, { |
| 54 | name: "Waku", |
| 55 | framework: WAKU_FRAMEWORK_SPECIFIER, |
| 56 | target: WAKU_NODE_TARGET_SPECIFIER, |
| 57 | options: wakuOptions(props), |
| 58 | htmlHandling: "drop-trailing-slash", |
| 59 | }).pipe(Namespace.push(id)); |