@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,41 +0,0 @@
1
- import { Outlet, createRootRouteWithContext } from '@tanstack/solid-router'
2
- import { TanStackRouterDevtools } from '@tanstack/solid-router-devtools'<% for(const integration of integrations.filter(i => i.type === 'layout' || i.type === 'provider')) { %>
3
- import <%= integration.name %> from "../<%= integration.path %>";
4
- <% } %>
5
- <% if (addOnEnabled['solid-ui']) { %>
6
- import "@fontsource/inter"
7
- <% } %>
8
- <% if (addOns.length) { %>import Header from '../components/Header'
9
- <% } %>
10
- <% for(const addOn of addOns) {
11
- for(const init of addOn.main?.initialize || []) { %>
12
- <%- init %>
13
- <% } } %>
14
-
15
- export const Route = createRootRouteWithContext()({
16
- component: RootComponent,
17
- })
18
-
19
- function RootComponent() {
20
- return (
21
- <>
22
- <% for(const integration of integrations.filter(i => i.type === 'provider')) { %>
23
- <<%= integration.name %>>
24
- <% } %>
25
-
26
- <% if (addOns.length) { %>
27
- <Header />
28
- <% } %>
29
- <Outlet />
30
- {/* <TanStackRouterDevtools /> */}
31
-
32
- <% for(const integration of integrations.filter(i => i.type === 'layout')) { %>
33
- <<%= integration.name %> />
34
- <% } %>
35
-
36
- <% for(const integration of integrations.filter(i => i.type === 'provider').reverse()) { %>
37
- </<%= integration.name %>>
38
- <% } %>
39
- </>
40
- )
41
- }
@@ -1,43 +0,0 @@
1
- import * as Solid from 'solid-js'
2
- import { createFileRoute } from '@tanstack/solid-router'
3
-
4
- import Header from '../components/Header'
5
- import logo from '../logo.svg'
6
-
7
- export const Route = createFileRoute('/')({
8
- component: IndexComponent,
9
- })
10
-
11
- function IndexComponent() {
12
- return (
13
- <div class="text-center">
14
- <Header />
15
- <header class="min-h-screen flex flex-col items-center justify-center bg-[#282c34] text-white text-[calc(10px+2vmin)]">
16
- <img
17
- src={logo}
18
- class="h-[40vmin] pointer-events-none animate-[spin_20s_linear_infinite]"
19
- alt="logo"
20
- />
21
- <p>
22
- Edit <code>src/routes/index.tsx</code> and save to reload.
23
- </p>
24
- <a
25
- class="text-[#61dafb] hover:underline"
26
- href="https://solidjs.com"
27
- target="_blank"
28
- rel="noopener noreferrer"
29
- >
30
- Learn Solid
31
- </a>
32
- <a
33
- class="text-[#61dafb] hover:underline"
34
- href="https://tanstack.com"
35
- target="_blank"
36
- rel="noopener noreferrer"
37
- >
38
- Learn TanStack
39
- </a>
40
- </header>
41
- </div>
42
- )
43
- }
package/tests/cra.test.ts DELETED
@@ -1,293 +0,0 @@
1
- import { describe, expect, test } from 'vitest'
2
-
3
- import { createApp } from '../src/create-app.js'
4
- import { finalizeAddOns } from '../src/add-ons.js';
5
- import { cleanupOutput, createTestEnvironment } from './test-utilities.js'
6
-
7
- describe('React Templates', () => {
8
- test('code router in javascript on npm', async () => {
9
- const projectName = 'TEST'
10
- const { environment, output } = createTestEnvironment(projectName)
11
- await createApp(
12
- {
13
- addOns: false,
14
- framework: 'react',
15
- chosenAddOns: [],
16
- git: true,
17
- mode: 'code-router',
18
- packageManager: 'npm',
19
- projectName,
20
- tailwind: false,
21
- toolchain: 'none',
22
- typescript: false,
23
- variableValues: {},
24
- },
25
- {
26
- silent: true,
27
- environment,
28
- },
29
- )
30
- cleanupOutput(output)
31
- await expect(JSON.stringify(output, null, 2)).toMatchFileSnapshot(
32
- './snapshots/cra/cr-js-npm.json',
33
- )
34
- })
35
-
36
- test('code router in typescript on npm', async () => {
37
- const projectName = 'TEST'
38
- const { environment, output } = createTestEnvironment(projectName)
39
- await createApp(
40
- {
41
- addOns: false,
42
- framework: 'react',
43
- chosenAddOns: [],
44
- git: true,
45
- mode: 'code-router',
46
- packageManager: 'npm',
47
- projectName,
48
- tailwind: false,
49
- toolchain: 'none',
50
- typescript: true,
51
- variableValues: {},
52
- },
53
- {
54
- silent: true,
55
- environment,
56
- },
57
- )
58
- cleanupOutput(output)
59
- await expect(JSON.stringify(output, null, 2)).toMatchFileSnapshot(
60
- './snapshots/cra/cr-ts-npm.json',
61
- )
62
- })
63
-
64
- test('file router on npm', async () => {
65
- const projectName = 'TEST'
66
- const { environment, output } = createTestEnvironment(projectName)
67
- await createApp(
68
- {
69
- addOns: false,
70
- framework: 'react',
71
- chosenAddOns: [],
72
- git: true,
73
- mode: 'file-router',
74
- packageManager: 'npm',
75
- projectName,
76
- tailwind: false,
77
- toolchain: 'none',
78
- typescript: true,
79
- variableValues: {},
80
- },
81
- {
82
- silent: true,
83
- environment,
84
- },
85
- )
86
- cleanupOutput(output)
87
- await expect(JSON.stringify(output, null, 2)).toMatchFileSnapshot(
88
- './snapshots/cra/fr-ts-npm.json',
89
- )
90
- })
91
-
92
- test('file router with tailwind on npm', async () => {
93
- const projectName = 'TEST'
94
- const { environment, output } = createTestEnvironment(projectName)
95
- await createApp(
96
- {
97
- addOns: false,
98
- framework: 'react',
99
- chosenAddOns: [],
100
- git: true,
101
- mode: 'file-router',
102
- packageManager: 'npm',
103
- projectName,
104
- tailwind: true,
105
- toolchain: 'none',
106
- typescript: true,
107
- variableValues: {},
108
- },
109
- {
110
- silent: true,
111
- environment,
112
- },
113
- )
114
- cleanupOutput(output)
115
- await expect(JSON.stringify(output, null, 2)).toMatchFileSnapshot(
116
- './snapshots/cra/fr-ts-tw-npm.json',
117
- )
118
- })
119
-
120
- test('file router with add-on start on npm', async () => {
121
- const projectName = 'TEST';
122
- const framework = 'react'
123
- const template = 'file-router'
124
- const { environment, output } = createTestEnvironment(projectName);
125
- await createApp(
126
- {
127
- addOns: true,
128
- framework,
129
- chosenAddOns: await finalizeAddOns(framework, template, ['start']),
130
- git: true,
131
- mode: template,
132
- packageManager: 'npm',
133
- projectName,
134
- tailwind: true,
135
- toolchain: 'none',
136
- typescript: true,
137
- variableValues: {},
138
- },
139
- {
140
- silent: true,
141
- environment,
142
- },
143
- );
144
- cleanupOutput(output);
145
- await expect(JSON.stringify(output, null, 2)).toMatchFileSnapshot(
146
- './snapshots/cra/cr-ts-start-npm.json',
147
- );
148
- });
149
- })
150
-
151
- describe('Solid Templates', () => {
152
- test('code router in javascript on npm', async () => {
153
- const projectName = 'TEST'
154
- const { environment, output } = createTestEnvironment(projectName)
155
- await createApp(
156
- {
157
- addOns: false,
158
- framework: 'solid',
159
- chosenAddOns: [],
160
- git: true,
161
- mode: 'code-router',
162
- packageManager: 'npm',
163
- projectName,
164
- tailwind: false,
165
- toolchain: 'none',
166
- typescript: false,
167
- variableValues: {},
168
- },
169
- {
170
- silent: true,
171
- environment,
172
- },
173
- )
174
- cleanupOutput(output)
175
- await expect(JSON.stringify(output, null, 2)).toMatchFileSnapshot(
176
- './snapshots/cra/solid-cr-js-npm.json',
177
- )
178
- })
179
-
180
- test('code router in typescript on npm', async () => {
181
- const projectName = 'TEST'
182
- const { environment, output } = createTestEnvironment(projectName)
183
- await createApp(
184
- {
185
- addOns: false,
186
- framework: 'solid',
187
- chosenAddOns: [],
188
- git: true,
189
- mode: 'code-router',
190
- packageManager: 'npm',
191
- projectName,
192
- tailwind: false,
193
- toolchain: 'none',
194
- typescript: true,
195
- variableValues: {},
196
- },
197
- {
198
- silent: true,
199
- environment,
200
- },
201
- )
202
- cleanupOutput(output)
203
- await expect(JSON.stringify(output, null, 2)).toMatchFileSnapshot(
204
- './snapshots/cra/solid-cr-ts-npm.json',
205
- )
206
- })
207
-
208
- test('file router on npm', async () => {
209
- const projectName = 'TEST'
210
- const { environment, output } = createTestEnvironment(projectName)
211
- await createApp(
212
- {
213
- addOns: false,
214
- framework: 'solid',
215
- chosenAddOns: [],
216
- git: true,
217
- mode: 'file-router',
218
- packageManager: 'npm',
219
- projectName,
220
- tailwind: false,
221
- toolchain: 'none',
222
- typescript: true,
223
- variableValues: {},
224
- },
225
- {
226
- silent: true,
227
- environment,
228
- },
229
- )
230
- cleanupOutput(output)
231
- await expect(JSON.stringify(output, null, 2)).toMatchFileSnapshot(
232
- './snapshots/cra/solid-fr-ts-npm.json',
233
- )
234
- })
235
-
236
- test('file router with tailwind on npm', async () => {
237
- const projectName = 'TEST'
238
- const { environment, output } = createTestEnvironment(projectName)
239
- await createApp(
240
- {
241
- addOns: false,
242
- framework: 'solid',
243
- chosenAddOns: [],
244
- git: true,
245
- mode: 'file-router',
246
- packageManager: 'npm',
247
- projectName,
248
- tailwind: true,
249
- toolchain: 'none',
250
- typescript: true,
251
- variableValues: {},
252
- },
253
- {
254
- silent: true,
255
- environment,
256
- },
257
- )
258
- cleanupOutput(output)
259
- await expect(JSON.stringify(output, null, 2)).toMatchFileSnapshot(
260
- './snapshots/cra/solid-fr-ts-tw-npm.json',
261
- )
262
- })
263
-
264
- test('file router with add-on start on npm', async () => {
265
- const projectName = 'TEST';
266
- const framework = 'solid';
267
- const template = 'file-router';
268
- const { environment, output } = createTestEnvironment(projectName);
269
- await createApp(
270
- {
271
- addOns: true,
272
- framework,
273
- chosenAddOns: await finalizeAddOns(framework, template, ['start']),
274
- git: true,
275
- mode: template,
276
- packageManager: 'npm',
277
- projectName,
278
- tailwind: true,
279
- toolchain: 'none',
280
- typescript: true,
281
- variableValues: {},
282
- },
283
- {
284
- silent: true,
285
- environment,
286
- },
287
- );
288
- cleanupOutput(output);
289
- await expect(JSON.stringify(output, null, 2)).toMatchFileSnapshot(
290
- './snapshots/cra/solid-cr-ts-start-npm.json',
291
- );
292
- });
293
- })
@@ -1,33 +0,0 @@
1
- {
2
- "files": {
3
- ".cta.json": "{\n \"framework\": \"react\",\n \"git\": true,\n \"mode\": \"code-router\",\n \"packageManager\": \"npm\",\n \"projectName\": \"TEST\",\n \"tailwind\": false,\n \"toolchain\": \"none\",\n \"typescript\": false,\n \"variableValues\": {},\n \"version\": 1,\n \"existingAddOns\": []\n}",
4
- ".gitignore": "node_modules\n.DS_Store\ndist\ndist-ssr\n*.local\n",
5
- "/.vscode/settings.json": "{\n \"files.watcherExclude\": {\n \"**/routeTree.gen.ts\": true\n },\n \"search.exclude\": {\n \"**/routeTree.gen.ts\": true\n },\n \"files.readonlyInclude\": {\n \"**/routeTree.gen.ts\": true\n }\n}\n",
6
- "/public/manifest.json": "{\n \"short_name\": \"TanStack App\",\n \"name\": \"Create TanStack App Sample\",\n \"icons\": [\n {\n \"src\": \"favicon.ico\",\n \"sizes\": \"64x64 32x32 24x24 16x16\",\n \"type\": \"image/x-icon\"\n },\n {\n \"src\": \"logo192.png\",\n \"type\": \"image/png\",\n \"sizes\": \"192x192\"\n },\n {\n \"src\": \"logo512.png\",\n \"type\": \"image/png\",\n \"sizes\": \"512x512\"\n }\n ],\n \"start_url\": \".\",\n \"display\": \"standalone\",\n \"theme_color\": \"#000000\",\n \"background_color\": \"#ffffff\"\n}\n",
7
- "/public/robots.txt": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n",
8
- "/src/App.css": ".App {\n text-align: center;\n}\n\n.App-logo {\n height: 40vmin;\n pointer-events: none;\n}\n\n@media (prefers-reduced-motion: no-preference) {\n .App-logo {\n animation: App-logo-spin infinite 20s linear;\n }\n}\n\n.App-header {\n background-color: #282c34;\n min-height: 100vh;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n font-size: calc(10px + 2vmin);\n color: white;\n}\n\n.App-link {\n color: #61dafb;\n}\n\n@keyframes App-logo-spin {\n from {\n transform: rotate(0deg);\n }\n to {\n transform: rotate(360deg);\n }\n}\n",
9
- "/src/App.jsx": "import logo from \"./logo.svg\";\nimport \"./App.css\";\n\n\nfunction App() {\n return (\n <div className=\"App\">\n <header className=\"App-header\">\n <img src={logo} className=\"App-logo\" alt=\"logo\" />\n <p>\n Edit <code>src/App.jsx</code> and save to reload.\n </p>\n <a\n className=\"App-link\"\n href=\"https://reactjs.org\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n Learn React\n </a>\n <a\n className=\"App-link\"\n href=\"https://tanstack.com\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n Learn TanStack\n </a>\n </header>\n </div>\n );\n}\n\n\nexport default App;\n\n",
10
- "/src/App.test.jsx": "import { describe, expect, test } from \"vitest\";\nimport { render, screen } from \"@testing-library/react\";\nimport App from \"./App.jsx\";\n\ndescribe(\"App\", () => {\n test(\"renders\", () => {\n render(<App />);\n expect(screen.getByText(\"Learn React\")).toBeDefined();\n });\n});\n",
11
- "/src/main.jsx": "import { StrictMode } from \"react\";\nimport ReactDOM from \"react-dom/client\";\nimport {\n Outlet,\n RouterProvider,\n createRootRoute,\n createRoute,\n createRouter,\n} from \"@tanstack/react-router\";\nimport { TanStackRouterDevtools } from \"@tanstack/react-router-devtools\";\n\n\nimport \"./styles.css\";\nimport reportWebVitals from \"./reportWebVitals.js\";\n\nimport App from \"./App.jsx\";\n\nconst rootRoute = createRootRoute({\n component: () => (\n <>\n \n \n <Outlet />\n <TanStackRouterDevtools />\n \n \n </>\n ),\n});\n\nconst indexRoute = createRoute({\n getParentRoute: () => rootRoute,\n path: \"/\",\n component: App,\n});\n\nconst routeTree = rootRoute.addChildren([indexRoute]);\n\nconst router = createRouter({\n routeTree,\n context: {\n \n },\n defaultPreload: \"intent\",\n scrollRestoration: true,\n defaultStructuralSharing: true,\n defaultPreloadStaleTime: 0,\n});\n\nconst rootElement = document.getElementById(\"app\");\nif (rootElement && !rootElement.innerHTML) {\n const root = ReactDOM.createRoot(rootElement);\n root.render(\n <StrictMode>\n \n <RouterProvider router={router} />\n \n </StrictMode>\n );\n}\n\n// If you want to start measuring performance in your app, pass a function\n// to log results (for example: reportWebVitals(console.log))\n// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals\nreportWebVitals();\n",
12
- "/src/reportWebVitals.js": " \nconst reportWebVitals = onPerfEntry => {\n if (onPerfEntry && onPerfEntry instanceof Function) {\n import('web-vitals').then(({ onCLS, onINP, onFCP, onLCP, onTTFB }) => {\n onCLS(onPerfEntry);\n onINP(onPerfEntry);\n onFCP(onPerfEntry);\n onLCP(onPerfEntry);\n onTTFB(onPerfEntry);\n });\n }\n};\n\nexport default reportWebVitals;\n",
13
- "/src/styles.css": "\nbody {\n margin: 0;\n font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", \"Roboto\", \"Oxygen\",\n \"Ubuntu\", \"Cantarell\", \"Fira Sans\", \"Droid Sans\", \"Helvetica Neue\",\n sans-serif;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n}\n\ncode {\n font-family: source-code-pro, Menlo, Monaco, Consolas, \"Courier New\",\n monospace;\n}\n",
14
- "README.md": "Welcome to your new TanStack app! \n\n# Getting Started\n\nTo run this application:\n\n```bash\nnpm install\nnpm run start \n```\n\n# Building For Production\n\nTo build this application for production:\n\n```bash\nnpm run build\n```\n\n## Testing\n\nThis project uses [Vitest](https://vitest.dev/) for testing. You can run the tests with:\n\n```bash\nnpm run test\n```\n\n## Styling\n\nThis project uses CSS for styling.\n\n\n\n\n## Routing\nThis 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/react/guide/file-based-routing) guide.\n\n### Adding A Route\n\nTo 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.\n\n```tsx\nconst aboutRoute = createRoute({\n getParentRoute: () => rootRoute,\n path: \"/about\",\n component: () => <h1>About</h1>,\n});\n```\n\nYou will also need to add the route to the `routeTree` in the `./src/main.jsx` file.\n\n```tsx\nconst routeTree = rootRoute.addChildren([indexRoute, aboutRoute]);\n```\n\nWith this set up you should be able to navigate to `/about` and see the about page.\n\nOf 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:\n\n```tsx\nimport About from \"./components/About.jsx\";\n\nconst aboutRoute = createRoute({\n getParentRoute: () => rootRoute,\n path: \"/about\",\n component: About,\n});\n```\n\nThat is how we have the `App` component set up with the home page.\n\nFor 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/react/guide/code-based-routing) documentation.\n\nNow that you have two routes you can use a `Link` component to navigate between them.\n\n### Adding Links\n\nTo use SPA (Single Page Application) navigation you will need to import the `Link` component from `@tanstack/react-router`.\n\n```tsx\nimport { Link } from \"@tanstack/react-router\";\n```\n\nThen anywhere in your JSX you can use it like so:\n\n```tsx\n<Link to=\"/about\">About</Link>\n```\n\nThis will create a link that will navigate to the `/about` route.\n\nMore information on the `Link` component can be found in the [Link documentation](https://tanstack.com/router/v1/docs/framework/react/api/router/linkComponent).\n\n### Using A Layout\n\n\nLayouts can be used to wrap the contents of the routes in menus, headers, footers, etc.\n\nThere is already a layout in the `src/main.jsx` file:\n\n```tsx\nconst rootRoute = createRootRoute({\n component: () => (\n <>\n <Outlet />\n <TanStackRouterDevtools />\n </>\n ),\n});\n```\n\nYou can use the React 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:\n\n```tsx\nimport { Link } from \"@tanstack/react-router\";\n\nconst rootRoute = createRootRoute({\n component: () => (\n <>\n <header>\n <nav>\n <Link to=\"/\">Home</Link>\n <Link to=\"/about\">About</Link>\n </nav>\n </header>\n <Outlet />\n <TanStackRouterDevtools />\n </>\n ),\n});\n```\n\nThe `<TanStackRouterDevtools />` component is not required so you can remove it if you don't want it in your layout.\n\nMore information on layouts can be found in the [Layouts documentation](https://tanstack.com/router/latest/docs/framework/react/guide/routing-concepts#layouts).\n\n\n### Migrating To File Base Routing\n\nFirst you need to add the Vite plugin for Tanstack Router:\n\n```bash\nnpm install @tanstack/router-plugin -D\n```\n\nFrom there you need to update your `vite.config.js` file to use the plugin:\n\n```ts\nimport { defineConfig } from \"vite\";\nimport viteReact from \"@vitejs/plugin-react\";\nimport { TanStackRouterVite } from \"@tanstack/router-plugin/vite\";\n \n// https://vitejs.dev/config/\nexport default defineConfig({\n plugins: [\n TanStackRouterVite(),\n viteReact()\n ],\n});\n```\n\nNow you'll need to rearrange your files a little bit. That starts with creating a `routes` directory in the `src` directory:\n\n```bash\nmkdir src/routes\n```\n\nThen you'll need to create a `src/routes/__root.jsx` file with the contents of the root route that was in `main.jsx`.\n\n```tsx\nimport { Outlet, createRootRoute } from \"@tanstack/react-router\";\nimport { TanStackRouterDevtools } from \"@tanstack/react-router-devtools\";\n\nexport const Route = createRootRoute({\n component: () => (\n <>\n <Outlet />\n <TanStackRouterDevtools />\n </>\n ),\n});\n```\n\nNext up you'll need to move your home route code into `src/routes/index.jsx`\n\n```tsx\nimport { createFileRoute } from \"@tanstack/react-router\";\n\nimport logo from \"../logo.svg\";\nimport \"../App.css\";\n\nexport const Route = createFileRoute(\"/\")({\n component: App,\n});\n\nfunction App() {\n return (\n <div className=\"App\">\n <header className=\"App-header\">\n <img src={logo} className=\"App-logo\" alt=\"logo\" />\n <p>\n Edit <code>src/App.tsx</code> and save to reload.\n </p>\n <a\n className=\"App-link\"\n href=\"https://reactjs.org\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n Learn React\n </a>\n <a\n className=\"App-link\"\n href=\"https://tanstack.com\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n Learn TanStack\n </a>\n </header>\n </div>\n );\n}\n```\n\nAt this point you can delete `src/App.jsx`, you will no longer need it as the contents have moved into `src/routes/index.jsx`.\n\nThe only additional code is the `createFileRoute` function that tells TanStack Router where to render the route. Helpfully the Vite plugin will keep the path argument that goes to `createFileRoute` automatically in sync with the file system.\n\nFinally the `src/main.jsx` file can be simplified down to this:\n\n```tsx\nimport { StrictMode } from \"react\";\nimport ReactDOM from \"react-dom/client\";\nimport { RouterProvider, createRouter } from \"@tanstack/react-router\";\n\n// Import the generated route tree\nimport { routeTree } from \"./routeTree.gen\";\n\nimport \"./styles.css\";\nimport reportWebVitals from \"./reportWebVitals.js\";\n\n// Create a new router instance\nconst router = createRouter({\n routeTree,\n defaultPreload: \"intent\",\n defaultPreloadStaleTime: 0,\n scrollRestoration: true,\n defaultStructuralSharing: true\n});\n\n// Render the app\nconst rootElement = document.getElementById(\"app\");\nif (!rootElement.innerHTML) {\n const root = ReactDOM.createRoot(rootElement);\n root.render(\n <StrictMode>\n <RouterProvider router={router} />\n </StrictMode>\n );\n}\n\n// If you want to start measuring performance in your app, pass a function\n// to log results (for example: reportWebVitals(console.log))\n// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals\nreportWebVitals();\n```\n\nNow you've got a file based routing setup in your project! Let's have some fun with it! Just create a file in `about.jsx` in `src/routes` and it if the application is running TanStack will automatically add contents to the file and you'll have the start of your `/about` route ready to go with no additional work. You can see why folks find File Based Routing so easy to use.\n\nYou can find out everything you need to know on how to use file based routing in the [File Based Routing](https://tanstack.com/router/latest/docs/framework/react/guide/file-based-routing) documentation.\n\n## Data Fetching\n\nThere 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.\n\nFor example:\n\n```tsx\nconst peopleRoute = createRoute({\n getParentRoute: () => rootRoute,\n path: \"/people\",\n loader: async () => {\n const response = await fetch(\"https://swapi.dev/api/people\");\n return response.json();\n },\n component: () => {\n const data = peopleRoute.useLoaderData();\n return (\n <ul>\n {data.results.map((person) => (\n <li key={person.name}>{person.name}</li>\n ))}\n </ul>\n );\n },\n});\n```\n\nLoaders simplify your data fetching logic dramatically. Check out more information in the [Loader documentation](https://tanstack.com/router/latest/docs/framework/react/guide/data-loading#loader-parameters).\n\n### React-Query\n\nReact-Query is an excellent addition or alternative to route loading and integrating it into you application is a breeze.\n\nFirst add your dependencies:\n\n```bash\nnpm install @tanstack/react-query @tanstack/react-query-devtools\n```\n\nNext we'll need to create a query client and provider. We recommend putting those in `main.jsx`.\n\n```tsx\nimport { QueryClient, QueryClientProvider } from \"@tanstack/react-query\";\n\n// ...\n\nconst queryClient = new QueryClient();\n\n// ...\n\nif (!rootElement.innerHTML) {\n const root = ReactDOM.createRoot(rootElement);\n\n root.render(\n <QueryClientProvider client={queryClient}>\n <RouterProvider router={router} />\n </QueryClientProvider>\n );\n}\n```\n\nYou can also add TanStack Query Devtools to the root route (optional).\n\n```tsx\nimport { ReactQueryDevtools } from \"@tanstack/react-query-devtools\";\n\nconst rootRoute = createRootRoute({\n component: () => (\n <>\n <Outlet />\n <ReactQueryDevtools buttonPosition=\"top-right\" />\n <TanStackRouterDevtools />\n </>\n ),\n});\n```\n\nNow you can use `useQuery` to fetch your data.\n\n```tsx\nimport { useQuery } from \"@tanstack/react-query\";\n\nimport \"./App.css\";\n\nfunction App() {\n const { data } = useQuery({\n queryKey: [\"people\"],\n queryFn: () =>\n fetch(\"https://swapi.dev/api/people\")\n .then((res) => res.json())\n .then((data) => data.results),\n initialData: [],\n });\n\n return (\n <div>\n <ul>\n {data.map((person) => (\n <li key={person.name}>{person.name}</li>\n ))}\n </ul>\n </div>\n );\n}\n\nexport default App;\n```\n\nYou can find out everything you need to know on how to use React-Query in the [React-Query documentation](https://tanstack.com/query/latest/docs/framework/react/overview).\n\n## State Management\n\nAnother common requirement for React applications is state management. There are many options for state management in React. TanStack Store provides a great starting point for your project.\n\nFirst you need to add TanStack Store as a dependency:\n\n```bash\nnpm install @tanstack/store\n```\n\nNow let's create a simple counter in the `src/App.jsx` file as a demonstration.\n\n```tsx\nimport { useStore } from \"@tanstack/react-store\";\nimport { Store } from \"@tanstack/store\";\nimport \"./App.css\";\n\nconst countStore = new Store(0);\n\nfunction App() {\n const count = useStore(countStore);\n return (\n <div>\n <button onClick={() => countStore.setState((n) => n + 1)}>\n Increment - {count}\n </button>\n </div>\n );\n}\n\nexport default App;\n```\n\nOne of the many nice features of TanStack Store is the ability to derive state from other state. That derived state will update when the base state updates.\n\nLet's check this out by doubling the count using derived state.\n\n```tsx\nimport { useStore } from \"@tanstack/react-store\";\nimport { Store, Derived } from \"@tanstack/store\";\nimport \"./App.css\";\n\nconst countStore = new Store(0);\n\nconst doubledStore = new Derived({\n fn: () => countStore.state * 2,\n deps: [countStore],\n});\ndoubledStore.mount();\n\nfunction App() {\n const count = useStore(countStore);\n const doubledCount = useStore(doubledStore);\n\n return (\n <div>\n <button onClick={() => countStore.setState((n) => n + 1)}>\n Increment - {count}\n </button>\n <div>Doubled - {doubledCount}</div>\n </div>\n );\n}\n\nexport default App;\n```\n\nWe use the `Derived` class to create a new store that is derived from another store. The `Derived` class has a `mount` method that will start the derived store updating.\n\nOnce we've created the derived store we can use it in the `App` component just like we would any other store using the `useStore` hook.\n\nYou can find out everything you need to know on how to use TanStack Store in the [TanStack Store documentation](https://tanstack.com/store/latest).\n\n# Demo files\n\nFiles 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.\n\n# Learn More\n\nYou can learn more about all of the offerings from TanStack in the [TanStack documentation](https://tanstack.com).\n",
15
- "index.html": "<!DOCTYPE html>\n<html lang=\"en\">\n <head>\n <meta charset=\"UTF-8\" />\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />\n <link rel=\"icon\" href=\"/favicon.ico\" />\n <meta name=\"theme-color\" content=\"#000000\" />\n <meta\n name=\"description\"\n content=\"Web site created using create-tsrouter-app\"\n />\n <link rel=\"apple-touch-icon\" href=\"/logo192.png\" />\n <link rel=\"manifest\" href=\"/manifest.json\" />\n <title>Create TanStack App - TEST</title>\n </head>\n <body>\n <div id=\"app\"></div>\n <script type=\"module\" src=\"/src/main.jsx\"></script>\n </body>\n</html>\n",
16
- "package.json": "{\n \"name\": \"TEST\",\n \"private\": true,\n \"type\": \"module\",\n \"scripts\": {\n \"dev\": \"vite --port 3000\",\n \"start\": \"vite --port 3000\",\n \"build\": \"vite build && tsc\",\n \"serve\": \"vite preview\",\n \"test\": \"vitest run\"\n },\n \"dependencies\": {\n \"@tanstack/react-router\": \"^1.114.3\",\n \"@tanstack/react-router-devtools\": \"^1.114.3\",\n \"react\": \"^19.0.0\",\n \"react-dom\": \"^19.0.0\"\n },\n \"devDependencies\": {\n \"@testing-library/dom\": \"^10.4.0\",\n \"@testing-library/react\": \"^16.2.0\",\n \"@types/react\": \"^19.0.8\",\n \"@types/react-dom\": \"^19.0.3\",\n \"@vitejs/plugin-react\": \"^4.3.4\",\n \"jsdom\": \"^26.0.0\",\n \"typescript\": \"^5.7.2\",\n \"vite\": \"^6.1.0\",\n \"vitest\": \"^3.0.5\",\n \"web-vitals\": \"^4.2.4\"\n }\n}",
17
- "vite.config.js": "import { defineConfig } from \"vite\";\nimport viteReact from \"@vitejs/plugin-react\";\nimport { resolve } from \"node:path\";\n\n// https://vitejs.dev/config/\nexport default defineConfig({\n plugins: [viteReact()],\n test: {\n globals: true,\n environment: \"jsdom\",\n },\n resolve: {\n alias: {\n '@': resolve(__dirname, './src'),\n },\n }\n});\n"
18
- },
19
- "commands": [
20
- {
21
- "command": "npm",
22
- "args": [
23
- "install"
24
- ]
25
- },
26
- {
27
- "command": "git",
28
- "args": [
29
- "init"
30
- ]
31
- }
32
- ]
33
- }
@@ -1,34 +0,0 @@
1
- {
2
- "files": {
3
- ".cta.json": "{\n \"framework\": \"react\",\n \"git\": true,\n \"mode\": \"code-router\",\n \"packageManager\": \"npm\",\n \"projectName\": \"TEST\",\n \"tailwind\": false,\n \"toolchain\": \"none\",\n \"typescript\": true,\n \"variableValues\": {},\n \"version\": 1,\n \"existingAddOns\": []\n}",
4
- ".gitignore": "node_modules\n.DS_Store\ndist\ndist-ssr\n*.local\n",
5
- "/.vscode/settings.json": "{\n \"files.watcherExclude\": {\n \"**/routeTree.gen.ts\": true\n },\n \"search.exclude\": {\n \"**/routeTree.gen.ts\": true\n },\n \"files.readonlyInclude\": {\n \"**/routeTree.gen.ts\": true\n }\n}\n",
6
- "/public/manifest.json": "{\n \"short_name\": \"TanStack App\",\n \"name\": \"Create TanStack App Sample\",\n \"icons\": [\n {\n \"src\": \"favicon.ico\",\n \"sizes\": \"64x64 32x32 24x24 16x16\",\n \"type\": \"image/x-icon\"\n },\n {\n \"src\": \"logo192.png\",\n \"type\": \"image/png\",\n \"sizes\": \"192x192\"\n },\n {\n \"src\": \"logo512.png\",\n \"type\": \"image/png\",\n \"sizes\": \"512x512\"\n }\n ],\n \"start_url\": \".\",\n \"display\": \"standalone\",\n \"theme_color\": \"#000000\",\n \"background_color\": \"#ffffff\"\n}\n",
7
- "/public/robots.txt": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n",
8
- "/src/App.css": ".App {\n text-align: center;\n}\n\n.App-logo {\n height: 40vmin;\n pointer-events: none;\n}\n\n@media (prefers-reduced-motion: no-preference) {\n .App-logo {\n animation: App-logo-spin infinite 20s linear;\n }\n}\n\n.App-header {\n background-color: #282c34;\n min-height: 100vh;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n font-size: calc(10px + 2vmin);\n color: white;\n}\n\n.App-link {\n color: #61dafb;\n}\n\n@keyframes App-logo-spin {\n from {\n transform: rotate(0deg);\n }\n to {\n transform: rotate(360deg);\n }\n}\n",
9
- "/src/App.test.tsx": "import { describe, expect, test } from 'vitest'\nimport { render, screen } from '@testing-library/react'\nimport App from './App.tsx'\n\ndescribe('App', () => {\n test('renders', () => {\n render(<App />)\n expect(screen.getByText('Learn React')).toBeDefined()\n })\n})\n",
10
- "/src/App.tsx": "import logo from './logo.svg'\nimport './App.css'\n\nfunction App() {\n return (\n <div className=\"App\">\n <header className=\"App-header\">\n <img src={logo} className=\"App-logo\" alt=\"logo\" />\n <p>\n Edit <code>src/App.tsx</code> and save to reload.\n </p>\n <a\n className=\"App-link\"\n href=\"https://reactjs.org\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n Learn React\n </a>\n <a\n className=\"App-link\"\n href=\"https://tanstack.com\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n Learn TanStack\n </a>\n </header>\n </div>\n )\n}\n\nexport default App\n",
11
- "/src/main.tsx": "import { StrictMode } from 'react'\nimport ReactDOM from 'react-dom/client'\nimport {\n Outlet,\n RouterProvider,\n createRootRoute,\n createRoute,\n createRouter,\n} from '@tanstack/react-router'\nimport { TanStackRouterDevtools } from '@tanstack/react-router-devtools'\n\nimport './styles.css'\nimport reportWebVitals from './reportWebVitals.ts'\n\nimport App from './App.tsx'\n\nconst rootRoute = createRootRoute({\n component: () => (\n <>\n <Outlet />\n <TanStackRouterDevtools />\n </>\n ),\n})\n\nconst indexRoute = createRoute({\n getParentRoute: () => rootRoute,\n path: '/',\n component: App,\n})\n\nconst routeTree = rootRoute.addChildren([indexRoute])\n\nconst router = createRouter({\n routeTree,\n context: {},\n defaultPreload: 'intent',\n scrollRestoration: true,\n defaultStructuralSharing: true,\n defaultPreloadStaleTime: 0,\n})\n\ndeclare module '@tanstack/react-router' {\n interface Register {\n router: typeof router\n }\n}\n\nconst rootElement = document.getElementById('app')\nif (rootElement && !rootElement.innerHTML) {\n const root = ReactDOM.createRoot(rootElement)\n root.render(\n <StrictMode>\n <RouterProvider router={router} />\n </StrictMode>,\n )\n}\n\n// If you want to start measuring performance in your app, pass a function\n// to log results (for example: reportWebVitals(console.log))\n// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals\nreportWebVitals()\n",
12
- "/src/reportWebVitals.ts": "const reportWebVitals = (onPerfEntry?: () => void) => {\n if (onPerfEntry && onPerfEntry instanceof Function) {\n import('web-vitals').then(({ onCLS, onINP, onFCP, onLCP, onTTFB }) => {\n onCLS(onPerfEntry)\n onINP(onPerfEntry)\n onFCP(onPerfEntry)\n onLCP(onPerfEntry)\n onTTFB(onPerfEntry)\n })\n }\n}\n\nexport default reportWebVitals\n",
13
- "/src/styles.css": "\nbody {\n margin: 0;\n font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", \"Roboto\", \"Oxygen\",\n \"Ubuntu\", \"Cantarell\", \"Fira Sans\", \"Droid Sans\", \"Helvetica Neue\",\n sans-serif;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n}\n\ncode {\n font-family: source-code-pro, Menlo, Monaco, Consolas, \"Courier New\",\n monospace;\n}\n",
14
- "README.md": "Welcome to your new TanStack app! \n\n# Getting Started\n\nTo run this application:\n\n```bash\nnpm install\nnpm run start \n```\n\n# Building For Production\n\nTo build this application for production:\n\n```bash\nnpm run build\n```\n\n## Testing\n\nThis project uses [Vitest](https://vitest.dev/) for testing. You can run the tests with:\n\n```bash\nnpm run test\n```\n\n## Styling\n\nThis project uses CSS for styling.\n\n\n\n\n## Routing\nThis 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.tsx` 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/react/guide/file-based-routing) guide.\n\n### Adding A Route\n\nTo add a new route to your application just add another `createRoute` call to the `./src/main.tsx` file. The example below adds a new `/about`route to the root route.\n\n```tsx\nconst aboutRoute = createRoute({\n getParentRoute: () => rootRoute,\n path: \"/about\",\n component: () => <h1>About</h1>,\n});\n```\n\nYou will also need to add the route to the `routeTree` in the `./src/main.tsx` file.\n\n```tsx\nconst routeTree = rootRoute.addChildren([indexRoute, aboutRoute]);\n```\n\nWith this set up you should be able to navigate to `/about` and see the about page.\n\nOf course you don't need to implement the About page in the `main.tsx` file. You can create that component in another file and import it into the `main.tsx` file, then use it in the `component` property of the `createRoute` call, like so:\n\n```tsx\nimport About from \"./components/About.tsx\";\n\nconst aboutRoute = createRoute({\n getParentRoute: () => rootRoute,\n path: \"/about\",\n component: About,\n});\n```\n\nThat is how we have the `App` component set up with the home page.\n\nFor 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/react/guide/code-based-routing) documentation.\n\nNow that you have two routes you can use a `Link` component to navigate between them.\n\n### Adding Links\n\nTo use SPA (Single Page Application) navigation you will need to import the `Link` component from `@tanstack/react-router`.\n\n```tsx\nimport { Link } from \"@tanstack/react-router\";\n```\n\nThen anywhere in your JSX you can use it like so:\n\n```tsx\n<Link to=\"/about\">About</Link>\n```\n\nThis will create a link that will navigate to the `/about` route.\n\nMore information on the `Link` component can be found in the [Link documentation](https://tanstack.com/router/v1/docs/framework/react/api/router/linkComponent).\n\n### Using A Layout\n\n\nLayouts can be used to wrap the contents of the routes in menus, headers, footers, etc.\n\nThere is already a layout in the `src/main.tsx` file:\n\n```tsx\nconst rootRoute = createRootRoute({\n component: () => (\n <>\n <Outlet />\n <TanStackRouterDevtools />\n </>\n ),\n});\n```\n\nYou can use the React 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:\n\n```tsx\nimport { Link } from \"@tanstack/react-router\";\n\nconst rootRoute = createRootRoute({\n component: () => (\n <>\n <header>\n <nav>\n <Link to=\"/\">Home</Link>\n <Link to=\"/about\">About</Link>\n </nav>\n </header>\n <Outlet />\n <TanStackRouterDevtools />\n </>\n ),\n});\n```\n\nThe `<TanStackRouterDevtools />` component is not required so you can remove it if you don't want it in your layout.\n\nMore information on layouts can be found in the [Layouts documentation](https://tanstack.com/router/latest/docs/framework/react/guide/routing-concepts#layouts).\n\n\n### Migrating To File Base Routing\n\nFirst you need to add the Vite plugin for Tanstack Router:\n\n```bash\nnpm install @tanstack/router-plugin -D\n```\n\nFrom there you need to update your `vite.config.js` file to use the plugin:\n\n```ts\nimport { defineConfig } from \"vite\";\nimport viteReact from \"@vitejs/plugin-react\";\nimport { TanStackRouterVite } from \"@tanstack/router-plugin/vite\";\n \n// https://vitejs.dev/config/\nexport default defineConfig({\n plugins: [\n TanStackRouterVite(),\n viteReact()\n ],\n});\n```\n\nNow you'll need to rearrange your files a little bit. That starts with creating a `routes` directory in the `src` directory:\n\n```bash\nmkdir src/routes\n```\n\nThen you'll need to create a `src/routes/__root.tsx` file with the contents of the root route that was in `main.tsx`.\n\n```tsx\nimport { Outlet, createRootRoute } from \"@tanstack/react-router\";\nimport { TanStackRouterDevtools } from \"@tanstack/react-router-devtools\";\n\nexport const Route = createRootRoute({\n component: () => (\n <>\n <Outlet />\n <TanStackRouterDevtools />\n </>\n ),\n});\n```\n\nNext up you'll need to move your home route code into `src/routes/index.tsx`\n\n```tsx\nimport { createFileRoute } from \"@tanstack/react-router\";\n\nimport logo from \"../logo.svg\";\nimport \"../App.css\";\n\nexport const Route = createFileRoute(\"/\")({\n component: App,\n});\n\nfunction App() {\n return (\n <div className=\"App\">\n <header className=\"App-header\">\n <img src={logo} className=\"App-logo\" alt=\"logo\" />\n <p>\n Edit <code>src/App.tsx</code> and save to reload.\n </p>\n <a\n className=\"App-link\"\n href=\"https://reactjs.org\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n Learn React\n </a>\n <a\n className=\"App-link\"\n href=\"https://tanstack.com\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n Learn TanStack\n </a>\n </header>\n </div>\n );\n}\n```\n\nAt this point you can delete `src/App.tsx`, you will no longer need it as the contents have moved into `src/routes/index.tsx`.\n\nThe only additional code is the `createFileRoute` function that tells TanStack Router where to render the route. Helpfully the Vite plugin will keep the path argument that goes to `createFileRoute` automatically in sync with the file system.\n\nFinally the `src/main.tsx` file can be simplified down to this:\n\n```tsx\nimport { StrictMode } from \"react\";\nimport ReactDOM from \"react-dom/client\";\nimport { RouterProvider, createRouter } from \"@tanstack/react-router\";\n\n// Import the generated route tree\nimport { routeTree } from \"./routeTree.gen\";\n\nimport \"./styles.css\";\nimport reportWebVitals from \"./reportWebVitals.ts\";\n\n// Create a new router instance\nconst router = createRouter({\n routeTree,\n defaultPreload: \"intent\",\n defaultPreloadStaleTime: 0,\n scrollRestoration: true,\n defaultStructuralSharing: true\n});\n\n// Register the router instance for type safety\ndeclare module \"@tanstack/react-router\" {\n interface Register {\n router: typeof router;\n }\n}\n\n// Render the app\nconst rootElement = document.getElementById(\"app\")!;\nif (!rootElement.innerHTML) {\n const root = ReactDOM.createRoot(rootElement);\n root.render(\n <StrictMode>\n <RouterProvider router={router} />\n </StrictMode>\n );\n}\n\n// If you want to start measuring performance in your app, pass a function\n// to log results (for example: reportWebVitals(console.log))\n// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals\nreportWebVitals();\n```\n\nNow you've got a file based routing setup in your project! Let's have some fun with it! Just create a file in `about.tsx` in `src/routes` and it if the application is running TanStack will automatically add contents to the file and you'll have the start of your `/about` route ready to go with no additional work. You can see why folks find File Based Routing so easy to use.\n\nYou can find out everything you need to know on how to use file based routing in the [File Based Routing](https://tanstack.com/router/latest/docs/framework/react/guide/file-based-routing) documentation.\n\n## Data Fetching\n\nThere 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.\n\nFor example:\n\n```tsx\nconst peopleRoute = createRoute({\n getParentRoute: () => rootRoute,\n path: \"/people\",\n loader: async () => {\n const response = await fetch(\"https://swapi.dev/api/people\");\n return response.json() as Promise<{\n results: {\n name: string;\n }[];\n }>;\n },\n component: () => {\n const data = peopleRoute.useLoaderData();\n return (\n <ul>\n {data.results.map((person) => (\n <li key={person.name}>{person.name}</li>\n ))}\n </ul>\n );\n },\n});\n```\n\nLoaders simplify your data fetching logic dramatically. Check out more information in the [Loader documentation](https://tanstack.com/router/latest/docs/framework/react/guide/data-loading#loader-parameters).\n\n### React-Query\n\nReact-Query is an excellent addition or alternative to route loading and integrating it into you application is a breeze.\n\nFirst add your dependencies:\n\n```bash\nnpm install @tanstack/react-query @tanstack/react-query-devtools\n```\n\nNext we'll need to create a query client and provider. We recommend putting those in `main.tsx`.\n\n```tsx\nimport { QueryClient, QueryClientProvider } from \"@tanstack/react-query\";\n\n// ...\n\nconst queryClient = new QueryClient();\n\n// ...\n\nif (!rootElement.innerHTML) {\n const root = ReactDOM.createRoot(rootElement);\n\n root.render(\n <QueryClientProvider client={queryClient}>\n <RouterProvider router={router} />\n </QueryClientProvider>\n );\n}\n```\n\nYou can also add TanStack Query Devtools to the root route (optional).\n\n```tsx\nimport { ReactQueryDevtools } from \"@tanstack/react-query-devtools\";\n\nconst rootRoute = createRootRoute({\n component: () => (\n <>\n <Outlet />\n <ReactQueryDevtools buttonPosition=\"top-right\" />\n <TanStackRouterDevtools />\n </>\n ),\n});\n```\n\nNow you can use `useQuery` to fetch your data.\n\n```tsx\nimport { useQuery } from \"@tanstack/react-query\";\n\nimport \"./App.css\";\n\nfunction App() {\n const { data } = useQuery({\n queryKey: [\"people\"],\n queryFn: () =>\n fetch(\"https://swapi.dev/api/people\")\n .then((res) => res.json())\n .then((data) => data.results as { name: string }[]),\n initialData: [],\n });\n\n return (\n <div>\n <ul>\n {data.map((person) => (\n <li key={person.name}>{person.name}</li>\n ))}\n </ul>\n </div>\n );\n}\n\nexport default App;\n```\n\nYou can find out everything you need to know on how to use React-Query in the [React-Query documentation](https://tanstack.com/query/latest/docs/framework/react/overview).\n\n## State Management\n\nAnother common requirement for React applications is state management. There are many options for state management in React. TanStack Store provides a great starting point for your project.\n\nFirst you need to add TanStack Store as a dependency:\n\n```bash\nnpm install @tanstack/store\n```\n\nNow let's create a simple counter in the `src/App.tsx` file as a demonstration.\n\n```tsx\nimport { useStore } from \"@tanstack/react-store\";\nimport { Store } from \"@tanstack/store\";\nimport \"./App.css\";\n\nconst countStore = new Store(0);\n\nfunction App() {\n const count = useStore(countStore);\n return (\n <div>\n <button onClick={() => countStore.setState((n) => n + 1)}>\n Increment - {count}\n </button>\n </div>\n );\n}\n\nexport default App;\n```\n\nOne of the many nice features of TanStack Store is the ability to derive state from other state. That derived state will update when the base state updates.\n\nLet's check this out by doubling the count using derived state.\n\n```tsx\nimport { useStore } from \"@tanstack/react-store\";\nimport { Store, Derived } from \"@tanstack/store\";\nimport \"./App.css\";\n\nconst countStore = new Store(0);\n\nconst doubledStore = new Derived({\n fn: () => countStore.state * 2,\n deps: [countStore],\n});\ndoubledStore.mount();\n\nfunction App() {\n const count = useStore(countStore);\n const doubledCount = useStore(doubledStore);\n\n return (\n <div>\n <button onClick={() => countStore.setState((n) => n + 1)}>\n Increment - {count}\n </button>\n <div>Doubled - {doubledCount}</div>\n </div>\n );\n}\n\nexport default App;\n```\n\nWe use the `Derived` class to create a new store that is derived from another store. The `Derived` class has a `mount` method that will start the derived store updating.\n\nOnce we've created the derived store we can use it in the `App` component just like we would any other store using the `useStore` hook.\n\nYou can find out everything you need to know on how to use TanStack Store in the [TanStack Store documentation](https://tanstack.com/store/latest).\n\n# Demo files\n\nFiles 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.\n\n# Learn More\n\nYou can learn more about all of the offerings from TanStack in the [TanStack documentation](https://tanstack.com).\n",
15
- "index.html": "<!DOCTYPE html>\n<html lang=\"en\">\n <head>\n <meta charset=\"UTF-8\" />\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />\n <link rel=\"icon\" href=\"/favicon.ico\" />\n <meta name=\"theme-color\" content=\"#000000\" />\n <meta\n name=\"description\"\n content=\"Web site created using create-tsrouter-app\"\n />\n <link rel=\"apple-touch-icon\" href=\"/logo192.png\" />\n <link rel=\"manifest\" href=\"/manifest.json\" />\n <title>Create TanStack App - TEST</title>\n </head>\n <body>\n <div id=\"app\"></div>\n <script type=\"module\" src=\"/src/main.tsx\"></script>\n </body>\n</html>\n",
16
- "package.json": "{\n \"name\": \"TEST\",\n \"private\": true,\n \"type\": \"module\",\n \"scripts\": {\n \"dev\": \"vite --port 3000\",\n \"start\": \"vite --port 3000\",\n \"build\": \"vite build && tsc\",\n \"serve\": \"vite preview\",\n \"test\": \"vitest run\"\n },\n \"dependencies\": {\n \"@tanstack/react-router\": \"^1.114.3\",\n \"@tanstack/react-router-devtools\": \"^1.114.3\",\n \"react\": \"^19.0.0\",\n \"react-dom\": \"^19.0.0\"\n },\n \"devDependencies\": {\n \"@testing-library/dom\": \"^10.4.0\",\n \"@testing-library/react\": \"^16.2.0\",\n \"@types/react\": \"^19.0.8\",\n \"@types/react-dom\": \"^19.0.3\",\n \"@vitejs/plugin-react\": \"^4.3.4\",\n \"jsdom\": \"^26.0.0\",\n \"typescript\": \"^5.7.2\",\n \"vite\": \"^6.1.0\",\n \"vitest\": \"^3.0.5\",\n \"web-vitals\": \"^4.2.4\"\n }\n}",
17
- "tsconfig.json": "{\n \"include\": [\"**/*.ts\", \"**/*.tsx\"],\n \"compilerOptions\": {\n \"target\": \"ES2022\",\n \"jsx\": \"react-jsx\",\n \"module\": \"ESNext\",\n \"lib\": [\"ES2022\", \"DOM\", \"DOM.Iterable\"],\n \"types\": [\"vite/client\"],\n\n /* Bundler mode */\n \"moduleResolution\": \"bundler\",\n \"allowImportingTsExtensions\": true,\n \"verbatimModuleSyntax\": true,\n \"noEmit\": true,\n\n /* Linting */\n \"skipLibCheck\": true,\n \"strict\": true,\n \"noUnusedLocals\": true,\n \"noUnusedParameters\": true,\n \"noFallthroughCasesInSwitch\": true,\n \"noUncheckedSideEffectImports\": true,\n \"baseUrl\": \".\",\n \"paths\": {\n \"@/*\": [\"./src/*\"],\n }\n }\n}\n",
18
- "vite.config.js": "import { defineConfig } from \"vite\";\nimport viteReact from \"@vitejs/plugin-react\";\nimport { resolve } from \"node:path\";\n\n// https://vitejs.dev/config/\nexport default defineConfig({\n plugins: [viteReact()],\n test: {\n globals: true,\n environment: \"jsdom\",\n },\n resolve: {\n alias: {\n '@': resolve(__dirname, './src'),\n },\n }\n});\n"
19
- },
20
- "commands": [
21
- {
22
- "command": "npm",
23
- "args": [
24
- "install"
25
- ]
26
- },
27
- {
28
- "command": "git",
29
- "args": [
30
- "init"
31
- ]
32
- }
33
- ]
34
- }
@@ -1,38 +0,0 @@
1
- {
2
- "files": {
3
- ".cta.json": "{\n \"framework\": \"react\",\n \"git\": true,\n \"mode\": \"file-router\",\n \"packageManager\": \"npm\",\n \"projectName\": \"TEST\",\n \"tailwind\": true,\n \"toolchain\": \"none\",\n \"typescript\": true,\n \"variableValues\": {},\n \"version\": 1,\n \"existingAddOns\": [\n \"start\"\n ]\n}",
4
- ".gitignore": "node_modules\n.DS_Store\ndist\ndist-ssr\n*.local\n.output\n.vinxi\n",
5
- "/.vscode/settings.json": "{\n \"files.watcherExclude\": {\n \"**/routeTree.gen.ts\": true\n },\n \"search.exclude\": {\n \"**/routeTree.gen.ts\": true\n },\n \"files.readonlyInclude\": {\n \"**/routeTree.gen.ts\": true\n }\n}\n",
6
- "/public/manifest.json": "{\n \"short_name\": \"TanStack App\",\n \"name\": \"Create TanStack App Sample\",\n \"icons\": [\n {\n \"src\": \"favicon.ico\",\n \"sizes\": \"64x64 32x32 24x24 16x16\",\n \"type\": \"image/x-icon\"\n },\n {\n \"src\": \"logo192.png\",\n \"type\": \"image/png\",\n \"sizes\": \"192x192\"\n },\n {\n \"src\": \"logo512.png\",\n \"type\": \"image/png\",\n \"sizes\": \"512x512\"\n }\n ],\n \"start_url\": \".\",\n \"display\": \"standalone\",\n \"theme_color\": \"#000000\",\n \"background_color\": \"#ffffff\"\n}\n",
7
- "/public/robots.txt": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n",
8
- "/src/api.ts": "import {\n createStartAPIHandler,\n defaultAPIFileRouteHandler,\n} from '@tanstack/react-start/api'\n\nexport default createStartAPIHandler(defaultAPIFileRouteHandler)\n",
9
- "/src/client.tsx": "import { hydrateRoot } from 'react-dom/client'\nimport { StartClient } from '@tanstack/react-start'\n\nimport { createRouter } from './router'\n\nconst router = createRouter()\n\nhydrateRoot(document, <StartClient router={router} />)\n",
10
- "/src/components/Header.tsx": "import { Link } from '@tanstack/react-router'\n\nexport default function Header() {\n return (\n <header className=\"p-2 flex gap-2 bg-white text-black justify-between\">\n <nav className=\"flex flex-row\">\n <div className=\"px-2 font-bold\">\n <Link to=\"/\">Home</Link>\n </div>\n\n <div className=\"px-2 font-bold\">\n <Link to=\"/demo/start/server-funcs\">Start - Server Functions</Link>\n </div>\n\n <div className=\"px-2 font-bold\">\n <Link to=\"/demo/start/api-request\">Start - API Request</Link>\n </div>\n </nav>\n </header>\n )\n}\n",
11
- "/src/router.tsx": "import { createRouter as createTanstackRouter } from '@tanstack/react-router'\n\n// Import the generated route tree\nimport { routeTree } from './routeTree.gen'\n\nimport './styles.css'\n\n// Create a new router instance\nexport const createRouter = () => {\n const router = createTanstackRouter({\n routeTree,\n scrollRestoration: true,\n defaultPreloadStaleTime: 0,\n })\n\n return router\n}\n\n// Register the router instance for type safety\ndeclare module '@tanstack/react-router' {\n interface Register {\n router: ReturnType<typeof createRouter>\n }\n}\n",
12
- "/src/routes/__root.tsx": "import {\n Outlet,\n HeadContent,\n Scripts,\n createRootRoute,\n} from '@tanstack/react-router'\nimport { TanStackRouterDevtools } from '@tanstack/react-router-devtools'\n\nimport Header from '../components/Header'\n\nimport appCss from '../styles.css?url'\n\nexport const Route = createRootRoute({\n head: () => ({\n meta: [\n {\n charSet: 'utf-8',\n },\n {\n name: 'viewport',\n content: 'width=device-width, initial-scale=1',\n },\n {\n title: 'TanStack Start Starter',\n },\n ],\n links: [\n {\n rel: 'stylesheet',\n href: appCss,\n },\n ],\n }),\n\n component: () => (\n <RootDocument>\n <Header />\n\n <Outlet />\n <TanStackRouterDevtools />\n </RootDocument>\n ),\n})\n\nfunction RootDocument({ children }: { children: React.ReactNode }) {\n return (\n <html lang=\"en\">\n <head>\n <HeadContent />\n </head>\n <body>\n {children}\n <Scripts />\n </body>\n </html>\n )\n}\n",
13
- "/src/routes/api.demo-names.ts": "import { createAPIFileRoute } from '@tanstack/react-start/api'\n\nexport const APIRoute = createAPIFileRoute('/demo/start/api/names')({\n GET: async ({ request }) => {\n return new Response(JSON.stringify(['Alice', 'Bob', 'Charlie']), {\n headers: {\n 'Content-Type': 'application/json',\n },\n })\n },\n})\n",
14
- "/src/routes/demo.start.api-request.tsx": "import { useEffect, useState } from 'react'\n\nimport { createFileRoute } from '@tanstack/react-router'\n\nfunction getNames() {\n return fetch('/api/demo-names').then((res) => res.json())\n}\n\nexport const Route = createFileRoute('/demo/start/api-request')({\n component: Home,\n})\n\nfunction Home() {\n const [names, setNames] = useState<Array<string>>([])\n useEffect(() => {\n getNames().then(setNames)\n }, [])\n\n return (\n <div className=\"p-4\">\n <div>{names.join(', ')}</div>\n </div>\n )\n}\n",
15
- "/src/routes/demo.start.server-funcs.tsx": "import * as fs from 'node:fs'\nimport { createFileRoute, useRouter } from '@tanstack/react-router'\nimport { createServerFn } from '@tanstack/react-start'\n\nconst filePath = 'count.txt'\n\nasync function readCount() {\n return parseInt(\n await fs.promises.readFile(filePath, 'utf-8').catch(() => '0'),\n )\n}\n\nconst getCount = createServerFn({\n method: 'GET',\n}).handler(() => {\n return readCount()\n})\n\nconst updateCount = createServerFn({ method: 'POST' })\n .validator((d: number) => d)\n .handler(async ({ data }) => {\n const count = await readCount()\n await fs.promises.writeFile(filePath, `${count + data}`)\n })\n\nexport const Route = createFileRoute('/demo/start/server-funcs')({\n component: Home,\n loader: async () => await getCount(),\n})\n\nfunction Home() {\n const router = useRouter()\n const state = Route.useLoaderData()\n\n return (\n <div className=\"p-4\">\n <button\n type=\"button\"\n onClick={() => {\n updateCount({ data: 1 }).then(() => {\n router.invalidate()\n })\n }}\n className=\"bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded\"\n >\n Add 1 to {state}?\n </button>\n </div>\n )\n}\n",
16
- "/src/routes/index.tsx": "import { createFileRoute } from '@tanstack/react-router'\nimport logo from '../logo.svg'\n\nexport const Route = createFileRoute('/')({\n component: App,\n})\n\nfunction App() {\n return (\n <div className=\"text-center\">\n <header className=\"min-h-screen flex flex-col items-center justify-center bg-[#282c34] text-white text-[calc(10px+2vmin)]\">\n <img\n src={logo}\n className=\"h-[40vmin] pointer-events-none animate-[spin_20s_linear_infinite]\"\n alt=\"logo\"\n />\n <p>\n Edit <code>src/routes/index.tsx</code> and save to reload.\n </p>\n <a\n className=\"text-[#61dafb] hover:underline\"\n href=\"https://reactjs.org\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n Learn React\n </a>\n <a\n className=\"text-[#61dafb] hover:underline\"\n href=\"https://tanstack.com\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n Learn TanStack\n </a>\n </header>\n </div>\n )\n}\n",
17
- "/src/ssr.tsx": "import {\n createStartHandler,\n defaultStreamHandler,\n} from '@tanstack/react-start/server'\nimport { getRouterManifest } from '@tanstack/react-start/router-manifest'\n\nimport { createRouter } from './router'\n\nlet streamHandler = defaultStreamHandler\n\nexport default createStartHandler({\n createRouter,\n getRouterManifest,\n})(streamHandler)\n",
18
- "/src/styles.css": "@import \"tailwindcss\";\n\nbody {\n @apply m-0;\n font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", \"Roboto\", \"Oxygen\",\n \"Ubuntu\", \"Cantarell\", \"Fira Sans\", \"Droid Sans\", \"Helvetica Neue\",\n sans-serif;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n}\n\ncode {\n font-family: source-code-pro, Menlo, Monaco, Consolas, \"Courier New\",\n monospace;\n}\n",
19
- "README.md": "Welcome to your new TanStack app! \n\n# Getting Started\n\nTo run this application:\n\n```bash\nnpm install\nnpm run start \n```\n\n# Building For Production\n\nTo build this application for production:\n\n```bash\nnpm run build\n```\n\n## Testing\n\nThis project uses [Vitest](https://vitest.dev/) for testing. You can run the tests with:\n\n```bash\nnpm run test\n```\n\n## Styling\n\nThis project uses [Tailwind CSS](https://tailwindcss.com/) for styling.\n\n\n\n\n## Routing\nThis project uses [TanStack Router](https://tanstack.com/router). The initial setup is a file based router. Which means that the routes are managed as files in `src/routes`.\n\n### Adding A Route\n\nTo add a new route to your application just add another a new file in the `./src/routes` directory.\n\nTanStack will automatically generate the content of the route file for you.\n\nNow that you have two routes you can use a `Link` component to navigate between them.\n\n### Adding Links\n\nTo use SPA (Single Page Application) navigation you will need to import the `Link` component from `@tanstack/react-router`.\n\n```tsx\nimport { Link } from \"@tanstack/react-router\";\n```\n\nThen anywhere in your JSX you can use it like so:\n\n```tsx\n<Link to=\"/about\">About</Link>\n```\n\nThis will create a link that will navigate to the `/about` route.\n\nMore information on the `Link` component can be found in the [Link documentation](https://tanstack.com/router/v1/docs/framework/react/api/router/linkComponent).\n\n### Using A Layout\n\nIn 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.\n\nHere is an example layout that includes a header:\n\n```tsx\nimport { Outlet, createRootRoute } from '@tanstack/react-router'\nimport { TanStackRouterDevtools } from '@tanstack/react-router-devtools'\n\nimport { Link } from \"@tanstack/react-router\";\n\nexport const Route = createRootRoute({\n component: () => (\n <>\n <header>\n <nav>\n <Link to=\"/\">Home</Link>\n <Link to=\"/about\">About</Link>\n </nav>\n </header>\n <Outlet />\n <TanStackRouterDevtools />\n </>\n ),\n})\n```\n\nThe `<TanStackRouterDevtools />` component is not required so you can remove it if you don't want it in your layout.\n\nMore information on layouts can be found in the [Layouts documentation](https://tanstack.com/router/latest/docs/framework/react/guide/routing-concepts#layouts).\n\n\n## Data Fetching\n\nThere 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.\n\nFor example:\n\n```tsx\nconst peopleRoute = createRoute({\n getParentRoute: () => rootRoute,\n path: \"/people\",\n loader: async () => {\n const response = await fetch(\"https://swapi.dev/api/people\");\n return response.json() as Promise<{\n results: {\n name: string;\n }[];\n }>;\n },\n component: () => {\n const data = peopleRoute.useLoaderData();\n return (\n <ul>\n {data.results.map((person) => (\n <li key={person.name}>{person.name}</li>\n ))}\n </ul>\n );\n },\n});\n```\n\nLoaders simplify your data fetching logic dramatically. Check out more information in the [Loader documentation](https://tanstack.com/router/latest/docs/framework/react/guide/data-loading#loader-parameters).\n\n### React-Query\n\nReact-Query is an excellent addition or alternative to route loading and integrating it into you application is a breeze.\n\nFirst add your dependencies:\n\n```bash\nnpm install @tanstack/react-query @tanstack/react-query-devtools\n```\n\nNext we'll need to create a query client and provider. We recommend putting those in `main.tsx`.\n\n```tsx\nimport { QueryClient, QueryClientProvider } from \"@tanstack/react-query\";\n\n// ...\n\nconst queryClient = new QueryClient();\n\n// ...\n\nif (!rootElement.innerHTML) {\n const root = ReactDOM.createRoot(rootElement);\n\n root.render(\n <QueryClientProvider client={queryClient}>\n <RouterProvider router={router} />\n </QueryClientProvider>\n );\n}\n```\n\nYou can also add TanStack Query Devtools to the root route (optional).\n\n```tsx\nimport { ReactQueryDevtools } from \"@tanstack/react-query-devtools\";\n\nconst rootRoute = createRootRoute({\n component: () => (\n <>\n <Outlet />\n <ReactQueryDevtools buttonPosition=\"top-right\" />\n <TanStackRouterDevtools />\n </>\n ),\n});\n```\n\nNow you can use `useQuery` to fetch your data.\n\n```tsx\nimport { useQuery } from \"@tanstack/react-query\";\n\nimport \"./App.css\";\n\nfunction App() {\n const { data } = useQuery({\n queryKey: [\"people\"],\n queryFn: () =>\n fetch(\"https://swapi.dev/api/people\")\n .then((res) => res.json())\n .then((data) => data.results as { name: string }[]),\n initialData: [],\n });\n\n return (\n <div>\n <ul>\n {data.map((person) => (\n <li key={person.name}>{person.name}</li>\n ))}\n </ul>\n </div>\n );\n}\n\nexport default App;\n```\n\nYou can find out everything you need to know on how to use React-Query in the [React-Query documentation](https://tanstack.com/query/latest/docs/framework/react/overview).\n\n## State Management\n\nAnother common requirement for React applications is state management. There are many options for state management in React. TanStack Store provides a great starting point for your project.\n\nFirst you need to add TanStack Store as a dependency:\n\n```bash\nnpm install @tanstack/store\n```\n\nNow let's create a simple counter in the `src/App.tsx` file as a demonstration.\n\n```tsx\nimport { useStore } from \"@tanstack/react-store\";\nimport { Store } from \"@tanstack/store\";\nimport \"./App.css\";\n\nconst countStore = new Store(0);\n\nfunction App() {\n const count = useStore(countStore);\n return (\n <div>\n <button onClick={() => countStore.setState((n) => n + 1)}>\n Increment - {count}\n </button>\n </div>\n );\n}\n\nexport default App;\n```\n\nOne of the many nice features of TanStack Store is the ability to derive state from other state. That derived state will update when the base state updates.\n\nLet's check this out by doubling the count using derived state.\n\n```tsx\nimport { useStore } from \"@tanstack/react-store\";\nimport { Store, Derived } from \"@tanstack/store\";\nimport \"./App.css\";\n\nconst countStore = new Store(0);\n\nconst doubledStore = new Derived({\n fn: () => countStore.state * 2,\n deps: [countStore],\n});\ndoubledStore.mount();\n\nfunction App() {\n const count = useStore(countStore);\n const doubledCount = useStore(doubledStore);\n\n return (\n <div>\n <button onClick={() => countStore.setState((n) => n + 1)}>\n Increment - {count}\n </button>\n <div>Doubled - {doubledCount}</div>\n </div>\n );\n}\n\nexport default App;\n```\n\nWe use the `Derived` class to create a new store that is derived from another store. The `Derived` class has a `mount` method that will start the derived store updating.\n\nOnce we've created the derived store we can use it in the `App` component just like we would any other store using the `useStore` hook.\n\nYou can find out everything you need to know on how to use TanStack Store in the [TanStack Store documentation](https://tanstack.com/store/latest).\n\n# Demo files\n\nFiles 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.\n\n# Learn More\n\nYou can learn more about all of the offerings from TanStack in the [TanStack documentation](https://tanstack.com).\n",
20
- "app.config.ts": "import { defineConfig } from '@tanstack/react-start/config'\nimport viteTsConfigPaths from 'vite-tsconfig-paths'\nimport tailwindcss from '@tailwindcss/vite'\n\nconst config = defineConfig({\n tsr: {\n appDirectory: 'src',\n },\n vite: {\n plugins: [\n // this is the plugin that enables path aliases\n viteTsConfigPaths({\n projects: ['./tsconfig.json'],\n }),\n tailwindcss(),\n ],\n },\n})\n\nexport default config\n",
21
- "package.json": "{\n \"name\": \"TEST\",\n \"private\": true,\n \"type\": \"module\",\n \"scripts\": {\n \"dev\": \"vinxi dev\",\n \"start\": \"vinxi start\",\n \"build\": \"vinxi build\",\n \"serve\": \"vite preview\",\n \"test\": \"vitest run\"\n },\n \"dependencies\": {\n \"@tailwindcss/vite\": \"^4.0.6\",\n \"@tanstack/react-router\": \"^1.114.3\",\n \"@tanstack/react-router-devtools\": \"^1.114.3\",\n \"@tanstack/react-router-with-query\": \"^1.114.3\",\n \"@tanstack/react-start\": \"^1.114.3\",\n \"@tanstack/router-plugin\": \"^1.114.3\",\n \"react\": \"^19.0.0\",\n \"react-dom\": \"^19.0.0\",\n \"tailwindcss\": \"^4.0.6\",\n \"vinxi\": \"^0.5.3\",\n \"vite-tsconfig-paths\": \"^5.1.4\"\n },\n \"devDependencies\": {\n \"@testing-library/dom\": \"^10.4.0\",\n \"@testing-library/react\": \"^16.2.0\",\n \"@types/react\": \"^19.0.8\",\n \"@types/react-dom\": \"^19.0.3\",\n \"@vitejs/plugin-react\": \"^4.3.4\",\n \"jsdom\": \"^26.0.0\",\n \"typescript\": \"^5.7.2\",\n \"vite\": \"^6.1.0\",\n \"vitest\": \"^3.0.5\",\n \"web-vitals\": \"^4.2.4\"\n }\n}",
22
- "tsconfig.json": "{\n \"include\": [\"**/*.ts\", \"**/*.tsx\"],\n \"compilerOptions\": {\n \"target\": \"ES2022\",\n \"jsx\": \"react-jsx\",\n \"module\": \"ESNext\",\n \"lib\": [\"ES2022\", \"DOM\", \"DOM.Iterable\"],\n \"types\": [\"vite/client\"],\n\n /* Bundler mode */\n \"moduleResolution\": \"bundler\",\n \"allowImportingTsExtensions\": true,\n \"verbatimModuleSyntax\": true,\n \"noEmit\": true,\n\n /* Linting */\n \"skipLibCheck\": true,\n \"strict\": true,\n \"noUnusedLocals\": true,\n \"noUnusedParameters\": true,\n \"noFallthroughCasesInSwitch\": true,\n \"noUncheckedSideEffectImports\": true,\n \"baseUrl\": \".\",\n \"paths\": {\n \"@/*\": [\"./src/*\"],\n }\n }\n}\n"
23
- },
24
- "commands": [
25
- {
26
- "command": "npm",
27
- "args": [
28
- "install"
29
- ]
30
- },
31
- {
32
- "command": "git",
33
- "args": [
34
- "init"
35
- ]
36
- }
37
- ]
38
- }