@farm.js/create-app 0.1.0-beta.7 → 0.1.0-beta.71
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +38 -6
- package/bin/create-farm-app.js +7 -2
- package/dist/index.js +3298 -16
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +3294 -14
- package/dist/index.mjs.map +1 -1
- package/dist/utils.js +9 -6
- package/dist/utils.js.map +1 -1
- package/dist/utils.mjs +9 -6
- package/dist/utils.mjs.map +1 -1
- package/package.json +2 -2
- package/templates/_integrations/better-auth/preact/farm.config.ts +17 -0
- package/templates/_integrations/better-auth/preact/src/app/dashboard/page.tsx +73 -0
- package/templates/_integrations/better-auth/preact/src/app/layout.tsx +14 -0
- package/templates/_integrations/better-auth/preact/src/app/page.tsx +36 -0
- package/templates/_integrations/better-auth/preact/src/app/sign-in/page.tsx +10 -0
- package/templates/_integrations/better-auth/preact/src/app/sign-up/page.tsx +10 -0
- package/templates/_integrations/better-auth/preact/src/components/auth-form.tsx +92 -0
- package/templates/_integrations/better-auth/preact/src/components/auth-shell.tsx +16 -0
- package/templates/_integrations/better-auth/preact/src/lib/auth-client.ts +5 -0
- package/templates/_integrations/better-auth/solid/farm.config.ts +17 -0
- package/templates/_integrations/better-auth/solid/src/app/dashboard/page.tsx +67 -0
- package/templates/_integrations/better-auth/solid/src/app/layout.tsx +14 -0
- package/templates/_integrations/better-auth/solid/src/app/page.tsx +36 -0
- package/templates/_integrations/better-auth/solid/src/app/sign-in/page.tsx +10 -0
- package/templates/_integrations/better-auth/solid/src/app/sign-up/page.tsx +10 -0
- package/templates/_integrations/better-auth/solid/src/components/auth-form.tsx +91 -0
- package/templates/_integrations/better-auth/solid/src/components/auth-shell.tsx +16 -0
- package/templates/_integrations/better-auth/solid/src/lib/auth-client.ts +5 -0
- package/templates/_integrations/better-auth/svelte/farm.config.ts +17 -0
- package/templates/_integrations/better-auth/svelte/src/app/dashboard/page.svelte +62 -0
- package/templates/_integrations/better-auth/svelte/src/app/layout.svelte +20 -0
- package/templates/_integrations/better-auth/svelte/src/app/page.svelte +32 -0
- package/templates/_integrations/better-auth/svelte/src/app/sign-in/page.svelte +10 -0
- package/templates/_integrations/better-auth/svelte/src/app/sign-up/page.svelte +10 -0
- package/templates/_integrations/better-auth/svelte/src/components/auth-form.svelte +83 -0
- package/templates/_integrations/better-auth/svelte/src/components/auth-shell.svelte +16 -0
- package/templates/_integrations/better-auth/svelte/src/components/resource-links.svelte +47 -0
- package/templates/_integrations/better-auth/svelte/src/lib/auth-client.ts +5 -0
- package/templates/_integrations/better-auth/vue/farm.config.ts +17 -0
- package/templates/_integrations/better-auth/vue/src/app/dashboard/page.vue +62 -0
- package/templates/_integrations/better-auth/vue/src/app/layout.vue +20 -0
- package/templates/_integrations/better-auth/vue/src/app/page.vue +34 -0
- package/templates/_integrations/better-auth/vue/src/app/sign-in/page.vue +12 -0
- package/templates/_integrations/better-auth/vue/src/app/sign-up/page.vue +12 -0
- package/templates/_integrations/better-auth/vue/src/components/auth-form.vue +86 -0
- package/templates/_integrations/better-auth/vue/src/components/auth-shell.vue +15 -0
- package/templates/_integrations/better-auth/vue/src/components/resource-links.vue +43 -0
- package/templates/_integrations/better-auth/vue/src/lib/auth-client.ts +5 -0
- package/templates/_renderers/preact/farm.config.ts +12 -0
- package/templates/_renderers/preact/package.json +26 -0
- package/templates/_renderers/preact/src/app/api/greeting/route.ts +15 -0
- package/templates/_renderers/preact/src/app/layout.tsx +16 -0
- package/templates/_renderers/preact/src/app/page.tsx +66 -0
- package/templates/_renderers/preact/src/app/preact.css +26 -0
- package/templates/_renderers/preact/src/components/resource-links.tsx +71 -0
- package/templates/_renderers/preact/src/lib/api-client.ts +4 -0
- package/templates/_renderers/preact/src/lib/api.generated.ts +7 -0
- package/templates/_renderers/preact/tsconfig.json +25 -0
- package/templates/_renderers/solid/farm.config.ts +12 -0
- package/templates/_renderers/solid/package.json +25 -0
- package/templates/_renderers/solid/src/app/api/greeting/route.ts +15 -0
- package/templates/_renderers/solid/src/app/layout.tsx +15 -0
- package/templates/_renderers/solid/src/app/page.tsx +56 -0
- package/templates/_renderers/solid/src/app/solid.css +22 -0
- package/templates/_renderers/solid/src/components/resource-links.tsx +71 -0
- package/templates/_renderers/solid/src/lib/api-client.ts +4 -0
- package/templates/_renderers/solid/src/lib/api.generated.ts +7 -0
- package/templates/_renderers/solid/tsconfig.json +25 -0
- package/templates/_renderers/svelte/farm.config.ts +9 -0
- package/templates/_renderers/svelte/package.json +28 -0
- package/templates/_renderers/svelte/src/app/api/greeting/route.ts +15 -0
- package/templates/_renderers/svelte/src/app/layout.svelte +21 -0
- package/templates/_renderers/svelte/src/app/page.svelte +64 -0
- package/templates/_renderers/svelte/src/app/svelte.css +26 -0
- package/templates/_renderers/svelte/src/components/resource-links.svelte +31 -0
- package/templates/_renderers/svelte/src/lib/api-client.ts +4 -0
- package/templates/_renderers/svelte/src/lib/api.generated.ts +7 -0
- package/templates/_renderers/svelte/tsconfig.json +23 -0
- package/templates/_renderers/vue/farm.config.ts +12 -0
- package/templates/_renderers/vue/package.json +26 -0
- package/templates/_renderers/vue/src/app/api/greeting/route.ts +15 -0
- package/templates/_renderers/vue/src/app/layout.vue +21 -0
- package/templates/_renderers/vue/src/app/page.vue +69 -0
- package/templates/_renderers/vue/src/app/vue.css +26 -0
- package/templates/_renderers/vue/src/components/resource-links.vue +33 -0
- package/templates/_renderers/vue/src/env.d.ts +7 -0
- package/templates/_renderers/vue/src/lib/api-client.ts +4 -0
- package/templates/_renderers/vue/src/lib/api.generated.ts +7 -0
- package/templates/_renderers/vue/tsconfig.json +23 -0
- package/templates/auth/.env.example +6 -0
- package/templates/auth/README.md +95 -0
- package/templates/auth/docs.config.ts +33 -0
- package/templates/auth/docs.json +36 -0
- package/templates/auth/farm.config.ts +20 -0
- package/templates/auth/gitignore +10 -0
- package/templates/auth/package.json +34 -0
- package/templates/auth/pnpm-workspace.yaml +13 -0
- package/templates/auth/src/app/dashboard/middleware.ts +13 -0
- package/templates/auth/src/app/dashboard/page.tsx +140 -0
- package/templates/auth/src/app/docs/page.md +29 -0
- package/templates/auth/src/app/error.tsx +25 -0
- package/templates/auth/src/app/globals.css +1064 -0
- package/templates/auth/src/app/layout.tsx +11 -0
- package/templates/auth/src/app/loading.tsx +15 -0
- package/templates/auth/src/app/not-found.tsx +26 -0
- package/templates/auth/src/app/page.tsx +46 -0
- package/templates/auth/src/app/sign-in/page.tsx +16 -0
- package/templates/auth/src/app/sign-up/page.tsx +16 -0
- package/templates/auth/src/components/auth-form.tsx +120 -0
- package/templates/auth/src/components/auth-shell.tsx +21 -0
- package/templates/auth/src/components/resource-links.tsx +78 -0
- package/templates/auth/src/components/sign-out-button.tsx +45 -0
- package/templates/auth/src/components/site-header.tsx +46 -0
- package/templates/auth/tsconfig.json +20 -0
- package/templates/basic/docs.config.ts +33 -0
- package/templates/basic/docs.json +36 -0
- package/templates/basic/farm.config.ts +9 -0
- package/templates/basic/package.json +7 -3
- package/templates/basic/pnpm-workspace.yaml +8 -0
- package/templates/basic/src/app/docs/page.md +29 -0
- package/templates/basic/src/app/globals.css +241 -0
- package/templates/basic/src/app/layout.tsx +3 -5
- package/templates/basic/src/app/page.tsx +20 -61
- package/templates/basic/src/components/resource-links.tsx +78 -0
- package/templates/basic/tsconfig.json +4 -0
- package/templates/better-auth/.env.example +3 -0
- package/templates/better-auth/README.md +89 -0
- package/templates/better-auth/docs.config.ts +33 -0
- package/templates/better-auth/docs.json +36 -0
- package/templates/better-auth/farm.config.ts +38 -0
- package/templates/better-auth/gitignore +10 -0
- package/templates/better-auth/package.json +36 -0
- package/templates/better-auth/pnpm-workspace.yaml +13 -0
- package/templates/better-auth/src/app/dashboard/middleware.ts +15 -0
- package/templates/better-auth/src/app/dashboard/page.tsx +188 -0
- package/templates/better-auth/src/app/docs/page.md +29 -0
- package/templates/better-auth/src/app/error.tsx +25 -0
- package/templates/better-auth/src/app/globals.css +1064 -0
- package/templates/better-auth/src/app/layout.tsx +11 -0
- package/templates/better-auth/src/app/loading.tsx +15 -0
- package/templates/better-auth/src/app/not-found.tsx +26 -0
- package/templates/better-auth/src/app/page.tsx +50 -0
- package/templates/better-auth/src/app/sign-in/page.tsx +16 -0
- package/templates/better-auth/src/app/sign-up/page.tsx +16 -0
- package/templates/better-auth/src/components/auth-form.tsx +120 -0
- package/templates/better-auth/src/components/auth-shell.tsx +21 -0
- package/templates/better-auth/src/components/resource-links.tsx +78 -0
- package/templates/better-auth/src/components/sign-out-button.tsx +45 -0
- package/templates/better-auth/src/components/site-header.tsx +46 -0
- package/templates/better-auth/src/lib/auth-client.ts +5 -0
- package/templates/better-auth/src/lib/auth.ts +50 -0
- package/templates/better-auth/src/lib/session.ts +8 -0
- package/templates/better-auth/tsconfig.json +20 -0
- package/templates/react-compiler/README.md +62 -0
- package/templates/react-compiler/docs.config.ts +33 -0
- package/templates/react-compiler/docs.json +36 -0
- package/templates/react-compiler/farm.config.ts +29 -0
- package/templates/react-compiler/gitignore +23 -0
- package/templates/react-compiler/package.json +34 -0
- package/templates/react-compiler/pnpm-workspace.yaml +8 -0
- package/templates/react-compiler/public/favicon.svg +5 -0
- package/templates/react-compiler/scripts/verify-experiment.mjs +113 -0
- package/templates/react-compiler/src/app/docs/page.md +29 -0
- package/templates/react-compiler/src/app/globals.css +470 -0
- package/templates/react-compiler/src/app/layout.tsx +22 -0
- package/templates/react-compiler/src/app/page.tsx +47 -0
- package/templates/react-compiler/src/components/compiler-comparison.tsx +93 -0
- package/templates/react-compiler/src/components/resource-links.tsx +78 -0
- package/templates/react-compiler/src/farm.d.ts +74 -0
- package/templates/react-compiler/src/lib/api.generated.ts +10 -0
- package/templates/react-compiler/tsconfig.json +24 -0
- package/templates/basic/src/app/about/page.tsx +0 -32
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { LayoutProps, Metadata } from "@farm.js/core";
|
|
2
|
+
import "./globals.css";
|
|
3
|
+
|
|
4
|
+
export const metadata: Metadata = {
|
|
5
|
+
title: "FARMJS React Compiler Starter",
|
|
6
|
+
description: "Start a FARMJS app with the experimental React AOT compiler.",
|
|
7
|
+
icons: {
|
|
8
|
+
icon: [{ url: "/favicon.svg", type: "image/svg+xml", sizes: "any" }],
|
|
9
|
+
},
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export default function RootLayout({ children }: LayoutProps) {
|
|
13
|
+
return (
|
|
14
|
+
<html lang="en">
|
|
15
|
+
<head>
|
|
16
|
+
<meta charSet="utf-8" />
|
|
17
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
18
|
+
</head>
|
|
19
|
+
<body>{children}</body>
|
|
20
|
+
</html>
|
|
21
|
+
);
|
|
22
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { publicEnv } from "@farm.js/core/env";
|
|
2
|
+
import { CompilerComparison } from "../components/compiler-comparison";
|
|
3
|
+
import { ResourceLinks } from "../components/resource-links";
|
|
4
|
+
|
|
5
|
+
export default function HomePage() {
|
|
6
|
+
const compilerMode = String(publicEnv.FARM_REACT_COMPILER_ENABLED);
|
|
7
|
+
|
|
8
|
+
return (
|
|
9
|
+
<main className="landing-main">
|
|
10
|
+
<section className="hero-section">
|
|
11
|
+
<div className="hero-copy">
|
|
12
|
+
<div className="eyebrow-row">
|
|
13
|
+
<span>00</span>
|
|
14
|
+
<span>FARMJS / React Compiler starter</span>
|
|
15
|
+
<span className="experimental-label">Experimental</span>
|
|
16
|
+
</div>
|
|
17
|
+
|
|
18
|
+
<h1>
|
|
19
|
+
Edit <code>page.tsx</code>. The compiler handles the rest.
|
|
20
|
+
</h1>
|
|
21
|
+
|
|
22
|
+
<p className="hero-summary">
|
|
23
|
+
Keep writing ordinary React. FARMJS prepares direct bindings for safe local state
|
|
24
|
+
updates and leaves everything else with React.
|
|
25
|
+
</p>
|
|
26
|
+
|
|
27
|
+
<div className="command-list" aria-label="Getting started">
|
|
28
|
+
<div className="command-row">
|
|
29
|
+
<span>01</span>
|
|
30
|
+
<code>pnpm dev</code>
|
|
31
|
+
</div>
|
|
32
|
+
<div className="command-row">
|
|
33
|
+
<span>02</span>
|
|
34
|
+
<div className="compiler-status">
|
|
35
|
+
<span className="status-dot" data-enabled={compilerMode} aria-hidden="true" />
|
|
36
|
+
<code data-compiler-status>experimental.compiler: {compilerMode}</code>
|
|
37
|
+
</div>
|
|
38
|
+
</div>
|
|
39
|
+
</div>
|
|
40
|
+
|
|
41
|
+
<CompilerComparison />
|
|
42
|
+
<ResourceLinks className="resource-links" />
|
|
43
|
+
</div>
|
|
44
|
+
</section>
|
|
45
|
+
</main>
|
|
46
|
+
);
|
|
47
|
+
}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { useState } from "react";
|
|
4
|
+
|
|
5
|
+
let compiledExecutions = 0;
|
|
6
|
+
let reactExecutions = 0;
|
|
7
|
+
|
|
8
|
+
export function CompiledCounter() {
|
|
9
|
+
const [count, setCount] = useState(0);
|
|
10
|
+
|
|
11
|
+
return (
|
|
12
|
+
<article className="counter-path counter-path-compiled" data-path="compiled">
|
|
13
|
+
<div className="counter-heading">
|
|
14
|
+
<span className="path-index">A</span>
|
|
15
|
+
<div>
|
|
16
|
+
<h3>AOT compiled</h3>
|
|
17
|
+
<p>Direct DOM binding</p>
|
|
18
|
+
</div>
|
|
19
|
+
</div>
|
|
20
|
+
|
|
21
|
+
<dl className="counter-metrics" aria-live="polite">
|
|
22
|
+
<div>
|
|
23
|
+
<dt>State</dt>
|
|
24
|
+
<dd data-metric="state">{count}</dd>
|
|
25
|
+
</div>
|
|
26
|
+
<div>
|
|
27
|
+
<dt>Executions</dt>
|
|
28
|
+
<dd data-metric="executions">
|
|
29
|
+
{typeof window === "undefined" ? 1 : ++compiledExecutions}
|
|
30
|
+
</dd>
|
|
31
|
+
</div>
|
|
32
|
+
</dl>
|
|
33
|
+
|
|
34
|
+
<button type="button" data-action="update" onClick={() => setCount((value) => value + 1)}>
|
|
35
|
+
Update compiled state
|
|
36
|
+
<span aria-hidden="true">↗</span>
|
|
37
|
+
</button>
|
|
38
|
+
</article>
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export function BaseReactCounter() {
|
|
43
|
+
"use no compiler";
|
|
44
|
+
|
|
45
|
+
const [count, setCount] = useState(0);
|
|
46
|
+
|
|
47
|
+
return (
|
|
48
|
+
<article className="counter-path" data-path="react">
|
|
49
|
+
<div className="counter-heading">
|
|
50
|
+
<span className="path-index">B</span>
|
|
51
|
+
<div>
|
|
52
|
+
<h3>Base React</h3>
|
|
53
|
+
<p>React reconciliation</p>
|
|
54
|
+
</div>
|
|
55
|
+
</div>
|
|
56
|
+
|
|
57
|
+
<dl className="counter-metrics" aria-live="polite">
|
|
58
|
+
<div>
|
|
59
|
+
<dt>State</dt>
|
|
60
|
+
<dd data-metric="state">{count}</dd>
|
|
61
|
+
</div>
|
|
62
|
+
<div>
|
|
63
|
+
<dt>Executions</dt>
|
|
64
|
+
<dd data-metric="executions">{typeof window === "undefined" ? 1 : ++reactExecutions}</dd>
|
|
65
|
+
</div>
|
|
66
|
+
</dl>
|
|
67
|
+
|
|
68
|
+
<button type="button" data-action="update" onClick={() => setCount((value) => value + 1)}>
|
|
69
|
+
Update React state
|
|
70
|
+
<span aria-hidden="true">↗</span>
|
|
71
|
+
</button>
|
|
72
|
+
</article>
|
|
73
|
+
);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export function CompilerComparison() {
|
|
77
|
+
return (
|
|
78
|
+
<section className="compiler-check" aria-labelledby="compiler-check-title">
|
|
79
|
+
<header className="check-heading">
|
|
80
|
+
<div>
|
|
81
|
+
<span>Live check</span>
|
|
82
|
+
<h2 id="compiler-check-title">Same click. Less React work.</h2>
|
|
83
|
+
</div>
|
|
84
|
+
<p>Watch executions after each update.</p>
|
|
85
|
+
</header>
|
|
86
|
+
|
|
87
|
+
<div className="comparison-grid">
|
|
88
|
+
<CompiledCounter />
|
|
89
|
+
<BaseReactCounter />
|
|
90
|
+
</div>
|
|
91
|
+
</section>
|
|
92
|
+
);
|
|
93
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
interface ResourceLinkAction {
|
|
2
|
+
href: string;
|
|
3
|
+
label: string;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
interface ResourceLinksProps {
|
|
7
|
+
className: string;
|
|
8
|
+
primary?: ResourceLinkAction;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
function DocsIcon() {
|
|
12
|
+
return (
|
|
13
|
+
<svg
|
|
14
|
+
className="resource-icon"
|
|
15
|
+
viewBox="0 0 24 24"
|
|
16
|
+
fill="none"
|
|
17
|
+
stroke="currentColor"
|
|
18
|
+
strokeWidth="1.8"
|
|
19
|
+
strokeLinecap="round"
|
|
20
|
+
strokeLinejoin="round"
|
|
21
|
+
aria-hidden="true"
|
|
22
|
+
focusable="false"
|
|
23
|
+
>
|
|
24
|
+
<path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8Z" />
|
|
25
|
+
<path d="M14 2v6h6M8 13h8M8 17h6" />
|
|
26
|
+
</svg>
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function GitHubIcon() {
|
|
31
|
+
return (
|
|
32
|
+
<svg
|
|
33
|
+
className="resource-icon"
|
|
34
|
+
viewBox="0 0 24 24"
|
|
35
|
+
fill="currentColor"
|
|
36
|
+
aria-hidden="true"
|
|
37
|
+
focusable="false"
|
|
38
|
+
>
|
|
39
|
+
<path d="M12 .7a11.5 11.5 0 0 0-3.64 22.41c.58.1.79-.25.79-.56v-2.23c-3.22.7-3.9-1.37-3.9-1.37-.52-1.34-1.28-1.69-1.28-1.69-1.05-.72.08-.7.08-.7 1.16.08 1.77 1.19 1.77 1.19 1.03 1.77 2.7 1.26 3.36.96.1-.75.4-1.26.73-1.55-2.57-.29-5.27-1.29-5.27-5.68 0-1.26.45-2.28 1.18-3.09-.12-.29-.51-1.47.11-3.05 0 0 .96-.31 3.16 1.18A10.95 10.95 0 0 1 12 6.1c.98 0 1.95.13 2.87.39 2.2-1.49 3.16-1.18 3.16-1.18.62 1.58.23 2.76.11 3.05.74.81 1.18 1.83 1.18 3.09 0 4.4-2.71 5.38-5.29 5.67.42.36.79 1.07.79 2.16v3.27c0 .31.21.67.8.56A11.5 11.5 0 0 0 12 .7Z" />
|
|
40
|
+
</svg>
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function ResourceSeparator() {
|
|
45
|
+
return (
|
|
46
|
+
<span className="resource-separator" aria-hidden="true">
|
|
47
|
+
/
|
|
48
|
+
</span>
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export function ResourceLinks({ className, primary }: ResourceLinksProps) {
|
|
53
|
+
return (
|
|
54
|
+
<nav className={className} aria-label="Starter resources">
|
|
55
|
+
{primary ? (
|
|
56
|
+
<span className="resource-link-item">
|
|
57
|
+
<a className="resource-link-primary" href={primary.href}>
|
|
58
|
+
{primary.label}
|
|
59
|
+
</a>
|
|
60
|
+
</span>
|
|
61
|
+
) : null}
|
|
62
|
+
<span className="resource-link-item">
|
|
63
|
+
{primary ? <ResourceSeparator /> : null}
|
|
64
|
+
<a href="https://farm.js.dev">
|
|
65
|
+
<DocsIcon />
|
|
66
|
+
<span>Docs</span>
|
|
67
|
+
</a>
|
|
68
|
+
</span>
|
|
69
|
+
<span className="resource-link-item">
|
|
70
|
+
<ResourceSeparator />
|
|
71
|
+
<a href="https://github.com/farming-labs/farm.js">
|
|
72
|
+
<GitHubIcon />
|
|
73
|
+
<span>GitHub</span>
|
|
74
|
+
</a>
|
|
75
|
+
</span>
|
|
76
|
+
</nav>
|
|
77
|
+
);
|
|
78
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated by Farm.js. Do not edit.
|
|
3
|
+
* Contains project-specific route, environment, and internationalization types.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import "@farm.js/core/image";
|
|
7
|
+
import "@farm.js/core/css";
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Auto-generated route types from src/app.
|
|
11
|
+
* Link href and route component props are typed automatically from generated declarations.
|
|
12
|
+
* Regenerated on dev start and when routes change.
|
|
13
|
+
* Set suppressLintOnLink: true in farm.config.ts to accept any string on Link href.
|
|
14
|
+
*/
|
|
15
|
+
export type RoutePath = "/";
|
|
16
|
+
export type RoutePattern = "/";
|
|
17
|
+
export type RouteModulePattern = "/";
|
|
18
|
+
declare module "@farm.js/core/client" {
|
|
19
|
+
interface LinkDefaultRoute {
|
|
20
|
+
_: import("./farm").RoutePath;
|
|
21
|
+
pattern: import("./farm").RoutePattern;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
declare module "@farm.js/core" {
|
|
26
|
+
interface LinkDefaultRoute {
|
|
27
|
+
_: import("./farm").RoutePath;
|
|
28
|
+
pattern: import("./farm").RoutePattern;
|
|
29
|
+
}
|
|
30
|
+
// Ensure root import ("@farm.js/core") uses the same typed Link signature as client entry.
|
|
31
|
+
const Link: typeof import("@farm.js/core/client").Link;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
// Internal declaration path used by @farm.js/core root type re-exports.
|
|
35
|
+
declare module "@farm.js/core/dist/client.js" {
|
|
36
|
+
interface LinkDefaultRoute {
|
|
37
|
+
_: import("./farm").RoutePath;
|
|
38
|
+
pattern: import("./farm").RoutePattern;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
declare global {
|
|
43
|
+
namespace FarmJS {
|
|
44
|
+
interface RouteRegistry {
|
|
45
|
+
pattern: import("./farm").RouteModulePattern;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Auto-generated env types from farm.config.
|
|
52
|
+
* Regenerated on dev start, build, and farm generate.
|
|
53
|
+
*/
|
|
54
|
+
import type FarmConfig from "../farm.config";
|
|
55
|
+
import type { InferEnv } from "@farm.js/core/env";
|
|
56
|
+
|
|
57
|
+
type FarmConfigEnv = typeof FarmConfig extends { env?: infer TEnv } ? NonNullable<TEnv> : never;
|
|
58
|
+
type FarmResolvedEnv = [FarmConfigEnv] extends [never]
|
|
59
|
+
? { server: {}; public: {} }
|
|
60
|
+
: InferEnv<FarmConfigEnv>;
|
|
61
|
+
|
|
62
|
+
declare module "@farm.js/core/env" {
|
|
63
|
+
interface FarmEnvTypes {
|
|
64
|
+
server: FarmResolvedEnv["server"];
|
|
65
|
+
public: FarmResolvedEnv["public"];
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
declare module "@farm.js/core" {
|
|
70
|
+
interface FarmEnvTypes {
|
|
71
|
+
server: FarmResolvedEnv["server"];
|
|
72
|
+
public: FarmResolvedEnv["public"];
|
|
73
|
+
}
|
|
74
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Auto-generated API router types
|
|
3
|
+
* This file is automatically generated - do not edit manually
|
|
4
|
+
*
|
|
5
|
+
* This file contains only TypeScript types for the API client.
|
|
6
|
+
* Runtime imports are used only at the type level.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
// Type-only representation of your API routes
|
|
10
|
+
export type APIRouter = {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2020",
|
|
4
|
+
"useDefineForClassFields": true,
|
|
5
|
+
"lib": ["ES2020", "DOM", "DOM.Iterable"],
|
|
6
|
+
"module": "ESNext",
|
|
7
|
+
"skipLibCheck": true,
|
|
8
|
+
"moduleResolution": "bundler",
|
|
9
|
+
"baseUrl": ".",
|
|
10
|
+
"paths": {
|
|
11
|
+
"@/*": ["./src/*"]
|
|
12
|
+
},
|
|
13
|
+
"allowImportingTsExtensions": true,
|
|
14
|
+
"resolveJsonModule": true,
|
|
15
|
+
"isolatedModules": true,
|
|
16
|
+
"noEmit": true,
|
|
17
|
+
"jsx": "react-jsx",
|
|
18
|
+
"strict": true,
|
|
19
|
+
"noUnusedLocals": true,
|
|
20
|
+
"noUnusedParameters": true,
|
|
21
|
+
"noFallthroughCasesInSwitch": true
|
|
22
|
+
},
|
|
23
|
+
"include": ["src", "farm.config.ts"]
|
|
24
|
+
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { Link } from "@farm.js/core/client";
|
|
2
|
-
|
|
3
|
-
export default function AboutPage() {
|
|
4
|
-
return (
|
|
5
|
-
<div className="min-h-screen p-8">
|
|
6
|
-
<div className="max-w-4xl mx-auto space-y-8">
|
|
7
|
-
<h1 className="text-5xl font-bold text-gray-900 mb-4">About Farm.js</h1>
|
|
8
|
-
|
|
9
|
-
<p className="text-xl text-gray-600 leading-relaxed">
|
|
10
|
-
Farm.js is a modern React meta-framework that combines the best of Vite's lightning-fast
|
|
11
|
-
development experience with Next.js-like semantics and React Server Components support.
|
|
12
|
-
</p>
|
|
13
|
-
|
|
14
|
-
<div className="bg-blue-50 border border-blue-200 rounded-lg p-6">
|
|
15
|
-
<h2 className="text-2xl font-semibold mb-3 text-blue-900">Why Farm.js?</h2>
|
|
16
|
-
<p className="text-gray-700 leading-relaxed">
|
|
17
|
-
We built Farm.js to provide developers with a framework that's both powerful and simple.
|
|
18
|
-
No complex configuration, no waiting for builds, just pure development joy with modern
|
|
19
|
-
React features.
|
|
20
|
-
</p>
|
|
21
|
-
</div>
|
|
22
|
-
|
|
23
|
-
<Link
|
|
24
|
-
href="/"
|
|
25
|
-
className="inline-flex items-center px-6 py-3 bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition-colors font-medium shadow-md hover:shadow-lg"
|
|
26
|
-
>
|
|
27
|
-
← Back to Home
|
|
28
|
-
</Link>
|
|
29
|
-
</div>
|
|
30
|
-
</div>
|
|
31
|
-
);
|
|
32
|
-
}
|