| 1 | import * as Namespace from "../../Namespace.ts"; |
| 2 | import { makeFrameworkSite, type FrameworkSiteProps } from "./FrameworkSite.ts"; |
| 3 | |
| 4 | /** Configuration for a Prisma Octane website. */ |
| 5 | export interface OctaneProps extends FrameworkSiteProps {} |
| 6 | |
| 7 | /** |
| 8 | * Octane SSR and client assets on Prisma Compute. |
| 9 | * |
| 10 | * `Prisma.Website.Octane` selects hosting and automatically wraps Octane's |
| 11 | * default native Node output for Bun on Compute. Keep compiler and route |
| 12 | * settings in `octane.config.ts` without an adapter. The legacy Node marker |
| 13 | * adapter remains optional for existing projects. |
| 14 | * |
| 15 | * Native framework development and HMR run without Prisma cloud resources. |
| 16 | * Apply `Alchemy.remote()` to use the live Compute deployment during dev. |
| 17 | * Packaging requires the optional `@vercel/nft` peer dependency. |
| 18 | * |
| 19 | * ### Creating a Website |
| 20 | * **Example:** Octane application |
| 21 | * ```typescript |
| 22 | * const site = yield* Prisma.Website.Octane("Web", { |
| 23 | * rootDir: "./app", |
| 24 | * }); |
| 25 | * ``` |
| 26 | * |
| 27 | * ### Deployment Configuration |
| 28 | * **Example:** Existing project and custom hostname |
| 29 | * ```typescript |
| 30 | * const site = yield* Prisma.Website.Octane("Web", { |
| 31 | * project, |
| 32 | * domain: "www.example.com", |
| 33 | * env: { API_BASE: "https://api.example.com" }, |
| 34 | * compute: { destroyOldDeployment: true }, |
| 35 | * }); |
| 36 | * ``` |
| 37 | * |
| 38 | * @resource |
| 39 | * @product Website |
| 40 | */ |
| 41 | export const Octane = (id: string, props: OctaneProps = {}) => |
| 42 | makeFrameworkSite(id, props, { |
| 43 | framework: "@alchemy.run/frontend-frameworks/octane", |
| 44 | target: "@alchemy.run/frontend-frameworks/octane/node", |
| 45 | }).pipe(Namespace.push(id)); |