The best way to control Claude Code, Codex and more from any computer or phone

main
ts 73 lines 2.46 KB
Raw
1 import { frameworkSite, type FrameworkSiteProps } from "./FrameworkSite.ts";
2
3 /** The framework-integration package that drives the TanStack Start build. */
4 export const TANSTACK_START_FRAMEWORK_SPECIFIER = "@alchemy.run/frontend-frameworks/tanstack-start";
5
6 /** The Node container deploy target for the TanStack Start build. */
7 export const TANSTACK_START_NODE_TARGET_SPECIFIER =
8 "@alchemy.run/frontend-frameworks/tanstack-start/node";
9
10 export interface TanStackStartProps extends FrameworkSiteProps {}
11
12 /**
13 * Deploy a [TanStack Start](https://tanstack.com/start) application to Cloud Run:
14 * the SSR server in a Cloud Run container, client assets baked into the image, served
15 * assets-first then the framework handler.
16 *
17 * The build runs through
18 * `@alchemy.run/frontend-frameworks/tanstack-start` with the
19 * `@alchemy.run/frontend-frameworks/tanstack-start/node` deploy target —
20 * both must be installed in your project, alongside
21 * `@tanstack/react-start` (or `@tanstack/solid-start`) and `vite`.
22 *
23 * Your `vite.config.ts` needs no adapter wiring: TanStack Start is pure
24 * Vite, so the integration drives the project's own `vite build`, forces
25 * the SSR bundle to be self-contained, and wraps its fetch handler as a
26 * Node HTTP server on Cloud Run's `PORT` (8080).
27 *
28 *
29 * ### Creating TanStack Start Sites
30 * **Example:** Basic TanStack Start App
31 * ```typescript
32 * const site = yield* GCP.Website.TanStackStart("Web", {
33 * rootDir: "./app",
34 * });
35 * ```
36 *
37 * **Example:** Warm Instance with More Memory
38 * ```typescript
39 * const site = yield* GCP.Website.TanStackStart("Web", {
40 * rootDir: "./app",
41 * scaling: { minInstanceCount: 1 },
42 * resources: { limits: { cpu: "1", memory: "1Gi" } },
43 * });
44 * ```
45 *
46 * ### Server Configuration
47 * **Example:** Process Environment
48 * ```typescript
49 * const site = yield* GCP.Website.TanStackStart("Web", {
50 * rootDir: "./app",
51 * env: {
52 * GREETING: "Hello from TanStack Start on Cloud Run!",
53 * },
54 * });
55 * ```
56 *
57 * **Example:** Read An Environment Variable From A Server Function
58 * ```typescript
59 * // src/routes/index.tsx
60 * const getGreeting = createServerFn({ method: "GET" }).handler(
61 * () => process.env.GREETING ?? "Hello!",
62 * );
63 * ```
64 *
65 * @resource
66 * @product Website
67 */
68 export const TanStackStart = (id: string, props: TanStackStartProps = {}) =>
69 frameworkSite(id, props, {
70 name: "TanStackStart",
71 framework: TANSTACK_START_FRAMEWORK_SPECIFIER,
72 target: TANSTACK_START_NODE_TARGET_SPECIFIER,
73 });