@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 51 lines 1.6 KB
Raw
1 import { frameworkSite, type FrameworkSiteProps } from "./FrameworkSite.ts";
2
3 /**
4 * The Next.js-on-Node framework module (`next build` + a custom
5 * `next({ dev: false })` server). Not OpenNext.
6 */
7 export const NEXTJS_NODE_FRAMEWORK_SPECIFIER = "@alchemy.run/frontend-frameworks/nextjs/node";
8
9 export interface NextjsProps extends FrameworkSiteProps {}
10
11 /**
12 * Deploy a Next.js application to Cloud Run as a long-running Node process:
13 * `next build`, then a serve entry that `import("next")` +
14 * `next({ dev: false }).prepare()` + `getRequestHandler()`. The `.next`
15 * output (and `public/` when present) is baked into the image; `next` is
16 * installed unbundled.
17 *
18 * Do not use OpenNext AWS/CF wrappers — those are Lambda/workerd.
19 *
20 * During `alchemy dev` the site is `next dev` and no cloud resources are
21 * declared; `Alchemy.remote()` opts back into the live Cloud Run service.
22 *
23 *
24 * ### Creating Next.js Sites
25 * **Example:** Basic Next.js App
26 * ```typescript
27 * const site = yield* GCP.Website.Nextjs("Web", {
28 * rootDir: "./app",
29 * });
30 * ```
31 *
32 * **Example:** Warm Instance with More Memory
33 * ```typescript
34 * const site = yield* GCP.Website.Nextjs("Web", {
35 * rootDir: "./app",
36 * scaling: { minInstanceCount: 1 },
37 * resources: { limits: { cpu: "1", memory: "1Gi" } },
38 * });
39 * ```
40 *
41 * @resource
42 * @product Website
43 */
44 export const Nextjs = (id: string, props: NextjsProps = {}) =>
45 frameworkSite(id, props, {
46 name: "Next.js",
47 framework: NEXTJS_NODE_FRAMEWORK_SPECIFIER,
48 target: NEXTJS_NODE_FRAMEWORK_SPECIFIER,
49 install: ["next", "react", "react-dom"],
50 skipClientAssets: true,
51 });