@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 50 lines 1.51 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 Fly 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 Service path.
22 *
23 *
24 * ### Creating Next.js Sites
25 * **Example:** Basic Next.js App
26 * ```typescript
27 * const site = yield* Fly.Website.Nextjs("Web", {
28 * rootDir: "./app",
29 * });
30 * ```
31 *
32 * **Example:** Custom Domain
33 * ```typescript
34 * const site = yield* Fly.Website.Nextjs("Web", {
35 * rootDir: "./app",
36 * domain: "app.example.com",
37 * });
38 * ```
39 *
40 * @resource
41 * @product Website
42 */
43 export const Nextjs = (id: string, props: NextjsProps = {}) =>
44 frameworkSite(id, props, {
45 name: "Next.js",
46 framework: NEXTJS_NODE_FRAMEWORK_SPECIFIER,
47 target: NEXTJS_NODE_FRAMEWORK_SPECIFIER,
48 install: ["next", "react", "react-dom"],
49 skipClientAssets: true,
50 });