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

main
ts 72 lines 2.34 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 Fly:
14 * the SSR server on a Machine, 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 port 3000.
27 *
28 *
29 * ### Creating TanStack Start Sites
30 * **Example:** Basic TanStack Start App
31 * ```typescript
32 * const site = yield* Fly.Website.TanStackStart("Web", {
33 * rootDir: "./app",
34 * });
35 * ```
36 *
37 * **Example:** Custom Domain
38 * ```typescript
39 * const site = yield* Fly.Website.TanStackStart("Web", {
40 * rootDir: "./app",
41 * domain: "app.example.com",
42 * });
43 * ```
44 *
45 * ### Server Configuration
46 * **Example:** Process Environment
47 * ```typescript
48 * const site = yield* Fly.Website.TanStackStart("Web", {
49 * rootDir: "./app",
50 * env: {
51 * GREETING: "Hello from TanStack Start on Fly!",
52 * },
53 * });
54 * ```
55 *
56 * **Example:** Read An Environment Variable From A Server Function
57 * ```typescript
58 * // src/routes/index.tsx
59 * const getGreeting = createServerFn({ method: "GET" }).handler(
60 * () => process.env.GREETING ?? "Hello!",
61 * );
62 * ```
63 *
64 * @resource
65 * @product Website
66 */
67 export const TanStackStart = (id: string, props: TanStackStartProps = {}) =>
68 frameworkSite(id, props, {
69 name: "TanStackStart",
70 framework: TANSTACK_START_FRAMEWORK_SPECIFIER,
71 target: TANSTACK_START_NODE_TARGET_SPECIFIER,
72 });