create-fate 1.3.3 → 1.5.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 (298) hide show
  1. package/bin/create-fate.mjs +41 -3
  2. package/package.json +1 -1
  3. package/templates/fate/_shared/vue-app/package.json +14 -16
  4. package/templates/fate/cloudflare/README.md +11 -0
  5. package/templates/fate/cloudflare/client/node_modules/.bin/browserslist +22 -0
  6. package/templates/fate/cloudflare/client/node_modules/.bin/cf-wrangler +22 -0
  7. package/templates/fate/cloudflare/client/node_modules/.bin/drizzle-kit +22 -0
  8. package/templates/fate/cloudflare/client/node_modules/.bin/esbuild +22 -0
  9. package/templates/fate/cloudflare/client/node_modules/.bin/fate +22 -0
  10. package/templates/fate/cloudflare/client/node_modules/.bin/fbtee +22 -0
  11. package/templates/fate/cloudflare/client/node_modules/.bin/intent +22 -0
  12. package/templates/fate/cloudflare/client/node_modules/.bin/jiti +22 -0
  13. package/templates/fate/cloudflare/client/node_modules/.bin/oxfmt +22 -0
  14. package/templates/fate/cloudflare/client/node_modules/.bin/oxlint +22 -0
  15. package/templates/fate/cloudflare/client/node_modules/.bin/rolldown +22 -0
  16. package/templates/fate/cloudflare/client/node_modules/.bin/tsc +22 -0
  17. package/templates/fate/cloudflare/client/node_modules/.bin/tsx +22 -0
  18. package/templates/fate/cloudflare/client/node_modules/.bin/vitest +22 -0
  19. package/templates/fate/cloudflare/client/node_modules/.bin/void +22 -0
  20. package/templates/fate/cloudflare/client/node_modules/.bin/vp +22 -0
  21. package/templates/fate/cloudflare/client/node_modules/.bin/vpr +22 -0
  22. package/templates/fate/cloudflare/client/node_modules/.bin/workerd +22 -0
  23. package/templates/fate/cloudflare/client/node_modules/.bin/wrangler +22 -0
  24. package/templates/fate/cloudflare/client/node_modules/.bin/wrangler2 +22 -0
  25. package/templates/fate/cloudflare/client/package.json +26 -21
  26. package/templates/fate/cloudflare/client/pages/layout.tsx +2 -16
  27. package/templates/fate/cloudflare/client/src/lib/AvailableLanguages.tsx +3 -3
  28. package/templates/fate/cloudflare/client/src/lib/LocaleContext.tsx +61 -0
  29. package/templates/fate/cloudflare/client/src/ui/LocaleSwitcher.tsx +26 -44
  30. package/templates/fate/cloudflare/client/start.mjs +11 -0
  31. package/templates/fate/cloudflare/client/translations/{de_DE.json → de-DE.json} +56 -113
  32. package/templates/fate/{graphql/client/translations/ja_JP.json → cloudflare/client/translations/ja-JP.json} +56 -113
  33. package/templates/fate/cloudflare/client/vite.config.ts +4 -8
  34. package/templates/fate/cloudflare/package.json +6 -10
  35. package/templates/fate/cloudflare/pnpm-workspace.yaml +4 -4
  36. package/templates/fate/cloudflare/server/db/migrations/20260508073357_initial_schema.sql +3 -2
  37. package/templates/fate/cloudflare/server/db/migrations/20260508120500_seed_cloudflare_demo.sql +10 -10
  38. package/templates/fate/cloudflare/server/db/migrations/meta/20260508073357_snapshot.json +10 -3
  39. package/templates/fate/cloudflare/server/db/schema.ts +2 -3
  40. package/templates/fate/cloudflare/server/node_modules/.bin/cf-wrangler +22 -0
  41. package/templates/fate/cloudflare/server/node_modules/.bin/drizzle-kit +22 -0
  42. package/templates/fate/cloudflare/server/node_modules/.bin/esbuild +22 -0
  43. package/templates/fate/cloudflare/server/node_modules/.bin/fate +22 -0
  44. package/templates/fate/cloudflare/server/node_modules/.bin/intent +22 -0
  45. package/templates/fate/cloudflare/server/node_modules/.bin/jiti +22 -0
  46. package/templates/fate/cloudflare/server/node_modules/.bin/oxfmt +22 -0
  47. package/templates/fate/cloudflare/server/node_modules/.bin/oxlint +22 -0
  48. package/templates/fate/cloudflare/server/node_modules/.bin/tsc +22 -0
  49. package/templates/fate/cloudflare/server/node_modules/.bin/tsx +22 -0
  50. package/templates/fate/cloudflare/server/node_modules/.bin/vitest +22 -0
  51. package/templates/fate/cloudflare/server/node_modules/.bin/vp +22 -0
  52. package/templates/fate/cloudflare/server/node_modules/.bin/vpr +22 -0
  53. package/templates/fate/cloudflare/server/node_modules/.bin/workerd +22 -0
  54. package/templates/fate/cloudflare/server/node_modules/.bin/wrangler +22 -0
  55. package/templates/fate/cloudflare/server/node_modules/.bin/wrangler2 +22 -0
  56. package/templates/fate/cloudflare/server/package.json +3 -3
  57. package/templates/fate/cloudflare/server/src/fate/server.ts +5 -2
  58. package/templates/fate/cloudflare/server/src/lib/auth.ts +0 -2
  59. package/templates/fate/cloudflare/server/tsconfig.json +1 -1
  60. package/templates/fate/cloudflare/tsconfig.json +2 -11
  61. package/templates/fate/cloudflare/vite.config.ts +3 -0
  62. package/templates/fate/drizzle/README.md +11 -0
  63. package/templates/fate/drizzle/client/node_modules/.bin/browserslist +22 -0
  64. package/templates/fate/drizzle/client/node_modules/.bin/cf-wrangler +22 -0
  65. package/templates/fate/drizzle/client/node_modules/.bin/drizzle-kit +22 -0
  66. package/templates/fate/drizzle/client/node_modules/.bin/esbuild +22 -0
  67. package/templates/fate/drizzle/client/node_modules/.bin/fate +22 -0
  68. package/templates/fate/drizzle/client/node_modules/.bin/fbtee +22 -0
  69. package/templates/fate/drizzle/client/node_modules/.bin/intent +22 -0
  70. package/templates/fate/drizzle/client/node_modules/.bin/jiti +22 -0
  71. package/templates/fate/drizzle/client/node_modules/.bin/oxfmt +22 -0
  72. package/templates/fate/drizzle/client/node_modules/.bin/oxlint +22 -0
  73. package/templates/fate/drizzle/client/node_modules/.bin/rolldown +22 -0
  74. package/templates/fate/drizzle/client/node_modules/.bin/tsc +22 -0
  75. package/templates/fate/drizzle/client/node_modules/.bin/tsx +22 -0
  76. package/templates/fate/drizzle/client/node_modules/.bin/vitest +22 -0
  77. package/templates/fate/drizzle/client/node_modules/.bin/void +22 -0
  78. package/templates/fate/drizzle/client/node_modules/.bin/vp +22 -0
  79. package/templates/fate/drizzle/client/node_modules/.bin/vpr +22 -0
  80. package/templates/fate/drizzle/client/node_modules/.bin/workerd +22 -0
  81. package/templates/fate/drizzle/client/node_modules/.bin/wrangler +22 -0
  82. package/templates/fate/drizzle/client/node_modules/.bin/wrangler2 +22 -0
  83. package/templates/fate/drizzle/client/package.json +28 -24
  84. package/templates/fate/drizzle/client/pages/layout.tsx +2 -16
  85. package/templates/fate/drizzle/client/src/lib/AvailableLanguages.tsx +3 -3
  86. package/templates/fate/drizzle/client/src/lib/LocaleContext.tsx +61 -0
  87. package/templates/fate/drizzle/client/src/ui/LocaleSwitcher.tsx +26 -44
  88. package/templates/fate/drizzle/client/start.mjs +11 -0
  89. package/templates/fate/{graphql/client/translations/de_DE.json → drizzle/client/translations/de-DE.json} +56 -113
  90. package/templates/fate/{cloudflare/client/translations/ja_JP.json → drizzle/client/translations/ja-JP.json} +56 -113
  91. package/templates/fate/drizzle/client/vite.config.ts +4 -8
  92. package/templates/fate/drizzle/package.json +6 -10
  93. package/templates/fate/drizzle/pnpm-workspace.yaml +4 -4
  94. package/templates/fate/drizzle/server/node_modules/.bin/drizzle-kit +22 -0
  95. package/templates/fate/drizzle/server/node_modules/.bin/esbuild +22 -0
  96. package/templates/fate/drizzle/server/node_modules/.bin/fate +22 -0
  97. package/templates/fate/drizzle/server/node_modules/.bin/intent +22 -0
  98. package/templates/fate/drizzle/server/node_modules/.bin/jiti +22 -0
  99. package/templates/fate/drizzle/server/node_modules/.bin/nodemon +22 -0
  100. package/templates/fate/drizzle/server/node_modules/.bin/oxfmt +22 -0
  101. package/templates/fate/drizzle/server/node_modules/.bin/oxlint +22 -0
  102. package/templates/fate/drizzle/server/node_modules/.bin/tsc +22 -0
  103. package/templates/fate/drizzle/server/node_modules/.bin/tsx +22 -0
  104. package/templates/fate/drizzle/server/node_modules/.bin/vitest +22 -0
  105. package/templates/fate/drizzle/server/node_modules/.bin/vp +22 -0
  106. package/templates/fate/drizzle/server/node_modules/.bin/vpr +22 -0
  107. package/templates/fate/drizzle/server/package.json +9 -9
  108. package/templates/fate/drizzle/server/src/app.tsx +1 -1
  109. package/templates/fate/drizzle/server/src/drizzle/schema.ts +2 -3
  110. package/templates/fate/drizzle/server/src/drizzle/seed.tsx +1 -1
  111. package/templates/fate/drizzle/tsconfig.json +1 -10
  112. package/templates/fate/graphql/README.md +11 -0
  113. package/templates/fate/graphql/client/node_modules/.bin/browserslist +22 -0
  114. package/templates/fate/graphql/client/node_modules/.bin/cf-wrangler +22 -0
  115. package/templates/fate/graphql/client/node_modules/.bin/drizzle-kit +22 -0
  116. package/templates/fate/graphql/client/node_modules/.bin/esbuild +22 -0
  117. package/templates/fate/graphql/client/node_modules/.bin/fate +22 -0
  118. package/templates/fate/graphql/client/node_modules/.bin/fbtee +22 -0
  119. package/templates/fate/graphql/client/node_modules/.bin/intent +22 -0
  120. package/templates/fate/graphql/client/node_modules/.bin/jiti +22 -0
  121. package/templates/fate/graphql/client/node_modules/.bin/oxfmt +22 -0
  122. package/templates/fate/graphql/client/node_modules/.bin/oxlint +22 -0
  123. package/templates/fate/graphql/client/node_modules/.bin/rolldown +22 -0
  124. package/templates/fate/graphql/client/node_modules/.bin/tsc +22 -0
  125. package/templates/fate/graphql/client/node_modules/.bin/tsx +22 -0
  126. package/templates/fate/graphql/client/node_modules/.bin/vitest +22 -0
  127. package/templates/fate/graphql/client/node_modules/.bin/void +22 -0
  128. package/templates/fate/graphql/client/node_modules/.bin/vp +22 -0
  129. package/templates/fate/graphql/client/node_modules/.bin/vpr +22 -0
  130. package/templates/fate/graphql/client/node_modules/.bin/workerd +22 -0
  131. package/templates/fate/graphql/client/node_modules/.bin/wrangler +22 -0
  132. package/templates/fate/graphql/client/node_modules/.bin/wrangler2 +22 -0
  133. package/templates/fate/graphql/client/node_modules/.bin/yaml +22 -0
  134. package/templates/fate/graphql/client/package.json +27 -23
  135. package/templates/fate/graphql/client/pages/layout.tsx +2 -16
  136. package/templates/fate/graphql/client/src/lib/AvailableLanguages.tsx +3 -3
  137. package/templates/fate/graphql/client/src/lib/LocaleContext.tsx +61 -0
  138. package/templates/fate/graphql/client/src/ui/LocaleSwitcher.tsx +26 -44
  139. package/templates/fate/graphql/client/src/ui/PostCard.tsx +1 -1
  140. package/templates/fate/graphql/client/start.mjs +11 -0
  141. package/templates/fate/{drizzle/client/translations/de_DE.json → graphql/client/translations/de-DE.json} +56 -113
  142. package/templates/fate/{http/client/translations/ja_JP.json → graphql/client/translations/ja-JP.json} +56 -113
  143. package/templates/fate/graphql/client/vite.config.ts +4 -8
  144. package/templates/fate/graphql/package.json +7 -11
  145. package/templates/fate/graphql/pnpm-workspace.yaml +4 -4
  146. package/templates/fate/graphql/server/package.json +25 -29
  147. package/templates/fate/graphql/server/prisma.config.ts +9 -1
  148. package/templates/fate/graphql/server/scripts/generate-graphql.tsx +1 -1
  149. package/templates/fate/graphql/server/src/index.tsx +1 -1
  150. package/templates/fate/graphql/server/src/prisma/schema.prisma +2 -1
  151. package/templates/fate/graphql/server/src/prisma/seed.tsx +1 -1
  152. package/templates/fate/graphql/server/tsconfig.json +1 -11
  153. package/templates/fate/graphql/tsconfig.json +1 -10
  154. package/templates/fate/graphql-client/README.md +9 -0
  155. package/templates/fate/graphql-client/_gitignore +3 -0
  156. package/templates/fate/graphql-client/package.json +27 -24
  157. package/templates/fate/graphql-client/pages/index.tsx +61 -27
  158. package/templates/fate/graphql-client/pages/layout.tsx +22 -15
  159. package/templates/fate/graphql-client/pnpm-workspace.yaml +6 -4
  160. package/templates/fate/graphql-client/src/lib/AvailableLanguages.tsx +5 -0
  161. package/templates/fate/graphql-client/src/lib/LocaleContext.tsx +61 -0
  162. package/templates/fate/graphql-client/src/ui/LocaleSwitcher.tsx +34 -0
  163. package/templates/fate/graphql-client/translations/de-DE.json +225 -0
  164. package/templates/fate/graphql-client/translations/ja-JP.json +225 -0
  165. package/templates/fate/graphql-client/vite.config.ts +9 -13
  166. package/templates/fate/http/README.md +11 -0
  167. package/templates/fate/http/client/node_modules/.bin/browserslist +22 -0
  168. package/templates/fate/http/client/node_modules/.bin/cf-wrangler +22 -0
  169. package/templates/fate/http/client/node_modules/.bin/drizzle-kit +22 -0
  170. package/templates/fate/http/client/node_modules/.bin/esbuild +22 -0
  171. package/templates/fate/http/client/node_modules/.bin/fate +22 -0
  172. package/templates/fate/http/client/node_modules/.bin/fbtee +22 -0
  173. package/templates/fate/http/client/node_modules/.bin/intent +22 -0
  174. package/templates/fate/http/client/node_modules/.bin/jiti +22 -0
  175. package/templates/fate/http/client/node_modules/.bin/oxfmt +22 -0
  176. package/templates/fate/http/client/node_modules/.bin/oxlint +22 -0
  177. package/templates/fate/http/client/node_modules/.bin/rolldown +22 -0
  178. package/templates/fate/http/client/node_modules/.bin/tsc +22 -0
  179. package/templates/fate/http/client/node_modules/.bin/tsx +22 -0
  180. package/templates/fate/http/client/node_modules/.bin/vitest +22 -0
  181. package/templates/fate/http/client/node_modules/.bin/void +22 -0
  182. package/templates/fate/http/client/node_modules/.bin/vp +22 -0
  183. package/templates/fate/http/client/node_modules/.bin/vpr +22 -0
  184. package/templates/fate/http/client/node_modules/.bin/workerd +22 -0
  185. package/templates/fate/http/client/node_modules/.bin/wrangler +22 -0
  186. package/templates/fate/http/client/node_modules/.bin/wrangler2 +22 -0
  187. package/templates/fate/http/client/package.json +26 -22
  188. package/templates/fate/http/client/pages/layout.tsx +2 -16
  189. package/templates/fate/http/client/src/lib/AvailableLanguages.tsx +3 -3
  190. package/templates/fate/http/client/src/lib/LocaleContext.tsx +61 -0
  191. package/templates/fate/http/client/src/ui/LocaleSwitcher.tsx +26 -44
  192. package/templates/fate/http/client/start.mjs +11 -0
  193. package/templates/fate/http/client/translations/{de_DE.json → de-DE.json} +56 -113
  194. package/templates/fate/{drizzle/client/translations/ja_JP.json → http/client/translations/ja-JP.json} +56 -113
  195. package/templates/fate/http/client/vite.config.ts +4 -8
  196. package/templates/fate/http/package.json +6 -10
  197. package/templates/fate/http/pnpm-workspace.yaml +4 -4
  198. package/templates/fate/http/server/node_modules/.bin/drizzle-kit +22 -0
  199. package/templates/fate/http/server/node_modules/.bin/esbuild +22 -0
  200. package/templates/fate/http/server/node_modules/.bin/fate +22 -0
  201. package/templates/fate/http/server/node_modules/.bin/intent +22 -0
  202. package/templates/fate/http/server/node_modules/.bin/jiti +22 -0
  203. package/templates/fate/http/server/node_modules/.bin/nodemon +22 -0
  204. package/templates/fate/http/server/node_modules/.bin/oxfmt +22 -0
  205. package/templates/fate/http/server/node_modules/.bin/oxlint +22 -0
  206. package/templates/fate/http/server/node_modules/.bin/tsc +22 -0
  207. package/templates/fate/http/server/node_modules/.bin/tsx +22 -0
  208. package/templates/fate/http/server/node_modules/.bin/vitest +22 -0
  209. package/templates/fate/http/server/node_modules/.bin/vp +22 -0
  210. package/templates/fate/http/server/node_modules/.bin/vpr +22 -0
  211. package/templates/fate/http/server/package.json +8 -8
  212. package/templates/fate/http/server/src/app.tsx +1 -1
  213. package/templates/fate/http/server/src/drizzle/schema.ts +2 -3
  214. package/templates/fate/http/server/src/drizzle/seed.tsx +1 -1
  215. package/templates/fate/http/tsconfig.json +1 -10
  216. package/templates/fate/prisma/README.md +11 -0
  217. package/templates/fate/prisma/client/node_modules/.bin/browserslist +22 -0
  218. package/templates/fate/prisma/client/node_modules/.bin/cf-wrangler +22 -0
  219. package/templates/fate/prisma/client/node_modules/.bin/drizzle-kit +22 -0
  220. package/templates/fate/prisma/client/node_modules/.bin/esbuild +22 -0
  221. package/templates/fate/prisma/client/node_modules/.bin/fate +22 -0
  222. package/templates/fate/prisma/client/node_modules/.bin/fbtee +22 -0
  223. package/templates/fate/prisma/client/node_modules/.bin/intent +22 -0
  224. package/templates/fate/prisma/client/node_modules/.bin/jiti +22 -0
  225. package/templates/fate/prisma/client/node_modules/.bin/oxfmt +22 -0
  226. package/templates/fate/prisma/client/node_modules/.bin/oxlint +22 -0
  227. package/templates/fate/prisma/client/node_modules/.bin/rolldown +22 -0
  228. package/templates/fate/prisma/client/node_modules/.bin/tsc +22 -0
  229. package/templates/fate/prisma/client/node_modules/.bin/tsx +22 -0
  230. package/templates/fate/prisma/client/node_modules/.bin/vitest +22 -0
  231. package/templates/fate/prisma/client/node_modules/.bin/void +22 -0
  232. package/templates/fate/prisma/client/node_modules/.bin/vp +22 -0
  233. package/templates/fate/prisma/client/node_modules/.bin/vpr +22 -0
  234. package/templates/fate/prisma/client/node_modules/.bin/workerd +22 -0
  235. package/templates/fate/prisma/client/node_modules/.bin/wrangler +22 -0
  236. package/templates/fate/prisma/client/node_modules/.bin/wrangler2 +22 -0
  237. package/templates/fate/prisma/client/node_modules/.bin/yaml +22 -0
  238. package/templates/fate/prisma/client/package.json +28 -24
  239. package/templates/fate/prisma/client/pages/layout.tsx +2 -16
  240. package/templates/fate/prisma/client/src/lib/AvailableLanguages.tsx +3 -3
  241. package/templates/fate/prisma/client/src/lib/LocaleContext.tsx +61 -0
  242. package/templates/fate/prisma/client/src/ui/LocaleSwitcher.tsx +26 -44
  243. package/templates/fate/prisma/client/start.mjs +11 -0
  244. package/templates/fate/prisma/client/translations/de-DE.json +632 -0
  245. package/templates/fate/prisma/client/translations/ja-JP.json +632 -0
  246. package/templates/fate/prisma/client/vite.config.ts +4 -8
  247. package/templates/fate/prisma/package.json +7 -11
  248. package/templates/fate/prisma/pnpm-workspace.yaml +4 -4
  249. package/templates/fate/prisma/server/node_modules/.bin/esbuild +22 -0
  250. package/templates/fate/prisma/server/node_modules/.bin/fate +22 -0
  251. package/templates/fate/prisma/server/node_modules/.bin/intent +22 -0
  252. package/templates/fate/prisma/server/node_modules/.bin/jiti +22 -0
  253. package/templates/fate/prisma/server/node_modules/.bin/nft +22 -0
  254. package/templates/fate/prisma/server/node_modules/.bin/nodemon +22 -0
  255. package/templates/fate/prisma/server/node_modules/.bin/oxfmt +22 -0
  256. package/templates/fate/prisma/server/node_modules/.bin/oxlint +22 -0
  257. package/templates/fate/prisma/server/node_modules/.bin/prisma +22 -0
  258. package/templates/fate/prisma/server/node_modules/.bin/tsc +22 -0
  259. package/templates/fate/prisma/server/node_modules/.bin/tsx +22 -0
  260. package/templates/fate/prisma/server/node_modules/.bin/vitest +22 -0
  261. package/templates/fate/prisma/server/node_modules/.bin/vp +22 -0
  262. package/templates/fate/prisma/server/node_modules/.bin/vpr +22 -0
  263. package/templates/fate/prisma/server/node_modules/.bin/yaml +22 -0
  264. package/templates/fate/prisma/server/package.json +9 -9
  265. package/templates/fate/prisma/server/prisma.config.ts +2 -1
  266. package/templates/fate/prisma/server/src/app.tsx +1 -1
  267. package/templates/fate/prisma/server/src/prisma/schema.prisma +2 -1
  268. package/templates/fate/prisma/server/src/prisma/seed.tsx +1 -1
  269. package/templates/fate/prisma/tsconfig.json +1 -10
  270. package/templates/fate/void/README.md +9 -0
  271. package/templates/fate/void/_gitignore +3 -0
  272. package/templates/fate/void/db/migrations/20260508073357_initial_schema.sql +3 -2
  273. package/templates/fate/void/db/migrations/20260508120500_seed_void_demo.sql +10 -10
  274. package/templates/fate/void/db/migrations/meta/20260508073357_snapshot.json +10 -3
  275. package/templates/fate/void/db/schema.ts +2 -3
  276. package/templates/fate/void/middleware/01.shared.ts +3 -0
  277. package/templates/fate/void/package.json +30 -25
  278. package/templates/fate/void/pages/index.tsx +23 -10
  279. package/templates/fate/void/pages/layout.tsx +22 -19
  280. package/templates/fate/void/pages/login.tsx +22 -18
  281. package/templates/fate/void/pages/search.tsx +18 -4
  282. package/templates/fate/void/pnpm-workspace.yaml +4 -4
  283. package/templates/fate/void/src/fate/server.ts +2 -1
  284. package/templates/fate/void/src/lib/AvailableLanguages.tsx +5 -0
  285. package/templates/fate/void/src/lib/LocaleContext.tsx +61 -0
  286. package/templates/fate/void/src/ui/CategoryCard.tsx +22 -4
  287. package/templates/fate/void/src/ui/CreatePost.tsx +12 -7
  288. package/templates/fate/void/src/ui/Error.tsx +4 -2
  289. package/templates/fate/void/src/ui/EventCard.tsx +18 -5
  290. package/templates/fate/void/src/ui/Header.tsx +10 -4
  291. package/templates/fate/void/src/ui/LocaleSwitcher.tsx +34 -0
  292. package/templates/fate/void/src/ui/PostCard.tsx +29 -14
  293. package/templates/fate/void/src/ui/UserCard.tsx +15 -8
  294. package/templates/fate/void/translations/de-DE.json +863 -0
  295. package/templates/fate/void/translations/ja-JP.json +863 -0
  296. package/templates/fate/void/vite.config.ts +6 -6
  297. package/templates/fate/prisma/client/translations/de_DE.json +0 -689
  298. package/templates/fate/prisma/client/translations/ja_JP.json +0 -689
@@ -4,14 +4,16 @@ export default function Error({ error: initialError }: { error: unknown }) {
4
4
  const error = initialError instanceof Error ? (initialError as Error) : null;
5
5
  return (
6
6
  <VStack gap={12}>
7
- <h3 className="text-xl font-semibold text-red-700">Error</h3>
7
+ <h3 className="text-xl font-semibold text-red-700">
8
+ <fbt desc="Error: Error">Error</fbt>
9
+ </h3>
8
10
  <code>{error ? error.stack || `fate Error: ${error.message}` : String(initialError)}</code>
9
11
  <div>
10
12
  <a
11
13
  className="cursor-pointer underline decoration-gray-300 hover:no-underline"
12
14
  onClick={() => window.location.reload()}
13
15
  >
14
- Try again
16
+ <fbt desc="Try again button">Try again</fbt>{' '}
15
17
  </a>
16
18
  </div>
17
19
  </VStack>
@@ -1,4 +1,5 @@
1
1
  import Stack, { VStack } from '@nkzw/stack';
2
+ import { fbs } from 'fbtee';
2
3
  import { ArrowUpRight, CalendarDays, MapPin, Users } from 'lucide-react';
3
4
  import { useEffect, useState } from 'react';
4
5
  import { useView, view, ViewRef } from 'react-fate';
@@ -41,7 +42,7 @@ const EventAttendeeChip = ({ attendee: attendeeRef }: { attendee: ViewRef<'Event
41
42
 
42
43
  return (
43
44
  <Badge className="text-nowrap" key={attendee.id} variant="outline">
44
- {user?.name ?? 'Guest'} · {formatLabel(attendee.status)}
45
+ {user?.name ?? fbs('Guest', 'Unnamed event attendee')} · {formatLabel(attendee.status)}
45
46
  </Badge>
46
47
  );
47
48
  };
@@ -110,12 +111,22 @@ export default function EventCard({ event: eventRef }: { event: ViewRef<'Event'>
110
111
  <Stack alignCenter gap>
111
112
  <Users className="text-muted-foreground" size={14} />
112
113
  <span className="text-sm text-foreground/80">
113
- {event.attendingCount ?? attendees.length} attending · capacity {event.capacity}
114
+ <fbt desc="Event attendance and capacity">
115
+ <fbt:param name="attending">{event.attendingCount ?? attendees.length}</fbt:param>{' '}
116
+ attending · capacity <fbt:param name="capacity">{event.capacity}</fbt:param>
117
+ </fbt>
114
118
  </span>
115
119
  </Stack>
116
120
  <Stack alignCenter gap>
117
121
  <ArrowUpRight className="text-muted-foreground" size={14} />
118
- <span className="text-sm text-foreground/80">Hosted by {host?.name ?? 'Unknown'}</span>
122
+ <span className="text-sm text-foreground/80">
123
+ <fbt desc="Event host">
124
+ Hosted by{' '}
125
+ <fbt:param name="host">
126
+ {host?.name ?? fbs('Unknown', 'Unknown event host')}
127
+ </fbt:param>
128
+ </fbt>
129
+ </span>
119
130
  </Stack>
120
131
  {topics.length ? (
121
132
  <Stack gap wrap>
@@ -128,7 +139,9 @@ export default function EventCard({ event: eventRef }: { event: ViewRef<'Event'>
128
139
  ) : null}
129
140
  {attendees.length ? (
130
141
  <VStack gap>
131
- <span className="text-xs text-muted-foreground">Community RSVPs</span>
142
+ <span className="text-xs text-muted-foreground">
143
+ <fbt desc="EventCard: Community RSVPs">Community RSVPs</fbt>
144
+ </span>
132
145
  <Stack gap wrap>
133
146
  {attendees.slice(0, 4).map(({ node }) => (
134
147
  <EventAttendeeChip attendee={node} key={node.id} />
@@ -143,7 +156,7 @@ export default function EventCard({ event: eventRef }: { event: ViewRef<'Event'>
143
156
  rel="noreferrer"
144
157
  target="_blank"
145
158
  >
146
- Join livestream
159
+ <fbt desc="EventCard: Join livestream">Join livestream</fbt>{' '}
147
160
  </a>
148
161
  ) : null}
149
162
  </VStack>
@@ -5,6 +5,7 @@ import type { SharedData } from '../lib/shared.ts';
5
5
  import AuthClient from '../user/AuthClient.tsx';
6
6
  import { Button } from './Button.tsx';
7
7
  import Link from './Link.tsx';
8
+ import LocaleSwitcher from './LocaleSwitcher.tsx';
8
9
 
9
10
  export default function Header() {
10
11
  const router = useRouter();
@@ -51,16 +52,19 @@ export default function Header() {
51
52
  <span className="italic">fate</span>
52
53
  </span>
53
54
  <p className="hidden text-xs text-muted-foreground sm:block">
54
- A modern data client for React.
55
+ <fbt desc="fate library tagline">A modern data client for React.</fbt>{' '}
55
56
  </p>
56
57
  </div>
57
58
  </Stack>
58
59
  </Link>
59
60
  <Stack alignCenter>
61
+ <LocaleSwitcher />
60
62
  <Button asChild size="sm" variant="ghost">
61
63
  <Link href="/search">
62
64
  <Search className="h-4 w-4" />
63
- <span className="hidden sm:inline">Search</span>
65
+ <span className="hidden sm:inline">
66
+ <fbt desc="Search button">Search</fbt>
67
+ </span>
64
68
  </Link>
65
69
  </Button>
66
70
  <div className="flex w-9 justify-end sm:w-24">
@@ -78,13 +82,15 @@ export default function Header() {
78
82
  }}
79
83
  >
80
84
  <LogOut className="h-4 w-4" />
81
- <span className="hidden sm:inline">Logout</span>
85
+ <span className="hidden sm:inline">
86
+ <fbt desc="Logout button">Logout</fbt>
87
+ </span>
82
88
  </Stack>
83
89
  </Button>
84
90
  ) : (
85
91
  <Button asChild className="w-full" size="sm" variant="ghost">
86
92
  <Link href="/login">
87
- <LogIn className="h-4 w-4" /> Login
93
+ <LogIn className="h-4 w-4" /> <fbt desc="Login button">Login</fbt>{' '}
88
94
  </Link>
89
95
  </Button>
90
96
  )}
@@ -0,0 +1,34 @@
1
+ import { useLocaleContext } from 'fbtee';
2
+ import { startTransition } from 'react';
3
+ import AvailableLanguages from '../lib/AvailableLanguages.tsx';
4
+
5
+ export default function LocaleSwitcher() {
6
+ const { locale, localeChangeIsPending, setLocale } = useLocaleContext();
7
+ return (
8
+ <label className="inline-flex items-center gap-2 text-sm">
9
+ <span className="sr-only">
10
+ <fbt desc="Locale switcher button">Change Language</fbt>
11
+ </span>
12
+ <select
13
+ className="rounded-md border border-gray-300 bg-background px-2 py-1 text-foreground"
14
+ disabled={localeChangeIsPending}
15
+ onChange={(event) => {
16
+ const nextLocale = event.target.value;
17
+ try {
18
+ localStorage.setItem('fbtee:locale', nextLocale);
19
+ } catch {
20
+ // Changing the language still works without browser storage.
21
+ }
22
+ startTransition(() => setLocale(nextLocale));
23
+ }}
24
+ value={locale}
25
+ >
26
+ {[...AvailableLanguages].map(([value, name]) => (
27
+ <option key={value} value={value}>
28
+ {name}
29
+ </option>
30
+ ))}
31
+ </select>
32
+ </label>
33
+ );
34
+ }
@@ -1,6 +1,7 @@
1
1
  import Stack, { VStack } from '@nkzw/stack';
2
2
  import { useShared } from '@void/react';
3
3
  import { cx } from 'class-variance-authority';
4
+ import { fbs } from 'fbtee';
4
5
  import {
5
6
  KeyboardEvent,
6
7
  Suspense,
@@ -79,7 +80,7 @@ const PostComments = ({
79
80
  ))}
80
81
  {loadNext ? (
81
82
  <Button onClick={loadNext} variant="ghost">
82
- Load more comments
83
+ <fbt desc="Load more comments button">Load more comments</fbt>{' '}
83
84
  </Button>
84
85
  ) : null}
85
86
  </VStack>
@@ -136,25 +137,29 @@ const CommentInput = ({
136
137
 
137
138
  return (
138
139
  <VStack action={addComment} as="form" gap>
139
- <span className="text-sm font-medium text-foreground">Add a comment</span>
140
+ <span className="text-sm font-medium text-foreground">
141
+ <fbt desc="Comment add label">Add a comment</fbt>
142
+ </span>
140
143
  <textarea
141
144
  className="squircle min-h-20 w-full border border-gray-200/80 bg-gray-100/50 p-3 text-sm placeholder-gray-500 transition outline-none focus:border-gray-500 focus:ring-2 focus:ring-gray-200 disabled:opacity-50 dark:border-neutral-800 dark:bg-neutral-900/40 dark:placeholder-gray-400"
142
145
  disabled={isPending}
143
146
  onChange={(event) => setCommentText(event.target.value)}
144
147
  onKeyDown={maybeSubmitComment}
145
- placeholder={user?.name ? `Share your thoughts, ${user.name}!` : 'Share your thoughts...'}
148
+ placeholder={fbs('Share your thoughts...', 'Placeholder text for comment input')}
146
149
  value={commentText}
147
150
  />
148
151
  {anyServerError ? (
149
152
  <p className="text-sm text-destructive">
150
- {anyServerError instanceof Error
151
- ? anyServerError.message
152
- : 'Something went wrong. Please try again.'}
153
+ {anyServerError instanceof Error ? (
154
+ anyServerError.message
155
+ ) : (
156
+ <fbt desc="Error text">Something went wrong. Please try again.</fbt>
157
+ )}
153
158
  </p>
154
159
  ) : null}
155
160
  <Stack end gap>
156
161
  <Button disabled={commentingIsDisabled} size="sm" type="submit" variant="secondary">
157
- Post comment
162
+ <fbt desc="Post comment button">Post comment</fbt>{' '}
158
163
  </Button>
159
164
  </Stack>
160
165
  </VStack>
@@ -237,7 +242,7 @@ export function PostCard({ detail, post: postRef }: { detail?: boolean; post: Vi
237
242
  </span>
238
243
  </Stack>
239
244
  <Button action={handleLike} disabled={likeIsPending} size="sm" variant="outline">
240
- Like
245
+ <fbt desc="Like button">Like</fbt>{' '}
241
246
  </Button>
242
247
  {detail && (
243
248
  <Button
@@ -246,7 +251,7 @@ export function PostCard({ detail, post: postRef }: { detail?: boolean; post: Vi
246
251
  size="sm"
247
252
  variant="outline"
248
253
  >
249
- Like (Slow)
254
+ <fbt desc="Like button with a slow request">Like (Slow)</fbt>{' '}
250
255
  </Button>
251
256
  )}
252
257
  {detail && (
@@ -260,7 +265,11 @@ export function PostCard({ detail, post: postRef }: { detail?: boolean; post: Vi
260
265
  size="sm"
261
266
  variant="outline"
262
267
  >
263
- {likeResult?.error ? 'Oops, try again!' : `Like (Error)`}
268
+ {likeResult?.error ? (
269
+ <fbt desc="Very short error messages">Oops, try again!</fbt>
270
+ ) : (
271
+ <fbt desc="Like button that triggers an error">Like (Error)</fbt>
272
+ )}
264
273
  </Button>
265
274
  )}
266
275
  {detail && (
@@ -270,7 +279,9 @@ export function PostCard({ detail, post: postRef }: { detail?: boolean; post: Vi
270
279
  size="sm"
271
280
  variant="outline"
272
281
  >
273
- Like (Network Error)
282
+ <fbt desc="Like button that triggers a network error">
283
+ Like (Network Error)
284
+ </fbt>{' '}
274
285
  </Button>
275
286
  )}
276
287
  {detail && (
@@ -285,7 +296,7 @@ export function PostCard({ detail, post: postRef }: { detail?: boolean; post: Vi
285
296
  size="sm"
286
297
  variant="outline"
287
298
  >
288
- Like (Many)
299
+ <fbt desc="Like button that can be pressed many times">Like (Many)</fbt>{' '}
289
300
  </Button>
290
301
  )}
291
302
  <Button
@@ -294,7 +305,7 @@ export function PostCard({ detail, post: postRef }: { detail?: boolean; post: Vi
294
305
  size="sm"
295
306
  variant="outline"
296
307
  >
297
- Unlike
308
+ <fbt desc="Unlike button">Unlike</fbt>{' '}
298
309
  </Button>
299
310
  </Stack>
300
311
  </Stack>
@@ -302,7 +313,11 @@ export function PostCard({ detail, post: postRef }: { detail?: boolean; post: Vi
302
313
  <p className="text-sm text-muted-foreground">- {author?.name ?? 'Unknown author'}</p>
303
314
  <VStack gap={16}>
304
315
  <h4 className="text-base font-semibold text-foreground">
305
- {post.commentCount} {post.commentCount === 1 ? 'Comment' : 'Comments'}
316
+ <fbt desc="Comment headline">
317
+ <fbt:plural count={post.commentCount} many="Comments" showCount="ifMany">
318
+ One Comment
319
+ </fbt:plural>
320
+ </fbt>
306
321
  </h4>
307
322
  <Suspense fallback={null}>
308
323
  <PostComments comments={post.comments} post={post} />
@@ -1,5 +1,6 @@
1
1
  import safeParse from '@nkzw/core/safeParse.js';
2
2
  import Stack, { VStack } from '@nkzw/stack';
3
+ import { fbs } from 'fbtee';
3
4
  import { ChangeEvent, useActionState, useState } from 'react';
4
5
  import { useFateClient, useView, view, ViewRef } from 'react-fate';
5
6
  import { User } from '../fate/server.ts';
@@ -68,7 +69,7 @@ const UserNameForm = ({ user }: { user: SessionUser }) => {
68
69
  (error instanceof Error &&
69
70
  error.message &&
70
71
  safeParse<Array<{ message: string }>>(error.message)?.[0]?.message) ||
71
- 'Failed to update user name.',
72
+ fbs('Failed to update user name.', 'User name update error'),
72
73
  );
73
74
  }
74
75
  }, null);
@@ -80,9 +81,11 @@ const UserNameForm = ({ user }: { user: SessionUser }) => {
80
81
  return (
81
82
  <div>
82
83
  <VStack action={submitAction} as="form" gap={12}>
83
- <h3 className="font-semibold">Update Name</h3>
84
+ <h3 className="font-semibold">
85
+ <fbt desc="Headline for update name section">Update Name</fbt>
86
+ </h3>
84
87
  <label className="sr-only" htmlFor="header-username">
85
- Username
88
+ <fbt desc="Username label">Username</fbt>{' '}
86
89
  </label>
87
90
  <Input
88
91
  aria-describedby={error ? 'header-username-error' : undefined}
@@ -92,13 +95,13 @@ const UserNameForm = ({ user }: { user: SessionUser }) => {
92
95
  id="header-username"
93
96
  name="name"
94
97
  onChange={handleChange}
95
- placeholder="Name"
98
+ placeholder={fbs('Name', 'UserCard: placeholder')}
96
99
  title={error ?? undefined}
97
100
  value={name}
98
101
  />
99
102
  <div>
100
103
  <Button disabled={isSaveDisabled} size="sm" type="submit" variant="secondary">
101
- Save
104
+ <fbt desc="Button for saving">Save</fbt>{' '}
102
105
  </Button>
103
106
  </div>
104
107
  </VStack>
@@ -114,11 +117,15 @@ export default function UserCard({ viewer: viewerRef }: { viewer: ViewRef<'User'
114
117
  <Card>
115
118
  <VStack between className="h-full" gap={16}>
116
119
  <VStack gap={16}>
117
- <H2>Your account</H2>
120
+ <H2>
121
+ <fbt desc="Your account headline">Your account</fbt>
122
+ </H2>
118
123
  <Stack alignCenter between gap={16}>
119
124
  <p className="text-sm text-muted-foreground">
120
- Signed in as {viewer.name}
121
- {viewer.email ? ` <${viewer.email}>` : null}.
125
+ <fbt desc="Signed in user">
126
+ Signed in as <fbt:param name="name">{viewer.name}</fbt:param>
127
+ <fbt:param name="email">{viewer.email ? ` <${viewer.email}>` : ''}</fbt:param>.
128
+ </fbt>
122
129
  </p>
123
130
  </Stack>
124
131
  </VStack>