1import * as Namespace from "../../Namespace.ts";
2import { makeFrameworkSite, type FrameworkSiteProps } from "./FrameworkSite.ts";
3
4/** Configuration for a Prisma Vocs website. */
5export interface VocsProps extends FrameworkSiteProps {
6 /** Production output directory relative to rootDir, matching vocs.config.*. @default "dist" */
7 outDir?: string;
8}
9
10/**
11 * Vocs documentation and its Waku RSC handler on Prisma Compute. Install Vocs and its Waku peers alongside the framework integration.
12 *
13 * Native framework development and HMR run without Prisma cloud resources.
14 * Apply `Alchemy.remote()` to use the live Compute deployment during dev.
15 * Packaging requires the optional `@vercel/nft` peer dependency.
16 *
17 * ### Creating a Website
18 * **Example:** Vocs application
19 * ```typescript
20 * const site = yield* Prisma.Website.Vocs("Web", {
21 * rootDir: "./app",
22 * });
23 * ```
24 *
25 * ### Deployment Configuration
26 * **Example:** Existing project and custom hostname
27 * ```typescript
28 * const site = yield* Prisma.Website.Vocs("Web", {
29 * project,
30 * domain: "www.example.com",
31 * env: { API_BASE: "https://api.example.com" },
32 * compute: { destroyOldDeployment: true },
33 * });
34 * ```
35 *
36 * @resource
37 * @product Website
38 */
39export const Vocs = (id: string, props: VocsProps = {}) =>
40 makeFrameworkSite(id, props, {
41 framework: "@alchemy.run/frontend-frameworks/vocs/node",
42 target: "@alchemy.run/frontend-frameworks/vocs/node",
43 options: { outDir: props.outDir },
44 htmlHandling: "drop-trailing-slash",
45 }).pipe(Namespace.push(id));