@tanstack/cta-engine 0.14.3 → 0.14.4

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,9 +0,0 @@
1
- {
2
- "dependencies": {
3
- "@fontsource/inter": "^5.1.1",
4
- "class-variance-authority": "^0.7.1",
5
- "clsx": "^2.1.1",
6
- "tailwind-merge": "^3.0.2",
7
- "tailwindcss-animate": "^1.0.7"
8
- }
9
- }
@@ -1,16 +0,0 @@
1
- import { defineConfig } from '@tanstack/solid-start/config'
2
- import viteTsConfigPaths from 'vite-tsconfig-paths'
3
-
4
- export default defineConfig({
5
- tsr: {
6
- appDirectory: 'src',
7
- },
8
- vite: {
9
- plugins: [
10
- // this is the plugin that enables path aliases
11
- viteTsConfigPaths({
12
- projects: ['./tsconfig.json'],
13
- }),
14
- ],
15
- },
16
- })
@@ -1,6 +0,0 @@
1
- import {
2
- createStartAPIHandler,
3
- defaultAPIFileRouteHandler,
4
- } from '@tanstack/solid-start/api'
5
-
6
- export default createStartAPIHandler(defaultAPIFileRouteHandler)
@@ -1,7 +0,0 @@
1
- import { hydrate } from 'solid-js/web'
2
- import { StartClient } from '@tanstack/solid-start'
3
- import { createRouter } from './router'
4
-
5
- const router = createRouter()
6
-
7
- hydrate(() => <StartClient router={router} />, document.body)
@@ -1,24 +0,0 @@
1
- import { createRouter as createTanstackRouter } from '@tanstack/solid-router'
2
-
3
- // Import the generated route tree
4
- import { routeTree } from './routeTree.gen'
5
-
6
- import './styles.css'
7
-
8
- // Create a new router instance
9
- export const createRouter = () => {
10
- const router = createTanstackRouter({
11
- routeTree,
12
- scrollRestoration: true,
13
- })
14
- return router
15
- }
16
-
17
- const router = createRouter()
18
-
19
- // Register the router instance for type safety
20
- declare module '@tanstack/solid-router' {
21
- interface Register {
22
- router: typeof router
23
- }
24
- }
@@ -1,49 +0,0 @@
1
- import * as fs from 'fs'
2
- import { createFileRoute, useRouter } from '@tanstack/solid-router'
3
- import { createServerFn } from '@tanstack/solid-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 class="p-4">
37
- <button
38
- onClick={() => {
39
- updateCount({ data: 1 }).then(() => {
40
- router.invalidate()
41
- })
42
- }}
43
- claclassssName="bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded"
44
- >
45
- Add 1 to {state}?
46
- </button>
47
- </div>
48
- )
49
- }
@@ -1,12 +0,0 @@
1
- import {
2
- createStartHandler,
3
- defaultStreamHandler,
4
- } from '@tanstack/solid-start/server'
5
- import { getRouterManifest } from '@tanstack/solid-start/router-manifest'
6
-
7
- import { createRouter } from './router'
8
-
9
- export default createStartHandler({
10
- createRouter,
11
- getRouterManifest,
12
- })(defaultStreamHandler)
@@ -1,14 +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
- }
@@ -1,12 +0,0 @@
1
- {
2
- "scripts": {
3
- "dev": "vinxi dev",
4
- "build": "vinxi build",
5
- "start": "vinxi start"
6
- },
7
- "dependencies": {
8
- "@tanstack/solid-start": "^1.114.3",
9
- "vinxi": "^0.5.3",
10
- "vite-tsconfig-paths": "^5.1.4"
11
- }
12
- }
@@ -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,77 +0,0 @@
1
- import { <% if (fileRouter) { %>createFileRoute<% } else { %>createRoute<% } %> } from '@tanstack/solid-router'
2
- import { useStore } from '@tanstack/solid-store'
3
-
4
- import { fullName, store } from '../lib/demo-store'
5
-
6
- <% if (codeRouter) { %>
7
- import type { RootRoute } from '@tanstack/solid-router'
8
- <% } else { %>
9
- export const Route = createFileRoute('/demo/store')({
10
- component: DemoStore,
11
- })
12
- <% } %>
13
-
14
- function FirstName() {
15
- const firstName = useStore(store, (state) => state.firstName)
16
- return (
17
- <input
18
- type="text"
19
- value={firstName()}
20
- onInput={(e) =>
21
- store.setState((state) => ({ ...state, firstName: e.target.value }))
22
- }
23
- class="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"
24
- />
25
- )
26
- }
27
-
28
- function LastName() {
29
- const lastName = useStore(store, (state) => state.lastName)
30
- return (
31
- <input
32
- type="text"
33
- value={lastName()}
34
- onInput={(e) =>
35
- store.setState((state) => ({ ...state, lastName: e.target.value }))
36
- }
37
- class="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"
38
- />
39
- )
40
- }
41
-
42
- function FullName() {
43
- const fName = useStore(fullName)
44
- return (
45
- <div class="bg-white/10 rounded-lg px-4 py-2 outline-none ">
46
- {fName}
47
- </div>
48
- )
49
- }
50
-
51
- function DemoStore() {
52
- return (
53
- <div
54
- class="min-h-[calc(100vh-32px)] text-white p-8 flex items-center justify-center w-full h-full"
55
- style={{
56
- 'background-image':
57
- 'radial-gradient(50% 50% at 80% 80%, #f4a460 0%, #8b4513 70%, #1a0f0a 100%)',
58
- }}
59
- >
60
- <div class="bg-white/10 backdrop-blur-lg rounded-xl p-8 shadow-lg flex flex-col gap-4 text-3xl min-w-1/2">
61
- <h1 class="text-4xl font-bold mb-5">Store Example</h1>
62
- <FirstName />
63
- <LastName />
64
- <FullName />
65
- </div>
66
- </div>
67
- )
68
- }
69
-
70
- <% if (codeRouter) { %>
71
- export default (parentRoute: RootRoute) => createRoute({
72
- path: '/demo/store',
73
- component: DemoStore,
74
- getParentRoute: () => parentRoute,
75
- })
76
- <% } %>
77
-
@@ -1,13 +0,0 @@
1
- {
2
- "name": "Store",
3
- "description": "Add TanStack Store to your application.",
4
- "phase": "add-on",
5
- "templates": ["file-router", "code-router"],
6
- "link": "https://tanstack.com/store/latest",
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/solid-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,5 +0,0 @@
1
- import { SolidQueryDevtools } from '@tanstack/solid-query-devtools'
2
-
3
- export default function AppTanstackQueryHeaderUser() {
4
- return <SolidQueryDevtools buttonPosition="bottom-right" />
5
- }
@@ -1,15 +0,0 @@
1
- import { QueryClient, QueryClientProvider } from '@tanstack/solid-query'
2
-
3
- import type { JSX } from 'solid-js'
4
-
5
- const queryClient = new QueryClient()
6
-
7
- export default function AppTanstackQueryProvider(props: {
8
- children: JSX.Element
9
- }) {
10
- return (
11
- <QueryClientProvider client={queryClient}>
12
- {props.children}
13
- </QueryClientProvider>
14
- )
15
- }
@@ -1,30 +0,0 @@
1
- import { createFileRoute } from '@tanstack/solid-router'
2
- import { createQuery } from '@tanstack/solid-query'
3
-
4
- export const Route = createFileRoute('/demo/tanstack-query')({
5
- component: App,
6
- })
7
-
8
- function App() {
9
- const peopleQuery = createQuery(() => ({
10
- queryKey: ['people'],
11
- queryFn: () =>
12
- fetch('https://swapi.dev/api/people')
13
- .then((res) => res.json())
14
- .then((data) => data.results as Array<{ name: string }>),
15
- initialData: [],
16
- }))
17
-
18
- return (
19
- <div class="p-4">
20
- <h1 class="text-2xl mb-4">People list from Swapi</h1>
21
- <ul>
22
- {peopleQuery.data.map((person) => (
23
- <li>{person.name}</li>
24
- ))}
25
- </ul>
26
- </div>
27
- )
28
- }
29
-
30
- export default App
@@ -1,13 +0,0 @@
1
- {
2
- "name": "TanStack Query",
3
- "description": "Integrate TanStack Query into your application.",
4
- "phase": "add-on",
5
- "templates": ["file-router"],
6
- "link": "https://tanstack.com/query/latest",
7
- "routes": [
8
- {
9
- "url": "/demo/tanstack-query",
10
- "name": "TanStack Query"
11
- }
12
- ]
13
- }
@@ -1,6 +0,0 @@
1
- {
2
- "dependencies": {
3
- "@tanstack/solid-query": "^5.66.0",
4
- "@tanstack/solid-query-devtools": "^5.66.0"
5
- }
6
- }
@@ -1,215 +0,0 @@
1
- Welcome to your new TanStack app!
2
-
3
- # Getting Started
4
-
5
- To run this application:
6
-
7
- ```bash
8
- <%= packageManager %> install
9
- <%= getPackageManagerRunScript('start') %>
10
- ```
11
-
12
- # Building For Production
13
-
14
- To build this application for production:
15
-
16
- ```bash
17
- <%= getPackageManagerRunScript('build') %>
18
- ```
19
-
20
- ## Styling
21
-
22
- This project uses [Tailwind CSS](https://tailwindcss.com/) for styling.
23
-
24
- <% for(const addon of addOns.filter(addon => addon.readme)) { %>
25
- <%- addon.readme %>
26
- <% } %>
27
-
28
- ## Routing
29
- <% if (fileRouter) { %>This project uses [TanStack Router](https://tanstack.com/router). The initial setup is a file based router. Which means that the routes are managed as fiels in `src/routes`.<% } else { %>This project uses [TanStack Router](https://tanstack.com/router). The initial setup is a code based router. Which means that the routes are defined in code (in the `./src/main.<%= jsx %>` file). If you like you can also use a file based routing setup by following the [File Based Routing](https://tanstack.com/router/latest/docs/framework/solid/guide/file-based-routing) guide.<% } %>
30
-
31
- ### Adding A Route
32
- <% if (fileRouter) { %>
33
- To add a new route to your application just add another a new file in the `./src/routes` directory.
34
-
35
- TanStack will automatically generate the content of the route file for you.
36
- <% } else { %>
37
- To add a new route to your application just add another `createRoute` call to the `./src/main.<%= jsx %>` file. The example below adds a new `/about`route to the root route.
38
-
39
- ```tsx
40
- const aboutRoute = createRoute({
41
- getParentRoute: () => rootRoute,
42
- path: "/about",
43
- component: () => <h1>About</h1>,
44
- });
45
- ```
46
-
47
- You will also need to add the route to the `routeTree` in the `./src/main.<%= jsx %>` file.
48
-
49
- ```tsx
50
- const routeTree = rootRoute.addChildren([indexRoute, aboutRoute]);
51
- ```
52
-
53
- With this set up you should be able to navigate to `/about` and see the about page.
54
-
55
- Of course you don't need to implement the About page in the `main.<%= jsx %>` file. You can create that component in another file and import it into the `main.<%= jsx %>` file, then use it in the `component` property of the `createRoute` call, like so:
56
-
57
- ```tsx
58
- import About from "./components/About.<%= jsx %>";
59
-
60
- const aboutRoute = createRoute({
61
- getParentRoute: () => rootRoute,
62
- path: "/about",
63
- component: About,
64
- });
65
- ```
66
-
67
- That is how we have the `App` component set up with the home page.
68
-
69
- For more information on the options you have when you are creating code based routes check out the [Code Based Routing](https://tanstack.com/router/latest/docs/framework/solid/guide/code-based-routing) documentation.
70
- <% } %>
71
- Now that you have two routes you can use a `Link` component to navigate between them.
72
-
73
- ### Adding Links
74
-
75
- To use SPA (Single Page Application) navigation you will need to import the `Link` component from `@tanstack/solid-router`.
76
-
77
- ```tsx
78
- import { Link } from "@tanstack/solid-router";
79
- ```
80
-
81
- Then anywhere in your JSX you can use it like so:
82
-
83
- ```tsx
84
- <Link to="/about">About</Link>
85
- ```
86
-
87
- This will create a link that will navigate to the `/about` route.
88
-
89
- More information on the `Link` component can be found in the [Link documentation](https://tanstack.com/router/v1/docs/framework/solid/api/router/linkComponent).
90
-
91
- ### Using A Layout
92
-
93
- <% if (codeRouter) { %>
94
- Layouts can be used to wrap the contents of the routes in menus, headers, footers, etc.
95
-
96
- There is already a layout in the `src/main.<%= jsx %>` file:
97
-
98
- ```tsx
99
- const rootRoute = createRootRoute({
100
- component: () => (
101
- <>
102
- <Outlet />
103
- <TanStackRouterDevtools />
104
- </>
105
- ),
106
- });
107
- ```
108
-
109
- You can use the Soliid component specified in the `component` property of the `rootRoute` to wrap the contents of the routes. The `<Outlet />` component is used to render the current route within the body of the layout. For example you could add a header to the layout like so:
110
-
111
- ```tsx
112
- import { Link } from "@tanstack/solid-router";
113
-
114
- const rootRoute = createRootRoute({
115
- component: () => (
116
- <>
117
- <header>
118
- <nav>
119
- <Link to="/">Home</Link>
120
- <Link to="/about">About</Link>
121
- </nav>
122
- </header>
123
- <Outlet />
124
- <TanStackRouterDevtools />
125
- </>
126
- ),
127
- });
128
- ```
129
- <% } else { %>In the File Based Routing setup the layout is located in `src/routes/__root.tsx`. Anything you add to the root route will appear in all the routes. The route content will appear in the JSX where you use the `<Outlet />` component.
130
-
131
- Here is an example layout that includes a header:
132
-
133
- ```tsx
134
- import { Outlet, createRootRoute } from '@tanstack/solid-router'
135
- import { TanStackRouterDevtools } from '@tanstack/solid-router-devtools'
136
-
137
- import { Link } from "@tanstack/solid-router";
138
-
139
- export const Route = createRootRoute({
140
- component: () => (
141
- <>
142
- <header>
143
- <nav>
144
- <Link to="/">Home</Link>
145
- <Link to="/about">About</Link>
146
- </nav>
147
- </header>
148
- <Outlet />
149
- <TanStackRouterDevtools />
150
- </>
151
- ),
152
- })
153
- ```
154
- <% } %>
155
- The `<TanStackRouterDevtools />` component is not required so you can remove it if you don't want it in your layout.
156
-
157
- More information on layouts can be found in the [Layouts documentation](https://tanstack.com/router/latest/docs/framework/solid/guide/routing-concepts#layouts).
158
-
159
- ## Data Fetching
160
-
161
- There are multiple ways to fetch data in your application. You can use TanStack Query to fetch data from a server. But you can also use the `loader` functionality built into TanStack Router to load the data for a route before it's rendered.
162
-
163
- For example:
164
-
165
- ```tsx
166
- const peopleRoute = createRoute({
167
- getParentRoute: () => rootRoute,
168
- path: "/people",
169
- loader: async () => {
170
- const response = await fetch("https://swapi.dev/api/people");<% if (typescript) { %>
171
- return response.json() as Promise<{
172
- results: {
173
- name: string;
174
- }[];
175
- }>;
176
- <% } else { %>
177
- return response.json();
178
- <% } %> },
179
- component: () => {
180
- const data = peopleRoute.useLoaderData();
181
- return (
182
- <ul>
183
- {data.results.map((person) => (
184
- <li key={person.name}>{person.name}</li>
185
- ))}
186
- </ul>
187
- );
188
- },
189
- });
190
- ```
191
-
192
- Loaders simplify your data fetching logic dramatically. Check out more information in the [Loader documentation](https://tanstack.com/router/latest/docs/framework/solid/guide/data-loading#loader-parameters).
193
-
194
- # Demo files
195
-
196
- Files prefixed with `demo` can be safely deleted. They are there to provide a starting point for you to play around with the features you've installed.
197
-
198
- <% if (toolchain && toolchain !== 'none') { %>
199
- ## Linting & Formatting
200
- <% if (toolchain === 'biome') { %>
201
- This project uses [Biome](https://biomejs.dev/) for linting and formatting. The following scripts are available:
202
- <% } %>
203
- <% if (toolchain === 'eslint+prettier') { %>
204
- This project uses [eslint](https://eslint.org/) and [prettier](https://prettier.io/) for linting and formatting. Eslint is configured using [tanstack/eslint-config](https://tanstack.com/config/latest/docs/eslint). The following scripts are available:
205
- <% } %>
206
- ```bash
207
- <%= getPackageManagerRunScript('lint') %>
208
- <%= getPackageManagerRunScript('format') %>
209
- <%= getPackageManagerRunScript('check') %>
210
- ```
211
- <% } %>
212
-
213
- # Learn More
214
-
215
- You can learn more about all of the offerings from TanStack in the [TanStack documentation](https://tanstack.com).