@farm.js/create-app 0.1.0-beta.9 → 0.1.0-beta.91

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.
Files changed (174) hide show
  1. package/README.md +39 -6
  2. package/bin/create-farm-app.js +8 -3
  3. package/dist/index.js +3291 -27
  4. package/dist/index.js.map +1 -1
  5. package/dist/index.mjs +3287 -25
  6. package/dist/index.mjs.map +1 -1
  7. package/dist/utils.js +9 -6
  8. package/dist/utils.js.map +1 -1
  9. package/dist/utils.mjs +9 -6
  10. package/dist/utils.mjs.map +1 -1
  11. package/package.json +5 -2
  12. package/templates/_integrations/better-auth/preact/farm.config.ts +20 -0
  13. package/templates/_integrations/better-auth/preact/src/app/dashboard/page.tsx +73 -0
  14. package/templates/_integrations/better-auth/preact/src/app/layout.tsx +14 -0
  15. package/templates/_integrations/better-auth/preact/src/app/page.tsx +36 -0
  16. package/templates/_integrations/better-auth/preact/src/app/sign-in/page.tsx +10 -0
  17. package/templates/_integrations/better-auth/preact/src/app/sign-up/page.tsx +10 -0
  18. package/templates/_integrations/better-auth/preact/src/components/auth-form.tsx +92 -0
  19. package/templates/_integrations/better-auth/preact/src/components/auth-shell.tsx +16 -0
  20. package/templates/_integrations/better-auth/preact/src/lib/auth-client.ts +5 -0
  21. package/templates/_integrations/better-auth/solid/farm.config.ts +20 -0
  22. package/templates/_integrations/better-auth/solid/src/app/dashboard/page.tsx +67 -0
  23. package/templates/_integrations/better-auth/solid/src/app/layout.tsx +14 -0
  24. package/templates/_integrations/better-auth/solid/src/app/page.tsx +36 -0
  25. package/templates/_integrations/better-auth/solid/src/app/sign-in/page.tsx +10 -0
  26. package/templates/_integrations/better-auth/solid/src/app/sign-up/page.tsx +10 -0
  27. package/templates/_integrations/better-auth/solid/src/components/auth-form.tsx +91 -0
  28. package/templates/_integrations/better-auth/solid/src/components/auth-shell.tsx +16 -0
  29. package/templates/_integrations/better-auth/solid/src/lib/auth-client.ts +5 -0
  30. package/templates/_integrations/better-auth/svelte/farm.config.ts +20 -0
  31. package/templates/_integrations/better-auth/svelte/src/app/dashboard/page.svelte +62 -0
  32. package/templates/_integrations/better-auth/svelte/src/app/layout.svelte +20 -0
  33. package/templates/_integrations/better-auth/svelte/src/app/page.svelte +32 -0
  34. package/templates/_integrations/better-auth/svelte/src/app/sign-in/page.svelte +10 -0
  35. package/templates/_integrations/better-auth/svelte/src/app/sign-up/page.svelte +10 -0
  36. package/templates/_integrations/better-auth/svelte/src/components/auth-form.svelte +83 -0
  37. package/templates/_integrations/better-auth/svelte/src/components/auth-shell.svelte +16 -0
  38. package/templates/_integrations/better-auth/svelte/src/components/resource-links.svelte +47 -0
  39. package/templates/_integrations/better-auth/svelte/src/lib/auth-client.ts +5 -0
  40. package/templates/_integrations/better-auth/vue/farm.config.ts +20 -0
  41. package/templates/_integrations/better-auth/vue/src/app/dashboard/page.vue +62 -0
  42. package/templates/_integrations/better-auth/vue/src/app/layout.vue +20 -0
  43. package/templates/_integrations/better-auth/vue/src/app/page.vue +34 -0
  44. package/templates/_integrations/better-auth/vue/src/app/sign-in/page.vue +12 -0
  45. package/templates/_integrations/better-auth/vue/src/app/sign-up/page.vue +12 -0
  46. package/templates/_integrations/better-auth/vue/src/components/auth-form.vue +86 -0
  47. package/templates/_integrations/better-auth/vue/src/components/auth-shell.vue +15 -0
  48. package/templates/_integrations/better-auth/vue/src/components/resource-links.vue +43 -0
  49. package/templates/_integrations/better-auth/vue/src/lib/auth-client.ts +5 -0
  50. package/templates/_renderers/preact/farm.config.ts +12 -0
  51. package/templates/_renderers/preact/package.json +26 -0
  52. package/templates/_renderers/preact/src/app/api/greeting/route.ts +15 -0
  53. package/templates/_renderers/preact/src/app/layout.tsx +16 -0
  54. package/templates/_renderers/preact/src/app/page.tsx +66 -0
  55. package/templates/_renderers/preact/src/app/preact.css +26 -0
  56. package/templates/_renderers/preact/src/components/resource-links.tsx +71 -0
  57. package/templates/_renderers/preact/src/lib/api-client.ts +4 -0
  58. package/templates/_renderers/preact/src/lib/api.generated.ts +7 -0
  59. package/templates/_renderers/preact/tsconfig.json +25 -0
  60. package/templates/_renderers/solid/farm.config.ts +12 -0
  61. package/templates/_renderers/solid/package.json +25 -0
  62. package/templates/_renderers/solid/src/app/api/greeting/route.ts +15 -0
  63. package/templates/_renderers/solid/src/app/layout.tsx +15 -0
  64. package/templates/_renderers/solid/src/app/page.tsx +56 -0
  65. package/templates/_renderers/solid/src/app/solid.css +22 -0
  66. package/templates/_renderers/solid/src/components/resource-links.tsx +71 -0
  67. package/templates/_renderers/solid/src/lib/api-client.ts +4 -0
  68. package/templates/_renderers/solid/src/lib/api.generated.ts +7 -0
  69. package/templates/_renderers/solid/tsconfig.json +25 -0
  70. package/templates/_renderers/svelte/farm.config.ts +9 -0
  71. package/templates/_renderers/svelte/package.json +28 -0
  72. package/templates/_renderers/svelte/src/app/api/greeting/route.ts +15 -0
  73. package/templates/_renderers/svelte/src/app/layout.svelte +21 -0
  74. package/templates/_renderers/svelte/src/app/page.svelte +64 -0
  75. package/templates/_renderers/svelte/src/app/svelte.css +26 -0
  76. package/templates/_renderers/svelte/src/components/resource-links.svelte +31 -0
  77. package/templates/_renderers/svelte/src/lib/api-client.ts +4 -0
  78. package/templates/_renderers/svelte/src/lib/api.generated.ts +7 -0
  79. package/templates/_renderers/svelte/tsconfig.json +23 -0
  80. package/templates/_renderers/vue/farm.config.ts +12 -0
  81. package/templates/_renderers/vue/package.json +26 -0
  82. package/templates/_renderers/vue/src/app/api/greeting/route.ts +15 -0
  83. package/templates/_renderers/vue/src/app/layout.vue +21 -0
  84. package/templates/_renderers/vue/src/app/page.vue +69 -0
  85. package/templates/_renderers/vue/src/app/vue.css +26 -0
  86. package/templates/_renderers/vue/src/components/resource-links.vue +33 -0
  87. package/templates/_renderers/vue/src/env.d.ts +7 -0
  88. package/templates/_renderers/vue/src/lib/api-client.ts +4 -0
  89. package/templates/_renderers/vue/src/lib/api.generated.ts +7 -0
  90. package/templates/_renderers/vue/tsconfig.json +23 -0
  91. package/templates/auth/.env.example +6 -0
  92. package/templates/auth/README.md +95 -0
  93. package/templates/auth/docs.config.ts +33 -0
  94. package/templates/auth/docs.json +36 -0
  95. package/templates/auth/farm.config.ts +20 -0
  96. package/templates/auth/gitignore +10 -0
  97. package/templates/auth/package.json +37 -0
  98. package/templates/auth/pnpm-workspace.yaml +13 -0
  99. package/templates/auth/src/app/dashboard/middleware.ts +13 -0
  100. package/templates/auth/src/app/dashboard/page.tsx +140 -0
  101. package/templates/auth/src/app/docs/page.md +29 -0
  102. package/templates/auth/src/app/error.tsx +25 -0
  103. package/templates/auth/src/app/globals.css +1064 -0
  104. package/templates/auth/src/app/layout.tsx +11 -0
  105. package/templates/auth/src/app/loading.tsx +15 -0
  106. package/templates/auth/src/app/not-found.tsx +26 -0
  107. package/templates/auth/src/app/page.tsx +46 -0
  108. package/templates/auth/src/app/sign-in/page.tsx +16 -0
  109. package/templates/auth/src/app/sign-up/page.tsx +16 -0
  110. package/templates/auth/src/components/auth-form.tsx +120 -0
  111. package/templates/auth/src/components/auth-shell.tsx +21 -0
  112. package/templates/auth/src/components/resource-links.tsx +78 -0
  113. package/templates/auth/src/components/sign-out-button.tsx +45 -0
  114. package/templates/auth/src/components/site-header.tsx +46 -0
  115. package/templates/auth/tsconfig.json +20 -0
  116. package/templates/basic/docs.config.ts +33 -0
  117. package/templates/basic/docs.json +36 -0
  118. package/templates/basic/farm.config.ts +9 -0
  119. package/templates/basic/package.json +10 -3
  120. package/templates/basic/pnpm-workspace.yaml +8 -0
  121. package/templates/basic/src/app/docs/page.md +29 -0
  122. package/templates/basic/src/app/globals.css +241 -0
  123. package/templates/basic/src/app/layout.tsx +3 -5
  124. package/templates/basic/src/app/page.tsx +20 -61
  125. package/templates/basic/src/components/resource-links.tsx +78 -0
  126. package/templates/basic/tsconfig.json +4 -0
  127. package/templates/better-auth/.env.example +3 -0
  128. package/templates/better-auth/README.md +95 -0
  129. package/templates/better-auth/docs.config.ts +33 -0
  130. package/templates/better-auth/docs.json +36 -0
  131. package/templates/better-auth/farm.config.ts +46 -0
  132. package/templates/better-auth/gitignore +10 -0
  133. package/templates/better-auth/package.json +40 -0
  134. package/templates/better-auth/pnpm-workspace.yaml +13 -0
  135. package/templates/better-auth/src/app/dashboard/middleware.ts +15 -0
  136. package/templates/better-auth/src/app/dashboard/page.tsx +188 -0
  137. package/templates/better-auth/src/app/docs/page.md +29 -0
  138. package/templates/better-auth/src/app/error.tsx +25 -0
  139. package/templates/better-auth/src/app/globals.css +1064 -0
  140. package/templates/better-auth/src/app/layout.tsx +11 -0
  141. package/templates/better-auth/src/app/loading.tsx +15 -0
  142. package/templates/better-auth/src/app/not-found.tsx +26 -0
  143. package/templates/better-auth/src/app/page.tsx +50 -0
  144. package/templates/better-auth/src/app/sign-in/page.tsx +16 -0
  145. package/templates/better-auth/src/app/sign-up/page.tsx +16 -0
  146. package/templates/better-auth/src/components/auth-form.tsx +120 -0
  147. package/templates/better-auth/src/components/auth-shell.tsx +21 -0
  148. package/templates/better-auth/src/components/resource-links.tsx +78 -0
  149. package/templates/better-auth/src/components/sign-out-button.tsx +45 -0
  150. package/templates/better-auth/src/components/site-header.tsx +46 -0
  151. package/templates/better-auth/src/lib/auth-client.ts +5 -0
  152. package/templates/better-auth/src/lib/auth.ts +46 -0
  153. package/templates/better-auth/src/lib/migrate-auth.ts +10 -0
  154. package/templates/better-auth/src/lib/session.ts +8 -0
  155. package/templates/better-auth/tsconfig.json +20 -0
  156. package/templates/react-compiler/README.md +62 -0
  157. package/templates/react-compiler/docs.config.ts +33 -0
  158. package/templates/react-compiler/docs.json +36 -0
  159. package/templates/react-compiler/farm.config.ts +29 -0
  160. package/templates/react-compiler/gitignore +23 -0
  161. package/templates/react-compiler/package.json +37 -0
  162. package/templates/react-compiler/pnpm-workspace.yaml +8 -0
  163. package/templates/react-compiler/public/favicon.svg +5 -0
  164. package/templates/react-compiler/scripts/verify-experiment.mjs +113 -0
  165. package/templates/react-compiler/src/app/docs/page.md +29 -0
  166. package/templates/react-compiler/src/app/globals.css +470 -0
  167. package/templates/react-compiler/src/app/layout.tsx +22 -0
  168. package/templates/react-compiler/src/app/page.tsx +47 -0
  169. package/templates/react-compiler/src/components/compiler-comparison.tsx +93 -0
  170. package/templates/react-compiler/src/components/resource-links.tsx +78 -0
  171. package/templates/react-compiler/src/farm.d.ts +74 -0
  172. package/templates/react-compiler/src/lib/api.generated.ts +10 -0
  173. package/templates/react-compiler/tsconfig.json +24 -0
  174. package/templates/basic/src/app/about/page.tsx +0 -32
@@ -0,0 +1,470 @@
1
+ @import "@fontsource-variable/geist/wght.css";
2
+ @import "@fontsource-variable/geist-mono/wght.css";
3
+ @import "tailwindcss";
4
+
5
+ :root {
6
+ --paper: #000000;
7
+ --paper-soft: #080808;
8
+ --ink: #f5f5f5;
9
+ --ink-soft: #a1a1a1;
10
+ --ink-faint: #686868;
11
+ --line: rgb(255 255 255 / 0.12);
12
+ --line-strong: rgb(255 255 255 / 0.22);
13
+ --accent: #b8ff5b;
14
+ --accent-soft: rgb(184 255 91 / 0.1);
15
+ --focus: #ffffff;
16
+ --font-sans: "Geist Variable", ui-sans-serif, system-ui, sans-serif;
17
+ --font-mono: "Geist Mono Variable", ui-monospace, monospace;
18
+ color-scheme: dark;
19
+ color: var(--ink);
20
+ font-family: var(--font-sans);
21
+ font-synthesis: none;
22
+ }
23
+
24
+ * {
25
+ box-sizing: border-box;
26
+ }
27
+
28
+ html {
29
+ min-width: 320px;
30
+ min-height: 100%;
31
+ background: var(--paper);
32
+ }
33
+
34
+ body {
35
+ min-height: 100vh;
36
+ margin: 0;
37
+ background: var(--paper);
38
+ color: var(--ink);
39
+ font-family: var(--font-sans);
40
+ text-rendering: optimizeLegibility;
41
+ }
42
+
43
+ button,
44
+ input {
45
+ font: inherit;
46
+ }
47
+
48
+ button,
49
+ a {
50
+ -webkit-tap-highlight-color: transparent;
51
+ }
52
+
53
+ button {
54
+ color: inherit;
55
+ }
56
+
57
+ a {
58
+ color: inherit;
59
+ text-decoration: none;
60
+ }
61
+
62
+ code {
63
+ font-family: var(--font-mono);
64
+ }
65
+
66
+ ::selection {
67
+ background: white;
68
+ color: black;
69
+ }
70
+
71
+ :focus-visible {
72
+ outline: 2px solid var(--focus);
73
+ outline-offset: 3px;
74
+ }
75
+
76
+ .landing-main {
77
+ position: relative;
78
+ isolation: isolate;
79
+ width: 100%;
80
+ min-height: 100vh;
81
+ overflow: hidden;
82
+ background: var(--paper);
83
+ }
84
+
85
+ .hero-section {
86
+ position: relative;
87
+ display: flex;
88
+ width: 100%;
89
+ min-height: 100vh;
90
+ align-items: center;
91
+ justify-content: flex-start;
92
+ padding: clamp(2.5rem, 6vh, 5rem) clamp(1.25rem, 7vw, 6rem);
93
+ }
94
+
95
+ .hero-section::before,
96
+ .hero-section::after {
97
+ position: absolute;
98
+ width: 9px;
99
+ height: 9px;
100
+ border-color: rgb(255 255 255 / 0.3);
101
+ content: "";
102
+ pointer-events: none;
103
+ }
104
+
105
+ .hero-section::before {
106
+ top: -1px;
107
+ left: -1px;
108
+ border-top: 1px solid;
109
+ border-left: 1px solid;
110
+ }
111
+
112
+ .hero-section::after {
113
+ right: 0;
114
+ bottom: -1px;
115
+ border-right: 1px solid;
116
+ border-bottom: 1px solid;
117
+ }
118
+
119
+ .hero-copy {
120
+ width: min(100%, 760px);
121
+ margin: 0;
122
+ }
123
+
124
+ .eyebrow-row {
125
+ display: flex;
126
+ flex-wrap: wrap;
127
+ align-items: center;
128
+ gap: 0.65rem;
129
+ color: var(--ink-faint);
130
+ font-family: var(--font-mono);
131
+ font-size: 0.67rem;
132
+ text-transform: uppercase;
133
+ }
134
+
135
+ .eyebrow-row > span:first-child {
136
+ color: var(--ink);
137
+ }
138
+
139
+ .experimental-label {
140
+ border-left: 1px solid var(--line-strong);
141
+ padding-left: 0.65rem;
142
+ color: var(--accent);
143
+ }
144
+
145
+ .hero-copy h1 {
146
+ max-width: 700px;
147
+ margin: 1.4rem 0 0;
148
+ font-size: clamp(2.15rem, 4vw, 3.55rem);
149
+ font-weight: 510;
150
+ letter-spacing: -0.055em;
151
+ line-height: 1.02;
152
+ }
153
+
154
+ .hero-copy h1 code {
155
+ border: 1px solid var(--line);
156
+ background: rgb(255 255 255 / 0.07);
157
+ padding: 0.04em 0.2em;
158
+ font-size: 0.76em;
159
+ font-weight: 450;
160
+ letter-spacing: -0.035em;
161
+ white-space: nowrap;
162
+ }
163
+
164
+ .hero-summary {
165
+ max-width: 590px;
166
+ margin: 1rem 0 0;
167
+ color: var(--ink-soft);
168
+ font-size: 0.91rem;
169
+ line-height: 1.6;
170
+ }
171
+
172
+ .command-list {
173
+ max-width: 590px;
174
+ margin-top: 1.65rem;
175
+ border-block: 1px solid var(--line);
176
+ }
177
+
178
+ .command-row {
179
+ display: grid;
180
+ min-width: 0;
181
+ grid-template-columns: auto minmax(0, 1fr);
182
+ align-items: center;
183
+ gap: 0.8rem;
184
+ padding: 0.82rem 0;
185
+ }
186
+
187
+ .command-row + .command-row {
188
+ border-top: 1px solid var(--line);
189
+ }
190
+
191
+ .command-row > span {
192
+ color: var(--ink-faint);
193
+ font-family: var(--font-mono);
194
+ font-size: 0.62rem;
195
+ }
196
+
197
+ .command-row code {
198
+ color: var(--ink);
199
+ font-size: 0.75rem;
200
+ overflow-wrap: anywhere;
201
+ }
202
+
203
+ .compiler-status {
204
+ display: inline-flex;
205
+ min-width: 0;
206
+ align-items: center;
207
+ gap: 0.65rem;
208
+ }
209
+
210
+ .status-dot {
211
+ width: 7px;
212
+ height: 7px;
213
+ flex: 0 0 auto;
214
+ border-radius: 50%;
215
+ background: var(--accent);
216
+ box-shadow: 0 0 0 3px var(--accent-soft);
217
+ }
218
+
219
+ .status-dot[data-enabled="false"] {
220
+ background: var(--ink-faint);
221
+ box-shadow: 0 0 0 3px rgb(255 255 255 / 6%);
222
+ }
223
+
224
+ .compiler-check {
225
+ margin-top: 1.9rem;
226
+ border: 1px solid var(--line);
227
+ background: var(--paper-soft);
228
+ }
229
+
230
+ .check-heading {
231
+ display: flex;
232
+ align-items: flex-end;
233
+ justify-content: space-between;
234
+ gap: 1.5rem;
235
+ border-bottom: 1px solid var(--line);
236
+ padding: 0.95rem 1rem;
237
+ }
238
+
239
+ .check-heading span {
240
+ color: var(--accent);
241
+ font-family: var(--font-mono);
242
+ font-size: 0.58rem;
243
+ letter-spacing: 0.05em;
244
+ text-transform: uppercase;
245
+ }
246
+
247
+ .check-heading h2 {
248
+ margin: 0.24rem 0 0;
249
+ font-size: 1rem;
250
+ font-weight: 560;
251
+ letter-spacing: -0.025em;
252
+ }
253
+
254
+ .check-heading p {
255
+ margin: 0;
256
+ color: var(--ink-faint);
257
+ font-family: var(--font-mono);
258
+ font-size: 0.62rem;
259
+ }
260
+
261
+ .comparison-grid {
262
+ display: grid;
263
+ grid-template-columns: repeat(2, minmax(0, 1fr));
264
+ }
265
+
266
+ .counter-path {
267
+ min-width: 0;
268
+ padding: 1rem;
269
+ }
270
+
271
+ .counter-path + .counter-path {
272
+ border-left: 1px solid var(--line);
273
+ }
274
+
275
+ .counter-path-compiled {
276
+ box-shadow: inset 0 2px 0 var(--accent);
277
+ }
278
+
279
+ .counter-heading {
280
+ display: flex;
281
+ align-items: center;
282
+ gap: 0.7rem;
283
+ }
284
+
285
+ .path-index {
286
+ display: inline-grid;
287
+ width: 23px;
288
+ height: 23px;
289
+ flex: 0 0 auto;
290
+ place-items: center;
291
+ border: 1px solid var(--line-strong);
292
+ border-radius: 50%;
293
+ color: var(--ink-soft);
294
+ font-family: var(--font-mono);
295
+ font-size: 0.58rem;
296
+ }
297
+
298
+ .counter-path-compiled .path-index {
299
+ border-color: rgb(184 255 91 / 0.35);
300
+ color: var(--accent);
301
+ }
302
+
303
+ .counter-heading h3,
304
+ .counter-heading p {
305
+ margin: 0;
306
+ }
307
+
308
+ .counter-heading h3 {
309
+ font-size: 0.82rem;
310
+ font-weight: 570;
311
+ }
312
+
313
+ .counter-heading p {
314
+ margin-top: 0.12rem;
315
+ color: var(--ink-faint);
316
+ font-family: var(--font-mono);
317
+ font-size: 0.56rem;
318
+ text-transform: uppercase;
319
+ }
320
+
321
+ .counter-metrics {
322
+ display: grid;
323
+ grid-template-columns: repeat(2, minmax(0, 1fr));
324
+ margin: 1rem 0;
325
+ border-block: 1px solid var(--line);
326
+ }
327
+
328
+ .counter-metrics > div {
329
+ padding: 0.75rem 0;
330
+ }
331
+
332
+ .counter-metrics > div + div {
333
+ border-left: 1px solid var(--line);
334
+ padding-left: 0.85rem;
335
+ }
336
+
337
+ .counter-metrics dt {
338
+ color: var(--ink-faint);
339
+ font-family: var(--font-mono);
340
+ font-size: 0.54rem;
341
+ text-transform: uppercase;
342
+ }
343
+
344
+ .counter-metrics dd {
345
+ margin: 0.2rem 0 0;
346
+ font-size: 1.45rem;
347
+ font-weight: 520;
348
+ letter-spacing: -0.04em;
349
+ }
350
+
351
+ .counter-path button {
352
+ display: inline-flex;
353
+ width: 100%;
354
+ min-height: 42px;
355
+ align-items: center;
356
+ justify-content: space-between;
357
+ gap: 1rem;
358
+ border: 1px solid var(--line-strong);
359
+ background: transparent;
360
+ padding: 0.65rem 0.75rem;
361
+ font-family: var(--font-mono);
362
+ font-size: 0.62rem;
363
+ cursor: pointer;
364
+ transition:
365
+ background-color 150ms ease,
366
+ border-color 150ms ease,
367
+ color 150ms ease,
368
+ transform 100ms ease;
369
+ }
370
+
371
+ .counter-path-compiled button {
372
+ border-color: rgb(184 255 91 / 0.42);
373
+ }
374
+
375
+ .counter-path button:active {
376
+ transform: translateY(1px);
377
+ }
378
+
379
+ .resource-links {
380
+ display: flex;
381
+ flex-wrap: wrap;
382
+ gap: 0.65rem;
383
+ margin-top: 1.35rem;
384
+ color: var(--ink-soft);
385
+ font-family: var(--font-mono);
386
+ font-size: 0.68rem;
387
+ text-transform: uppercase;
388
+ }
389
+
390
+ .resource-link-item {
391
+ display: inline-flex;
392
+ align-items: center;
393
+ gap: 0.65rem;
394
+ white-space: nowrap;
395
+ }
396
+
397
+ .resource-separator {
398
+ color: var(--ink-faint);
399
+ user-select: none;
400
+ }
401
+
402
+ .resource-links a {
403
+ display: inline-flex;
404
+ align-items: center;
405
+ gap: 0.45rem;
406
+ border-bottom: 1px solid transparent;
407
+ padding-block: 0.2rem;
408
+ transition:
409
+ border-color 150ms ease,
410
+ color 150ms ease;
411
+ }
412
+
413
+ .resource-icon {
414
+ width: 0.85rem;
415
+ height: 0.85rem;
416
+ flex: 0 0 auto;
417
+ }
418
+
419
+ @media (hover: hover) and (pointer: fine) {
420
+ .counter-path button:hover {
421
+ border-color: var(--ink-soft);
422
+ background: rgb(255 255 255 / 0.05);
423
+ }
424
+
425
+ .counter-path-compiled button:hover {
426
+ border-color: var(--accent);
427
+ background: var(--accent-soft);
428
+ }
429
+
430
+ .resource-links a:hover {
431
+ border-color: currentColor;
432
+ color: var(--ink);
433
+ }
434
+ }
435
+
436
+ @media (max-width: 680px) {
437
+ .hero-section {
438
+ align-items: flex-start;
439
+ padding: 2.25rem 1.25rem;
440
+ }
441
+
442
+ .hero-copy h1 {
443
+ font-size: clamp(2rem, 10vw, 2.75rem);
444
+ overflow-wrap: anywhere;
445
+ }
446
+
447
+ .check-heading {
448
+ align-items: flex-start;
449
+ flex-direction: column;
450
+ gap: 0.45rem;
451
+ }
452
+
453
+ .comparison-grid {
454
+ grid-template-columns: 1fr;
455
+ }
456
+
457
+ .counter-path + .counter-path {
458
+ border-top: 1px solid var(--line);
459
+ border-left: 0;
460
+ }
461
+ }
462
+
463
+ @media (prefers-reduced-motion: reduce) {
464
+ *,
465
+ *::before,
466
+ *::after {
467
+ scroll-behavior: auto !important;
468
+ transition-duration: 0.01ms !important;
469
+ }
470
+ }
@@ -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://farmjs.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
+ }