create-tsrouter-app 0.10.0 → 0.11.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 (247) hide show
  1. package/README.md +15 -15
  2. package/dist/index.js +5 -2
  3. package/package.json +2 -17
  4. package/src/index.ts +5 -2
  5. package/.gitattributes +0 -2
  6. package/.github/FUNDING.yml +0 -1
  7. package/.github/ISSUE_TEMPLATE/bug_report.yml +0 -94
  8. package/.github/ISSUE_TEMPLATE/config.yml +0 -11
  9. package/.github/workflows/ci.yml +0 -45
  10. package/.nvmrc +0 -1
  11. package/.prettierignore +0 -3
  12. package/CONTRIBUTING.md +0 -34
  13. package/dist/add-ons.js +0 -69
  14. package/dist/cli.js +0 -89
  15. package/dist/constants.js +0 -4
  16. package/dist/create-app.js +0 -477
  17. package/dist/environment.js +0 -43
  18. package/dist/mcp.js +0 -211
  19. package/dist/options.js +0 -292
  20. package/dist/package-manager.js +0 -30
  21. package/dist/toolchain.js +0 -6
  22. package/dist/types.js +0 -1
  23. package/eslint.config.js +0 -35
  24. package/prettier.config.js +0 -10
  25. package/scripts/publish.js +0 -33
  26. package/src/add-ons.ts +0 -156
  27. package/src/cli.ts +0 -135
  28. package/src/constants.ts +0 -7
  29. package/src/create-app.ts +0 -771
  30. package/src/environment.ts +0 -70
  31. package/src/mcp.ts +0 -252
  32. package/src/options.ts +0 -338
  33. package/src/package-manager.ts +0 -46
  34. package/src/toolchain.ts +0 -7
  35. package/src/types.ts +0 -34
  36. package/templates/react/add-on/clerk/README.md +0 -3
  37. package/templates/react/add-on/clerk/assets/_dot_env.local.append +0 -2
  38. package/templates/react/add-on/clerk/assets/src/integrations/clerk/header-user.tsx +0 -19
  39. package/templates/react/add-on/clerk/assets/src/integrations/clerk/provider.tsx +0 -18
  40. package/templates/react/add-on/clerk/assets/src/routes/demo.clerk.tsx +0 -20
  41. package/templates/react/add-on/clerk/info.json +0 -13
  42. package/templates/react/add-on/clerk/package.json +0 -5
  43. package/templates/react/add-on/convex/README.md +0 -4
  44. package/templates/react/add-on/convex/assets/_dot_cursorrules.append +0 -93
  45. package/templates/react/add-on/convex/assets/_dot_env.local.append +0 -3
  46. package/templates/react/add-on/convex/assets/convex/products.ts +0 -8
  47. package/templates/react/add-on/convex/assets/convex/schema.ts +0 -10
  48. package/templates/react/add-on/convex/assets/src/integrations/convex/provider.tsx +0 -20
  49. package/templates/react/add-on/convex/assets/src/routes/demo.convex.tsx +0 -33
  50. package/templates/react/add-on/convex/info.json +0 -13
  51. package/templates/react/add-on/convex/package.json +0 -6
  52. package/templates/react/add-on/form/assets/src/components/demo.FormComponents.tsx.ejs +0 -300
  53. package/templates/react/add-on/form/assets/src/hooks/demo.form-context.ts +0 -4
  54. package/templates/react/add-on/form/assets/src/hooks/demo.form.ts +0 -22
  55. package/templates/react/add-on/form/assets/src/routes/demo.form.address.tsx.ejs +0 -213
  56. package/templates/react/add-on/form/assets/src/routes/demo.form.simple.tsx.ejs +0 -77
  57. package/templates/react/add-on/form/info.json +0 -26
  58. package/templates/react/add-on/form/package.json +0 -6
  59. package/templates/react/add-on/module-federation/assets/module-federation.config.js.ejs +0 -31
  60. package/templates/react/add-on/module-federation/assets/src/demo-mf-component.tsx +0 -3
  61. package/templates/react/add-on/module-federation/assets/src/demo-mf-self-contained.tsx +0 -11
  62. package/templates/react/add-on/module-federation/info.json +0 -7
  63. package/templates/react/add-on/module-federation/package.json +0 -5
  64. package/templates/react/add-on/netlify/README.md +0 -11
  65. package/templates/react/add-on/netlify/info.json +0 -7
  66. package/templates/react/add-on/sentry/assets/_dot_cursorrules.append +0 -22
  67. package/templates/react/add-on/sentry/assets/_dot_env.local.append +0 -2
  68. package/templates/react/add-on/sentry/assets/src/app/global-middleware.ts +0 -25
  69. package/templates/react/add-on/sentry/assets/src/routes/demo.sentry.testing.tsx +0 -480
  70. package/templates/react/add-on/sentry/info.json +0 -14
  71. package/templates/react/add-on/sentry/package.json +0 -7
  72. package/templates/react/add-on/shadcn/README.md +0 -7
  73. package/templates/react/add-on/shadcn/assets/_dot_cursorrules.append +0 -7
  74. package/templates/react/add-on/shadcn/assets/components.json +0 -21
  75. package/templates/react/add-on/shadcn/assets/src/lib/utils.ts +0 -6
  76. package/templates/react/add-on/shadcn/assets/src/styles.css +0 -138
  77. package/templates/react/add-on/shadcn/info.json +0 -7
  78. package/templates/react/add-on/shadcn/package.json +0 -9
  79. package/templates/react/add-on/start/assets/_dot_gitignore.append +0 -2
  80. package/templates/react/add-on/start/assets/app.config.ts.ejs +0 -19
  81. package/templates/react/add-on/start/assets/postcss.config.ts +0 -5
  82. package/templates/react/add-on/start/assets/src/api.ts +0 -6
  83. package/templates/react/add-on/start/assets/src/client.tsx +0 -8
  84. package/templates/react/add-on/start/assets/src/router.tsx.ejs +0 -77
  85. package/templates/react/add-on/start/assets/src/routes/api.demo-names.ts +0 -11
  86. package/templates/react/add-on/start/assets/src/routes/demo.start.api-request.tsx.ejs +0 -33
  87. package/templates/react/add-on/start/assets/src/routes/demo.start.server-funcs.tsx +0 -50
  88. package/templates/react/add-on/start/assets/src/ssr.tsx +0 -12
  89. package/templates/react/add-on/start/info.json +0 -18
  90. package/templates/react/add-on/start/package.json +0 -15
  91. package/templates/react/add-on/store/assets/src/lib/demo-store.ts +0 -13
  92. package/templates/react/add-on/store/assets/src/routes/demo.store.tsx.ejs +0 -75
  93. package/templates/react/add-on/store/info.json +0 -13
  94. package/templates/react/add-on/store/package.json +0 -6
  95. package/templates/react/add-on/tRPC/assets/src/integrations/trpc/init.ts +0 -9
  96. package/templates/react/add-on/tRPC/assets/src/integrations/trpc/react.ts +0 -4
  97. package/templates/react/add-on/tRPC/assets/src/integrations/trpc/router.ts +0 -18
  98. package/templates/react/add-on/tRPC/assets/src/routes/api.trpc.$.tsx +0 -16
  99. package/templates/react/add-on/tRPC/info.json +0 -9
  100. package/templates/react/add-on/tRPC/package.json +0 -9
  101. package/templates/react/add-on/table/assets/src/data/demo-table-data.ts +0 -50
  102. package/templates/react/add-on/table/assets/src/routes/demo.table.tsx.ejs +0 -373
  103. package/templates/react/add-on/table/info.json +0 -13
  104. package/templates/react/add-on/table/package.json +0 -7
  105. package/templates/react/add-on/tanstack-query/assets/src/integrations/tanstack-query/layout.tsx +0 -5
  106. package/templates/react/add-on/tanstack-query/assets/src/integrations/tanstack-query/root-provider.tsx.ejs +0 -70
  107. package/templates/react/add-on/tanstack-query/assets/src/routes/demo.tanstack-query.tsx.ejs +0 -53
  108. package/templates/react/add-on/tanstack-query/info.json +0 -13
  109. package/templates/react/add-on/tanstack-query/package.json +0 -6
  110. package/templates/react/base/README.md.ejs +0 -558
  111. package/templates/react/base/_dot_gitignore +0 -5
  112. package/templates/react/base/_dot_vscode/settings.biome.json +0 -38
  113. package/templates/react/base/_dot_vscode/settings.json +0 -11
  114. package/templates/react/base/index.html.ejs +0 -20
  115. package/templates/react/base/package.biome.json +0 -10
  116. package/templates/react/base/package.eslintprettier.json +0 -11
  117. package/templates/react/base/package.json +0 -29
  118. package/templates/react/base/package.ts.json +0 -7
  119. package/templates/react/base/package.tw.json +0 -6
  120. package/templates/react/base/public/favicon.ico +0 -0
  121. package/templates/react/base/public/logo192.png +0 -0
  122. package/templates/react/base/public/logo512.png +0 -0
  123. package/templates/react/base/public/manifest.json +0 -25
  124. package/templates/react/base/public/robots.txt +0 -3
  125. package/templates/react/base/src/App.css +0 -38
  126. package/templates/react/base/src/App.test.tsx.ejs +0 -10
  127. package/templates/react/base/src/App.tsx.ejs +0 -74
  128. package/templates/react/base/src/components/Header.tsx.ejs +0 -27
  129. package/templates/react/base/src/logo.svg +0 -44
  130. package/templates/react/base/src/reportWebVitals.ts.ejs +0 -28
  131. package/templates/react/base/src/styles.css.ejs +0 -15
  132. package/templates/react/base/toolchain/.prettierignore +0 -3
  133. package/templates/react/base/toolchain/biome.json +0 -31
  134. package/templates/react/base/toolchain/eslint.config.js +0 -5
  135. package/templates/react/base/toolchain/prettier.config.js +0 -10
  136. package/templates/react/base/tsconfig.json.ejs +0 -29
  137. package/templates/react/base/vite.config.js.ejs +0 -23
  138. package/templates/react/code-router/src/main.tsx.ejs +0 -92
  139. package/templates/react/example/tanchat/README.md +0 -37
  140. package/templates/react/example/tanchat/assets/_dot_env.local.append +0 -2
  141. package/templates/react/example/tanchat/assets/public/example-guitar-flowers.jpg +0 -0
  142. package/templates/react/example/tanchat/assets/public/example-guitar-motherboard.jpg +0 -0
  143. package/templates/react/example/tanchat/assets/public/example-guitar-racing.jpg +0 -0
  144. package/templates/react/example/tanchat/assets/public/example-guitar-steamer-trunk.jpg +0 -0
  145. package/templates/react/example/tanchat/assets/public/example-guitar-superhero.jpg +0 -0
  146. package/templates/react/example/tanchat/assets/public/example-guitar-traveling.jpg +0 -0
  147. package/templates/react/example/tanchat/assets/public/example-guitar-video-games.jpg +0 -0
  148. package/templates/react/example/tanchat/assets/src/components/example-AIAssistant.tsx +0 -173
  149. package/templates/react/example/tanchat/assets/src/components/example-GuitarRecommendation.tsx +0 -47
  150. package/templates/react/example/tanchat/assets/src/data/example-guitars.ts +0 -83
  151. package/templates/react/example/tanchat/assets/src/demo.index.css +0 -220
  152. package/templates/react/example/tanchat/assets/src/integrations/tanchat/header-user.tsx +0 -5
  153. package/templates/react/example/tanchat/assets/src/routes/example.chat.tsx +0 -159
  154. package/templates/react/example/tanchat/assets/src/routes/example.guitars/$guitarId.tsx +0 -50
  155. package/templates/react/example/tanchat/assets/src/routes/example.guitars/index.tsx +0 -54
  156. package/templates/react/example/tanchat/assets/src/store/example-assistant.ts +0 -3
  157. package/templates/react/example/tanchat/assets/src/utils/demo.ai.ts +0 -62
  158. package/templates/react/example/tanchat/assets/src/utils/demo.tools.ts +0 -47
  159. package/templates/react/example/tanchat/info.json +0 -19
  160. package/templates/react/example/tanchat/package.json +0 -15
  161. package/templates/react/file-router/package.fr.json +0 -5
  162. package/templates/react/file-router/src/main.tsx.ejs +0 -55
  163. package/templates/react/file-router/src/routes/__root.tsx.ejs +0 -81
  164. package/templates/solid/add-on/form/assets/src/routes/demo.form.tsx.ejs +0 -352
  165. package/templates/solid/add-on/form/info.json +0 -13
  166. package/templates/solid/add-on/form/package.json +0 -5
  167. package/templates/solid/add-on/module-federation/assets/module-federation.config.js.ejs +0 -27
  168. package/templates/solid/add-on/module-federation/assets/src/demo-mf-component.tsx +0 -3
  169. package/templates/solid/add-on/module-federation/assets/src/demo-mf-self-contained.tsx +0 -9
  170. package/templates/solid/add-on/module-federation/info.json +0 -7
  171. package/templates/solid/add-on/module-federation/package.json +0 -5
  172. package/templates/solid/add-on/sentry/assets/_dot_cursorrules.append +0 -22
  173. package/templates/solid/add-on/sentry/assets/_dot_env.local.append +0 -2
  174. package/templates/solid/add-on/sentry/assets/src/routes/demo.sentry.bad-event-handler.tsx +0 -20
  175. package/templates/solid/add-on/sentry/info.json +0 -13
  176. package/templates/solid/add-on/sentry/package.json +0 -5
  177. package/templates/solid/add-on/solid-ui/README.md +0 -9
  178. package/templates/solid/add-on/solid-ui/assets/src/lib/utils.ts +0 -6
  179. package/templates/solid/add-on/solid-ui/assets/src/styles.css +0 -138
  180. package/templates/solid/add-on/solid-ui/assets/ui.config.json +0 -13
  181. package/templates/solid/add-on/solid-ui/info.json +0 -11
  182. package/templates/solid/add-on/solid-ui/package.json +0 -9
  183. package/templates/solid/add-on/store/assets/src/lib/demo-store.ts +0 -13
  184. package/templates/solid/add-on/store/assets/src/routes/demo.store.tsx.ejs +0 -77
  185. package/templates/solid/add-on/store/info.json +0 -13
  186. package/templates/solid/add-on/store/package.json +0 -6
  187. package/templates/solid/add-on/tanstack-query/assets/src/integrations/tanstack-query/header-user.tsx +0 -5
  188. package/templates/solid/add-on/tanstack-query/assets/src/integrations/tanstack-query/provider.tsx +0 -15
  189. package/templates/solid/add-on/tanstack-query/assets/src/routes/demo.tanstack-query.tsx +0 -30
  190. package/templates/solid/add-on/tanstack-query/info.json +0 -13
  191. package/templates/solid/add-on/tanstack-query/package.json +0 -6
  192. package/templates/solid/base/README.md.ejs +0 -215
  193. package/templates/solid/base/_dot_cursorrules.append +0 -35
  194. package/templates/solid/base/_dot_gitignore +0 -5
  195. package/templates/solid/base/_dot_vscode/settings.biome.json +0 -38
  196. package/templates/solid/base/_dot_vscode/settings.json +0 -11
  197. package/templates/solid/base/index.html.ejs +0 -20
  198. package/templates/solid/base/package.biome.json +0 -10
  199. package/templates/solid/base/package.eslintprettier.json +0 -11
  200. package/templates/solid/base/package.json +0 -22
  201. package/templates/solid/base/package.ts.json +0 -5
  202. package/templates/solid/base/package.tw.json +0 -6
  203. package/templates/solid/base/public/favicon.ico +0 -0
  204. package/templates/solid/base/public/logo192.png +0 -0
  205. package/templates/solid/base/public/logo512.png +0 -0
  206. package/templates/solid/base/public/manifest.json +0 -25
  207. package/templates/solid/base/public/robots.txt +0 -3
  208. package/templates/solid/base/src/App.css +0 -0
  209. package/templates/solid/base/src/App.tsx.ejs +0 -47
  210. package/templates/solid/base/src/components/Header.tsx.ejs +0 -26
  211. package/templates/solid/base/src/logo.svg +0 -120
  212. package/templates/solid/base/src/styles.css.ejs +0 -15
  213. package/templates/solid/base/toolchain/.prettierignore +0 -3
  214. package/templates/solid/base/toolchain/biome.json +0 -31
  215. package/templates/solid/base/toolchain/eslint.config.js +0 -5
  216. package/templates/solid/base/toolchain/prettier.config.js +0 -10
  217. package/templates/solid/base/tsconfig.json.ejs +0 -31
  218. package/templates/solid/base/vite.config.js.ejs +0 -22
  219. package/templates/solid/code-router/src/main.tsx.ejs +0 -71
  220. package/templates/solid/example/tanchat/README.md +0 -52
  221. package/templates/solid/example/tanchat/assets/ai-streaming-server/README.md +0 -110
  222. package/templates/solid/example/tanchat/assets/ai-streaming-server/_dot_env.example +0 -1
  223. package/templates/solid/example/tanchat/assets/ai-streaming-server/package.json +0 -26
  224. package/templates/solid/example/tanchat/assets/ai-streaming-server/src/index.ts +0 -102
  225. package/templates/solid/example/tanchat/assets/ai-streaming-server/tsconfig.json +0 -15
  226. package/templates/solid/example/tanchat/assets/src/components/demo.SettingsDialog.tsx +0 -149
  227. package/templates/solid/example/tanchat/assets/src/demo.index.css +0 -227
  228. package/templates/solid/example/tanchat/assets/src/lib/demo-store.ts +0 -13
  229. package/templates/solid/example/tanchat/assets/src/routes/example.chat.tsx +0 -435
  230. package/templates/solid/example/tanchat/assets/src/store/demo.hooks.ts +0 -17
  231. package/templates/solid/example/tanchat/assets/src/store/demo.store.ts +0 -133
  232. package/templates/solid/example/tanchat/info.json +0 -14
  233. package/templates/solid/example/tanchat/package.json +0 -7
  234. package/templates/solid/file-router/package.fr.json +0 -5
  235. package/templates/solid/file-router/src/main.tsx.ejs +0 -47
  236. package/templates/solid/file-router/src/routes/__root.tsx.ejs +0 -41
  237. package/templates/solid/file-router/src/routes/index.tsx +0 -43
  238. package/tests/cra.test.ts +0 -232
  239. package/tests/snapshots/cra/cr-js-npm.json +0 -32
  240. package/tests/snapshots/cra/cr-ts-npm.json +0 -33
  241. package/tests/snapshots/cra/fr-ts-npm.json +0 -33
  242. package/tests/snapshots/cra/fr-ts-tw-npm.json +0 -32
  243. package/tests/snapshots/cra/solid-cr-js-npm.json +0 -30
  244. package/tests/snapshots/cra/solid-cr-ts-npm.json +0 -31
  245. package/tests/snapshots/cra/solid-fr-ts-npm.json +0 -32
  246. package/tests/snapshots/cra/solid-fr-ts-tw-npm.json +0 -31
  247. package/tests/test-utilities.ts +0 -83
package/README.md CHANGED
@@ -10,17 +10,17 @@ To maintain compatability with `create-react-app` you can build a new applicatio
10
10
 
11
11
  | Command | Description |
12
12
  | -------------------------------------------------------------------------------- | ------------------------------------------------- |
13
- | `npx create-tsrouter-app@latest my-app` | Create a new app |
14
- | `npx create-tsrouter-app@latest my-app --template file-router` | Create a new file based app |
15
- | `npx create-tsrouter-app@latest my-app --template typescript` | Create a new TypeScript app using the Code Router |
16
- | `npx create-tsrouter-app@latest my-app --tailwind` | Add Tailwind CSS support |
17
- | `npx create-tsrouter-app@latest my-app --framework solid` | Create a Solid app |
18
- | `npx create-tsrouter-app@latest my-app --framework solid --template file-router` | Create a Solid app with file-router |
13
+ | `pnpx create-tsrouter-app@latest my-app` | Create a new app |
14
+ | `pnpx create-tsrouter-app@latest my-app --template file-router` | Create a new file based app |
15
+ | `pnpx create-tsrouter-app@latest my-app --template typescript` | Create a new TypeScript app using the Code Router |
16
+ | `pnpx create-tsrouter-app@latest my-app --tailwind` | Add Tailwind CSS support |
17
+ | `pnpx create-tsrouter-app@latest my-app --framework solid` | Create a Solid app |
18
+ | `pnpx create-tsrouter-app@latest my-app --framework solid --template file-router` | Create a Solid app with file-router |
19
19
 
20
20
  If you don't specify a project name, the CLI will walk you through an interactive setup process:
21
21
 
22
22
  ```bash
23
- npx create-tsrouter-app@latest
23
+ pnpx create-tsrouter-app@latest
24
24
  ```
25
25
 
26
26
  This will start an interactive CLI that guides you through the setup process, allowing you to choose:
@@ -38,7 +38,7 @@ This will start an interactive CLI that guides you through the setup process, al
38
38
  You can also use command line flags to specify your preferences directly:
39
39
 
40
40
  ```bash
41
- npx create-tsrouter-app@latest my-app --template file-router --tailwind --package-manager pnpm
41
+ pnpx create-tsrouter-app@latest my-app --template file-router --tailwind --package-manager pnpm
42
42
  ```
43
43
 
44
44
  Available options:
@@ -67,7 +67,7 @@ File Based Routing is the default option when using the interactive CLI. The loc
67
67
  To explicitly choose File Based Routing, use:
68
68
 
69
69
  ```bash
70
- npx create-tsrouter-app@latest my-app --template file-router
70
+ pnpx create-tsrouter-app@latest my-app --template file-router
71
71
  ```
72
72
 
73
73
  ### Code Based Routing
@@ -75,7 +75,7 @@ npx create-tsrouter-app@latest my-app --template file-router
75
75
  If you prefer traditional code-based routing, you can select it in the interactive CLI or specify it by using either the `typescript` or `javascript` template:
76
76
 
77
77
  ```bash
78
- npx create-tsrouter-app@latest my-app --template typescript
78
+ pnpx create-tsrouter-app@latest my-app --template typescript
79
79
  ```
80
80
 
81
81
  ## Additional Configuration
@@ -109,7 +109,7 @@ Setting this flag to `eslint+prettier` will configure it as your toolchain of ch
109
109
  You can enable add-on selection:
110
110
 
111
111
  ```bash
112
- npx create-tsrouter-app@latest --add-ons
112
+ pnpx create-tsrouter-app@latest --add-ons
113
113
  ```
114
114
 
115
115
  This will prompt you to select the add-ons you want to enable during application creation.
@@ -117,19 +117,19 @@ This will prompt you to select the add-ons you want to enable during application
117
117
  You can enable specific add-ons directly by adding a comma separated list of add-on names to the `--add-ons` flag. For example:
118
118
 
119
119
  ```bash
120
- npx create-tsrouter-app@latest my-app --add-ons shadcn,tanstack-query
120
+ pnpx create-tsrouter-app@latest my-app --add-ons shadcn,tanstack-query
121
121
  ```
122
122
 
123
123
  You can get a list of all available add-ons by running:
124
124
 
125
125
  ```bash
126
- npx create-tsrouter-app@latest --list-add-ons
126
+ pnpx create-tsrouter-app@latest --list-add-ons
127
127
  ```
128
128
 
129
129
  This will display a list of all available add-ons for React that are compatible with the Code Router.
130
130
 
131
131
  ```bash
132
- npx create-tsrouter-app@latest --list-add-ons --framework solid --template file-router
132
+ pnpx create-tsrouter-app@latest --list-add-ons --framework solid --template file-router
133
133
  ```
134
134
 
135
135
  Will get you a list of all available add-ons for Solid that are compatible with the File Router.
@@ -139,7 +139,7 @@ Will get you a list of all available add-ons for Solid that are compatible with
139
139
  You can launch the `create-tsrouter-app` CLI with the `--mcp` flag to enable MCP support. Use this in your MCP enabled IDE to allow the Agent model to generate TanStack Router applications.
140
140
 
141
141
  ```bash
142
- npx create-tsrouter-app@latest --mcp
142
+ pnpx create-tsrouter-app@latest --mcp
143
143
  ```
144
144
 
145
145
  Shown below is the configuration for MCP support in Cursor.
package/dist/index.js CHANGED
@@ -1,3 +1,6 @@
1
1
  #!/usr/bin/env node
2
- import { cli } from './cli.js';
3
- cli();
2
+ import { cli } from '@tanstack/cta-engine';
3
+ cli({
4
+ name: 'create-tsrouter-app',
5
+ appName: 'TanStack',
6
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-tsrouter-app",
3
- "version": "0.10.0",
3
+ "version": "0.11.0",
4
4
  "description": "Tanstack Application Builder",
5
5
  "bin": "./dist/index.js",
6
6
  "type": "module",
@@ -22,25 +22,10 @@
22
22
  "author": "Jack Herrington <jherr@pobox.com>",
23
23
  "license": "MIT",
24
24
  "dependencies": {
25
- "@clack/prompts": "^0.10.0",
26
- "@modelcontextprotocol/sdk": "^1.6.0",
27
- "chalk": "^5.4.1",
28
- "commander": "^13.1.0",
29
- "ejs": "^3.1.10",
30
- "execa": "^9.5.2",
31
- "express": "^4.21.2",
32
- "prettier": "^3.5.0",
33
- "vitest": "^3.0.8",
34
- "zod": "^3.24.2"
25
+ "@tanstack/cta-engine": "0.11.0"
35
26
  },
36
27
  "devDependencies": {
37
- "@tanstack/config": "^0.16.2",
38
- "@types/ejs": "^3.1.5",
39
- "@types/express": "^5.0.0",
40
28
  "@types/node": "^22.13.4",
41
- "eslint": "^9.20.0",
42
- "eslint-plugin-react-hooks": "^5.1.0",
43
- "eslint-plugin-unused-imports": "^4.1.4",
44
29
  "typescript": "^5.6.3"
45
30
  },
46
31
  "scripts": {}
package/src/index.ts CHANGED
@@ -1,4 +1,7 @@
1
1
  #!/usr/bin/env node
2
- import { cli } from './cli.js'
2
+ import { cli } from '@tanstack/cta-engine'
3
3
 
4
- cli()
4
+ cli({
5
+ name: 'create-tsrouter-app',
6
+ appName: 'TanStack',
7
+ })
package/.gitattributes DELETED
@@ -1,2 +0,0 @@
1
- # Auto detect text files and perform LF normalization
2
- * text=auto
@@ -1 +0,0 @@
1
- github: tannerlinsley
@@ -1,94 +0,0 @@
1
- name: '🐛 Bug report'
2
- description: Create a report to help us improve
3
- body:
4
- - type: markdown
5
- attributes:
6
- value: |
7
- Thank you for reporting an issue :pray:.
8
-
9
- This issue tracker is for reporting bugs found in `create-tsrouter-app` (https://github.com/tanstack/create-tsrouter-app).
10
- If you have a question about how to achieve something and are struggling, please post a question
11
- inside of `create-tsrouter-app` Discussions tab: https://github.com/tanstack/create-tsrouter-app/discussions
12
-
13
- Before submitting a new bug/issue, please check the links below to see if there is a solution or question posted there already:
14
- - `create-tsrouter-app` Issues tab: https://github.com/tanstack/create-tsrouter-app/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc
15
- - `create-tsrouter-app` closed issues tab: https://github.com/tanstack/create-tsrouter-app/issues?q=is%3Aissue+sort%3Aupdated-desc+is%3Aclosed
16
- - `create-tsrouter-app` Discussions tab: https://github.com/tanstack/create-tsrouter-app/discussions
17
-
18
- The more information you fill in, the better the community can help you.
19
- - type: dropdown
20
- id: project
21
- attributes:
22
- label: Which project does this relate to?
23
- description: If you are unsure, please leave this as "Create Tanstack App".
24
- options:
25
- - Create Tanstack App
26
- validations:
27
- required: true
28
- - type: textarea
29
- id: description
30
- attributes:
31
- label: Describe the bug
32
- description: Provide a clear and concise description of the challenge you are running into.
33
- validations:
34
- required: true
35
- - type: input
36
- id: link
37
- attributes:
38
- label: Your Example Website or App
39
- description: |
40
- Which website or app were you using when the bug happened?
41
- Note:
42
- - Please provide a link via our pre-configured Stackblitz project ([file-based routes](https://stackblitz.com/github/tanstack/router/tree/main/examples/react/quickstart-file-based?file=src%2Fmain.tsx)|[code-based routes](https://stackblitz.com/github/tanstack/router/tree/main/examples/react/quickstart?file=src%2Fmain.tsx)) or a link to a repo that can reproduce the issue.
43
- - Your bug will may get fixed much faster if we can run your code and it doesn't have dependencies other than the `router` npm package / dependency.
44
- - To create a shareable code example you can use Stackblitz. Please no localhost URLs.
45
- - Please read these tips for providing a minimal example: https://stackoverflow.com/help/mcve.
46
- placeholder: reproduction URL
47
- validations:
48
- required: true
49
- - type: textarea
50
- id: steps
51
- attributes:
52
- label: Steps to Reproduce the Bug or Issue
53
- description: Describe the steps we have to take to reproduce the behavior.
54
- placeholder: |
55
- 1. Go to '...'
56
- 2. Click on '....'
57
- 3. Scroll down to '....'
58
- 4. See error
59
- validations:
60
- required: true
61
- - type: textarea
62
- id: expected
63
- attributes:
64
- label: Expected behavior
65
- description: Provide a clear and concise description of what you expected to happen.
66
- placeholder: |
67
- As a user, I expected ___ behavior but i am seeing ___
68
- validations:
69
- required: true
70
- - type: textarea
71
- id: screenshots_or_videos
72
- attributes:
73
- label: Screenshots or Videos
74
- description: |
75
- If applicable, add screenshots or a video to help explain your problem.
76
- For more information on the supported file image/file types and the file size limits, please refer
77
- to the following link: https://docs.github.com/en/github/writing-on-github/working-with-advanced-formatting/attaching-files
78
- placeholder: |
79
- You can drag your video or image files inside of this editor ↓
80
- - type: textarea
81
- id: platform
82
- attributes:
83
- label: Platform
84
- value: |
85
- - OS: [e.g. macOS, Windows, Linux]
86
- - Browser: [e.g. Chrome, Safari, Firefox]
87
- - Version: [e.g. 91.1]
88
- validations:
89
- required: true
90
- - type: textarea
91
- id: additional
92
- attributes:
93
- label: Additional context
94
- description: Add any other context about the problem here.
@@ -1,11 +0,0 @@
1
- blank_issues_enabled: false
2
- contact_links:
3
- - name: 🤔 Feature Requests & Questions
4
- url: https://github.com/tanstack/create-tsrouter-app/discussions
5
- about: Please ask and answer questions here.
6
- - name: 💬 Community Chat
7
- url: https://discord.gg/mQd7egN
8
- about: A dedicated discord server hosted by Tanner Linsley
9
- - name: 💬 Tanstack Twitter
10
- url: https://twitter.com/tan_stack
11
- about: Stay up to date with new releases of our libraries
@@ -1,45 +0,0 @@
1
- name: ci
2
-
3
- on:
4
- workflow_dispatch:
5
- inputs:
6
- tag:
7
- description: override release tag
8
- required: false
9
- push:
10
- branches: [main, alpha, beta]
11
-
12
- concurrency:
13
- group: ${{ github.workflow }}-${{ github.event.number || github.ref }}
14
- cancel-in-progress: true
15
-
16
- permissions:
17
- contents: write
18
- id-token: write
19
-
20
- jobs:
21
- test-and-publish:
22
- name: Test & Publish
23
- if: github.repository_owner == 'TanStack'
24
- runs-on: ubuntu-latest
25
- steps:
26
- - name: Checkout
27
- uses: actions/checkout@v4.2.2
28
- with:
29
- fetch-depth: 0
30
- - name: Setup Tools
31
- uses: tanstack/config/.github/setup@main
32
- - name: Test
33
- run: pnpm test
34
- - name: Build
35
- run: pnpm build
36
- - name: Publish
37
- run: |
38
- git config --global user.name 'Tanner Linsley'
39
- git config --global user.email 'tannerlinsley@users.noreply.github.com'
40
- npm config set '//registry.npmjs.org/:_authToken' "${NPM_TOKEN}"
41
- pnpm run cipublish
42
- env:
43
- GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
44
- NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
45
- TAG: ${{ inputs.tag }}
package/.nvmrc DELETED
@@ -1 +0,0 @@
1
- 20.17.0
package/.prettierignore DELETED
@@ -1,3 +0,0 @@
1
- dist
2
- project-template
3
- node_modules
package/CONTRIBUTING.md DELETED
@@ -1,34 +0,0 @@
1
- # Contributing
2
-
3
- - Clone the repo
4
- - `gh repo clone TanStack/create-tsrouter-app`
5
- - Ensure `node` is installed
6
- - https://nodejs.org/en/
7
- - Ensure `pnpm` is installed
8
- - https://pnpm.io/installation
9
- - Why? We use `pnpm` to manage workspace dependencies. It's easily the best monorepo/workspace experience available as of when this was written.
10
- - Install dependencies
11
- - `pnpm install`
12
- - This installs dependencies for all of the packages in the monorepo, even examples!
13
- - Dependencies inside of the packages and examples are automatically linked together as local/dynamic dependencies.
14
- - Run the build
15
- - `pnpm build`
16
- - Build an example app with the builder
17
- - `pnpm start app-js`
18
- - Run the `app-js` app just to make sure it works
19
- - Make changes to the code
20
- - Re-run `pnpm build` and `pnpm start` (in all its configurations) to make sure the changes work
21
- - Check your work and PR
22
-
23
- # Testing combinations
24
-
25
- These must all product running applications that can be built (`pnpm build`) and tested (`pnpm test`).
26
-
27
- | Command | Description |
28
- | -------------------------------------------------------- | ------------------------------------------------------------------ |
29
- | `pnpm start app-js` | Creates a JavaScript app |
30
- | `pnpm start app-ts --template typescript` | Creates a TypeScript app |
31
- | `pnpm start app-js-tw --tailwind` | Creates a JavaScript app with Tailwind CSS |
32
- | `pnpm start app-ts-tw --template typescript --tailwind` | Creates a TypeScript app with Tailwind CSS |
33
- | `pnpm start app-fr --template file-router` | Creates a TypeScript app with File Based Routing |
34
- | `pnpm start app-fr-tw --template file-router --tailwind` | Creates a TypeScript app with File Based Routing with Tailwind CSS |
package/dist/add-ons.js DELETED
@@ -1,69 +0,0 @@
1
- import { readFile } from 'node:fs/promises';
2
- import { existsSync, readdirSync, statSync } from 'node:fs';
3
- import { resolve } from 'node:path';
4
- import { fileURLToPath } from 'node:url';
5
- import chalk from 'chalk';
6
- import { DEFAULT_FRAMEWORK } from './constants.js';
7
- function isDirectory(path) {
8
- return statSync(path).isDirectory();
9
- }
10
- export async function getAllAddOns(framework, template) {
11
- const addOns = [];
12
- for (const type of ['add-on', 'example']) {
13
- const addOnsBase = fileURLToPath(new URL(`../templates/${framework}/${type}`, import.meta.url));
14
- if (!existsSync(addOnsBase)) {
15
- continue;
16
- }
17
- for (const dir of await readdirSync(addOnsBase).filter((file) => isDirectory(resolve(addOnsBase, file)))) {
18
- const filePath = resolve(addOnsBase, dir, 'info.json');
19
- const fileContent = await readFile(filePath, 'utf-8');
20
- const info = JSON.parse(fileContent);
21
- if (!info.templates.includes(template)) {
22
- continue;
23
- }
24
- let packageAdditions = {};
25
- if (existsSync(resolve(addOnsBase, dir, 'package.json'))) {
26
- packageAdditions = JSON.parse(await readFile(resolve(addOnsBase, dir, 'package.json'), 'utf-8'));
27
- }
28
- let readme;
29
- if (existsSync(resolve(addOnsBase, dir, 'README.md'))) {
30
- readme = await readFile(resolve(addOnsBase, dir, 'README.md'), 'utf-8');
31
- }
32
- addOns.push({
33
- ...info,
34
- id: dir,
35
- type,
36
- directory: resolve(addOnsBase, dir),
37
- packageAdditions,
38
- readme,
39
- });
40
- }
41
- }
42
- return addOns;
43
- }
44
- // Turn the list of chosen add-on IDs into a final list of add-ons by resolving dependencies
45
- export async function finalizeAddOns(framework, template, chosenAddOnIDs) {
46
- const finalAddOnIDs = new Set(chosenAddOnIDs);
47
- const addOns = await getAllAddOns(framework, template);
48
- for (const addOnID of finalAddOnIDs) {
49
- const addOn = addOns.find((a) => a.id === addOnID);
50
- if (!addOn) {
51
- throw new Error(`Add-on ${addOnID} not found`);
52
- }
53
- for (const dependsOn of addOn.dependsOn || []) {
54
- const dep = addOns.find((a) => a.id === dependsOn);
55
- if (!dep) {
56
- throw new Error(`Dependency ${dependsOn} not found`);
57
- }
58
- finalAddOnIDs.add(dep.id);
59
- }
60
- }
61
- return [...finalAddOnIDs].map((id) => addOns.find((a) => a.id === id));
62
- }
63
- export async function listAddOns(options) {
64
- const mode = options.template === 'file-router' ? 'file-router' : 'code-router';
65
- const addOns = await getAllAddOns(options.framework || DEFAULT_FRAMEWORK, mode);
66
- for (const addOn of addOns) {
67
- console.log(`${chalk.bold(addOn.id)}: ${addOn.description}`);
68
- }
69
- }
package/dist/cli.js DELETED
@@ -1,89 +0,0 @@
1
- import { Command, InvalidArgumentError } from 'commander';
2
- import { intro, log } from '@clack/prompts';
3
- import { createApp } from './create-app.js';
4
- import { normalizeOptions, promptForOptions } from './options.js';
5
- import { SUPPORTED_PACKAGE_MANAGERS } from './package-manager.js';
6
- import { SUPPORTED_TOOLCHAINS } from './toolchain.js';
7
- import runServer from './mcp.js';
8
- import { listAddOns } from './add-ons.js';
9
- import { DEFAULT_FRAMEWORK, SUPPORTED_FRAMEWORKS } from './constants.js';
10
- import { createDefaultEnvironment } from './environment.js';
11
- export function cli() {
12
- const program = new Command();
13
- program
14
- .name('create-tsrouter-app')
15
- .description('CLI to create a new TanStack application')
16
- .argument('[project-name]', 'name of the project')
17
- .option('--no-git', 'do not create a git repository')
18
- .option('--framework <type>', 'project framework (solid, react)', (value) => {
19
- if (!SUPPORTED_FRAMEWORKS.includes(value)) {
20
- throw new InvalidArgumentError(`Invalid framework: ${value}. Only the following are allowed: ${SUPPORTED_FRAMEWORKS.join(', ')}`);
21
- }
22
- return value;
23
- }, DEFAULT_FRAMEWORK)
24
- .option('--template <type>', 'project template (typescript, javascript, file-router)', (value) => {
25
- if (value !== 'typescript' &&
26
- value !== 'javascript' &&
27
- value !== 'file-router') {
28
- throw new InvalidArgumentError(`Invalid template: ${value}. Only the following are allowed: typescript, javascript, file-router`);
29
- }
30
- return value;
31
- })
32
- .option(`--package-manager <${SUPPORTED_PACKAGE_MANAGERS.join('|')}>`, `Explicitly tell the CLI to use this package manager`, (value) => {
33
- if (!SUPPORTED_PACKAGE_MANAGERS.includes(value)) {
34
- throw new InvalidArgumentError(`Invalid package manager: ${value}. The following are allowed: ${SUPPORTED_PACKAGE_MANAGERS.join(', ')}`);
35
- }
36
- return value;
37
- })
38
- .option(`--toolchain <${SUPPORTED_TOOLCHAINS.join('|')}>`, `Explicitly tell the CLI to use this toolchain`, (value) => {
39
- if (!SUPPORTED_TOOLCHAINS.includes(value)) {
40
- throw new InvalidArgumentError(`Invalid toolchain: ${value}. The following are allowed: ${SUPPORTED_TOOLCHAINS.join(', ')}`);
41
- }
42
- return value;
43
- })
44
- .option('--tailwind', 'add Tailwind CSS', false)
45
- .option('--add-ons [...add-ons]', 'pick from a list of available add-ons (comma separated list)', (value) => {
46
- let addOns = !!value;
47
- if (typeof value === 'string') {
48
- addOns = value.split(',').map((addon) => addon.trim());
49
- }
50
- return addOns;
51
- })
52
- .option('--list-add-ons', 'list all available add-ons', false)
53
- .option('--mcp', 'run the MCP server', false)
54
- .option('--mcp-sse', 'run the MCP server in SSE mode', false)
55
- .action(async (projectName, options) => {
56
- if (options.listAddOns) {
57
- await listAddOns(options);
58
- }
59
- else if (options.mcp || options.mcpSse) {
60
- await runServer(!!options.mcpSse);
61
- }
62
- else {
63
- try {
64
- const cliOptions = {
65
- projectName,
66
- ...options,
67
- };
68
- let finalOptions = await normalizeOptions(cliOptions);
69
- if (finalOptions) {
70
- intro(`Creating a new TanStack app in ${projectName}...`);
71
- }
72
- else {
73
- intro("Let's configure your TanStack application");
74
- finalOptions = await promptForOptions(cliOptions);
75
- }
76
- await createApp(finalOptions, {
77
- environment: createDefaultEnvironment(),
78
- });
79
- }
80
- catch (error) {
81
- log.error(error instanceof Error
82
- ? error.message
83
- : 'An unknown error occurred');
84
- process.exit(1);
85
- }
86
- }
87
- });
88
- program.parse();
89
- }
package/dist/constants.js DELETED
@@ -1,4 +0,0 @@
1
- export const CODE_ROUTER = 'code-router';
2
- export const FILE_ROUTER = 'file-router';
3
- export const SUPPORTED_FRAMEWORKS = ['solid', 'react'];
4
- export const DEFAULT_FRAMEWORK = 'react';