@opentf/create-afw 0.6.0 → 0.8.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 (162) hide show
  1. package/README.md +5 -8
  2. package/esdev/templates/app/_option/language/ts/tsconfig.json +2 -4
  3. package/esdev/templates/app/_option/render/{client+server/yes+styling/css+language → client/_option/server/yes/_option/styling/css/_option/language}/js/README.md +1 -1
  4. package/esdev/templates/app/_option/render/{server+server/yes+styling/css+language → client/_option/server/yes/_option/styling/css/_option/language}/js/package.json +1 -1
  5. package/esdev/templates/app/_option/render/{client+server/yes+styling/css+language → client/_option/server/yes/_option/styling/css/_option/language}/ts/README.md +1 -1
  6. package/esdev/templates/app/_option/render/{server+server/yes+styling/css+language → client/_option/server/yes/_option/styling/css/_option/language}/ts/package.json +1 -1
  7. package/esdev/templates/app/_option/render/{client+server/yes+styling/tailwind+language → client/_option/server/yes/_option/styling/tailwind/_option/language}/js/README.md +1 -1
  8. package/esdev/templates/app/_option/render/{mixed+server/yes+styling/tailwind+language → client/_option/server/yes/_option/styling/tailwind/_option/language}/js/package.json +1 -1
  9. package/esdev/templates/app/_option/render/{client+server/yes+styling/tailwind+language → client/_option/server/yes/_option/styling/tailwind/_option/language}/ts/README.md +1 -1
  10. package/esdev/templates/app/_option/render/{client+server/yes+styling/tailwind+language → client/_option/server/yes/_option/styling/tailwind/_option/language}/ts/package.json +1 -1
  11. package/esdev/templates/app/_option/render/{mixed+server/yes+styling/css+language → mixed/_option/server/yes/_option/styling/css/_option/language}/js/README.md +1 -1
  12. package/esdev/templates/app/_option/render/{mixed+server/yes+styling/css+language → mixed/_option/server/yes/_option/styling/css/_option/language}/js/package.json +1 -1
  13. package/esdev/templates/app/_option/render/{mixed+server/yes+styling/css+language → mixed/_option/server/yes/_option/styling/css/_option/language}/ts/README.md +1 -1
  14. package/esdev/templates/app/_option/render/{mixed+server/yes+styling/css+language → mixed/_option/server/yes/_option/styling/css/_option/language}/ts/package.json +1 -1
  15. package/esdev/templates/app/_option/render/{mixed+server/yes+styling/tailwind+language → mixed/_option/server/yes/_option/styling/tailwind/_option/language}/js/README.md +1 -1
  16. package/esdev/templates/app/_option/render/{server+server/yes+styling/tailwind+language → mixed/_option/server/yes/_option/styling/tailwind/_option/language}/js/package.json +1 -1
  17. package/esdev/templates/app/_option/render/{mixed+server/yes+styling/tailwind+language → mixed/_option/server/yes/_option/styling/tailwind/_option/language}/ts/README.md +1 -1
  18. package/esdev/templates/app/_option/render/{server+server/yes+styling/tailwind+language → mixed/_option/server/yes/_option/styling/tailwind/_option/language}/ts/package.json +1 -1
  19. package/esdev/templates/app/_option/render/{server+server/yes+styling/css+language → server/_option/server/yes/_option/styling/css/_option/language}/js/README.md +1 -1
  20. package/esdev/templates/app/_option/render/{static+server/yes+styling/css+language → server/_option/server/yes/_option/styling/css/_option/language}/js/package.json +1 -1
  21. package/esdev/templates/app/_option/render/{server+server/yes+styling/css+language → server/_option/server/yes/_option/styling/css/_option/language}/ts/README.md +1 -1
  22. package/esdev/templates/app/_option/render/{client+server/yes+styling/css+language → server/_option/server/yes/_option/styling/css/_option/language}/ts/package.json +1 -1
  23. package/esdev/templates/app/_option/render/{server+server/yes+styling/tailwind+language → server/_option/server/yes/_option/styling/tailwind/_option/language}/js/README.md +1 -1
  24. package/esdev/templates/app/_option/render/{static+server/yes+styling/tailwind+language → server/_option/server/yes/_option/styling/tailwind/_option/language}/js/package.json +1 -1
  25. package/esdev/templates/app/_option/render/{server+server/yes+styling/tailwind+language → server/_option/server/yes/_option/styling/tailwind/_option/language}/ts/README.md +1 -1
  26. package/esdev/templates/app/_option/render/{static+server/yes+styling/tailwind+language → server/_option/server/yes/_option/styling/tailwind/_option/language}/ts/package.json +1 -1
  27. package/esdev/templates/app/_option/render/{static+server/yes+styling/css+language → static/_option/server/yes/_option/styling/css/_option/language}/js/README.md +1 -1
  28. package/esdev/templates/app/_option/render/{client+server/yes+styling/css+language → static/_option/server/yes/_option/styling/css/_option/language}/js/package.json +1 -1
  29. package/esdev/templates/app/_option/render/{static+server/yes+styling/css+language → static/_option/server/yes/_option/styling/css/_option/language}/ts/README.md +1 -1
  30. package/esdev/templates/app/_option/render/{static+server/yes+styling/css+language → static/_option/server/yes/_option/styling/css/_option/language}/ts/package.json +1 -1
  31. package/esdev/templates/app/_option/render/{static+server/yes+styling/tailwind+language → static/_option/server/yes/_option/styling/tailwind/_option/language}/js/README.md +1 -1
  32. package/esdev/templates/app/_option/render/{client+server/yes+styling/tailwind+language → static/_option/server/yes/_option/styling/tailwind/_option/language}/js/package.json +1 -1
  33. package/esdev/templates/app/_option/render/{static+server/yes+styling/tailwind+language → static/_option/server/yes/_option/styling/tailwind/_option/language}/ts/README.md +1 -1
  34. package/esdev/templates/app/_option/render/{mixed+server/yes+styling/tailwind+language → static/_option/server/yes/_option/styling/tailwind/_option/language}/ts/package.json +1 -1
  35. package/esdev/templates/app/_option/server/yes/server.js +4 -3
  36. package/esdev/templates/app/template.json +1 -1
  37. package/esdev/templates/docs/_option/language/ts/tsconfig.json +2 -4
  38. package/esdev/templates/library/_option/language/ts/tsconfig.json +2 -4
  39. package/esdev/templates/library/template.json +1 -1
  40. package/index.js +3 -16
  41. package/package.json +6 -6
  42. package/templates.js +7 -16
  43. package/versions.json +4 -4
  44. /package/esdev/templates/app/_option/render/{client+language → client/_option/language}/js/app/_config.js +0 -0
  45. /package/esdev/templates/app/_option/render/{client+language → client/_option/language}/ts/app/_config.ts +0 -0
  46. /package/esdev/templates/app/_option/render/{client+server/no+styling/css+language → client/_option/server/no/_option/styling/css/_option/language}/js/README.md +0 -0
  47. /package/esdev/templates/app/_option/render/{client+server/no+styling/css+language → client/_option/server/no/_option/styling/css/_option/language}/js/app/layout.jsx +0 -0
  48. /package/esdev/templates/app/_option/render/{client+server/no+styling/css+language → client/_option/server/no/_option/styling/css/_option/language}/js/package.json +0 -0
  49. /package/esdev/templates/app/_option/render/{client+server/no+styling/css+language → client/_option/server/no/_option/styling/css/_option/language}/ts/README.md +0 -0
  50. /package/esdev/templates/app/_option/render/{client+server/no+styling/css+language → client/_option/server/no/_option/styling/css/_option/language}/ts/app/layout.tsx +0 -0
  51. /package/esdev/templates/app/_option/render/{client+server/no+styling/css+language → client/_option/server/no/_option/styling/css/_option/language}/ts/package.json +0 -0
  52. /package/esdev/templates/app/_option/render/{client+server/no+styling/tailwind+language → client/_option/server/no/_option/styling/tailwind/_option/language}/js/README.md +0 -0
  53. /package/esdev/templates/app/_option/render/{client+server/no+styling/tailwind+language → client/_option/server/no/_option/styling/tailwind/_option/language}/js/app/layout.jsx +0 -0
  54. /package/esdev/templates/app/_option/render/{client+server/no+styling/tailwind+language → client/_option/server/no/_option/styling/tailwind/_option/language}/js/package.json +0 -0
  55. /package/esdev/templates/app/_option/render/{client+server/no+styling/tailwind+language → client/_option/server/no/_option/styling/tailwind/_option/language}/ts/README.md +0 -0
  56. /package/esdev/templates/app/_option/render/{client+server/no+styling/tailwind+language → client/_option/server/no/_option/styling/tailwind/_option/language}/ts/app/layout.tsx +0 -0
  57. /package/esdev/templates/app/_option/render/{client+server/no+styling/tailwind+language → client/_option/server/no/_option/styling/tailwind/_option/language}/ts/package.json +0 -0
  58. /package/esdev/templates/app/_option/render/{client+server → client/_option/server}/no/esdev.json +0 -0
  59. /package/esdev/templates/app/_option/render/{client+server/yes+styling/css+language → client/_option/server/yes/_option/styling/css/_option/language}/js/app/layout.jsx +0 -0
  60. /package/esdev/templates/app/_option/render/{client+server/yes+styling/css+language → client/_option/server/yes/_option/styling/css/_option/language}/ts/app/layout.tsx +0 -0
  61. /package/esdev/templates/app/_option/render/{client+server/yes+styling/tailwind+language → client/_option/server/yes/_option/styling/tailwind/_option/language}/js/app/layout.jsx +0 -0
  62. /package/esdev/templates/app/_option/render/{client+server/yes+styling/tailwind+language → client/_option/server/yes/_option/styling/tailwind/_option/language}/ts/app/layout.tsx +0 -0
  63. /package/esdev/templates/app/_option/render/{client+server → client/_option/server}/yes/esdev.json +0 -0
  64. /package/esdev/templates/app/_option/render/{mixed+language → mixed/_option/language}/js/app/_config.js +0 -0
  65. /package/esdev/templates/app/_option/render/{mixed+language → mixed/_option/language}/js/app/about/_config.js +0 -0
  66. /package/esdev/templates/app/_option/render/{mixed+language → mixed/_option/language}/js/app/dashboard/_config.js +0 -0
  67. /package/esdev/templates/app/_option/render/{mixed+language → mixed/_option/language}/js/app/dashboard/loader.js +0 -0
  68. /package/esdev/templates/app/_option/render/{mixed+language → mixed/_option/language}/ts/app/_config.ts +0 -0
  69. /package/esdev/templates/app/_option/render/{mixed+language → mixed/_option/language}/ts/app/about/_config.ts +0 -0
  70. /package/esdev/templates/app/_option/render/{mixed+language → mixed/_option/language}/ts/app/dashboard/_config.ts +0 -0
  71. /package/esdev/templates/app/_option/render/{mixed+language → mixed/_option/language}/ts/app/dashboard/loader.ts +0 -0
  72. /package/esdev/templates/app/_option/render/{mixed+server/yes+styling/css+language → mixed/_option/server/yes/_option/styling/css/_option/language}/js/app/layout.jsx +0 -0
  73. /package/esdev/templates/app/_option/render/{mixed+server/yes+styling/css+language → mixed/_option/server/yes/_option/styling/css/_option/language}/ts/app/layout.tsx +0 -0
  74. /package/esdev/templates/app/_option/render/{mixed+server/yes+styling/tailwind+language → mixed/_option/server/yes/_option/styling/tailwind/_option/language}/js/app/layout.jsx +0 -0
  75. /package/esdev/templates/app/_option/render/{mixed+server/yes+styling/tailwind+language → mixed/_option/server/yes/_option/styling/tailwind/_option/language}/ts/app/layout.tsx +0 -0
  76. /package/esdev/templates/app/_option/render/{mixed+server → mixed/_option/server}/yes/esdev.json +0 -0
  77. /package/esdev/templates/app/_option/render/{mixed+styling/css+language → mixed/_option/styling/css/_option/language}/js/app/dashboard/page.jsx +0 -0
  78. /package/esdev/templates/app/_option/render/{mixed+styling/css+language → mixed/_option/styling/css/_option/language}/ts/app/dashboard/page.tsx +0 -0
  79. /package/esdev/templates/app/_option/render/{mixed+styling/tailwind+language → mixed/_option/styling/tailwind/_option/language}/js/app/dashboard/page.jsx +0 -0
  80. /package/esdev/templates/app/_option/render/{mixed+styling/tailwind+language → mixed/_option/styling/tailwind/_option/language}/ts/app/dashboard/page.tsx +0 -0
  81. /package/esdev/templates/app/_option/render/{server+language → server/_option/language}/js/app/_config.js +0 -0
  82. /package/esdev/templates/app/_option/render/{server+language → server/_option/language}/ts/app/_config.ts +0 -0
  83. /package/esdev/templates/app/_option/render/{server+server/yes+styling/css+language → server/_option/server/yes/_option/styling/css/_option/language}/js/app/layout.jsx +0 -0
  84. /package/esdev/templates/app/_option/render/{server+server/yes+styling/css+language → server/_option/server/yes/_option/styling/css/_option/language}/ts/app/layout.tsx +0 -0
  85. /package/esdev/templates/app/_option/render/{server+server/yes+styling/tailwind+language → server/_option/server/yes/_option/styling/tailwind/_option/language}/js/app/layout.jsx +0 -0
  86. /package/esdev/templates/app/_option/render/{server+server/yes+styling/tailwind+language → server/_option/server/yes/_option/styling/tailwind/_option/language}/ts/app/layout.tsx +0 -0
  87. /package/esdev/templates/app/_option/render/{server+server → server/_option/server}/yes/esdev.json +0 -0
  88. /package/esdev/templates/app/_option/render/{static+language → static/_option/language}/js/app/_config.js +0 -0
  89. /package/esdev/templates/app/_option/render/{static+language → static/_option/language}/ts/app/_config.ts +0 -0
  90. /package/esdev/templates/app/_option/render/{static+server/no+styling/css+language → static/_option/server/no/_option/styling/css/_option/language}/js/README.md +0 -0
  91. /package/esdev/templates/app/_option/render/{static+server/no+styling/css+language → static/_option/server/no/_option/styling/css/_option/language}/js/app/layout.jsx +0 -0
  92. /package/esdev/templates/app/_option/render/{static+server/no+styling/css+language → static/_option/server/no/_option/styling/css/_option/language}/js/package.json +0 -0
  93. /package/esdev/templates/app/_option/render/{static+server/no+styling/css+language → static/_option/server/no/_option/styling/css/_option/language}/ts/README.md +0 -0
  94. /package/esdev/templates/app/_option/render/{static+server/no+styling/css+language → static/_option/server/no/_option/styling/css/_option/language}/ts/app/layout.tsx +0 -0
  95. /package/esdev/templates/app/_option/render/{static+server/no+styling/css+language → static/_option/server/no/_option/styling/css/_option/language}/ts/package.json +0 -0
  96. /package/esdev/templates/app/_option/render/{static+server/no+styling/tailwind+language → static/_option/server/no/_option/styling/tailwind/_option/language}/js/README.md +0 -0
  97. /package/esdev/templates/app/_option/render/{static+server/no+styling/tailwind+language → static/_option/server/no/_option/styling/tailwind/_option/language}/js/app/layout.jsx +0 -0
  98. /package/esdev/templates/app/_option/render/{static+server/no+styling/tailwind+language → static/_option/server/no/_option/styling/tailwind/_option/language}/js/package.json +0 -0
  99. /package/esdev/templates/app/_option/render/{static+server/no+styling/tailwind+language → static/_option/server/no/_option/styling/tailwind/_option/language}/ts/README.md +0 -0
  100. /package/esdev/templates/app/_option/render/{static+server/no+styling/tailwind+language → static/_option/server/no/_option/styling/tailwind/_option/language}/ts/app/layout.tsx +0 -0
  101. /package/esdev/templates/app/_option/render/{static+server/no+styling/tailwind+language → static/_option/server/no/_option/styling/tailwind/_option/language}/ts/package.json +0 -0
  102. /package/esdev/templates/app/_option/render/{static+server → static/_option/server}/no/esdev.json +0 -0
  103. /package/esdev/templates/app/_option/render/{static+server → static/_option/server}/no/ssg.js +0 -0
  104. /package/esdev/templates/app/_option/render/{static+server/yes+styling/css+language → static/_option/server/yes/_option/styling/css/_option/language}/js/app/layout.jsx +0 -0
  105. /package/esdev/templates/app/_option/render/{static+server/yes+styling/css+language → static/_option/server/yes/_option/styling/css/_option/language}/ts/app/layout.tsx +0 -0
  106. /package/esdev/templates/app/_option/render/{static+server/yes+styling/tailwind+language → static/_option/server/yes/_option/styling/tailwind/_option/language}/js/app/layout.jsx +0 -0
  107. /package/esdev/templates/app/_option/render/{static+server/yes+styling/tailwind+language → static/_option/server/yes/_option/styling/tailwind/_option/language}/ts/app/layout.tsx +0 -0
  108. /package/esdev/templates/app/_option/render/{static+server → static/_option/server}/yes/esdev.json +0 -0
  109. /package/esdev/templates/app/_option/server/{yes+language → yes/_option/language}/js/app/_middleware.js +0 -0
  110. /package/esdev/templates/app/_option/server/{yes+language → yes/_option/language}/js/app/api/hello/route.js +0 -0
  111. /package/esdev/templates/app/_option/server/{yes+language → yes/_option/language}/js/app/todos/loader.js +0 -0
  112. /package/esdev/templates/app/_option/server/{yes+language → yes/_option/language}/js/app/todos/todos.server.js +0 -0
  113. /package/esdev/templates/app/_option/server/{yes+language → yes/_option/language}/js/tests/server/api.test.js +0 -0
  114. /package/esdev/templates/app/_option/server/{yes+language → yes/_option/language}/ts/app/_middleware.ts +0 -0
  115. /package/esdev/templates/app/_option/server/{yes+language → yes/_option/language}/ts/app/api/hello/route.ts +0 -0
  116. /package/esdev/templates/app/_option/server/{yes+language → yes/_option/language}/ts/app/todos/loader.ts +0 -0
  117. /package/esdev/templates/app/_option/server/{yes+language → yes/_option/language}/ts/app/todos/todos.server.ts +0 -0
  118. /package/esdev/templates/app/_option/server/{yes+language → yes/_option/language}/ts/tests/server/api.test.ts +0 -0
  119. /package/esdev/templates/app/_option/server/{yes+styling/css+language → yes/_option/styling/css/_option/language}/js/app/todos/page.jsx +0 -0
  120. /package/esdev/templates/app/_option/server/{yes+styling/css+language → yes/_option/styling/css/_option/language}/ts/app/todos/page.tsx +0 -0
  121. /package/esdev/templates/app/_option/server/{yes+styling/tailwind+language → yes/_option/styling/tailwind/_option/language}/js/app/todos/page.jsx +0 -0
  122. /package/esdev/templates/app/_option/server/{yes+styling/tailwind+language → yes/_option/styling/tailwind/_option/language}/ts/app/todos/page.tsx +0 -0
  123. /package/esdev/templates/app/_option/styling/{css+language → css/_option/language}/js/app/Counter.jsx +0 -0
  124. /package/esdev/templates/app/_option/styling/{css+language → css/_option/language}/js/app/page.jsx +0 -0
  125. /package/esdev/templates/app/_option/styling/{css+language → css/_option/language}/ts/app/Counter.tsx +0 -0
  126. /package/esdev/templates/app/_option/styling/{css+language → css/_option/language}/ts/app/page.tsx +0 -0
  127. /package/esdev/templates/app/_option/styling/{tailwind+language → tailwind/_option/language}/js/app/Counter.jsx +0 -0
  128. /package/esdev/templates/app/_option/styling/{tailwind+language → tailwind/_option/language}/js/app/page.jsx +0 -0
  129. /package/esdev/templates/app/_option/styling/{tailwind+language → tailwind/_option/language}/ts/app/Counter.tsx +0 -0
  130. /package/esdev/templates/app/_option/styling/{tailwind+language → tailwind/_option/language}/ts/app/page.tsx +0 -0
  131. /package/esdev/templates/docs/_option/blog/{no+language → no/_option/language}/js/README.md +0 -0
  132. /package/esdev/templates/docs/_option/blog/{no+language → no/_option/language}/js/app/page.jsx +0 -0
  133. /package/esdev/templates/docs/_option/blog/{no+language → no/_option/language}/js/tests/ui/Home.test.js +0 -0
  134. /package/esdev/templates/docs/_option/blog/{no+language → no/_option/language}/ts/README.md +0 -0
  135. /package/esdev/templates/docs/_option/blog/{no+language → no/_option/language}/ts/app/page.tsx +0 -0
  136. /package/esdev/templates/docs/_option/blog/{no+language → no/_option/language}/ts/tests/ui/Home.test.ts +0 -0
  137. /package/esdev/templates/docs/_option/blog/{yes+language → yes/_option/language}/js/README.md +0 -0
  138. /package/esdev/templates/docs/_option/blog/{yes+language → yes/_option/language}/js/app/blog/layout.jsx +0 -0
  139. /package/esdev/templates/docs/_option/blog/{yes+language → yes/_option/language}/js/app/blog/page.jsx +0 -0
  140. /package/esdev/templates/docs/_option/blog/{yes+language → yes/_option/language}/js/app/page.jsx +0 -0
  141. /package/esdev/templates/docs/_option/blog/{yes+language → yes/_option/language}/js/tests/ui/Home.test.js +0 -0
  142. /package/esdev/templates/docs/_option/blog/{yes+language → yes/_option/language}/ts/README.md +0 -0
  143. /package/esdev/templates/docs/_option/blog/{yes+language → yes/_option/language}/ts/app/blog/layout.tsx +0 -0
  144. /package/esdev/templates/docs/_option/blog/{yes+language → yes/_option/language}/ts/app/blog/page.tsx +0 -0
  145. /package/esdev/templates/docs/_option/blog/{yes+language → yes/_option/language}/ts/app/page.tsx +0 -0
  146. /package/esdev/templates/docs/_option/blog/{yes+language → yes/_option/language}/ts/tests/ui/Home.test.ts +0 -0
  147. /package/esdev/templates/library/_option/styling/{css+language → css/_option/language}/js/README.md +0 -0
  148. /package/esdev/templates/library/_option/styling/{css+language → css/_option/language}/js/app/page.jsx +0 -0
  149. /package/esdev/templates/library/_option/styling/{css+language → css/_option/language}/js/package.json +0 -0
  150. /package/esdev/templates/library/_option/styling/{css+language → css/_option/language}/js/src/Counter.jsx +0 -0
  151. /package/esdev/templates/library/_option/styling/{css+language → css/_option/language}/ts/README.md +0 -0
  152. /package/esdev/templates/library/_option/styling/{css+language → css/_option/language}/ts/app/page.tsx +0 -0
  153. /package/esdev/templates/library/_option/styling/{css+language → css/_option/language}/ts/package.json +0 -0
  154. /package/esdev/templates/library/_option/styling/{css+language → css/_option/language}/ts/src/Counter.tsx +0 -0
  155. /package/esdev/templates/library/_option/styling/{tailwind+language → tailwind/_option/language}/js/README.md +0 -0
  156. /package/esdev/templates/library/_option/styling/{tailwind+language → tailwind/_option/language}/js/app/page.jsx +0 -0
  157. /package/esdev/templates/library/_option/styling/{tailwind+language → tailwind/_option/language}/js/package.json +0 -0
  158. /package/esdev/templates/library/_option/styling/{tailwind+language → tailwind/_option/language}/js/src/Counter.jsx +0 -0
  159. /package/esdev/templates/library/_option/styling/{tailwind+language → tailwind/_option/language}/ts/README.md +0 -0
  160. /package/esdev/templates/library/_option/styling/{tailwind+language → tailwind/_option/language}/ts/app/page.tsx +0 -0
  161. /package/esdev/templates/library/_option/styling/{tailwind+language → tailwind/_option/language}/ts/package.json +0 -0
  162. /package/esdev/templates/library/_option/styling/{tailwind+language → tailwind/_option/language}/ts/src/Counter.tsx +0 -0
package/README.md CHANGED
@@ -13,8 +13,8 @@ dev server is shown. Nothing is started for you.
13
13
  | Prompt | Asked for | Choices |
14
14
  | --- | --- | --- |
15
15
  | Template | every project | `app`, `docs`, `library` |
16
- | Rendering | `app` | `spa` (in the browser), `ssr` (per request, hydrated), `ssg` (prerendered) |
17
- | Server | `app`, unless `ssr` | API routes, middleware, loaders and server functions on Node: yes or no |
16
+ | Rendering | `app` | `client` (in the browser), `server` (per request, hydrated), `static` (prerendered), `mixed` (server, with a static page and a client section); written to `app/_config.js` |
17
+ | Server | `app`, for `client` and `static` | API routes, middleware, loaders and server functions on Node: yes or no |
18
18
  | Styling | `app`, `library` | CSS, or Tailwind CSS |
19
19
  | Blog | `docs` | Posts with RSS and Atom feeds: yes or no (default) |
20
20
  | Language | every project | TypeScript (default), JavaScript |
@@ -22,15 +22,15 @@ dev server is shown. Nothing is started for you.
22
22
  Or pass the choices:
23
23
 
24
24
  ```sh
25
- npm create @opentf/afw@latest my-app -- --template app --render ssg --server --tailwind
25
+ npm create @opentf/afw@latest my-app -- --template app --render static --server --tailwind
26
26
  npm create @opentf/afw@latest my-docs -- --template docs-js --blog
27
27
  ```
28
28
 
29
29
  | Option | Values |
30
30
  | --- | --- |
31
31
  | `-t`, `--template` | `app`, `docs`, `library`; add `-ts` or `-js` for the language (`app-js`) |
32
- | `-r`, `--render` | `spa` (default), `ssr`, `ssg` — `app` only |
33
- | `--server`, `--no-server` | Add a Node server, or not (default) — `app` only; `ssr` always has one |
32
+ | `-r`, `--render` | `client` (default), `server`, `static`, `mixed` — `app` only |
33
+ | `--server`, `--no-server` | Add a Node server, or not (default) — `app` only; `server` and `mixed` always have one |
34
34
  | `-s`, `--styling` | `css` (default) or `tailwind`; `--tailwind` for short — `app` and `library` |
35
35
  | `--blog`, `--no-blog` | Add a blog, or not (default) — `docs` only |
36
36
  | `-l`, `--language` | `ts` (default) or `js` |
@@ -44,9 +44,6 @@ npm create @opentf/afw@latest my-docs -- --template docs-js --blog
44
44
  | `docs` | An [`@opentf/afw-docs`](https://afw.opentechf.org/packages/afw-docs) site: MDX docs, prerendered, with search, `sitemap.xml` and `llms.txt`; with `--blog`, a blog with RSS/Atom feeds |
45
45
  | `library` | Components published as JSX source (`index.js` and `src/`), `@opentf/afw` as a peer dependency, a preview app and a test |
46
46
 
47
- The names of earlier releases still work: `spa`, `fullstack` (`app --server`), `ssr`
48
- and `ssg`.
49
-
50
47
  - A non-empty target directory: choose to cancel, remove its files, or ignore them.
51
48
  - A folder name that is not a valid package name: you are asked for one (`My App` → `my-app`).
52
49
  - Apps and docs sites have `dev`, `build` and `test` (Vitest) scripts, and either `start`
@@ -11,10 +11,8 @@
11
11
  "jsx": "preserve",
12
12
  "jsxImportSource": "@opentf/afw",
13
13
  "types": [
14
- "@opentf/esrun-types"
15
- ],
16
- "customConditions": [
17
- "esdev"
14
+ "@opentf/esrun-types",
15
+ "@opentf/esdev-plugin-afw/client"
18
16
  ],
19
17
  "strict": true,
20
18
  "noEmit": true,
@@ -6,7 +6,7 @@ An [AFW](https://afw.opentechf.org) app on esdev and ES-Runtime: pages rendered
6
6
  | --- | --- |
7
7
  | `{{pm}} run dev` | Start the dev server |
8
8
  | `{{pm}} run build` | Build for production |
9
- | `{{pm}} run start` | Run the built server on ES-Runtime (`PORT`) |
9
+ | `{{pm}} run start` | Run the built server on ES-Runtime, on port 3000 (another `PORT` needs the same port in `--allow-listen`) |
10
10
  | `{{pm}} run test` | Run the tests with esdev |
11
11
 
12
12
  - Pages live in `app/`: `app/about/page.md` is served at `/about`.
@@ -5,7 +5,7 @@
5
5
  "scripts": {
6
6
  "dev": "esdev start",
7
7
  "build": "esdev build",
8
- "start": "esrun --allow-read --allow-net --allow-listen=3000 --allow-env=PORT --allow-imports dist/server.js",
8
+ "start": "esrun --allow-read=dist --allow-listen=0.0.0.0:3000 --allow-env=PORT --allow-imports dist/server.js",
9
9
  "test": "esdev test tests/server && esdev test --dom --setup=@opentf/afw-test/setup tests/ui"
10
10
  },
11
11
  "dependencies": {
@@ -6,7 +6,7 @@ An [AFW](https://afw.opentechf.org) app on esdev and ES-Runtime: pages rendered
6
6
  | --- | --- |
7
7
  | `{{pm}} run dev` | Start the dev server |
8
8
  | `{{pm}} run build` | Build for production |
9
- | `{{pm}} run start` | Run the built server on ES-Runtime (`PORT`) |
9
+ | `{{pm}} run start` | Run the built server on ES-Runtime, on port 3000 (another `PORT` needs the same port in `--allow-listen`) |
10
10
  | `{{pm}} run test` | Run the tests with esdev |
11
11
  | `{{pm}} run typecheck` | Check types |
12
12
 
@@ -5,7 +5,7 @@
5
5
  "scripts": {
6
6
  "dev": "esdev start",
7
7
  "build": "esdev build",
8
- "start": "esrun --allow-read --allow-net --allow-listen=3000 --allow-env=PORT --allow-imports dist/server.js",
8
+ "start": "esrun --allow-read=dist --allow-listen=0.0.0.0:3000 --allow-env=PORT --allow-imports dist/server.js",
9
9
  "test": "esdev test tests/server && esdev test --dom --setup=@opentf/afw-test/setup tests/ui",
10
10
  "typecheck": "esdev typecheck"
11
11
  },
@@ -6,7 +6,7 @@ An [AFW](https://afw.opentechf.org) app on esdev and ES-Runtime: pages rendered
6
6
  | --- | --- |
7
7
  | `{{pm}} run dev` | Start the dev server |
8
8
  | `{{pm}} run build` | Build for production |
9
- | `{{pm}} run start` | Run the built server on ES-Runtime (`PORT`) |
9
+ | `{{pm}} run start` | Run the built server on ES-Runtime, on port 3000 (another `PORT` needs the same port in `--allow-listen`) |
10
10
  | `{{pm}} run test` | Run the tests with esdev |
11
11
 
12
12
  - Pages live in `app/`: `app/about/page.md` is served at `/about`.
@@ -5,7 +5,7 @@
5
5
  "scripts": {
6
6
  "dev": "esdev start",
7
7
  "build": "esdev build",
8
- "start": "esrun --allow-read --allow-net --allow-listen=3000 --allow-env=PORT --allow-imports dist/server.js",
8
+ "start": "esrun --allow-read=dist --allow-listen=0.0.0.0:3000 --allow-env=PORT --allow-imports dist/server.js",
9
9
  "test": "esdev test tests/server && esdev test --dom --setup=@opentf/afw-test/setup tests/ui"
10
10
  },
11
11
  "dependencies": {
@@ -6,7 +6,7 @@ An [AFW](https://afw.opentechf.org) app on esdev and ES-Runtime: pages rendered
6
6
  | --- | --- |
7
7
  | `{{pm}} run dev` | Start the dev server |
8
8
  | `{{pm}} run build` | Build for production |
9
- | `{{pm}} run start` | Run the built server on ES-Runtime (`PORT`) |
9
+ | `{{pm}} run start` | Run the built server on ES-Runtime, on port 3000 (another `PORT` needs the same port in `--allow-listen`) |
10
10
  | `{{pm}} run test` | Run the tests with esdev |
11
11
  | `{{pm}} run typecheck` | Check types |
12
12
 
@@ -5,7 +5,7 @@
5
5
  "scripts": {
6
6
  "dev": "esdev start",
7
7
  "build": "esdev build",
8
- "start": "esrun --allow-read --allow-net --allow-listen=3000 --allow-env=PORT --allow-imports dist/server.js",
8
+ "start": "esrun --allow-read=dist --allow-listen=0.0.0.0:3000 --allow-env=PORT --allow-imports dist/server.js",
9
9
  "test": "esdev test tests/server && esdev test --dom --setup=@opentf/afw-test/setup tests/ui",
10
10
  "typecheck": "esdev typecheck"
11
11
  },
@@ -6,7 +6,7 @@ An [AFW](https://afw.opentechf.org) app on esdev and ES-Runtime: pages rendered
6
6
  | --- | --- |
7
7
  | `{{pm}} run dev` | Start the dev server |
8
8
  | `{{pm}} run build` | Build for production |
9
- | `{{pm}} run start` | Run the built server on ES-Runtime (`PORT`) |
9
+ | `{{pm}} run start` | Run the built server on ES-Runtime, on port 3000 (another `PORT` needs the same port in `--allow-listen`) |
10
10
  | `{{pm}} run test` | Run the tests with esdev |
11
11
 
12
12
  - Pages live in `app/`: `app/about/page.md` is served at `/about`.
@@ -5,7 +5,7 @@
5
5
  "scripts": {
6
6
  "dev": "esdev start",
7
7
  "build": "esdev build",
8
- "start": "esrun --allow-read --allow-net --allow-listen=3000 --allow-env=PORT --allow-imports dist/server.js",
8
+ "start": "esrun --allow-read=dist --allow-listen=0.0.0.0:3000 --allow-env=PORT --allow-imports dist/server.js",
9
9
  "test": "esdev test tests/server && esdev test --dom --setup=@opentf/afw-test/setup tests/ui"
10
10
  },
11
11
  "dependencies": {
@@ -6,7 +6,7 @@ An [AFW](https://afw.opentechf.org) app on esdev and ES-Runtime: pages rendered
6
6
  | --- | --- |
7
7
  | `{{pm}} run dev` | Start the dev server |
8
8
  | `{{pm}} run build` | Build for production |
9
- | `{{pm}} run start` | Run the built server on ES-Runtime (`PORT`) |
9
+ | `{{pm}} run start` | Run the built server on ES-Runtime, on port 3000 (another `PORT` needs the same port in `--allow-listen`) |
10
10
  | `{{pm}} run test` | Run the tests with esdev |
11
11
  | `{{pm}} run typecheck` | Check types |
12
12
 
@@ -5,7 +5,7 @@
5
5
  "scripts": {
6
6
  "dev": "esdev start",
7
7
  "build": "esdev build",
8
- "start": "esrun --allow-read --allow-net --allow-listen=3000 --allow-env=PORT --allow-imports dist/server.js",
8
+ "start": "esrun --allow-read=dist --allow-listen=0.0.0.0:3000 --allow-env=PORT --allow-imports dist/server.js",
9
9
  "test": "esdev test tests/server && esdev test --dom --setup=@opentf/afw-test/setup tests/ui",
10
10
  "typecheck": "esdev typecheck"
11
11
  },
@@ -6,7 +6,7 @@ An [AFW](https://afw.opentechf.org) app on esdev and ES-Runtime: pages rendered
6
6
  | --- | --- |
7
7
  | `{{pm}} run dev` | Start the dev server |
8
8
  | `{{pm}} run build` | Build for production |
9
- | `{{pm}} run start` | Run the built server on ES-Runtime (`PORT`) |
9
+ | `{{pm}} run start` | Run the built server on ES-Runtime, on port 3000 (another `PORT` needs the same port in `--allow-listen`) |
10
10
  | `{{pm}} run test` | Run the tests with esdev |
11
11
 
12
12
  - Pages live in `app/`: `app/about/page.md` is served at `/about`.
@@ -5,7 +5,7 @@
5
5
  "scripts": {
6
6
  "dev": "esdev start",
7
7
  "build": "esdev build",
8
- "start": "esrun --allow-read --allow-net --allow-listen=3000 --allow-env=PORT --allow-imports dist/server.js",
8
+ "start": "esrun --allow-read=dist --allow-listen=0.0.0.0:3000 --allow-env=PORT --allow-imports dist/server.js",
9
9
  "test": "esdev test tests/server && esdev test --dom --setup=@opentf/afw-test/setup tests/ui"
10
10
  },
11
11
  "dependencies": {
@@ -6,7 +6,7 @@ An [AFW](https://afw.opentechf.org) app on esdev and ES-Runtime: pages rendered
6
6
  | --- | --- |
7
7
  | `{{pm}} run dev` | Start the dev server |
8
8
  | `{{pm}} run build` | Build for production |
9
- | `{{pm}} run start` | Run the built server on ES-Runtime (`PORT`) |
9
+ | `{{pm}} run start` | Run the built server on ES-Runtime, on port 3000 (another `PORT` needs the same port in `--allow-listen`) |
10
10
  | `{{pm}} run test` | Run the tests with esdev |
11
11
  | `{{pm}} run typecheck` | Check types |
12
12
 
@@ -5,7 +5,7 @@
5
5
  "scripts": {
6
6
  "dev": "esdev start",
7
7
  "build": "esdev build",
8
- "start": "esrun --allow-read --allow-net --allow-listen=3000 --allow-env=PORT --allow-imports dist/server.js",
8
+ "start": "esrun --allow-read=dist --allow-listen=0.0.0.0:3000 --allow-env=PORT --allow-imports dist/server.js",
9
9
  "test": "esdev test tests/server && esdev test --dom --setup=@opentf/afw-test/setup tests/ui",
10
10
  "typecheck": "esdev typecheck"
11
11
  },
@@ -6,7 +6,7 @@ An [AFW](https://afw.opentechf.org) app on esdev and ES-Runtime: pages rendered
6
6
  | --- | --- |
7
7
  | `{{pm}} run dev` | Start the dev server |
8
8
  | `{{pm}} run build` | Build for production |
9
- | `{{pm}} run start` | Run the built server on ES-Runtime (`PORT`) |
9
+ | `{{pm}} run start` | Run the built server on ES-Runtime, on port 3000 (another `PORT` needs the same port in `--allow-listen`) |
10
10
  | `{{pm}} run test` | Run the tests with esdev |
11
11
 
12
12
  - Pages live in `app/`: `app/about/page.md` is served at `/about`.
@@ -5,7 +5,7 @@
5
5
  "scripts": {
6
6
  "dev": "esdev start",
7
7
  "build": "esdev build",
8
- "start": "esrun --allow-read --allow-net --allow-listen=3000 --allow-env=PORT --allow-imports dist/server.js",
8
+ "start": "esrun --allow-read=dist --allow-listen=0.0.0.0:3000 --allow-env=PORT --allow-imports dist/server.js",
9
9
  "test": "esdev test tests/server && esdev test --dom --setup=@opentf/afw-test/setup tests/ui"
10
10
  },
11
11
  "dependencies": {
@@ -6,7 +6,7 @@ An [AFW](https://afw.opentechf.org) app on esdev and ES-Runtime: pages rendered
6
6
  | --- | --- |
7
7
  | `{{pm}} run dev` | Start the dev server |
8
8
  | `{{pm}} run build` | Build for production |
9
- | `{{pm}} run start` | Run the built server on ES-Runtime (`PORT`) |
9
+ | `{{pm}} run start` | Run the built server on ES-Runtime, on port 3000 (another `PORT` needs the same port in `--allow-listen`) |
10
10
  | `{{pm}} run test` | Run the tests with esdev |
11
11
  | `{{pm}} run typecheck` | Check types |
12
12
 
@@ -5,7 +5,7 @@
5
5
  "scripts": {
6
6
  "dev": "esdev start",
7
7
  "build": "esdev build",
8
- "start": "esrun --allow-read --allow-net --allow-listen=3000 --allow-env=PORT --allow-imports dist/server.js",
8
+ "start": "esrun --allow-read=dist --allow-listen=0.0.0.0:3000 --allow-env=PORT --allow-imports dist/server.js",
9
9
  "test": "esdev test tests/server && esdev test --dom --setup=@opentf/afw-test/setup tests/ui",
10
10
  "typecheck": "esdev typecheck"
11
11
  },
@@ -6,7 +6,7 @@ An [AFW](https://afw.opentechf.org) app on esdev and ES-Runtime: pages rendered
6
6
  | --- | --- |
7
7
  | `{{pm}} run dev` | Start the dev server |
8
8
  | `{{pm}} run build` | Build for production |
9
- | `{{pm}} run start` | Run the built server on ES-Runtime (`PORT`) |
9
+ | `{{pm}} run start` | Run the built server on ES-Runtime, on port 3000 (another `PORT` needs the same port in `--allow-listen`) |
10
10
  | `{{pm}} run test` | Run the tests with esdev |
11
11
 
12
12
  - Pages live in `app/`: `app/about/page.md` is served at `/about`.
@@ -5,7 +5,7 @@
5
5
  "scripts": {
6
6
  "dev": "esdev start",
7
7
  "build": "esdev build",
8
- "start": "esrun --allow-read --allow-net --allow-listen=3000 --allow-env=PORT --allow-imports dist/server.js",
8
+ "start": "esrun --allow-read=dist --allow-listen=0.0.0.0:3000 --allow-env=PORT --allow-imports dist/server.js",
9
9
  "test": "esdev test tests/server && esdev test --dom --setup=@opentf/afw-test/setup tests/ui"
10
10
  },
11
11
  "dependencies": {
@@ -6,7 +6,7 @@ An [AFW](https://afw.opentechf.org) app on esdev and ES-Runtime: pages rendered
6
6
  | --- | --- |
7
7
  | `{{pm}} run dev` | Start the dev server |
8
8
  | `{{pm}} run build` | Build for production |
9
- | `{{pm}} run start` | Run the built server on ES-Runtime (`PORT`) |
9
+ | `{{pm}} run start` | Run the built server on ES-Runtime, on port 3000 (another `PORT` needs the same port in `--allow-listen`) |
10
10
  | `{{pm}} run test` | Run the tests with esdev |
11
11
  | `{{pm}} run typecheck` | Check types |
12
12
 
@@ -5,7 +5,7 @@
5
5
  "scripts": {
6
6
  "dev": "esdev start",
7
7
  "build": "esdev build",
8
- "start": "esrun --allow-read --allow-net --allow-listen=3000 --allow-env=PORT --allow-imports dist/server.js",
8
+ "start": "esrun --allow-read=dist --allow-listen=0.0.0.0:3000 --allow-env=PORT --allow-imports dist/server.js",
9
9
  "test": "esdev test tests/server && esdev test --dom --setup=@opentf/afw-test/setup tests/ui",
10
10
  "typecheck": "esdev typecheck"
11
11
  },
@@ -6,7 +6,7 @@ An [AFW](https://afw.opentechf.org) app on esdev and ES-Runtime: pages prerender
6
6
  | --- | --- |
7
7
  | `{{pm}} run dev` | Start the dev server |
8
8
  | `{{pm}} run build` | Build for production |
9
- | `{{pm}} run start` | Run the built server on ES-Runtime (`PORT`) |
9
+ | `{{pm}} run start` | Run the built server on ES-Runtime, on port 3000 (another `PORT` needs the same port in `--allow-listen`) |
10
10
  | `{{pm}} run test` | Run the tests with esdev |
11
11
 
12
12
  - Pages live in `app/`: `app/about/page.md` is served at `/about`.
@@ -5,7 +5,7 @@
5
5
  "scripts": {
6
6
  "dev": "esdev start",
7
7
  "build": "esdev build",
8
- "start": "esrun --allow-read --allow-net --allow-listen=3000 --allow-env=PORT --allow-imports dist/server.js",
8
+ "start": "esrun --allow-read=dist --allow-listen=0.0.0.0:3000 --allow-env=PORT --allow-imports dist/server.js",
9
9
  "test": "esdev test tests/server && esdev test --dom --setup=@opentf/afw-test/setup tests/ui"
10
10
  },
11
11
  "dependencies": {
@@ -6,7 +6,7 @@ An [AFW](https://afw.opentechf.org) app on esdev and ES-Runtime: pages prerender
6
6
  | --- | --- |
7
7
  | `{{pm}} run dev` | Start the dev server |
8
8
  | `{{pm}} run build` | Build for production |
9
- | `{{pm}} run start` | Run the built server on ES-Runtime (`PORT`) |
9
+ | `{{pm}} run start` | Run the built server on ES-Runtime, on port 3000 (another `PORT` needs the same port in `--allow-listen`) |
10
10
  | `{{pm}} run test` | Run the tests with esdev |
11
11
  | `{{pm}} run typecheck` | Check types |
12
12
 
@@ -5,7 +5,7 @@
5
5
  "scripts": {
6
6
  "dev": "esdev start",
7
7
  "build": "esdev build",
8
- "start": "esrun --allow-read --allow-net --allow-listen=3000 --allow-env=PORT --allow-imports dist/server.js",
8
+ "start": "esrun --allow-read=dist --allow-listen=0.0.0.0:3000 --allow-env=PORT --allow-imports dist/server.js",
9
9
  "test": "esdev test tests/server && esdev test --dom --setup=@opentf/afw-test/setup tests/ui",
10
10
  "typecheck": "esdev typecheck"
11
11
  },
@@ -6,7 +6,7 @@ An [AFW](https://afw.opentechf.org) app on esdev and ES-Runtime: pages prerender
6
6
  | --- | --- |
7
7
  | `{{pm}} run dev` | Start the dev server |
8
8
  | `{{pm}} run build` | Build for production |
9
- | `{{pm}} run start` | Run the built server on ES-Runtime (`PORT`) |
9
+ | `{{pm}} run start` | Run the built server on ES-Runtime, on port 3000 (another `PORT` needs the same port in `--allow-listen`) |
10
10
  | `{{pm}} run test` | Run the tests with esdev |
11
11
 
12
12
  - Pages live in `app/`: `app/about/page.md` is served at `/about`.
@@ -5,7 +5,7 @@
5
5
  "scripts": {
6
6
  "dev": "esdev start",
7
7
  "build": "esdev build",
8
- "start": "esrun --allow-read --allow-net --allow-listen=3000 --allow-env=PORT --allow-imports dist/server.js",
8
+ "start": "esrun --allow-read=dist --allow-listen=0.0.0.0:3000 --allow-env=PORT --allow-imports dist/server.js",
9
9
  "test": "esdev test tests/server && esdev test --dom --setup=@opentf/afw-test/setup tests/ui"
10
10
  },
11
11
  "dependencies": {
@@ -6,7 +6,7 @@ An [AFW](https://afw.opentechf.org) app on esdev and ES-Runtime: pages prerender
6
6
  | --- | --- |
7
7
  | `{{pm}} run dev` | Start the dev server |
8
8
  | `{{pm}} run build` | Build for production |
9
- | `{{pm}} run start` | Run the built server on ES-Runtime (`PORT`) |
9
+ | `{{pm}} run start` | Run the built server on ES-Runtime, on port 3000 (another `PORT` needs the same port in `--allow-listen`) |
10
10
  | `{{pm}} run test` | Run the tests with esdev |
11
11
  | `{{pm}} run typecheck` | Check types |
12
12
 
@@ -5,7 +5,7 @@
5
5
  "scripts": {
6
6
  "dev": "esdev start",
7
7
  "build": "esdev build",
8
- "start": "esrun --allow-read --allow-net --allow-listen=3000 --allow-env=PORT --allow-imports dist/server.js",
8
+ "start": "esrun --allow-read=dist --allow-listen=0.0.0.0:3000 --allow-env=PORT --allow-imports dist/server.js",
9
9
  "test": "esdev test tests/server && esdev test --dom --setup=@opentf/afw-test/setup tests/ui",
10
10
  "typecheck": "esdev typecheck"
11
11
  },
@@ -34,11 +34,12 @@ async function readStatic(pathname) {
34
34
  const shell = await file(new URL("./index.html", outDir)).text();
35
35
  const html = (body) => new Response(body, { headers: { "content-type": "text/html; charset=utf-8" } });
36
36
 
37
- // Pages: rendered per route policy when the app renders any page on the server
38
- // (`app/_config.js`); otherwise every page is the shell and renders in the browser.
37
+ // Pages: rendered per route policy when the app renders any page on the server or at
38
+ // build time (`app/_config.js`); otherwise every page is the shell, rendered in the
39
+ // browser, which shows its own 404 for an unknown path.
39
40
  const renderPage = app.createPageRenderer
40
41
  ? app.createPageRenderer({ shell, readStatic })
41
- : async (request) => ((request.headers.get("accept") ?? "").includes("text/html") ? html(shell) : null);
42
+ : async (request) => (["GET", "HEAD"].includes(request.method.toUpperCase()) ? html(request.method.toUpperCase() === "HEAD" ? null : shell) : null);
42
43
 
43
44
  const server = serve(
44
45
  { port: Number(env.PORT ?? "3000") },
@@ -60,7 +60,7 @@
60
60
  "name": "styling",
61
61
  "question": "Select a styling:",
62
62
  "kind": "choice",
63
- "default": "css",
63
+ "unattended": "css",
64
64
  "choices": [
65
65
  {
66
66
  "value": "css",
@@ -11,10 +11,8 @@
11
11
  "jsx": "preserve",
12
12
  "jsxImportSource": "@opentf/afw",
13
13
  "types": [
14
- "@opentf/esrun-types"
15
- ],
16
- "customConditions": [
17
- "esdev"
14
+ "@opentf/esrun-types",
15
+ "@opentf/esdev-plugin-afw/client"
18
16
  ],
19
17
  "strict": true,
20
18
  "noEmit": true,
@@ -11,10 +11,8 @@
11
11
  "jsx": "preserve",
12
12
  "jsxImportSource": "@opentf/afw",
13
13
  "types": [
14
- "@opentf/esrun-types"
15
- ],
16
- "customConditions": [
17
- "esdev"
14
+ "@opentf/esrun-types",
15
+ "@opentf/esdev-plugin-afw/client"
18
16
  ],
19
17
  "strict": true,
20
18
  "noEmit": true,
@@ -8,7 +8,7 @@
8
8
  "name": "styling",
9
9
  "question": "Select a styling:",
10
10
  "kind": "choice",
11
- "default": "css",
11
+ "unattended": "css",
12
12
  "choices": [
13
13
  {
14
14
  "value": "css",
package/index.js CHANGED
@@ -16,7 +16,7 @@ import { styleText } from "node:util";
16
16
  import * as prompts from "@clack/prompts";
17
17
  import { slugify } from "@opentf/std";
18
18
 
19
- import { LEGACY_TEMPLATES, RENDERINGS, RENDER_ALIASES, SERVER_RENDERINGS, STYLINGS, TEMPLATES, projectFiles } from "./templates.js";
19
+ import { RENDERINGS, SERVER_RENDERINGS, STYLINGS, TEMPLATES, projectFiles } from "./templates.js";
20
20
  import { afwVersions } from "./versions.js";
21
21
 
22
22
  const DEFAULT_DIRECTORY = "afw-app";
@@ -48,9 +48,7 @@ ${TEMPLATE_NAMES.map((t) => ` ${t.padEnd(10)} ${TEMPLATES[t]}`).join("\n")}
48
48
 
49
49
  Renderings (app), set in app/_config.js; any folder can change it with its own:
50
50
  ${Object.entries(RENDERINGS).map(([r, label]) => ` ${r.padEnd(10)} ${label}`).join("\n")}
51
- (spa, ssr and ssg from earlier releases mean client, server and static.)
52
51
 
53
- Shorthands from earlier releases: ${Object.entries(LEGACY_TEMPLATES).map(([name, t]) => `${name} = app --render ${t.render}${t.server ? " --server" : ""}`).join("; ")}.
54
52
 
55
53
  For the esdev + ES-Runtime workflow, use \`esdev create\`.`;
56
54
 
@@ -90,26 +88,15 @@ export function parseArgs(args) {
90
88
  }
91
89
  if (options.template !== undefined) {
92
90
  const [, base, lang] = options.template.match(/^(.*?)(?:-(ts|js))?$/);
93
- if (!TEMPLATES[base] && !LEGACY_TEMPLATES[base]) {
91
+ if (!TEMPLATES[base]) {
94
92
  throw new Error(`Unknown template "${options.template}". Choose one of: ${TEMPLATE_NAMES.join(", ")} (optionally with -ts or -js).`);
95
93
  }
96
94
  if (lang) {
97
95
  if (options.language && options.language !== lang) throw new Error(`--template ${options.template} conflicts with --language ${options.language}`);
98
96
  options.language = lang;
99
97
  }
100
- const legacy = LEGACY_TEMPLATES[base];
101
- if (legacy) {
102
- // An earlier release's name: a shorthand for app with its rendering and server.
103
- if (options.render !== undefined && (RENDER_ALIASES[options.render] ?? options.render) !== legacy.render) throw new Error(`--template ${base} conflicts with --render ${options.render}`);
104
- if (legacy.server && options.server === false) throw new Error(`--template ${base} conflicts with --no-server`);
105
- options.template = legacy.template;
106
- options.render = legacy.render;
107
- options.server ??= legacy.server;
108
- } else {
109
- options.template = base;
110
- }
98
+ options.template = base;
111
99
  }
112
- if (options.render !== undefined) options.render = RENDER_ALIASES[options.render] ?? options.render;
113
100
  if (options.render !== undefined && !RENDERINGS[options.render]) {
114
101
  throw new Error(`Unknown rendering "${options.render}". Choose one of: ${Object.keys(RENDERINGS).join(", ")}.`);
115
102
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opentf/create-afw",
3
- "version": "0.6.0",
3
+ "version": "0.8.0",
4
4
  "description": "Create an AFW app on Vite and Node: npm create @opentf/afw.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -27,11 +27,11 @@
27
27
  "templates": "esdev/templates"
28
28
  },
29
29
  "devDependencies": {
30
- "@opentf/afw": "0.39.0",
31
- "@opentf/afw-docs": "0.37.0",
32
- "@opentf/afw-form": "1.34.0",
33
- "@opentf/afw-test": "1.34.0",
34
- "@opentf/vite-plugin-afw": "0.7.0",
30
+ "@opentf/afw": "0.40.0",
31
+ "@opentf/afw-docs": "0.39.0",
32
+ "@opentf/afw-form": "1.35.0",
33
+ "@opentf/afw-test": "1.36.0",
34
+ "@opentf/vite-plugin-afw": "0.9.0",
35
35
  "@tailwindcss/vite": "4.3.3",
36
36
  "happy-dom": "21.0.4",
37
37
  "tailwindcss": "4.3.3",
package/templates.js CHANGED
@@ -31,9 +31,6 @@ export const RENDERINGS = {
31
31
  mixed: "Server by default, plus a static page and a client section to copy",
32
32
  };
33
33
 
34
- /** The rendering names of earlier releases, kept as shorthands. */
35
- export const RENDER_ALIASES = { spa: "client", ssr: "server", ssg: "static" };
36
-
37
34
  /** Renderings that always have a server. */
38
35
  export const SERVER_RENDERINGS = new Set(["server", "mixed"]);
39
36
 
@@ -41,13 +38,6 @@ export const TOOLCHAINS = { vite: "Vite + Node", esdev: "esdev + ES-Runtime" };
41
38
 
42
39
  export const STYLINGS = { css: "CSS", tailwind: "Tailwind CSS" };
43
40
 
44
- /** The template names of earlier releases, kept as shorthands. */
45
- export const LEGACY_TEMPLATES = {
46
- spa: { template: "app", render: "client", server: false },
47
- fullstack: { template: "app", render: "client", server: true },
48
- ssr: { template: "app", render: "server", server: true },
49
- ssg: { template: "app", render: "static", server: false },
50
- };
51
41
 
52
42
  // The third-party tools a new project starts on. AFW's own packages take the
53
43
  // versions this scaffolder was released with (versions.js).
@@ -76,7 +66,6 @@ export function projectFiles({
76
66
  toolchain = "vite", pm = "npm",
77
67
  }) {
78
68
  if (!TEMPLATES[template]) throw new Error(`Unknown template "${template}". Choose one of: ${Object.keys(TEMPLATES).join(", ")}`);
79
- render = RENDER_ALIASES[render] ?? render;
80
69
  if (!RENDERINGS[render]) throw new Error(`Unknown rendering "${render}". Choose one of: ${Object.keys(RENDERINGS).join(", ")}`);
81
70
  if (!STYLINGS[styling]) throw new Error(`Unknown styling "${styling}". Choose one of: ${Object.keys(STYLINGS).join(", ")}`);
82
71
  if (!TOOLCHAINS[toolchain]) throw new Error(`Unknown toolchain "${toolchain}". Choose one of: ${Object.keys(TOOLCHAINS).join(", ")}`);
@@ -176,10 +165,11 @@ function tsconfig(ctx, include, { allowJs = false } = {}) {
176
165
  lib: ["ESNext", "DOM", "DOM.Iterable"],
177
166
  jsx: "preserve",
178
167
  jsxImportSource: "@opentf/afw",
179
- // esdev: the runtime's types, and the `esdev` condition `@opentf/afw-test/test` uses.
168
+ // The toolchain's types (the runtime, `@afw/routes`, `.md`/`.css` imports). Under Vite,
169
+ // the `vitest` condition gives `@opentf/afw-test/test` Vitest's types.
180
170
  ...(ctx.esdev
181
- ? { types: ["@opentf/esrun-types"], customConditions: ["esdev"] }
182
- : { types: ["@opentf/vite-plugin-afw/client"] }),
171
+ ? { types: ["@opentf/esrun-types", "@opentf/esdev-plugin-afw/client"] }
172
+ : { types: ["@opentf/vite-plugin-afw/client"], customConditions: ["vitest"] }),
183
173
  strict: true,
184
174
  noEmit: true,
185
175
  isolatedModules: true,
@@ -302,7 +292,8 @@ function scripts(ctx, { server, client = false }) {
302
292
  dev: "esdev start",
303
293
  build: "esdev build",
304
294
  ...(server
305
- ? { start: "esrun --allow-read --allow-net --allow-listen=3000 --allow-env=PORT --allow-imports dist/server.js" }
295
+ // Reads only its build (dist/), listens on 3000; it dials nothing, so no --allow-net.
296
+ ? { start: "esrun --allow-read=dist --allow-listen=0.0.0.0:3000 --allow-env=PORT --allow-imports dist/server.js" }
306
297
  : { preview: client ? "esdev preview --spa" : "esdev preview" }),
307
298
  test: testScript(ctx, { server }),
308
299
  ...(ctx.ts ? { typecheck: "esdev typecheck" } : {}),
@@ -325,7 +316,7 @@ function commandRows(ctx, { server }) {
325
316
  [`${pm} run dev`, "Start the dev server"],
326
317
  [`${pm} run build`, "Build for production"],
327
318
  server
328
- ? [`${pm} run start`, ctx.esdev ? "Run the built server on ES-Runtime (`PORT`)" : "Run the built Node server (`PORT`, `HOST`)"]
319
+ ? [`${pm} run start`, ctx.esdev ? "Run the built server on ES-Runtime, on port 3000 (another `PORT` needs the same port in `--allow-listen`)" : "Run the built Node server (`PORT`, `HOST`)"]
329
320
  : [`${pm} run preview`, "Preview the production build"],
330
321
  [`${pm} run test`, `Run the tests with ${runner(ctx)}`],
331
322
  ...(ctx.ts ? [[`${pm} run typecheck`, "Check types"]] : []),
package/versions.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
- "@opentf/afw": "^0.39.0",
3
- "@opentf/afw-docs": "^0.37.0",
4
- "@opentf/afw-test": "^1.34.0",
5
- "@opentf/vite-plugin-afw": "^0.7.0"
2
+ "@opentf/afw": "^0.40.0",
3
+ "@opentf/afw-docs": "^0.39.0",
4
+ "@opentf/afw-test": "^1.36.0",
5
+ "@opentf/vite-plugin-afw": "^0.9.0"
6
6
  }