| 1 | import { frameworkSite, type FrameworkSiteProps } from "./FrameworkSite.ts"; |
| 2 | |
| 3 | /** The framework-integration package that drives the Octane build. */ |
| 4 | export const OCTANE_FRAMEWORK_SPECIFIER = |
| 5 | "@alchemy.run/frontend-frameworks/octane"; |
| 6 | |
| 7 | /** The Node container deploy target for the Octane build. */ |
| 8 | export const OCTANE_NODE_TARGET_SPECIFIER = |
| 9 | "@alchemy.run/frontend-frameworks/octane/node"; |
| 10 | |
| 11 | export interface OctaneProps extends FrameworkSiteProps {} |
| 12 | |
| 13 | /** |
| 14 | * Deploy an [OctaneJS](https://octanejs.dev) application to Cloud Run: Octane's |
| 15 | * SSR server in a Cloud Run container, static assets baked into the image. |
| 16 | * |
| 17 | * `GCP.Website.Octane` selects hosting and automatically wraps Octane's |
| 18 | * default native Node output. Keep compiler and route settings in |
| 19 | * `octane.config.ts` without an adapter. The legacy Node marker adapter |
| 20 | * remains optional for existing projects. |
| 21 | * |
| 22 | * ### Creating Octane Sites |
| 23 | * **Example:** Basic Octane App |
| 24 | * ```typescript |
| 25 | * const site = yield* GCP.Website.Octane("Web", { |
| 26 | * rootDir: "./app", |
| 27 | * }); |
| 28 | * ``` |
| 29 | * |
| 30 | * **Example:** Warm Instance with More Memory |
| 31 | * ```typescript |
| 32 | * const site = yield* GCP.Website.Octane("Web", { |
| 33 | * rootDir: "./app", |
| 34 | * scaling: { minInstanceCount: 1 }, |
| 35 | * resources: { limits: { cpu: "1", memory: "1Gi" } }, |
| 36 | * }); |
| 37 | * ``` |
| 38 | * |
| 39 | * @resource |
| 40 | * @product Website |
| 41 | */ |
| 42 | export const Octane = (id: string, props: OctaneProps = {}) => |
| 43 | frameworkSite(id, props, { |
| 44 | name: "Octane", |
| 45 | framework: OCTANE_FRAMEWORK_SPECIFIER, |
| 46 | target: OCTANE_NODE_TARGET_SPECIFIER, |
| 47 | }); |