@tanstack/cta-engine 0.14.3 → 0.15.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 (343) hide show
  1. package/dist/add-ons.js +5 -91
  2. package/dist/add-to-app.js +171 -0
  3. package/dist/config-file.js +34 -11
  4. package/dist/constants.js +0 -2
  5. package/dist/create-app.js +142 -451
  6. package/dist/custom-add-ons/add-on.js +175 -0
  7. package/dist/custom-add-ons/shared.js +116 -0
  8. package/dist/custom-add-ons/starter.js +84 -0
  9. package/dist/environment.js +67 -44
  10. package/dist/file-helpers.js +165 -0
  11. package/dist/frameworks.js +92 -0
  12. package/dist/index.js +18 -1
  13. package/dist/integrations/git.js +4 -0
  14. package/dist/integrations/shadcn.js +33 -0
  15. package/dist/options.js +9 -333
  16. package/dist/package-json.js +48 -0
  17. package/dist/package-manager.js +51 -6
  18. package/dist/registry.js +56 -0
  19. package/dist/special-steps/index.js +24 -0
  20. package/dist/special-steps/rimraf-node-modules.js +16 -0
  21. package/dist/template-file.js +112 -0
  22. package/dist/types/add-ons.d.ts +3 -8
  23. package/dist/types/add-to-app.d.ts +17 -0
  24. package/dist/types/config-file.d.ts +7 -4
  25. package/dist/types/constants.d.ts +0 -3
  26. package/dist/types/create-app.d.ts +1 -7
  27. package/dist/types/custom-add-ons/add-on.d.ts +69 -0
  28. package/dist/types/custom-add-ons/shared.d.ts +15 -0
  29. package/dist/types/custom-add-ons/starter.d.ts +7 -0
  30. package/dist/types/environment.d.ts +2 -1
  31. package/dist/types/file-helpers.d.ts +15 -0
  32. package/dist/types/frameworks.d.ts +7 -0
  33. package/dist/types/index.d.ts +21 -1
  34. package/dist/types/integrations/git.d.ts +2 -0
  35. package/dist/types/integrations/shadcn.d.ts +2 -0
  36. package/dist/types/options.d.ts +2 -6
  37. package/dist/types/package-json.d.ts +7 -0
  38. package/dist/types/package-manager.d.ts +18 -1
  39. package/dist/types/registry.d.ts +25 -0
  40. package/dist/types/special-steps/index.d.ts +2 -0
  41. package/dist/types/special-steps/rimraf-node-modules.d.ts +2 -0
  42. package/dist/types/template-file.d.ts +2 -0
  43. package/dist/types/types.d.ts +788 -85
  44. package/dist/types/utils.d.ts +5 -0
  45. package/dist/types.js +65 -1
  46. package/dist/utils.js +9 -0
  47. package/package.json +9 -12
  48. package/src/add-ons.ts +7 -123
  49. package/src/add-to-app.ts +276 -0
  50. package/src/config-file.ts +51 -20
  51. package/src/constants.ts +0 -5
  52. package/src/create-app.ts +180 -730
  53. package/src/custom-add-ons/add-on.ts +261 -0
  54. package/src/custom-add-ons/shared.ts +160 -0
  55. package/src/custom-add-ons/starter.ts +126 -0
  56. package/src/environment.ts +80 -45
  57. package/src/file-helpers.ts +235 -0
  58. package/src/frameworks.ts +134 -0
  59. package/src/index.ts +85 -1
  60. package/src/integrations/git.ts +7 -0
  61. package/src/integrations/shadcn.ts +54 -0
  62. package/src/options.ts +8 -409
  63. package/src/package-json.ts +69 -0
  64. package/src/package-manager.ts +80 -9
  65. package/src/registry.ts +92 -0
  66. package/src/special-steps/index.ts +36 -0
  67. package/src/special-steps/rimraf-node-modules.ts +25 -0
  68. package/src/template-file.ts +150 -0
  69. package/src/types.ts +175 -87
  70. package/src/utils.ts +17 -0
  71. package/tests/add-ons.test.ts +67 -0
  72. package/tests/add-to-app.test.ts +358 -0
  73. package/tests/config-file.test.ts +105 -0
  74. package/tests/create-app.test.ts +120 -0
  75. package/tests/custom-add-ons/add-on.test.ts +12 -0
  76. package/tests/custom-add-ons/shared.test.ts +253 -0
  77. package/tests/custom-add-ons/starter.test.ts +58 -0
  78. package/tests/environment.test.ts +115 -0
  79. package/tests/file-helper.test.ts +90 -0
  80. package/tests/frameworks.test.ts +95 -0
  81. package/tests/index.test.ts +9 -0
  82. package/tests/integrations/git.test.ts +20 -0
  83. package/tests/integrations/shadcn.test.ts +91 -0
  84. package/tests/options.test.ts +42 -0
  85. package/tests/package-json.test.ts +63 -0
  86. package/tests/package-manager.test.ts +154 -0
  87. package/tests/setupVitest.ts +6 -0
  88. package/tests/template-file.test.ts +178 -0
  89. package/tests/utils.test.ts +23 -0
  90. package/vitest.config.ts +21 -0
  91. package/dist/add.js +0 -125
  92. package/dist/cli.js +0 -132
  93. package/dist/custom-add-on.js +0 -254
  94. package/dist/file-helper.js +0 -18
  95. package/dist/mcp.js +0 -229
  96. package/dist/templates.js +0 -6
  97. package/dist/toolchain.js +0 -6
  98. package/dist/types/add.d.ts +0 -3
  99. package/dist/types/cli.d.ts +0 -7
  100. package/dist/types/custom-add-on.d.ts +0 -3
  101. package/dist/types/file-helper.d.ts +0 -2
  102. package/dist/types/mcp.d.ts +0 -7
  103. package/dist/types/templates.d.ts +0 -1
  104. package/dist/types/toolchain.d.ts +0 -3
  105. package/src/add.ts +0 -186
  106. package/src/cli.ts +0 -210
  107. package/src/custom-add-on.ts +0 -325
  108. package/src/file-helper.ts +0 -20
  109. package/src/mcp.ts +0 -302
  110. package/src/templates.ts +0 -7
  111. package/src/toolchain.ts +0 -7
  112. package/templates/react/add-on/clerk/README.md +0 -3
  113. package/templates/react/add-on/clerk/assets/_dot_env.local.append +0 -2
  114. package/templates/react/add-on/clerk/assets/src/integrations/clerk/header-user.tsx +0 -19
  115. package/templates/react/add-on/clerk/assets/src/integrations/clerk/provider.tsx +0 -18
  116. package/templates/react/add-on/clerk/assets/src/routes/demo.clerk.tsx +0 -20
  117. package/templates/react/add-on/clerk/info.json +0 -13
  118. package/templates/react/add-on/clerk/package.json +0 -5
  119. package/templates/react/add-on/convex/README.md +0 -4
  120. package/templates/react/add-on/convex/assets/_dot_cursorrules.append +0 -93
  121. package/templates/react/add-on/convex/assets/_dot_env.local.append +0 -3
  122. package/templates/react/add-on/convex/assets/convex/products.ts +0 -8
  123. package/templates/react/add-on/convex/assets/convex/schema.ts +0 -10
  124. package/templates/react/add-on/convex/assets/src/integrations/convex/provider.tsx +0 -20
  125. package/templates/react/add-on/convex/assets/src/routes/demo.convex.tsx +0 -33
  126. package/templates/react/add-on/convex/info.json +0 -13
  127. package/templates/react/add-on/convex/package.json +0 -6
  128. package/templates/react/add-on/form/assets/src/components/demo.FormComponents.tsx.ejs +0 -300
  129. package/templates/react/add-on/form/assets/src/hooks/demo.form-context.ts +0 -4
  130. package/templates/react/add-on/form/assets/src/hooks/demo.form.ts +0 -22
  131. package/templates/react/add-on/form/assets/src/routes/demo.form.address.tsx.ejs +0 -213
  132. package/templates/react/add-on/form/assets/src/routes/demo.form.simple.tsx.ejs +0 -77
  133. package/templates/react/add-on/form/info.json +0 -26
  134. package/templates/react/add-on/form/package.json +0 -6
  135. package/templates/react/add-on/module-federation/assets/module-federation.config.js.ejs +0 -31
  136. package/templates/react/add-on/module-federation/assets/src/demo-mf-component.tsx +0 -3
  137. package/templates/react/add-on/module-federation/assets/src/demo-mf-self-contained.tsx +0 -11
  138. package/templates/react/add-on/module-federation/info.json +0 -7
  139. package/templates/react/add-on/module-federation/package.json +0 -5
  140. package/templates/react/add-on/netlify/README.md +0 -11
  141. package/templates/react/add-on/netlify/info.json +0 -7
  142. package/templates/react/add-on/sentry/assets/_dot_cursorrules.append +0 -22
  143. package/templates/react/add-on/sentry/assets/_dot_env.local.append +0 -11
  144. package/templates/react/add-on/sentry/assets/src/app/global-middleware.ts +0 -11
  145. package/templates/react/add-on/sentry/assets/src/routes/demo.sentry.testing.tsx +0 -489
  146. package/templates/react/add-on/sentry/info.json +0 -14
  147. package/templates/react/add-on/sentry/package.json +0 -5
  148. package/templates/react/add-on/shadcn/README.md +0 -7
  149. package/templates/react/add-on/shadcn/assets/_dot_cursorrules.append +0 -7
  150. package/templates/react/add-on/shadcn/assets/components.json +0 -21
  151. package/templates/react/add-on/shadcn/assets/src/lib/utils.ts +0 -6
  152. package/templates/react/add-on/shadcn/assets/src/styles.css +0 -138
  153. package/templates/react/add-on/shadcn/info.json +0 -7
  154. package/templates/react/add-on/shadcn/package.json +0 -9
  155. package/templates/react/add-on/start/assets/_dot_gitignore.append +0 -2
  156. package/templates/react/add-on/start/assets/app.config.ts.ejs +0 -32
  157. package/templates/react/add-on/start/assets/src/api.ts +0 -6
  158. package/templates/react/add-on/start/assets/src/client.tsx.ejs +0 -33
  159. package/templates/react/add-on/start/assets/src/router.tsx.ejs +0 -48
  160. package/templates/react/add-on/start/assets/src/routes/api.demo-names.ts +0 -11
  161. package/templates/react/add-on/start/assets/src/routes/demo.start.api-request.tsx.ejs +0 -33
  162. package/templates/react/add-on/start/assets/src/routes/demo.start.server-funcs.tsx +0 -50
  163. package/templates/react/add-on/start/assets/src/ssr.tsx.ejs +0 -30
  164. package/templates/react/add-on/start/info.json +0 -18
  165. package/templates/react/add-on/start/package.json +0 -13
  166. package/templates/react/add-on/store/assets/src/lib/demo-store.ts +0 -13
  167. package/templates/react/add-on/store/assets/src/routes/demo.store.tsx.ejs +0 -75
  168. package/templates/react/add-on/store/info.json +0 -13
  169. package/templates/react/add-on/store/package.json +0 -6
  170. package/templates/react/add-on/t3env/README.md +0 -16
  171. package/templates/react/add-on/t3env/assets/src/env.ts +0 -39
  172. package/templates/react/add-on/t3env/info.json +0 -10
  173. package/templates/react/add-on/t3env/package.json +0 -6
  174. package/templates/react/add-on/tRPC/assets/src/integrations/trpc/init.ts +0 -9
  175. package/templates/react/add-on/tRPC/assets/src/integrations/trpc/react.ts +0 -4
  176. package/templates/react/add-on/tRPC/assets/src/integrations/trpc/router.ts +0 -18
  177. package/templates/react/add-on/tRPC/assets/src/routes/api.trpc.$.tsx +0 -16
  178. package/templates/react/add-on/tRPC/info.json +0 -9
  179. package/templates/react/add-on/tRPC/package.json +0 -9
  180. package/templates/react/add-on/table/assets/src/data/demo-table-data.ts +0 -50
  181. package/templates/react/add-on/table/assets/src/routes/demo.table.tsx.ejs +0 -373
  182. package/templates/react/add-on/table/info.json +0 -13
  183. package/templates/react/add-on/table/package.json +0 -7
  184. package/templates/react/add-on/tanstack-query/assets/src/integrations/tanstack-query/layout.tsx +0 -5
  185. package/templates/react/add-on/tanstack-query/assets/src/integrations/tanstack-query/root-provider.tsx.ejs +0 -70
  186. package/templates/react/add-on/tanstack-query/assets/src/routes/demo.tanstack-query.tsx.ejs +0 -53
  187. package/templates/react/add-on/tanstack-query/info.json +0 -13
  188. package/templates/react/add-on/tanstack-query/package.json +0 -6
  189. package/templates/react/base/README.md.ejs +0 -558
  190. package/templates/react/base/_dot_gitignore +0 -5
  191. package/templates/react/base/_dot_vscode/settings.biome.json +0 -38
  192. package/templates/react/base/_dot_vscode/settings.json +0 -11
  193. package/templates/react/base/index.html.ejs +0 -20
  194. package/templates/react/base/package.biome.json +0 -10
  195. package/templates/react/base/package.eslintprettier.json +0 -11
  196. package/templates/react/base/package.json +0 -30
  197. package/templates/react/base/package.ts.json +0 -7
  198. package/templates/react/base/package.tw.json +0 -6
  199. package/templates/react/base/public/favicon.ico +0 -0
  200. package/templates/react/base/public/logo192.png +0 -0
  201. package/templates/react/base/public/logo512.png +0 -0
  202. package/templates/react/base/public/manifest.json +0 -25
  203. package/templates/react/base/public/robots.txt +0 -3
  204. package/templates/react/base/src/App.css +0 -38
  205. package/templates/react/base/src/App.test.tsx.ejs +0 -10
  206. package/templates/react/base/src/App.tsx.ejs +0 -74
  207. package/templates/react/base/src/components/Header.tsx.ejs +0 -27
  208. package/templates/react/base/src/logo.svg +0 -44
  209. package/templates/react/base/src/reportWebVitals.ts.ejs +0 -28
  210. package/templates/react/base/src/styles.css.ejs +0 -15
  211. package/templates/react/base/toolchain/.prettierignore +0 -3
  212. package/templates/react/base/toolchain/biome.json +0 -31
  213. package/templates/react/base/toolchain/eslint.config.js +0 -5
  214. package/templates/react/base/toolchain/prettier.config.js +0 -10
  215. package/templates/react/base/tsconfig.json.ejs +0 -29
  216. package/templates/react/base/vite.config.js.ejs +0 -23
  217. package/templates/react/code-router/src/main.tsx.ejs +0 -92
  218. package/templates/react/example/tanchat/README.md +0 -37
  219. package/templates/react/example/tanchat/assets/_dot_env.local.append +0 -2
  220. package/templates/react/example/tanchat/assets/public/example-guitar-flowers.jpg +0 -0
  221. package/templates/react/example/tanchat/assets/public/example-guitar-motherboard.jpg +0 -0
  222. package/templates/react/example/tanchat/assets/public/example-guitar-racing.jpg +0 -0
  223. package/templates/react/example/tanchat/assets/public/example-guitar-steamer-trunk.jpg +0 -0
  224. package/templates/react/example/tanchat/assets/public/example-guitar-superhero.jpg +0 -0
  225. package/templates/react/example/tanchat/assets/public/example-guitar-traveling.jpg +0 -0
  226. package/templates/react/example/tanchat/assets/public/example-guitar-video-games.jpg +0 -0
  227. package/templates/react/example/tanchat/assets/src/components/example-AIAssistant.tsx +0 -173
  228. package/templates/react/example/tanchat/assets/src/components/example-GuitarRecommendation.tsx +0 -47
  229. package/templates/react/example/tanchat/assets/src/data/example-guitars.ts +0 -83
  230. package/templates/react/example/tanchat/assets/src/demo.index.css +0 -220
  231. package/templates/react/example/tanchat/assets/src/integrations/tanchat/header-user.tsx +0 -5
  232. package/templates/react/example/tanchat/assets/src/routes/api.messages.ts +0 -24
  233. package/templates/react/example/tanchat/assets/src/routes/api.sse.ts +0 -23
  234. package/templates/react/example/tanchat/assets/src/routes/example.chat.tsx +0 -159
  235. package/templates/react/example/tanchat/assets/src/routes/example.guitars/$guitarId.tsx +0 -50
  236. package/templates/react/example/tanchat/assets/src/routes/example.guitars/index.tsx +0 -54
  237. package/templates/react/example/tanchat/assets/src/store/example-assistant.ts +0 -3
  238. package/templates/react/example/tanchat/assets/src/utils/demo.ai.ts +0 -62
  239. package/templates/react/example/tanchat/assets/src/utils/demo.sse.ts +0 -31
  240. package/templates/react/example/tanchat/assets/src/utils/demo.tools.ts +0 -47
  241. package/templates/react/example/tanchat/info.json +0 -19
  242. package/templates/react/example/tanchat/package.json +0 -16
  243. package/templates/react/file-router/package.fr.json +0 -5
  244. package/templates/react/file-router/src/main.tsx.ejs +0 -55
  245. package/templates/react/file-router/src/routes/__root.tsx.ejs +0 -82
  246. package/templates/solid/add-on/form/assets/src/routes/demo.form.tsx.ejs +0 -352
  247. package/templates/solid/add-on/form/info.json +0 -13
  248. package/templates/solid/add-on/form/package.json +0 -5
  249. package/templates/solid/add-on/module-federation/assets/module-federation.config.js.ejs +0 -27
  250. package/templates/solid/add-on/module-federation/assets/src/demo-mf-component.tsx +0 -3
  251. package/templates/solid/add-on/module-federation/assets/src/demo-mf-self-contained.tsx +0 -9
  252. package/templates/solid/add-on/module-federation/info.json +0 -7
  253. package/templates/solid/add-on/module-federation/package.json +0 -5
  254. package/templates/solid/add-on/sentry/assets/_dot_cursorrules.append +0 -22
  255. package/templates/solid/add-on/sentry/assets/_dot_env.local.append +0 -2
  256. package/templates/solid/add-on/sentry/assets/src/routes/demo.sentry.bad-event-handler.tsx +0 -20
  257. package/templates/solid/add-on/sentry/info.json +0 -13
  258. package/templates/solid/add-on/sentry/package.json +0 -5
  259. package/templates/solid/add-on/solid-ui/README.md +0 -9
  260. package/templates/solid/add-on/solid-ui/assets/src/lib/utils.ts +0 -6
  261. package/templates/solid/add-on/solid-ui/assets/src/styles.css +0 -138
  262. package/templates/solid/add-on/solid-ui/assets/ui.config.json +0 -13
  263. package/templates/solid/add-on/solid-ui/info.json +0 -11
  264. package/templates/solid/add-on/solid-ui/package.json +0 -9
  265. package/templates/solid/add-on/start/assets/app.config.ts +0 -16
  266. package/templates/solid/add-on/start/assets/src/api.ts +0 -6
  267. package/templates/solid/add-on/start/assets/src/client.tsx +0 -7
  268. package/templates/solid/add-on/start/assets/src/router.tsx.ejs +0 -24
  269. package/templates/solid/add-on/start/assets/src/routes/demo.start.server-funcs.tsx +0 -49
  270. package/templates/solid/add-on/start/assets/src/ssr.tsx +0 -12
  271. package/templates/solid/add-on/start/info.json +0 -14
  272. package/templates/solid/add-on/start/package.json +0 -12
  273. package/templates/solid/add-on/store/assets/src/lib/demo-store.ts +0 -13
  274. package/templates/solid/add-on/store/assets/src/routes/demo.store.tsx.ejs +0 -77
  275. package/templates/solid/add-on/store/info.json +0 -13
  276. package/templates/solid/add-on/store/package.json +0 -6
  277. package/templates/solid/add-on/t3env/README.md +0 -16
  278. package/templates/solid/add-on/t3env/assets/src/env.ts +0 -39
  279. package/templates/solid/add-on/t3env/info.json +0 -10
  280. package/templates/solid/add-on/t3env/package.json +0 -6
  281. package/templates/solid/add-on/tanstack-query/assets/src/integrations/tanstack-query/header-user.tsx +0 -5
  282. package/templates/solid/add-on/tanstack-query/assets/src/integrations/tanstack-query/provider.tsx +0 -15
  283. package/templates/solid/add-on/tanstack-query/assets/src/routes/demo.tanstack-query.tsx +0 -30
  284. package/templates/solid/add-on/tanstack-query/info.json +0 -13
  285. package/templates/solid/add-on/tanstack-query/package.json +0 -6
  286. package/templates/solid/base/README.md.ejs +0 -215
  287. package/templates/solid/base/_dot_cursorrules.append +0 -35
  288. package/templates/solid/base/_dot_gitignore +0 -5
  289. package/templates/solid/base/_dot_vscode/settings.biome.json +0 -38
  290. package/templates/solid/base/_dot_vscode/settings.json +0 -11
  291. package/templates/solid/base/index.html.ejs +0 -20
  292. package/templates/solid/base/package.biome.json +0 -10
  293. package/templates/solid/base/package.eslintprettier.json +0 -11
  294. package/templates/solid/base/package.json +0 -23
  295. package/templates/solid/base/package.ts.json +0 -5
  296. package/templates/solid/base/package.tw.json +0 -6
  297. package/templates/solid/base/public/favicon.ico +0 -0
  298. package/templates/solid/base/public/logo192.png +0 -0
  299. package/templates/solid/base/public/logo512.png +0 -0
  300. package/templates/solid/base/public/manifest.json +0 -25
  301. package/templates/solid/base/public/robots.txt +0 -3
  302. package/templates/solid/base/src/App.css +0 -0
  303. package/templates/solid/base/src/App.tsx.ejs +0 -47
  304. package/templates/solid/base/src/components/Header.tsx.ejs +0 -26
  305. package/templates/solid/base/src/logo.svg +0 -120
  306. package/templates/solid/base/src/styles.css.ejs +0 -15
  307. package/templates/solid/base/toolchain/.prettierignore +0 -3
  308. package/templates/solid/base/toolchain/biome.json +0 -31
  309. package/templates/solid/base/toolchain/eslint.config.js +0 -5
  310. package/templates/solid/base/toolchain/prettier.config.js +0 -10
  311. package/templates/solid/base/tsconfig.json.ejs +0 -31
  312. package/templates/solid/base/vite.config.js.ejs +0 -22
  313. package/templates/solid/code-router/src/main.tsx.ejs +0 -71
  314. package/templates/solid/example/tanchat/README.md +0 -52
  315. package/templates/solid/example/tanchat/assets/ai-streaming-server/README.md +0 -110
  316. package/templates/solid/example/tanchat/assets/ai-streaming-server/_dot_env.example +0 -1
  317. package/templates/solid/example/tanchat/assets/ai-streaming-server/package.json +0 -26
  318. package/templates/solid/example/tanchat/assets/ai-streaming-server/src/index.ts +0 -102
  319. package/templates/solid/example/tanchat/assets/ai-streaming-server/tsconfig.json +0 -15
  320. package/templates/solid/example/tanchat/assets/src/components/demo.SettingsDialog.tsx +0 -149
  321. package/templates/solid/example/tanchat/assets/src/demo.index.css +0 -227
  322. package/templates/solid/example/tanchat/assets/src/lib/demo-store.ts +0 -13
  323. package/templates/solid/example/tanchat/assets/src/routes/example.chat.tsx +0 -435
  324. package/templates/solid/example/tanchat/assets/src/store/demo.hooks.ts +0 -17
  325. package/templates/solid/example/tanchat/assets/src/store/demo.store.ts +0 -133
  326. package/templates/solid/example/tanchat/info.json +0 -14
  327. package/templates/solid/example/tanchat/package.json +0 -7
  328. package/templates/solid/file-router/package.fr.json +0 -5
  329. package/templates/solid/file-router/src/main.tsx.ejs +0 -47
  330. package/templates/solid/file-router/src/routes/__root.tsx.ejs +0 -41
  331. package/templates/solid/file-router/src/routes/index.tsx +0 -43
  332. package/tests/cra.test.ts +0 -293
  333. package/tests/snapshots/cra/cr-js-npm.json +0 -33
  334. package/tests/snapshots/cra/cr-ts-npm.json +0 -34
  335. package/tests/snapshots/cra/cr-ts-start-npm.json +0 -38
  336. package/tests/snapshots/cra/fr-ts-npm.json +0 -34
  337. package/tests/snapshots/cra/fr-ts-tw-npm.json +0 -33
  338. package/tests/snapshots/cra/solid-cr-js-npm.json +0 -31
  339. package/tests/snapshots/cra/solid-cr-ts-npm.json +0 -32
  340. package/tests/snapshots/cra/solid-cr-ts-start-npm.json +0 -36
  341. package/tests/snapshots/cra/solid-fr-ts-npm.json +0 -33
  342. package/tests/snapshots/cra/solid-fr-ts-tw-npm.json +0 -32
  343. package/tests/test-utilities.ts +0 -87
@@ -1,138 +0,0 @@
1
- @import 'tailwindcss';
2
-
3
- @plugin "tailwindcss-animate";
4
-
5
- @custom-variant dark (&:is(.dark *));
6
-
7
- body {
8
- @apply m-0;
9
- font-family:
10
- -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu',
11
- 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
12
- -webkit-font-smoothing: antialiased;
13
- -moz-osx-font-smoothing: grayscale;
14
- }
15
-
16
- code {
17
- font-family:
18
- source-code-pro, Menlo, Monaco, Consolas, 'Courier New', monospace;
19
- }
20
-
21
- :root {
22
- --background: oklch(1 0 0);
23
- --foreground: oklch(0.141 0.005 285.823);
24
- --card: oklch(1 0 0);
25
- --card-foreground: oklch(0.141 0.005 285.823);
26
- --popover: oklch(1 0 0);
27
- --popover-foreground: oklch(0.141 0.005 285.823);
28
- --primary: oklch(0.21 0.006 285.885);
29
- --primary-foreground: oklch(0.985 0 0);
30
- --secondary: oklch(0.967 0.001 286.375);
31
- --secondary-foreground: oklch(0.21 0.006 285.885);
32
- --muted: oklch(0.967 0.001 286.375);
33
- --muted-foreground: oklch(0.552 0.016 285.938);
34
- --accent: oklch(0.967 0.001 286.375);
35
- --accent-foreground: oklch(0.21 0.006 285.885);
36
- --destructive: oklch(0.577 0.245 27.325);
37
- --destructive-foreground: oklch(0.577 0.245 27.325);
38
- --border: oklch(0.92 0.004 286.32);
39
- --input: oklch(0.92 0.004 286.32);
40
- --ring: oklch(0.871 0.006 286.286);
41
- --chart-1: oklch(0.646 0.222 41.116);
42
- --chart-2: oklch(0.6 0.118 184.704);
43
- --chart-3: oklch(0.398 0.07 227.392);
44
- --chart-4: oklch(0.828 0.189 84.429);
45
- --chart-5: oklch(0.769 0.188 70.08);
46
- --radius: 0.625rem;
47
- --sidebar: oklch(0.985 0 0);
48
- --sidebar-foreground: oklch(0.141 0.005 285.823);
49
- --sidebar-primary: oklch(0.21 0.006 285.885);
50
- --sidebar-primary-foreground: oklch(0.985 0 0);
51
- --sidebar-accent: oklch(0.967 0.001 286.375);
52
- --sidebar-accent-foreground: oklch(0.21 0.006 285.885);
53
- --sidebar-border: oklch(0.92 0.004 286.32);
54
- --sidebar-ring: oklch(0.871 0.006 286.286);
55
- }
56
-
57
- .dark {
58
- --background: oklch(0.141 0.005 285.823);
59
- --foreground: oklch(0.985 0 0);
60
- --card: oklch(0.141 0.005 285.823);
61
- --card-foreground: oklch(0.985 0 0);
62
- --popover: oklch(0.141 0.005 285.823);
63
- --popover-foreground: oklch(0.985 0 0);
64
- --primary: oklch(0.985 0 0);
65
- --primary-foreground: oklch(0.21 0.006 285.885);
66
- --secondary: oklch(0.274 0.006 286.033);
67
- --secondary-foreground: oklch(0.985 0 0);
68
- --muted: oklch(0.274 0.006 286.033);
69
- --muted-foreground: oklch(0.705 0.015 286.067);
70
- --accent: oklch(0.274 0.006 286.033);
71
- --accent-foreground: oklch(0.985 0 0);
72
- --destructive: oklch(0.396 0.141 25.723);
73
- --destructive-foreground: oklch(0.637 0.237 25.331);
74
- --border: oklch(0.274 0.006 286.033);
75
- --input: oklch(0.274 0.006 286.033);
76
- --ring: oklch(0.442 0.017 285.786);
77
- --chart-1: oklch(0.488 0.243 264.376);
78
- --chart-2: oklch(0.696 0.17 162.48);
79
- --chart-3: oklch(0.769 0.188 70.08);
80
- --chart-4: oklch(0.627 0.265 303.9);
81
- --chart-5: oklch(0.645 0.246 16.439);
82
- --sidebar: oklch(0.21 0.006 285.885);
83
- --sidebar-foreground: oklch(0.985 0 0);
84
- --sidebar-primary: oklch(0.488 0.243 264.376);
85
- --sidebar-primary-foreground: oklch(0.985 0 0);
86
- --sidebar-accent: oklch(0.274 0.006 286.033);
87
- --sidebar-accent-foreground: oklch(0.985 0 0);
88
- --sidebar-border: oklch(0.274 0.006 286.033);
89
- --sidebar-ring: oklch(0.442 0.017 285.786);
90
- }
91
-
92
- @theme inline {
93
- --color-background: var(--background);
94
- --color-foreground: var(--foreground);
95
- --color-card: var(--card);
96
- --color-card-foreground: var(--card-foreground);
97
- --color-popover: var(--popover);
98
- --color-popover-foreground: var(--popover-foreground);
99
- --color-primary: var(--primary);
100
- --color-primary-foreground: var(--primary-foreground);
101
- --color-secondary: var(--secondary);
102
- --color-secondary-foreground: var(--secondary-foreground);
103
- --color-muted: var(--muted);
104
- --color-muted-foreground: var(--muted-foreground);
105
- --color-accent: var(--accent);
106
- --color-accent-foreground: var(--accent-foreground);
107
- --color-destructive: var(--destructive);
108
- --color-destructive-foreground: var(--destructive-foreground);
109
- --color-border: var(--border);
110
- --color-input: var(--input);
111
- --color-ring: var(--ring);
112
- --color-chart-1: var(--chart-1);
113
- --color-chart-2: var(--chart-2);
114
- --color-chart-3: var(--chart-3);
115
- --color-chart-4: var(--chart-4);
116
- --color-chart-5: var(--chart-5);
117
- --radius-sm: calc(var(--radius) - 4px);
118
- --radius-md: calc(var(--radius) - 2px);
119
- --radius-lg: var(--radius);
120
- --radius-xl: calc(var(--radius) + 4px);
121
- --color-sidebar: var(--sidebar);
122
- --color-sidebar-foreground: var(--sidebar-foreground);
123
- --color-sidebar-primary: var(--sidebar-primary);
124
- --color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
125
- --color-sidebar-accent: var(--sidebar-accent);
126
- --color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
127
- --color-sidebar-border: var(--sidebar-border);
128
- --color-sidebar-ring: var(--sidebar-ring);
129
- }
130
-
131
- @layer base {
132
- * {
133
- @apply border-border outline-ring/50;
134
- }
135
- body {
136
- @apply bg-background text-foreground;
137
- }
138
- }
@@ -1,7 +0,0 @@
1
- {
2
- "name": "Shadcn",
3
- "description": "Add Shadcn UI to your application.",
4
- "phase": "add-on",
5
- "templates": ["file-router", "code-router"],
6
- "link": "https://ui.shadcn.com/"
7
- }
@@ -1,9 +0,0 @@
1
- {
2
- "dependencies": {
3
- "class-variance-authority": "^0.7.1",
4
- "clsx": "^2.1.1",
5
- "lucide-react": "^0.476.0",
6
- "tailwind-merge": "^3.0.2",
7
- "tailwindcss-animate": "^1.0.7"
8
- }
9
- }
@@ -1,2 +0,0 @@
1
- .output
2
- .vinxi
@@ -1,32 +0,0 @@
1
- import { defineConfig } from '@tanstack/react-start/config'
2
- import viteTsConfigPaths from 'vite-tsconfig-paths'<% if (tailwind) { %>
3
- import tailwindcss from "@tailwindcss/vite"
4
- <% } %><% if (addOnEnabled['sentry']) { %>
5
- import { wrapVinxiConfigWithSentry } from "@sentry/tanstackstart-react";
6
- <% } %>
7
- const config = defineConfig({
8
- tsr: {
9
- appDirectory: 'src',
10
- },
11
- vite: {
12
- plugins: [
13
- // this is the plugin that enables path aliases
14
- viteTsConfigPaths({
15
- projects: ['./tsconfig.json'],
16
- }),
17
- <% if (tailwind) { %>tailwindcss(),<% } %>
18
- ],
19
- },
20
- })
21
-
22
- <% if (addOnEnabled['sentry']) { %>
23
- export default wrapVinxiConfigWithSentry(config, {
24
- org: process.env.VITE_SENTRY_ORG,
25
- project: process.env.VITE_SENTRY_PROJECT,
26
- authToken: process.env.SENTRY_AUTH_TOKEN,
27
- // Only print logs for uploading source maps in CI
28
- // Set to `true` to suppress logs
29
- silent: !process.env.CI,
30
- });<% } else { %>
31
- export default config
32
- <% } %>
@@ -1,6 +0,0 @@
1
- import {
2
- createStartAPIHandler,
3
- defaultAPIFileRouteHandler,
4
- } from '@tanstack/react-start/api'
5
-
6
- export default createStartAPIHandler(defaultAPIFileRouteHandler)
@@ -1,33 +0,0 @@
1
- import { hydrateRoot } from 'react-dom/client'
2
- import { StartClient } from '@tanstack/react-start'
3
- <% if (addOnEnabled['sentry']) { %>
4
- import * as Sentry from "@sentry/tanstackstart-react";
5
- <% } %>
6
- import { createRouter } from './router'
7
-
8
- const router = createRouter()
9
-
10
- <% if (addOnEnabled['sentry']) { %>
11
- Sentry.init({
12
- dsn: import.meta.env.VITE_SENTRY_DSN,
13
- integrations: [
14
- Sentry.tanstackRouterBrowserTracingIntegration(router),
15
- Sentry.replayIntegration({
16
- maskAllText: false,
17
- blockAllMedia: false,
18
- }),
19
- ],
20
- // Set tracesSampleRate to 1.0 to capture 100%
21
- // of transactions for tracing.
22
- // We recommend adjusting this value in production.
23
- // Learn more at https://docs.sentry.io/platforms/javascript/configuration/options/#traces-sample-rate
24
- tracesSampleRate: 1.0,
25
- // Capture Replay for 10% of all sessions,
26
- // plus for 100% of sessions with an error.
27
- // Learn more at https://docs.sentry.io/platforms/javascript/session-replay/configuration/#general-integration-configuration
28
- replaysSessionSampleRate: 0.1,
29
- replaysOnErrorSampleRate: 1.0,
30
- });
31
- <% } %>
32
-
33
- hydrateRoot(document, <StartClient router={router} />)
@@ -1,48 +0,0 @@
1
- import { createRouter as createTanstackRouter } from '@tanstack/react-router'<% if (addOnEnabled['tanstack-query']) { %>
2
- import { routerWithQueryClient } from '@tanstack/react-router-with-query'
3
- import * as TanstackQuery from './integrations/tanstack-query/root-provider'
4
- <% } %>
5
-
6
- // Import the generated route tree
7
- import { routeTree } from './routeTree.gen'
8
-
9
- import './styles.css'
10
-
11
- // Create a new router instance
12
- export const createRouter = () => {
13
- <% if (addOnEnabled['tanstack-query']) { %>
14
- const router = routerWithQueryClient(createTanstackRouter({
15
- routeTree,
16
- context: {
17
- <% if (addOnEnabled['tanstack-query']) { %>
18
- ...TanstackQuery.getContext(),
19
- <% } %>
20
- },
21
- scrollRestoration: true,
22
- defaultPreloadStaleTime: 0,
23
- <% if (addOnEnabled.tRPC) { %>
24
- Wrap: (props: { children: React.ReactNode }) => {
25
- return (
26
- <TanstackQuery.Provider>
27
- {props.children}
28
- </TanstackQuery.Provider>
29
- );
30
- },
31
- <% } %>
32
- }), TanstackQuery.getContext().queryClient)
33
- <% } else { %>
34
- const router = createTanstackRouter({
35
- routeTree,
36
- scrollRestoration: true,
37
- defaultPreloadStaleTime: 0,
38
- })
39
- <% } %>
40
- return router
41
- }
42
-
43
- // Register the router instance for type safety
44
- declare module '@tanstack/react-router' {
45
- interface Register {
46
- router: ReturnType<typeof createRouter>
47
- }
48
- }
@@ -1,11 +0,0 @@
1
- import { createAPIFileRoute } from '@tanstack/react-start/api'
2
-
3
- export const APIRoute = createAPIFileRoute('/demo/start/api/names')({
4
- GET: async ({ request }) => {
5
- return new Response(JSON.stringify(['Alice', 'Bob', 'Charlie']), {
6
- headers: {
7
- 'Content-Type': 'application/json',
8
- },
9
- })
10
- },
11
- })
@@ -1,33 +0,0 @@
1
- <% if (addOnEnabled['react-query']) { %>
2
- import { useQuery } from '@tanstack/react-query'
3
- <% } else { %>
4
- import { useEffect, useState } from 'react'
5
- <% } %>
6
- import { createFileRoute } from '@tanstack/react-router'
7
-
8
- function getNames() {
9
- return fetch('/api/demo-names').then((res) => res.json())
10
- }
11
-
12
- export const Route = createFileRoute('/demo/start/api-request')({
13
- component: Home,
14
- })
15
-
16
- function Home() {
17
- <% if (addOnEnabled['react-query']) { %>
18
- const { data: names = [] } = useQuery({
19
- queryKey: ['names'],
20
- queryFn: getNames,
21
- })
22
- <% } else { %>
23
- const [names, setNames] = useState<Array<string>>([])
24
- useEffect(() => {
25
- getNames().then(setNames)
26
- }, [])
27
- <% } %>
28
- return (
29
- <div className="p-4">
30
- <div>{names.join(', ')}</div>
31
- </div>
32
- )
33
- }
@@ -1,50 +0,0 @@
1
- import * as fs from 'node:fs'
2
- import { createFileRoute, useRouter } from '@tanstack/react-router'
3
- import { createServerFn } from '@tanstack/react-start'
4
-
5
- const filePath = 'count.txt'
6
-
7
- async function readCount() {
8
- return parseInt(
9
- await fs.promises.readFile(filePath, 'utf-8').catch(() => '0'),
10
- )
11
- }
12
-
13
- const getCount = createServerFn({
14
- method: 'GET',
15
- }).handler(() => {
16
- return readCount()
17
- })
18
-
19
- const updateCount = createServerFn({ method: 'POST' })
20
- .validator((d: number) => d)
21
- .handler(async ({ data }) => {
22
- const count = await readCount()
23
- await fs.promises.writeFile(filePath, `${count + data}`)
24
- })
25
-
26
- export const Route = createFileRoute('/demo/start/server-funcs')({
27
- component: Home,
28
- loader: async () => await getCount(),
29
- })
30
-
31
- function Home() {
32
- const router = useRouter()
33
- const state = Route.useLoaderData()
34
-
35
- return (
36
- <div className="p-4">
37
- <button
38
- type="button"
39
- onClick={() => {
40
- updateCount({ data: 1 }).then(() => {
41
- router.invalidate()
42
- })
43
- }}
44
- className="bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded"
45
- >
46
- Add 1 to {state}?
47
- </button>
48
- </div>
49
- )
50
- }
@@ -1,30 +0,0 @@
1
- import {
2
- createStartHandler,
3
- defaultStreamHandler,
4
- } from '@tanstack/react-start/server'
5
- import { getRouterManifest } from '@tanstack/react-start/router-manifest'
6
-
7
- import { createRouter } from './router'
8
-
9
- <% if (addOnEnabled['sentry']) { %>
10
- import * as Sentry from "@sentry/tanstackstart-react";
11
- Sentry.init({
12
- dsn: process.env.VITE_SENTRY_DSN,
13
- // Set tracesSampleRate to 1.0 to capture 100%
14
- // of transactions for tracing.
15
- // We recommend adjusting this value in production
16
- // Learn more at
17
- // https://docs.sentry.io/platforms/javascript/configuration/options/#traces-sample-rate
18
- tracesSampleRate: 1.0,
19
- });
20
- <% } %>
21
-
22
- let streamHandler = defaultStreamHandler
23
- <% if (addOnEnabled['sentry']) { %>
24
- streamHandler = Sentry.wrapStreamHandlerWithSentry(defaultStreamHandler)
25
- <% } %>
26
-
27
- export default createStartHandler({
28
- createRouter,
29
- getRouterManifest,
30
- })(streamHandler)
@@ -1,18 +0,0 @@
1
- {
2
- "name": "Start",
3
- "phase": "setup",
4
- "description": "Add TanStack Start for SSR, API endpoints, and more.",
5
- "link": "https://tanstack.com/start/latest",
6
- "templates": ["file-router"],
7
- "warning": "TanStack Start is not yet at 1.0 and may change significantly or not be compatible with other add-ons.",
8
- "routes": [
9
- {
10
- "url": "/demo/start/server-funcs",
11
- "name": "Start - Server Functions"
12
- },
13
- {
14
- "url": "/demo/start/api-request",
15
- "name": "Start - API Request"
16
- }
17
- ]
18
- }
@@ -1,13 +0,0 @@
1
- {
2
- "scripts": {
3
- "dev": "vinxi dev",
4
- "build": "vinxi build",
5
- "start": "vinxi start"
6
- },
7
- "dependencies": {
8
- "@tanstack/react-router-with-query": "^1.114.3",
9
- "@tanstack/react-start": "^1.114.3",
10
- "vinxi": "^0.5.3",
11
- "vite-tsconfig-paths": "^5.1.4"
12
- }
13
- }
@@ -1,13 +0,0 @@
1
- import { Derived, Store } from '@tanstack/store'
2
-
3
- export const store = new Store({
4
- firstName: 'Jane',
5
- lastName: 'Smith',
6
- })
7
-
8
- export const fullName = new Derived({
9
- fn: () => `${store.state.firstName} ${store.state.lastName}`,
10
- deps: [store],
11
- })
12
-
13
- fullName.mount()
@@ -1,75 +0,0 @@
1
- import { <% if (fileRouter) { %>createFileRoute<% } else { %>createRoute<% } %> } from '@tanstack/react-router'
2
- import { useStore } from '@tanstack/react-store'
3
-
4
- import { fullName, store } from '../lib/demo-store'
5
- <% if (codeRouter) { %>
6
- import type { RootRoute } from '@tanstack/react-router'
7
- <% } else { %>
8
- export const Route = createFileRoute('/demo/store')({
9
- component: DemoStore,
10
- })
11
- <% } %>
12
-
13
- function FirstName() {
14
- const firstName = useStore(store, (state) => state.firstName)
15
- return (
16
- <input
17
- type="text"
18
- value={firstName}
19
- onChange={(e) =>
20
- store.setState((state) => ({ ...state, firstName: e.target.value }))
21
- }
22
- className="bg-white/10 rounded-lg px-4 py-2 outline-none border border-white/20 hover:border-white/40 focus:border-white/60 transition-colors duration-200 placeholder-white/40"
23
- />
24
- )
25
- }
26
-
27
- function LastName() {
28
- const lastName = useStore(store, (state) => state.lastName)
29
- return (
30
- <input
31
- type="text"
32
- value={lastName}
33
- onChange={(e) =>
34
- store.setState((state) => ({ ...state, lastName: e.target.value }))
35
- }
36
- className="bg-white/10 rounded-lg px-4 py-2 outline-none border border-white/20 hover:border-white/40 focus:border-white/60 transition-colors duration-200 placeholder-white/40"
37
- />
38
- )
39
- }
40
-
41
- function FullName() {
42
- const fName = useStore(fullName)
43
- return (
44
- <div className="bg-white/10 rounded-lg px-4 py-2 outline-none ">
45
- {fName}
46
- </div>
47
- )
48
- }
49
-
50
- function DemoStore() {
51
- return (
52
- <div
53
- className="min-h-[calc(100vh-32px)] text-white p-8 flex items-center justify-center w-full h-full"
54
- style={{
55
- backgroundImage:
56
- 'radial-gradient(50% 50% at 80% 80%, #f4a460 0%, #8b4513 70%, #1a0f0a 100%)',
57
- }}
58
- >
59
- <div className="bg-white/10 backdrop-blur-lg rounded-xl p-8 shadow-lg flex flex-col gap-4 text-3xl min-w-1/2">
60
- <h1 className="text-4xl font-bold mb-5">Store Example</h1>
61
- <FirstName />
62
- <LastName />
63
- <FullName />
64
- </div>
65
- </div>
66
- )
67
- }
68
-
69
- <% if (codeRouter) { %>
70
- export default (parentRoute: RootRoute) => createRoute({
71
- path: '/demo/store',
72
- component: DemoStore,
73
- getParentRoute: () => parentRoute,
74
- })
75
- <% } %>
@@ -1,13 +0,0 @@
1
- {
2
- "name": "Store",
3
- "description": "Add TanStack Store to your application.",
4
- "phase": "add-on",
5
- "link": "https://tanstack.com/store/latest",
6
- "templates": ["file-router", "code-router"],
7
- "routes": [
8
- {
9
- "url": "/demo/store",
10
- "name": "Store"
11
- }
12
- ]
13
- }
@@ -1,6 +0,0 @@
1
- {
2
- "dependencies": {
3
- "@tanstack/store": "^0.7.0",
4
- "@tanstack/react-store": "^0.7.0"
5
- }
6
- }
@@ -1,16 +0,0 @@
1
- ## T3Env
2
-
3
- - You can use T3Env to add type safety to your environment variables.
4
- - Add Environment variables to the `src/env.mjs` file.
5
- - Use the environment variables in your code.
6
-
7
- ### Usage
8
-
9
- ```ts
10
- import { env } from "@/env";
11
-
12
- console.log(env.VITE_APP_TITLE);
13
- ```
14
-
15
-
16
-
@@ -1,39 +0,0 @@
1
- import { createEnv } from "@t3-oss/env-core";
2
- import { z } from "zod";
3
-
4
- export const env = createEnv({
5
- server: {
6
- SERVER_URL: z.string().url().optional(),
7
- },
8
-
9
- /**
10
- * The prefix that client-side variables must have. This is enforced both at
11
- * a type-level and at runtime.
12
- */
13
- clientPrefix: "VITE_",
14
-
15
- client: {
16
- VITE_APP_TITLE: z.string().min(1).optional(),
17
- },
18
-
19
- /**
20
- * What object holds the environment variables at runtime. This is usually
21
- * `process.env` or `import.meta.env`.
22
- */
23
- runtimeEnv: import.meta.env,
24
-
25
- /**
26
- * By default, this library will feed the environment variables directly to
27
- * the Zod validator.
28
- *
29
- * This means that if you have an empty string for a value that is supposed
30
- * to be a number (e.g. `PORT=` in a ".env" file), Zod will incorrectly flag
31
- * it as a type mismatch violation. Additionally, if you have an empty string
32
- * for a value that is supposed to be a string with a default value (e.g.
33
- * `DOMAIN=` in an ".env" file), the default value will never be applied.
34
- *
35
- * In order to solve these issues, we recommend that all new projects
36
- * explicitly specify this option as true.
37
- */
38
- emptyStringAsUndefined: true,
39
- });
@@ -1,10 +0,0 @@
1
- {
2
- "name": "T3Env",
3
- "description": "Add type safety to your environment variables",
4
- "phase": "add-on",
5
- "link": "https://github.com/t3-oss/t3-env",
6
- "templates": [
7
- "file-router",
8
- "code-router"
9
- ]
10
- }
@@ -1,6 +0,0 @@
1
- {
2
- "dependencies": {
3
- "zod": "^3.24.2",
4
- "@t3-oss/env-core": "^0.12.0"
5
- }
6
- }
@@ -1,9 +0,0 @@
1
- import { initTRPC } from "@trpc/server";
2
- import superjson from "superjson";
3
-
4
- const t = initTRPC.create({
5
- transformer: superjson,
6
- });
7
-
8
- export const createTRPCRouter = t.router;
9
- export const publicProcedure = t.procedure;
@@ -1,4 +0,0 @@
1
- import { createTRPCContext } from "@trpc/tanstack-react-query";
2
- import type { TRPCRouter } from "@/integrations/trpc/router";
3
-
4
- export const { TRPCProvider, useTRPC } = createTRPCContext<TRPCRouter>();
@@ -1,18 +0,0 @@
1
- import { TRPCError } from '@trpc/server'
2
- import type { TRPCRouterRecord } from '@trpc/server'
3
- // import { z } from 'zod'
4
-
5
- import { createTRPCRouter, publicProcedure } from './init'
6
-
7
- const peopleRouter = {
8
- list: publicProcedure.query(async () =>
9
- fetch('https://swapi.dev/api/people')
10
- .then((res) => res.json())
11
- .then((d) => d.results as { name: string }[]),
12
- ),
13
- } satisfies TRPCRouterRecord
14
-
15
- export const trpcRouter = createTRPCRouter({
16
- people: peopleRouter,
17
- })
18
- export type TRPCRouter = typeof trpcRouter