@devries-cameron20 / t3code Mirror · read-only
Fork 0

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

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 21, 06:00 UTC

main
ts 65 lines 1.87 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 Fly: the RSC server on a
35 * Machine, 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* Fly.Website.Waku("Web", {
43 * rootDir: "./app",
44 * });
45 * ```
46 *
47 * **Example:** Custom Domain
48 * ```typescript
49 * const site = yield* Fly.Website.Waku("Web", {
50 * rootDir: "./app",
51 * domain: "app.example.com",
52 * });
53 * ```
54 *
55 * @resource
56 * @product Website
57 */
58 export const Waku = (id: string, props: WakuProps = {}) =>
59 frameworkSite(id, props, {
60 name: "Waku",
61 framework: WAKU_FRAMEWORK_SPECIFIER,
62 target: WAKU_NODE_TARGET_SPECIFIER,
63 options: wakuOptions(props),
64 htmlHandling: "drop-trailing-slash",
65 });