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

main
ts 59 lines 1.91 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 Vocs build. */
5 export const VOCS_FRAMEWORK_SPECIFIER = "@alchemy.run/frontend-frameworks/vocs/node";
6
7 /** The Node container deploy target for the Vocs build. */
8 export const VOCS_NODE_TARGET_SPECIFIER = "@alchemy.run/frontend-frameworks/vocs/node";
9
10 export interface VocsProps extends FrameworkSiteProps {
11 /**
12 * Vocs build output directory, relative to {@link rootDir}. Set this when
13 * `vocs.config.*` customizes `outDir` so generated output stays outside the
14 * rebuild hash.
15 * @default "dist"
16 */
17 outDir?: string;
18 }
19
20 /**
21 * Deploy a [Vocs](https://vocs.dev) documentation project to Railway: static
22 * assets first, then Vocs' Waku RSC handler (`/about` not `/about/`) from
23 * one `Railway.Service`.
24 *
25 * Requires `@alchemy.run/frontend-frameworks`, `vocs`, and Vocs' Waku peer
26 * dependencies in the project.
27 *
28 * During `alchemy dev` the site is Vocs' own dev server and no cloud
29 * resources are created. `Alchemy.remote()` opts back into the live
30 * Service path.
31 *
32 * ### Deploying a Vocs Site
33 * **Example:** Vocs documentation site
34 * ```typescript
35 * const docs = yield* Railway.Website.Vocs("Docs", {
36 * rootDir: "./docs",
37 * });
38 * ```
39 *
40 * ### Custom Build Output
41 * **Example:** Custom output directory
42 * ```typescript
43 * // vocs.config.ts: defineConfig({ outDir: "build" })
44 * const docs = yield* Railway.Website.Vocs("Docs", {
45 * rootDir: "./docs",
46 * outDir: "build",
47 * });
48 * ```
49 *
50 * @resource
51 * @product Website
52 */
53 export const Vocs = (id: string, props: VocsProps = {}) =>
54 makeFrameworkSite(id, props, {
55 name: "Vocs",
56 framework: VOCS_FRAMEWORK_SPECIFIER,
57 target: VOCS_NODE_TARGET_SPECIFIER,
58 options: props.outDir !== undefined ? { outDir: props.outDir } : undefined,
59 }).pipe(Namespace.push(id));