@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 2.13 KB
Raw
1 import * as Namespace from "alchemy/Namespace";
2 import { makeFrameworkSite, type FrameworkSiteProps } from "./FrameworkSite.ts";
3
4 /**
5 * The vinext-on-Node framework module (vinext's Vite build +
6 * `startProdServer`). Not the Cloudflare Worker source.
7 */
8 export const VINEXT_NODE_FRAMEWORK_SPECIFIER = "@alchemy.run/frontend-frameworks/vinext/node";
9
10 export interface VinextProps extends FrameworkSiteProps {}
11
12 /**
13 * Deploy a [vinext](https://vinext.dev) application to Cloud Run as a
14 * long-running Node process: vinext's Vite build, then vinext's production
15 * server (`startProdServer`). The `dist/` output is baked into the
16 * image; `vinext`, `react`, `react-dom`, and `react-server-dom-webpack`
17 * are installed with `npm install` rather than bundled.
18 *
19 * Do not use the Cloudflare Worker entry (`vinext/server/fetch-handler`)
20 * — that is workerd.
21 *
22 * During `alchemy dev` the site is `vinext dev` and no cloud resources
23 * are declared; `Alchemy.remote()` opts back into the live Cloud Run
24 * service.
25 *
26 * ### Creating vinext Sites
27 * **Example:** Basic vinext App
28 * ```typescript
29 * const site = yield* GCP.Website.Vinext("Web", {
30 * rootDir: "./app",
31 * });
32 * ```
33 *
34 * **Example:** Warm Instance with More Memory
35 * ```typescript
36 * const site = yield* GCP.Website.Vinext("Web", {
37 * rootDir: "./app",
38 * scaling: { minInstanceCount: 1 },
39 * resources: { limits: { cpu: "1", memory: "1Gi" } },
40 * });
41 * ```
42 *
43 * ### Data Cache
44 * **Example:** Redis data cache
45 * ISR / `"use cache"` default to in-process memory, which Cloud Run
46 * instances do not share. Set `env.REDIS_URL` for a durable Redis store;
47 * the adapter is injected automatically.
48 * ```typescript
49 * const site = yield* GCP.Website.Vinext("Web", {
50 * env: {
51 * REDIS_URL: "redis://10.0.0.3:6379",
52 * },
53 * });
54 * ```
55 *
56 * @resource
57 * @product Website
58 */
59 export const Vinext = (id: string, props: VinextProps = {}) =>
60 makeFrameworkSite(id, props, {
61 name: "Vinext",
62 framework: VINEXT_NODE_FRAMEWORK_SPECIFIER,
63 target: VINEXT_NODE_FRAMEWORK_SPECIFIER,
64 install: ["vinext", "react", "react-dom", "react-server-dom-webpack"],
65 }).pipe(Namespace.push(id));