@opentf/create-afw 0.5.0 → 0.7.0

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 (212) hide show
  1. package/README.md +5 -8
  2. package/esdev/templates/app/_gitignore +18 -0
  3. package/esdev/templates/app/_option/language/js/entry.js +4 -0
  4. package/esdev/templates/app/_option/language/js/index.html +13 -0
  5. package/esdev/templates/app/_option/language/js/jsconfig.json +6 -0
  6. package/esdev/templates/app/_option/language/js/tests/ui/Counter.test.js +10 -0
  7. package/esdev/templates/app/_option/language/ts/entry.ts +4 -0
  8. package/esdev/templates/app/_option/language/ts/index.html +13 -0
  9. package/esdev/templates/app/_option/language/ts/tests/ui/Counter.test.ts +10 -0
  10. package/esdev/templates/app/_option/language/ts/tsconfig.json +28 -0
  11. package/esdev/templates/app/_option/render/client/_option/language/js/app/_config.js +6 -0
  12. package/esdev/templates/app/_option/render/client/_option/language/ts/app/_config.ts +6 -0
  13. package/esdev/templates/app/_option/render/client/_option/server/no/_option/styling/css/_option/language/js/README.md +14 -0
  14. package/esdev/templates/app/_option/render/client/_option/server/no/_option/styling/css/_option/language/js/app/layout.jsx +13 -0
  15. package/esdev/templates/app/_option/render/client/_option/server/no/_option/styling/css/_option/language/js/package.json +19 -0
  16. package/esdev/templates/app/_option/render/client/_option/server/no/_option/styling/css/_option/language/ts/README.md +15 -0
  17. package/esdev/templates/app/_option/render/client/_option/server/no/_option/styling/css/_option/language/ts/app/layout.tsx +13 -0
  18. package/esdev/templates/app/_option/render/client/_option/server/no/_option/styling/css/_option/language/ts/package.json +21 -0
  19. package/esdev/templates/app/_option/render/client/_option/server/no/_option/styling/tailwind/_option/language/js/README.md +15 -0
  20. package/esdev/templates/app/_option/render/client/_option/server/no/_option/styling/tailwind/_option/language/js/app/layout.jsx +13 -0
  21. package/esdev/templates/app/_option/render/client/_option/server/no/_option/styling/tailwind/_option/language/js/package.json +20 -0
  22. package/esdev/templates/app/_option/render/client/_option/server/no/_option/styling/tailwind/_option/language/ts/README.md +16 -0
  23. package/esdev/templates/app/_option/render/client/_option/server/no/_option/styling/tailwind/_option/language/ts/app/layout.tsx +13 -0
  24. package/esdev/templates/app/_option/render/client/_option/server/no/_option/styling/tailwind/_option/language/ts/package.json +22 -0
  25. package/esdev/templates/app/_option/render/client/_option/server/no/esdev.json +18 -0
  26. package/esdev/templates/app/_option/render/client/_option/server/yes/_option/styling/css/_option/language/js/README.md +15 -0
  27. package/esdev/templates/app/_option/render/client/_option/server/yes/_option/styling/css/_option/language/js/app/layout.jsx +14 -0
  28. package/esdev/templates/app/_option/render/client/_option/server/yes/_option/styling/css/_option/language/js/package.json +19 -0
  29. package/esdev/templates/app/_option/render/client/_option/server/yes/_option/styling/css/_option/language/ts/README.md +16 -0
  30. package/esdev/templates/app/_option/render/client/_option/server/yes/_option/styling/css/_option/language/ts/app/layout.tsx +14 -0
  31. package/esdev/templates/app/_option/render/client/_option/server/yes/_option/styling/css/_option/language/ts/package.json +21 -0
  32. package/esdev/templates/app/_option/render/client/_option/server/yes/_option/styling/tailwind/_option/language/js/README.md +16 -0
  33. package/esdev/templates/app/_option/render/client/_option/server/yes/_option/styling/tailwind/_option/language/js/app/layout.jsx +14 -0
  34. package/esdev/templates/app/_option/render/client/_option/server/yes/_option/styling/tailwind/_option/language/js/package.json +20 -0
  35. package/esdev/templates/app/_option/render/client/_option/server/yes/_option/styling/tailwind/_option/language/ts/README.md +17 -0
  36. package/esdev/templates/app/_option/render/client/_option/server/yes/_option/styling/tailwind/_option/language/ts/app/layout.tsx +14 -0
  37. package/esdev/templates/app/_option/render/client/_option/server/yes/_option/styling/tailwind/_option/language/ts/package.json +22 -0
  38. package/esdev/templates/app/_option/render/client/_option/server/yes/esdev.json +28 -0
  39. package/esdev/templates/app/_option/render/mixed/_option/language/js/app/_config.js +6 -0
  40. package/esdev/templates/app/_option/render/mixed/_option/language/js/app/about/_config.js +4 -0
  41. package/esdev/templates/app/_option/render/mixed/_option/language/js/app/dashboard/_config.js +5 -0
  42. package/esdev/templates/app/_option/render/mixed/_option/language/js/app/dashboard/loader.js +4 -0
  43. package/esdev/templates/app/_option/render/mixed/_option/language/ts/app/_config.ts +6 -0
  44. package/esdev/templates/app/_option/render/mixed/_option/language/ts/app/about/_config.ts +4 -0
  45. package/esdev/templates/app/_option/render/mixed/_option/language/ts/app/dashboard/_config.ts +5 -0
  46. package/esdev/templates/app/_option/render/mixed/_option/language/ts/app/dashboard/loader.ts +4 -0
  47. package/esdev/templates/app/_option/render/mixed/_option/server/yes/_option/styling/css/_option/language/js/README.md +15 -0
  48. package/esdev/templates/app/_option/render/mixed/_option/server/yes/_option/styling/css/_option/language/js/app/layout.jsx +15 -0
  49. package/esdev/templates/app/_option/render/mixed/_option/server/yes/_option/styling/css/_option/language/js/package.json +19 -0
  50. package/esdev/templates/app/_option/render/mixed/_option/server/yes/_option/styling/css/_option/language/ts/README.md +16 -0
  51. package/esdev/templates/app/_option/render/mixed/_option/server/yes/_option/styling/css/_option/language/ts/app/layout.tsx +15 -0
  52. package/esdev/templates/app/_option/render/mixed/_option/server/yes/_option/styling/css/_option/language/ts/package.json +21 -0
  53. package/esdev/templates/app/_option/render/mixed/_option/server/yes/_option/styling/tailwind/_option/language/js/README.md +16 -0
  54. package/esdev/templates/app/_option/render/mixed/_option/server/yes/_option/styling/tailwind/_option/language/js/app/layout.jsx +15 -0
  55. package/esdev/templates/app/_option/render/mixed/_option/server/yes/_option/styling/tailwind/_option/language/js/package.json +20 -0
  56. package/esdev/templates/app/_option/render/mixed/_option/server/yes/_option/styling/tailwind/_option/language/ts/README.md +17 -0
  57. package/esdev/templates/app/_option/render/mixed/_option/server/yes/_option/styling/tailwind/_option/language/ts/app/layout.tsx +15 -0
  58. package/esdev/templates/app/_option/render/mixed/_option/server/yes/_option/styling/tailwind/_option/language/ts/package.json +22 -0
  59. package/esdev/templates/app/_option/render/mixed/_option/server/yes/esdev.json +28 -0
  60. package/esdev/templates/app/_option/render/mixed/_option/styling/css/_option/language/js/app/dashboard/page.jsx +13 -0
  61. package/esdev/templates/app/_option/render/mixed/_option/styling/css/_option/language/ts/app/dashboard/page.tsx +13 -0
  62. package/esdev/templates/app/_option/render/mixed/_option/styling/tailwind/_option/language/js/app/dashboard/page.jsx +13 -0
  63. package/esdev/templates/app/_option/render/mixed/_option/styling/tailwind/_option/language/ts/app/dashboard/page.tsx +13 -0
  64. package/esdev/templates/app/_option/render/server/_option/language/js/app/_config.js +6 -0
  65. package/esdev/templates/app/_option/render/server/_option/language/ts/app/_config.ts +6 -0
  66. package/esdev/templates/app/_option/render/server/_option/server/yes/_option/styling/css/_option/language/js/README.md +15 -0
  67. package/esdev/templates/app/_option/render/server/_option/server/yes/_option/styling/css/_option/language/js/app/layout.jsx +14 -0
  68. package/esdev/templates/app/_option/render/server/_option/server/yes/_option/styling/css/_option/language/js/package.json +19 -0
  69. package/esdev/templates/app/_option/render/server/_option/server/yes/_option/styling/css/_option/language/ts/README.md +16 -0
  70. package/esdev/templates/app/_option/render/server/_option/server/yes/_option/styling/css/_option/language/ts/app/layout.tsx +14 -0
  71. package/esdev/templates/app/_option/render/server/_option/server/yes/_option/styling/css/_option/language/ts/package.json +21 -0
  72. package/esdev/templates/app/_option/render/server/_option/server/yes/_option/styling/tailwind/_option/language/js/README.md +16 -0
  73. package/esdev/templates/app/_option/render/server/_option/server/yes/_option/styling/tailwind/_option/language/js/app/layout.jsx +14 -0
  74. package/esdev/templates/app/_option/render/server/_option/server/yes/_option/styling/tailwind/_option/language/js/package.json +20 -0
  75. package/esdev/templates/app/_option/render/server/_option/server/yes/_option/styling/tailwind/_option/language/ts/README.md +17 -0
  76. package/esdev/templates/app/_option/render/server/_option/server/yes/_option/styling/tailwind/_option/language/ts/app/layout.tsx +14 -0
  77. package/esdev/templates/app/_option/render/server/_option/server/yes/_option/styling/tailwind/_option/language/ts/package.json +22 -0
  78. package/esdev/templates/app/_option/render/server/_option/server/yes/esdev.json +28 -0
  79. package/esdev/templates/app/_option/render/static/_option/language/js/app/_config.js +6 -0
  80. package/esdev/templates/app/_option/render/static/_option/language/ts/app/_config.ts +6 -0
  81. package/esdev/templates/app/_option/render/static/_option/server/no/_option/styling/css/_option/language/js/README.md +14 -0
  82. package/esdev/templates/app/_option/render/static/_option/server/no/_option/styling/css/_option/language/js/app/layout.jsx +13 -0
  83. package/esdev/templates/app/_option/render/static/_option/server/no/_option/styling/css/_option/language/js/package.json +20 -0
  84. package/esdev/templates/app/_option/render/static/_option/server/no/_option/styling/css/_option/language/ts/README.md +15 -0
  85. package/esdev/templates/app/_option/render/static/_option/server/no/_option/styling/css/_option/language/ts/app/layout.tsx +13 -0
  86. package/esdev/templates/app/_option/render/static/_option/server/no/_option/styling/css/_option/language/ts/package.json +22 -0
  87. package/esdev/templates/app/_option/render/static/_option/server/no/_option/styling/tailwind/_option/language/js/README.md +15 -0
  88. package/esdev/templates/app/_option/render/static/_option/server/no/_option/styling/tailwind/_option/language/js/app/layout.jsx +13 -0
  89. package/esdev/templates/app/_option/render/static/_option/server/no/_option/styling/tailwind/_option/language/js/package.json +21 -0
  90. package/esdev/templates/app/_option/render/static/_option/server/no/_option/styling/tailwind/_option/language/ts/README.md +16 -0
  91. package/esdev/templates/app/_option/render/static/_option/server/no/_option/styling/tailwind/_option/language/ts/app/layout.tsx +13 -0
  92. package/esdev/templates/app/_option/render/static/_option/server/no/_option/styling/tailwind/_option/language/ts/package.json +23 -0
  93. package/esdev/templates/app/_option/render/static/_option/server/no/esdev.json +32 -0
  94. package/esdev/templates/app/_option/render/static/_option/server/no/ssg.js +131 -0
  95. package/esdev/templates/app/_option/render/static/_option/server/yes/_option/styling/css/_option/language/js/README.md +15 -0
  96. package/esdev/templates/app/_option/render/static/_option/server/yes/_option/styling/css/_option/language/js/app/layout.jsx +14 -0
  97. package/esdev/templates/app/_option/render/static/_option/server/yes/_option/styling/css/_option/language/js/package.json +19 -0
  98. package/esdev/templates/app/_option/render/static/_option/server/yes/_option/styling/css/_option/language/ts/README.md +16 -0
  99. package/esdev/templates/app/_option/render/static/_option/server/yes/_option/styling/css/_option/language/ts/app/layout.tsx +14 -0
  100. package/esdev/templates/app/_option/render/static/_option/server/yes/_option/styling/css/_option/language/ts/package.json +21 -0
  101. package/esdev/templates/app/_option/render/static/_option/server/yes/_option/styling/tailwind/_option/language/js/README.md +16 -0
  102. package/esdev/templates/app/_option/render/static/_option/server/yes/_option/styling/tailwind/_option/language/js/app/layout.jsx +14 -0
  103. package/esdev/templates/app/_option/render/static/_option/server/yes/_option/styling/tailwind/_option/language/js/package.json +20 -0
  104. package/esdev/templates/app/_option/render/static/_option/server/yes/_option/styling/tailwind/_option/language/ts/README.md +17 -0
  105. package/esdev/templates/app/_option/render/static/_option/server/yes/_option/styling/tailwind/_option/language/ts/app/layout.tsx +14 -0
  106. package/esdev/templates/app/_option/render/static/_option/server/yes/_option/styling/tailwind/_option/language/ts/package.json +22 -0
  107. package/esdev/templates/app/_option/render/static/_option/server/yes/esdev.json +28 -0
  108. package/esdev/templates/app/_option/server/yes/_option/language/js/app/_middleware.js +9 -0
  109. package/esdev/templates/app/_option/server/yes/_option/language/js/app/api/hello/route.js +4 -0
  110. package/esdev/templates/app/_option/server/yes/_option/language/js/app/todos/loader.js +7 -0
  111. package/esdev/templates/app/_option/server/yes/_option/language/js/app/todos/todos.server.js +15 -0
  112. package/esdev/templates/app/_option/server/yes/_option/language/js/tests/server/api.test.js +8 -0
  113. package/esdev/templates/app/_option/server/yes/_option/language/ts/app/_middleware.ts +9 -0
  114. package/esdev/templates/app/_option/server/yes/_option/language/ts/app/api/hello/route.ts +4 -0
  115. package/esdev/templates/app/_option/server/yes/_option/language/ts/app/todos/loader.ts +7 -0
  116. package/esdev/templates/app/_option/server/yes/_option/language/ts/app/todos/todos.server.ts +15 -0
  117. package/esdev/templates/app/_option/server/yes/_option/language/ts/tests/server/api.test.ts +8 -0
  118. package/esdev/templates/app/_option/server/yes/_option/styling/css/_option/language/js/app/todos/page.jsx +29 -0
  119. package/esdev/templates/app/_option/server/yes/_option/styling/css/_option/language/ts/app/todos/page.tsx +29 -0
  120. package/esdev/templates/app/_option/server/yes/_option/styling/tailwind/_option/language/js/app/todos/page.jsx +29 -0
  121. package/esdev/templates/app/_option/server/yes/_option/styling/tailwind/_option/language/ts/app/todos/page.tsx +29 -0
  122. package/esdev/templates/app/_option/server/yes/server.js +53 -0
  123. package/esdev/templates/app/_option/styling/css/_option/language/js/app/Counter.jsx +10 -0
  124. package/esdev/templates/app/_option/styling/css/_option/language/js/app/page.jsx +13 -0
  125. package/esdev/templates/app/_option/styling/css/_option/language/ts/app/Counter.tsx +10 -0
  126. package/esdev/templates/app/_option/styling/css/_option/language/ts/app/page.tsx +13 -0
  127. package/esdev/templates/app/_option/styling/css/app/global.css +16 -0
  128. package/esdev/templates/app/_option/styling/tailwind/_option/language/js/app/Counter.jsx +10 -0
  129. package/esdev/templates/app/_option/styling/tailwind/_option/language/js/app/page.jsx +13 -0
  130. package/esdev/templates/app/_option/styling/tailwind/_option/language/ts/app/Counter.tsx +10 -0
  131. package/esdev/templates/app/_option/styling/tailwind/_option/language/ts/app/page.tsx +13 -0
  132. package/esdev/templates/app/_option/styling/tailwind/app/global.css +7 -0
  133. package/esdev/templates/app/app/about/page.md +7 -0
  134. package/esdev/templates/app/template.json +96 -0
  135. package/esdev/templates/catalog.json +15 -0
  136. package/esdev/templates/docs/_gitignore +18 -0
  137. package/esdev/templates/docs/_option/blog/no/_option/language/js/README.md +14 -0
  138. package/esdev/templates/docs/_option/blog/no/_option/language/js/app/page.jsx +15 -0
  139. package/esdev/templates/docs/_option/blog/no/_option/language/js/tests/ui/Home.test.js +9 -0
  140. package/esdev/templates/docs/_option/blog/no/_option/language/ts/README.md +15 -0
  141. package/esdev/templates/docs/_option/blog/no/_option/language/ts/app/page.tsx +15 -0
  142. package/esdev/templates/docs/_option/blog/no/_option/language/ts/tests/ui/Home.test.ts +9 -0
  143. package/esdev/templates/docs/_option/blog/no/afw.config.js +13 -0
  144. package/esdev/templates/docs/_option/blog/yes/_option/language/js/README.md +14 -0
  145. package/esdev/templates/docs/_option/blog/yes/_option/language/js/app/blog/layout.jsx +7 -0
  146. package/esdev/templates/docs/_option/blog/yes/_option/language/js/app/blog/page.jsx +13 -0
  147. package/esdev/templates/docs/_option/blog/yes/_option/language/js/app/page.jsx +15 -0
  148. package/esdev/templates/docs/_option/blog/yes/_option/language/js/tests/ui/Home.test.js +10 -0
  149. package/esdev/templates/docs/_option/blog/yes/_option/language/ts/README.md +15 -0
  150. package/esdev/templates/docs/_option/blog/yes/_option/language/ts/app/blog/layout.tsx +7 -0
  151. package/esdev/templates/docs/_option/blog/yes/_option/language/ts/app/blog/page.tsx +13 -0
  152. package/esdev/templates/docs/_option/blog/yes/_option/language/ts/app/page.tsx +15 -0
  153. package/esdev/templates/docs/_option/blog/yes/_option/language/ts/tests/ui/Home.test.ts +10 -0
  154. package/esdev/templates/docs/_option/blog/yes/afw.config.js +15 -0
  155. package/esdev/templates/docs/_option/blog/yes/app/blog/hello-world/page.mdx +10 -0
  156. package/esdev/templates/docs/_option/language/js/app/_config.js +4 -0
  157. package/esdev/templates/docs/_option/language/js/app/docs/layout.jsx +6 -0
  158. package/esdev/templates/docs/_option/language/js/app/layout.jsx +3 -0
  159. package/esdev/templates/docs/_option/language/js/entry.js +6 -0
  160. package/esdev/templates/docs/_option/language/js/index.html +12 -0
  161. package/esdev/templates/docs/_option/language/js/jsconfig.json +6 -0
  162. package/esdev/templates/docs/_option/language/js/package.json +21 -0
  163. package/esdev/templates/docs/_option/language/ts/app/_config.ts +4 -0
  164. package/esdev/templates/docs/_option/language/ts/app/docs/layout.tsx +6 -0
  165. package/esdev/templates/docs/_option/language/ts/app/layout.tsx +3 -0
  166. package/esdev/templates/docs/_option/language/ts/entry.ts +6 -0
  167. package/esdev/templates/docs/_option/language/ts/index.html +12 -0
  168. package/esdev/templates/docs/_option/language/ts/package.json +23 -0
  169. package/esdev/templates/docs/_option/language/ts/tsconfig.json +30 -0
  170. package/esdev/templates/docs/app/docs/_meta.js +5 -0
  171. package/esdev/templates/docs/app/docs/getting-started/page.mdx +11 -0
  172. package/esdev/templates/docs/app/docs/guides/writing-pages/page.mdx +20 -0
  173. package/esdev/templates/docs/app/docs/page.mdx +14 -0
  174. package/esdev/templates/docs/app/global.css +1 -0
  175. package/esdev/templates/docs/esdev.json +39 -0
  176. package/esdev/templates/docs/ssg.js +131 -0
  177. package/esdev/templates/docs/template.json +43 -0
  178. package/esdev/templates/library/_gitignore +18 -0
  179. package/esdev/templates/library/_option/language/js/entry.js +4 -0
  180. package/esdev/templates/library/_option/language/js/index.html +13 -0
  181. package/esdev/templates/library/_option/language/js/index.js +2 -0
  182. package/esdev/templates/library/_option/language/js/jsconfig.json +6 -0
  183. package/esdev/templates/library/_option/language/js/tests/ui/Counter.test.js +10 -0
  184. package/esdev/templates/library/_option/language/ts/entry.ts +4 -0
  185. package/esdev/templates/library/_option/language/ts/index.html +13 -0
  186. package/esdev/templates/library/_option/language/ts/index.ts +2 -0
  187. package/esdev/templates/library/_option/language/ts/tests/ui/Counter.test.ts +10 -0
  188. package/esdev/templates/library/_option/language/ts/tsconfig.json +30 -0
  189. package/esdev/templates/library/_option/styling/css/_option/language/js/README.md +12 -0
  190. package/esdev/templates/library/_option/styling/css/_option/language/js/app/page.jsx +10 -0
  191. package/esdev/templates/library/_option/styling/css/_option/language/js/package.json +26 -0
  192. package/esdev/templates/library/_option/styling/css/_option/language/js/src/Counter.jsx +10 -0
  193. package/esdev/templates/library/_option/styling/css/_option/language/ts/README.md +13 -0
  194. package/esdev/templates/library/_option/styling/css/_option/language/ts/app/page.tsx +10 -0
  195. package/esdev/templates/library/_option/styling/css/_option/language/ts/package.json +28 -0
  196. package/esdev/templates/library/_option/styling/css/_option/language/ts/src/Counter.tsx +10 -0
  197. package/esdev/templates/library/_option/styling/css/app/global.css +16 -0
  198. package/esdev/templates/library/_option/styling/tailwind/_option/language/js/README.md +13 -0
  199. package/esdev/templates/library/_option/styling/tailwind/_option/language/js/app/page.jsx +10 -0
  200. package/esdev/templates/library/_option/styling/tailwind/_option/language/js/package.json +27 -0
  201. package/esdev/templates/library/_option/styling/tailwind/_option/language/js/src/Counter.jsx +10 -0
  202. package/esdev/templates/library/_option/styling/tailwind/_option/language/ts/README.md +14 -0
  203. package/esdev/templates/library/_option/styling/tailwind/_option/language/ts/app/page.tsx +10 -0
  204. package/esdev/templates/library/_option/styling/tailwind/_option/language/ts/package.json +29 -0
  205. package/esdev/templates/library/_option/styling/tailwind/_option/language/ts/src/Counter.tsx +10 -0
  206. package/esdev/templates/library/_option/styling/tailwind/app/global.css +7 -0
  207. package/esdev/templates/library/esdev.json +18 -0
  208. package/esdev/templates/library/template.json +44 -0
  209. package/index.js +12 -21
  210. package/package.json +14 -9
  211. package/templates.js +257 -77
  212. package/versions.json +4 -4
@@ -0,0 +1,28 @@
1
+ {
2
+ "plugins": [
3
+ {
4
+ "module": "@opentf/esdev-plugin-afw",
5
+ "options": {
6
+ "appDir": "app"
7
+ }
8
+ }
9
+ ],
10
+ "build": {
11
+ "targets": {
12
+ "web": {
13
+ "entry": "index.html",
14
+ "outdir": "dist"
15
+ },
16
+ "server": {
17
+ "entry": "server.js",
18
+ "out": "dist/server.js"
19
+ }
20
+ }
21
+ },
22
+ "dev": {
23
+ "run": "server",
24
+ "app": {
25
+ "port": 3000
26
+ }
27
+ }
28
+ }
@@ -0,0 +1,6 @@
1
+ import { defineRoute } from "@opentf/afw";
2
+
3
+ // How the pages in app/ render: "server" (per request), "static" (once, at build time) or
4
+ // "client" (in the browser). A folder's own _config.js sets it for that folder and
5
+ // the folders below it; the nearest one wins.
6
+ export default defineRoute({ render: "server" });
@@ -0,0 +1,4 @@
1
+ import { defineRoute } from "@opentf/afw";
2
+
3
+ // Built once at build time; the rest of the app renders per request.
4
+ export default defineRoute({ render: "static" });
@@ -0,0 +1,5 @@
1
+ import { defineRoute } from "@opentf/afw";
2
+
3
+ // Rendered in the browser: the server sends the layout and this folder's loader data,
4
+ // and never loads its pages, so they may use browser-only code.
5
+ export default defineRoute({ render: "client" });
@@ -0,0 +1,4 @@
1
+ // Still runs on the server: a client page gets its data with the page.
2
+ export default function loader() {
3
+ return { visits: 42 };
4
+ }
@@ -0,0 +1,6 @@
1
+ import { defineRoute } from "@opentf/afw";
2
+
3
+ // How the pages in app/ render: "server" (per request), "static" (once, at build time) or
4
+ // "client" (in the browser). A folder's own _config.ts sets it for that folder and
5
+ // the folders below it; the nearest one wins.
6
+ export default defineRoute({ render: "server" });
@@ -0,0 +1,4 @@
1
+ import { defineRoute } from "@opentf/afw";
2
+
3
+ // Built once at build time; the rest of the app renders per request.
4
+ export default defineRoute({ render: "static" });
@@ -0,0 +1,5 @@
1
+ import { defineRoute } from "@opentf/afw";
2
+
3
+ // Rendered in the browser: the server sends the layout and this folder's loader data,
4
+ // and never loads its pages, so they may use browser-only code.
5
+ export default defineRoute({ render: "client" });
@@ -0,0 +1,4 @@
1
+ // Still runs on the server: a client page gets its data with the page.
2
+ export default function loader() {
3
+ return { visits: 42 };
4
+ }
@@ -0,0 +1,15 @@
1
+ # {{name}}
2
+
3
+ An [AFW](https://afw.opentechf.org) app on esdev and ES-Runtime: pages rendered on the server by default, with a prebuilt page (`/about`) and a section rendered in the browser (`/dashboard`), with a server on ES-Runtime.
4
+
5
+ | Command | What it does |
6
+ | --- | --- |
7
+ | `{{pm}} run dev` | Start the dev server |
8
+ | `{{pm}} run build` | Build for production |
9
+ | `{{pm}} run start` | Run the built server on ES-Runtime (`PORT`) |
10
+ | `{{pm}} run test` | Run the tests with esdev |
11
+
12
+ - Pages live in `app/`: `app/about/page.md` is served at `/about`.
13
+ - `app/_config.js` sets how pages render (`server`, `static` or `client`); a folder's own `_config.js` changes it for that folder.
14
+ - Component tests live in `tests/ui/`, server tests (API routes, loaders) in `tests/server/`.
15
+ - On the server: API routes (`app/api/hello/route.js`), middleware (`app/_middleware.js`), a loader (`app/todos/loader.js`) and server functions (`app/todos/todos.server.js`), which components call like async functions.
@@ -0,0 +1,15 @@
1
+ import { Link } from "@opentf/afw";
2
+
3
+ export default function Layout({ children }) {
4
+ return (
5
+ <>
6
+ <nav>
7
+ <Link href="/">Home</Link>
8
+ <Link href="/about">About</Link>
9
+ <Link href="/todos">Todos</Link>
10
+ <Link href="/dashboard">Dashboard</Link>
11
+ </nav>
12
+ <main>{children}</main>
13
+ </>
14
+ );
15
+ }
@@ -0,0 +1,19 @@
1
+ {
2
+ "name": "{{name}}",
3
+ "private": true,
4
+ "type": "module",
5
+ "scripts": {
6
+ "dev": "esdev start",
7
+ "build": "esdev build",
8
+ "start": "esrun --allow-read=dist --allow-listen=0.0.0.0:3000 --allow-env=PORT --allow-imports dist/server.js",
9
+ "test": "esdev test tests/server && esdev test --dom --setup=@opentf/afw-test/setup tests/ui"
10
+ },
11
+ "dependencies": {
12
+ "@opentf/afw": "{{registry:@opentf/afw}}"
13
+ },
14
+ "devDependencies": {
15
+ "@opentf/afw-test": "{{registry:@opentf/afw-test}}",
16
+ "@opentf/esdev-plugin-afw": "{{registry:@opentf/esdev-plugin-afw}}",
17
+ "@opentf/esrun-types": "{{registry:@opentf/esrun-types}}"
18
+ }
19
+ }
@@ -0,0 +1,16 @@
1
+ # {{name}}
2
+
3
+ An [AFW](https://afw.opentechf.org) app on esdev and ES-Runtime: pages rendered on the server by default, with a prebuilt page (`/about`) and a section rendered in the browser (`/dashboard`), with a server on ES-Runtime.
4
+
5
+ | Command | What it does |
6
+ | --- | --- |
7
+ | `{{pm}} run dev` | Start the dev server |
8
+ | `{{pm}} run build` | Build for production |
9
+ | `{{pm}} run start` | Run the built server on ES-Runtime (`PORT`) |
10
+ | `{{pm}} run test` | Run the tests with esdev |
11
+ | `{{pm}} run typecheck` | Check types |
12
+
13
+ - Pages live in `app/`: `app/about/page.md` is served at `/about`.
14
+ - `app/_config.ts` sets how pages render (`server`, `static` or `client`); a folder's own `_config.ts` changes it for that folder.
15
+ - Component tests live in `tests/ui/`, server tests (API routes, loaders) in `tests/server/`.
16
+ - On the server: API routes (`app/api/hello/route.ts`), middleware (`app/_middleware.ts`), a loader (`app/todos/loader.ts`) and server functions (`app/todos/todos.server.ts`), which components call like async functions.
@@ -0,0 +1,15 @@
1
+ import { Link } from "@opentf/afw";
2
+
3
+ export default function Layout({ children }: { children: unknown }) {
4
+ return (
5
+ <>
6
+ <nav>
7
+ <Link href="/">Home</Link>
8
+ <Link href="/about">About</Link>
9
+ <Link href="/todos">Todos</Link>
10
+ <Link href="/dashboard">Dashboard</Link>
11
+ </nav>
12
+ <main>{children}</main>
13
+ </>
14
+ );
15
+ }
@@ -0,0 +1,21 @@
1
+ {
2
+ "name": "{{name}}",
3
+ "private": true,
4
+ "type": "module",
5
+ "scripts": {
6
+ "dev": "esdev start",
7
+ "build": "esdev build",
8
+ "start": "esrun --allow-read=dist --allow-listen=0.0.0.0:3000 --allow-env=PORT --allow-imports dist/server.js",
9
+ "test": "esdev test tests/server && esdev test --dom --setup=@opentf/afw-test/setup tests/ui",
10
+ "typecheck": "esdev typecheck"
11
+ },
12
+ "dependencies": {
13
+ "@opentf/afw": "{{registry:@opentf/afw}}"
14
+ },
15
+ "devDependencies": {
16
+ "@opentf/afw-test": "{{registry:@opentf/afw-test}}",
17
+ "@opentf/esdev-plugin-afw": "{{registry:@opentf/esdev-plugin-afw}}",
18
+ "@opentf/esrun-types": "{{registry:@opentf/esrun-types}}",
19
+ "typescript": "{{registry:typescript}}"
20
+ }
21
+ }
@@ -0,0 +1,16 @@
1
+ # {{name}}
2
+
3
+ An [AFW](https://afw.opentechf.org) app on esdev and ES-Runtime: pages rendered on the server by default, with a prebuilt page (`/about`) and a section rendered in the browser (`/dashboard`), with a server on ES-Runtime.
4
+
5
+ | Command | What it does |
6
+ | --- | --- |
7
+ | `{{pm}} run dev` | Start the dev server |
8
+ | `{{pm}} run build` | Build for production |
9
+ | `{{pm}} run start` | Run the built server on ES-Runtime (`PORT`) |
10
+ | `{{pm}} run test` | Run the tests with esdev |
11
+
12
+ - Pages live in `app/`: `app/about/page.md` is served at `/about`.
13
+ - `app/_config.js` sets how pages render (`server`, `static` or `client`); a folder's own `_config.js` changes it for that folder.
14
+ - Component tests live in `tests/ui/`, server tests (API routes, loaders) in `tests/server/`.
15
+ - On the server: API routes (`app/api/hello/route.js`), middleware (`app/_middleware.js`), a loader (`app/todos/loader.js`) and server functions (`app/todos/todos.server.js`), which components call like async functions.
16
+ - Styled with Tailwind CSS: utility classes go straight into `class`.
@@ -0,0 +1,15 @@
1
+ import { Link } from "@opentf/afw";
2
+
3
+ export default function Layout({ children }) {
4
+ return (
5
+ <>
6
+ <nav class="mb-8 flex gap-4 text-sky-700">
7
+ <Link href="/">Home</Link>
8
+ <Link href="/about">About</Link>
9
+ <Link href="/todos">Todos</Link>
10
+ <Link href="/dashboard">Dashboard</Link>
11
+ </nav>
12
+ <main>{children}</main>
13
+ </>
14
+ );
15
+ }
@@ -0,0 +1,20 @@
1
+ {
2
+ "name": "{{name}}",
3
+ "private": true,
4
+ "type": "module",
5
+ "scripts": {
6
+ "dev": "esdev start",
7
+ "build": "esdev build",
8
+ "start": "esrun --allow-read=dist --allow-listen=0.0.0.0:3000 --allow-env=PORT --allow-imports dist/server.js",
9
+ "test": "esdev test tests/server && esdev test --dom --setup=@opentf/afw-test/setup tests/ui"
10
+ },
11
+ "dependencies": {
12
+ "@opentf/afw": "{{registry:@opentf/afw}}"
13
+ },
14
+ "devDependencies": {
15
+ "@opentf/afw-test": "{{registry:@opentf/afw-test}}",
16
+ "@opentf/esdev-plugin-afw": "{{registry:@opentf/esdev-plugin-afw}}",
17
+ "@opentf/esrun-types": "{{registry:@opentf/esrun-types}}",
18
+ "tailwindcss": "{{registry:tailwindcss}}"
19
+ }
20
+ }
@@ -0,0 +1,17 @@
1
+ # {{name}}
2
+
3
+ An [AFW](https://afw.opentechf.org) app on esdev and ES-Runtime: pages rendered on the server by default, with a prebuilt page (`/about`) and a section rendered in the browser (`/dashboard`), with a server on ES-Runtime.
4
+
5
+ | Command | What it does |
6
+ | --- | --- |
7
+ | `{{pm}} run dev` | Start the dev server |
8
+ | `{{pm}} run build` | Build for production |
9
+ | `{{pm}} run start` | Run the built server on ES-Runtime (`PORT`) |
10
+ | `{{pm}} run test` | Run the tests with esdev |
11
+ | `{{pm}} run typecheck` | Check types |
12
+
13
+ - Pages live in `app/`: `app/about/page.md` is served at `/about`.
14
+ - `app/_config.ts` sets how pages render (`server`, `static` or `client`); a folder's own `_config.ts` changes it for that folder.
15
+ - Component tests live in `tests/ui/`, server tests (API routes, loaders) in `tests/server/`.
16
+ - On the server: API routes (`app/api/hello/route.ts`), middleware (`app/_middleware.ts`), a loader (`app/todos/loader.ts`) and server functions (`app/todos/todos.server.ts`), which components call like async functions.
17
+ - Styled with Tailwind CSS: utility classes go straight into `class`.
@@ -0,0 +1,15 @@
1
+ import { Link } from "@opentf/afw";
2
+
3
+ export default function Layout({ children }: { children: unknown }) {
4
+ return (
5
+ <>
6
+ <nav class="mb-8 flex gap-4 text-sky-700">
7
+ <Link href="/">Home</Link>
8
+ <Link href="/about">About</Link>
9
+ <Link href="/todos">Todos</Link>
10
+ <Link href="/dashboard">Dashboard</Link>
11
+ </nav>
12
+ <main>{children}</main>
13
+ </>
14
+ );
15
+ }
@@ -0,0 +1,22 @@
1
+ {
2
+ "name": "{{name}}",
3
+ "private": true,
4
+ "type": "module",
5
+ "scripts": {
6
+ "dev": "esdev start",
7
+ "build": "esdev build",
8
+ "start": "esrun --allow-read=dist --allow-listen=0.0.0.0:3000 --allow-env=PORT --allow-imports dist/server.js",
9
+ "test": "esdev test tests/server && esdev test --dom --setup=@opentf/afw-test/setup tests/ui",
10
+ "typecheck": "esdev typecheck"
11
+ },
12
+ "dependencies": {
13
+ "@opentf/afw": "{{registry:@opentf/afw}}"
14
+ },
15
+ "devDependencies": {
16
+ "@opentf/afw-test": "{{registry:@opentf/afw-test}}",
17
+ "@opentf/esdev-plugin-afw": "{{registry:@opentf/esdev-plugin-afw}}",
18
+ "@opentf/esrun-types": "{{registry:@opentf/esrun-types}}",
19
+ "tailwindcss": "{{registry:tailwindcss}}",
20
+ "typescript": "{{registry:typescript}}"
21
+ }
22
+ }
@@ -0,0 +1,28 @@
1
+ {
2
+ "plugins": [
3
+ {
4
+ "module": "@opentf/esdev-plugin-afw",
5
+ "options": {
6
+ "appDir": "app"
7
+ }
8
+ }
9
+ ],
10
+ "build": {
11
+ "targets": {
12
+ "web": {
13
+ "entry": "index.html",
14
+ "outdir": "dist"
15
+ },
16
+ "server": {
17
+ "entry": "server.js",
18
+ "out": "dist/server.js"
19
+ }
20
+ }
21
+ },
22
+ "dev": {
23
+ "run": "server",
24
+ "app": {
25
+ "port": 3000
26
+ }
27
+ }
28
+ }
@@ -0,0 +1,13 @@
1
+ import { router } from "@opentf/afw";
2
+
3
+ export const metadata = { title: "Dashboard" };
4
+
5
+ export default function Dashboard() {
6
+ const visits = $derived(router.data?.visits ?? 0);
7
+ return (
8
+ <section>
9
+ <h1>Dashboard</h1>
10
+ <p>Rendered in your browser, {visits} visits. Browser-only code is safe here.</p>
11
+ </section>
12
+ );
13
+ }
@@ -0,0 +1,13 @@
1
+ import { router } from "@opentf/afw";
2
+
3
+ export const metadata = { title: "Dashboard" };
4
+
5
+ export default function Dashboard() {
6
+ const visits = $derived((router.data as { visits?: number } | undefined)?.visits ?? 0);
7
+ return (
8
+ <section>
9
+ <h1>Dashboard</h1>
10
+ <p>Rendered in your browser, {visits} visits. Browser-only code is safe here.</p>
11
+ </section>
12
+ );
13
+ }
@@ -0,0 +1,13 @@
1
+ import { router } from "@opentf/afw";
2
+
3
+ export const metadata = { title: "Dashboard" };
4
+
5
+ export default function Dashboard() {
6
+ const visits = $derived(router.data?.visits ?? 0);
7
+ return (
8
+ <section>
9
+ <h1 class="mb-4 text-2xl font-bold">Dashboard</h1>
10
+ <p>Rendered in your browser, {visits} visits. Browser-only code is safe here.</p>
11
+ </section>
12
+ );
13
+ }
@@ -0,0 +1,13 @@
1
+ import { router } from "@opentf/afw";
2
+
3
+ export const metadata = { title: "Dashboard" };
4
+
5
+ export default function Dashboard() {
6
+ const visits = $derived((router.data as { visits?: number } | undefined)?.visits ?? 0);
7
+ return (
8
+ <section>
9
+ <h1 class="mb-4 text-2xl font-bold">Dashboard</h1>
10
+ <p>Rendered in your browser, {visits} visits. Browser-only code is safe here.</p>
11
+ </section>
12
+ );
13
+ }
@@ -0,0 +1,6 @@
1
+ import { defineRoute } from "@opentf/afw";
2
+
3
+ // How the pages in app/ render: "server" (per request), "static" (once, at build time) or
4
+ // "client" (in the browser). A folder's own _config.js sets it for that folder and
5
+ // the folders below it; the nearest one wins.
6
+ export default defineRoute({ render: "server" });
@@ -0,0 +1,6 @@
1
+ import { defineRoute } from "@opentf/afw";
2
+
3
+ // How the pages in app/ render: "server" (per request), "static" (once, at build time) or
4
+ // "client" (in the browser). A folder's own _config.ts sets it for that folder and
5
+ // the folders below it; the nearest one wins.
6
+ export default defineRoute({ render: "server" });
@@ -0,0 +1,15 @@
1
+ # {{name}}
2
+
3
+ An [AFW](https://afw.opentechf.org) app on esdev and ES-Runtime: pages rendered on the server per request, with a server on ES-Runtime.
4
+
5
+ | Command | What it does |
6
+ | --- | --- |
7
+ | `{{pm}} run dev` | Start the dev server |
8
+ | `{{pm}} run build` | Build for production |
9
+ | `{{pm}} run start` | Run the built server on ES-Runtime (`PORT`) |
10
+ | `{{pm}} run test` | Run the tests with esdev |
11
+
12
+ - Pages live in `app/`: `app/about/page.md` is served at `/about`.
13
+ - `app/_config.js` sets how pages render (`server`, `static` or `client`); a folder's own `_config.js` changes it for that folder.
14
+ - Component tests live in `tests/ui/`, server tests (API routes, loaders) in `tests/server/`.
15
+ - On the server: API routes (`app/api/hello/route.js`), middleware (`app/_middleware.js`), a loader (`app/todos/loader.js`) and server functions (`app/todos/todos.server.js`), which components call like async functions.
@@ -0,0 +1,14 @@
1
+ import { Link } from "@opentf/afw";
2
+
3
+ export default function Layout({ children }) {
4
+ return (
5
+ <>
6
+ <nav>
7
+ <Link href="/">Home</Link>
8
+ <Link href="/about">About</Link>
9
+ <Link href="/todos">Todos</Link>
10
+ </nav>
11
+ <main>{children}</main>
12
+ </>
13
+ );
14
+ }
@@ -0,0 +1,19 @@
1
+ {
2
+ "name": "{{name}}",
3
+ "private": true,
4
+ "type": "module",
5
+ "scripts": {
6
+ "dev": "esdev start",
7
+ "build": "esdev build",
8
+ "start": "esrun --allow-read=dist --allow-listen=0.0.0.0:3000 --allow-env=PORT --allow-imports dist/server.js",
9
+ "test": "esdev test tests/server && esdev test --dom --setup=@opentf/afw-test/setup tests/ui"
10
+ },
11
+ "dependencies": {
12
+ "@opentf/afw": "{{registry:@opentf/afw}}"
13
+ },
14
+ "devDependencies": {
15
+ "@opentf/afw-test": "{{registry:@opentf/afw-test}}",
16
+ "@opentf/esdev-plugin-afw": "{{registry:@opentf/esdev-plugin-afw}}",
17
+ "@opentf/esrun-types": "{{registry:@opentf/esrun-types}}"
18
+ }
19
+ }
@@ -0,0 +1,16 @@
1
+ # {{name}}
2
+
3
+ An [AFW](https://afw.opentechf.org) app on esdev and ES-Runtime: pages rendered on the server per request, with a server on ES-Runtime.
4
+
5
+ | Command | What it does |
6
+ | --- | --- |
7
+ | `{{pm}} run dev` | Start the dev server |
8
+ | `{{pm}} run build` | Build for production |
9
+ | `{{pm}} run start` | Run the built server on ES-Runtime (`PORT`) |
10
+ | `{{pm}} run test` | Run the tests with esdev |
11
+ | `{{pm}} run typecheck` | Check types |
12
+
13
+ - Pages live in `app/`: `app/about/page.md` is served at `/about`.
14
+ - `app/_config.ts` sets how pages render (`server`, `static` or `client`); a folder's own `_config.ts` changes it for that folder.
15
+ - Component tests live in `tests/ui/`, server tests (API routes, loaders) in `tests/server/`.
16
+ - On the server: API routes (`app/api/hello/route.ts`), middleware (`app/_middleware.ts`), a loader (`app/todos/loader.ts`) and server functions (`app/todos/todos.server.ts`), which components call like async functions.
@@ -0,0 +1,14 @@
1
+ import { Link } from "@opentf/afw";
2
+
3
+ export default function Layout({ children }: { children: unknown }) {
4
+ return (
5
+ <>
6
+ <nav>
7
+ <Link href="/">Home</Link>
8
+ <Link href="/about">About</Link>
9
+ <Link href="/todos">Todos</Link>
10
+ </nav>
11
+ <main>{children}</main>
12
+ </>
13
+ );
14
+ }
@@ -0,0 +1,21 @@
1
+ {
2
+ "name": "{{name}}",
3
+ "private": true,
4
+ "type": "module",
5
+ "scripts": {
6
+ "dev": "esdev start",
7
+ "build": "esdev build",
8
+ "start": "esrun --allow-read=dist --allow-listen=0.0.0.0:3000 --allow-env=PORT --allow-imports dist/server.js",
9
+ "test": "esdev test tests/server && esdev test --dom --setup=@opentf/afw-test/setup tests/ui",
10
+ "typecheck": "esdev typecheck"
11
+ },
12
+ "dependencies": {
13
+ "@opentf/afw": "{{registry:@opentf/afw}}"
14
+ },
15
+ "devDependencies": {
16
+ "@opentf/afw-test": "{{registry:@opentf/afw-test}}",
17
+ "@opentf/esdev-plugin-afw": "{{registry:@opentf/esdev-plugin-afw}}",
18
+ "@opentf/esrun-types": "{{registry:@opentf/esrun-types}}",
19
+ "typescript": "{{registry:typescript}}"
20
+ }
21
+ }
@@ -0,0 +1,16 @@
1
+ # {{name}}
2
+
3
+ An [AFW](https://afw.opentechf.org) app on esdev and ES-Runtime: pages rendered on the server per request, with a server on ES-Runtime.
4
+
5
+ | Command | What it does |
6
+ | --- | --- |
7
+ | `{{pm}} run dev` | Start the dev server |
8
+ | `{{pm}} run build` | Build for production |
9
+ | `{{pm}} run start` | Run the built server on ES-Runtime (`PORT`) |
10
+ | `{{pm}} run test` | Run the tests with esdev |
11
+
12
+ - Pages live in `app/`: `app/about/page.md` is served at `/about`.
13
+ - `app/_config.js` sets how pages render (`server`, `static` or `client`); a folder's own `_config.js` changes it for that folder.
14
+ - Component tests live in `tests/ui/`, server tests (API routes, loaders) in `tests/server/`.
15
+ - On the server: API routes (`app/api/hello/route.js`), middleware (`app/_middleware.js`), a loader (`app/todos/loader.js`) and server functions (`app/todos/todos.server.js`), which components call like async functions.
16
+ - Styled with Tailwind CSS: utility classes go straight into `class`.
@@ -0,0 +1,14 @@
1
+ import { Link } from "@opentf/afw";
2
+
3
+ export default function Layout({ children }) {
4
+ return (
5
+ <>
6
+ <nav class="mb-8 flex gap-4 text-sky-700">
7
+ <Link href="/">Home</Link>
8
+ <Link href="/about">About</Link>
9
+ <Link href="/todos">Todos</Link>
10
+ </nav>
11
+ <main>{children}</main>
12
+ </>
13
+ );
14
+ }
@@ -0,0 +1,20 @@
1
+ {
2
+ "name": "{{name}}",
3
+ "private": true,
4
+ "type": "module",
5
+ "scripts": {
6
+ "dev": "esdev start",
7
+ "build": "esdev build",
8
+ "start": "esrun --allow-read=dist --allow-listen=0.0.0.0:3000 --allow-env=PORT --allow-imports dist/server.js",
9
+ "test": "esdev test tests/server && esdev test --dom --setup=@opentf/afw-test/setup tests/ui"
10
+ },
11
+ "dependencies": {
12
+ "@opentf/afw": "{{registry:@opentf/afw}}"
13
+ },
14
+ "devDependencies": {
15
+ "@opentf/afw-test": "{{registry:@opentf/afw-test}}",
16
+ "@opentf/esdev-plugin-afw": "{{registry:@opentf/esdev-plugin-afw}}",
17
+ "@opentf/esrun-types": "{{registry:@opentf/esrun-types}}",
18
+ "tailwindcss": "{{registry:tailwindcss}}"
19
+ }
20
+ }
@@ -0,0 +1,17 @@
1
+ # {{name}}
2
+
3
+ An [AFW](https://afw.opentechf.org) app on esdev and ES-Runtime: pages rendered on the server per request, with a server on ES-Runtime.
4
+
5
+ | Command | What it does |
6
+ | --- | --- |
7
+ | `{{pm}} run dev` | Start the dev server |
8
+ | `{{pm}} run build` | Build for production |
9
+ | `{{pm}} run start` | Run the built server on ES-Runtime (`PORT`) |
10
+ | `{{pm}} run test` | Run the tests with esdev |
11
+ | `{{pm}} run typecheck` | Check types |
12
+
13
+ - Pages live in `app/`: `app/about/page.md` is served at `/about`.
14
+ - `app/_config.ts` sets how pages render (`server`, `static` or `client`); a folder's own `_config.ts` changes it for that folder.
15
+ - Component tests live in `tests/ui/`, server tests (API routes, loaders) in `tests/server/`.
16
+ - On the server: API routes (`app/api/hello/route.ts`), middleware (`app/_middleware.ts`), a loader (`app/todos/loader.ts`) and server functions (`app/todos/todos.server.ts`), which components call like async functions.
17
+ - Styled with Tailwind CSS: utility classes go straight into `class`.
@@ -0,0 +1,14 @@
1
+ import { Link } from "@opentf/afw";
2
+
3
+ export default function Layout({ children }: { children: unknown }) {
4
+ return (
5
+ <>
6
+ <nav class="mb-8 flex gap-4 text-sky-700">
7
+ <Link href="/">Home</Link>
8
+ <Link href="/about">About</Link>
9
+ <Link href="/todos">Todos</Link>
10
+ </nav>
11
+ <main>{children}</main>
12
+ </>
13
+ );
14
+ }
@@ -0,0 +1,22 @@
1
+ {
2
+ "name": "{{name}}",
3
+ "private": true,
4
+ "type": "module",
5
+ "scripts": {
6
+ "dev": "esdev start",
7
+ "build": "esdev build",
8
+ "start": "esrun --allow-read=dist --allow-listen=0.0.0.0:3000 --allow-env=PORT --allow-imports dist/server.js",
9
+ "test": "esdev test tests/server && esdev test --dom --setup=@opentf/afw-test/setup tests/ui",
10
+ "typecheck": "esdev typecheck"
11
+ },
12
+ "dependencies": {
13
+ "@opentf/afw": "{{registry:@opentf/afw}}"
14
+ },
15
+ "devDependencies": {
16
+ "@opentf/afw-test": "{{registry:@opentf/afw-test}}",
17
+ "@opentf/esdev-plugin-afw": "{{registry:@opentf/esdev-plugin-afw}}",
18
+ "@opentf/esrun-types": "{{registry:@opentf/esrun-types}}",
19
+ "tailwindcss": "{{registry:tailwindcss}}",
20
+ "typescript": "{{registry:typescript}}"
21
+ }
22
+ }