@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 62 lines 2.02 KB
Raw
1 import * as Namespace from "alchemy/Namespace";
2 import { makeFrameworkSite, type FrameworkSiteProps } from "./FrameworkSite.ts";
3
4 /**
5 * The framework-integration module that drives vinext's Vite build plus
6 * vinext's Node `startProdServer` serve entry.
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 a Hetzner Cloud
14 * Server: vinext's Vite build then a long-running `startProdServer` systemd
15 * unit on port 3000. Does **not** use the Cloudflare Worker entry
16 * (`vinext/server/fetch-handler`).
17 *
18 * The `dist/` output is packed into the unit archive. `vinext`,
19 * `react`, `react-dom`, and `react-server-dom-webpack` are installed on
20 * the unit with `npm install` rather than bundled.
21 *
22 * During `alchemy dev` the site is `vinext dev` and no cloud resources
23 * are declared; `Alchemy.remote()` opts back into the live Service.
24 *
25 * ### Creating vinext Sites
26 * **Example:** Basic vinext App
27 * ```typescript
28 * const site = yield* Hetzner.Website.Vinext("Web", {
29 * rootDir: "./app",
30 * });
31 * ```
32 *
33 * **Example:** Custom Domain
34 * ```typescript
35 * const site = yield* Hetzner.Website.Vinext("Web", {
36 * rootDir: "./app",
37 * domain: "app.example.com",
38 * zone,
39 * });
40 * ```
41 *
42 * **Example:** Redis data cache
43 * ISR / `"use cache"` default to in-process memory. Set `env.REDIS_URL` on
44 * this resource for a durable Redis store; the adapter is injected automatically.
45 * ```typescript
46 * const site = yield* Hetzner.Website.Vinext("Web", {
47 * env: {
48 * REDIS_URL: "redis://cache.internal:6379",
49 * },
50 * });
51 * ```
52 *
53 * @resource
54 * @product Website
55 */
56 export const Vinext = (id: string, props: VinextProps = {}) =>
57 makeFrameworkSite(id, props, {
58 name: "Vinext",
59 framework: VINEXT_NODE_FRAMEWORK_SPECIFIER,
60 target: VINEXT_NODE_FRAMEWORK_SPECIFIER,
61 install: ["vinext", "react", "react-dom", "react-server-dom-webpack"],
62 }).pipe(Namespace.push(id));