create-start-app 0.3.1 → 0.4.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 (165) hide show
  1. package/README.md +41 -9
  2. package/dist/add-ons.js +69 -0
  3. package/dist/cli.js +78 -0
  4. package/dist/constants.js +4 -0
  5. package/dist/create-app.js +371 -0
  6. package/dist/index.js +2 -347
  7. package/dist/mcp.js +169 -0
  8. package/dist/options.js +260 -0
  9. package/dist/{utils/getPackageManager.js → package-manager.js} +1 -0
  10. package/dist/types.js +1 -0
  11. package/package.json +8 -4
  12. package/src/add-ons.ts +156 -0
  13. package/src/cli.ts +114 -0
  14. package/src/constants.ts +7 -0
  15. package/src/create-app.ts +582 -0
  16. package/src/index.ts +2 -507
  17. package/src/mcp.ts +205 -0
  18. package/src/options.ts +308 -0
  19. package/src/{utils/getPackageManager.ts → package-manager.ts} +1 -0
  20. package/src/types.ts +30 -0
  21. package/templates/react/add-on/clerk/README.md +3 -0
  22. package/templates/react/add-on/clerk/assets/_dot_env.local.append +2 -0
  23. package/templates/react/add-on/clerk/assets/src/integrations/clerk/header-user.tsx +19 -0
  24. package/templates/react/add-on/clerk/assets/src/integrations/clerk/provider.tsx +18 -0
  25. package/templates/react/add-on/clerk/assets/src/routes/demo.clerk.tsx +20 -0
  26. package/templates/react/add-on/clerk/info.json +13 -0
  27. package/templates/react/add-on/clerk/package.json +5 -0
  28. package/templates/react/add-on/convex/README.md +4 -0
  29. package/templates/react/add-on/convex/assets/_dot_cursorrules.append +93 -0
  30. package/templates/react/add-on/convex/assets/_dot_env.local.append +3 -0
  31. package/templates/react/add-on/convex/assets/convex/products.ts +8 -0
  32. package/templates/react/add-on/convex/assets/convex/schema.ts +10 -0
  33. package/templates/react/add-on/convex/assets/src/integrations/convex/provider.tsx +20 -0
  34. package/templates/react/add-on/convex/assets/src/routes/demo.convex.tsx +33 -0
  35. package/templates/react/add-on/convex/info.json +13 -0
  36. package/templates/react/add-on/convex/package.json +6 -0
  37. package/templates/react/add-on/form/assets/src/routes/demo.form.tsx.ejs +62 -0
  38. package/templates/react/add-on/form/info.json +13 -0
  39. package/templates/react/add-on/form/package.json +5 -0
  40. package/templates/react/add-on/module-federation/assets/module-federation.config.js.ejs +31 -0
  41. package/templates/react/add-on/module-federation/assets/src/demo-mf-component.tsx +3 -0
  42. package/templates/react/add-on/module-federation/assets/src/demo-mf-self-contained.tsx +11 -0
  43. package/templates/react/add-on/module-federation/info.json +7 -0
  44. package/templates/react/add-on/module-federation/package.json +5 -0
  45. package/templates/react/add-on/netlify/README.md +11 -0
  46. package/templates/react/add-on/netlify/info.json +7 -0
  47. package/templates/react/add-on/sentry/assets/_dot_cursorrules.append +22 -0
  48. package/templates/react/add-on/sentry/assets/_dot_env.local.append +2 -0
  49. package/templates/react/add-on/sentry/assets/src/app/global-middleware.ts +25 -0
  50. package/templates/react/add-on/sentry/assets/src/routes/demo.sentry.testing.tsx +480 -0
  51. package/templates/react/add-on/sentry/info.json +14 -0
  52. package/templates/react/add-on/sentry/package.json +7 -0
  53. package/templates/react/add-on/shadcn/README.md +7 -0
  54. package/templates/react/add-on/shadcn/assets/_dot_cursorrules.append +7 -0
  55. package/templates/react/add-on/shadcn/info.json +11 -0
  56. package/templates/react/add-on/start/assets/app.config.ts +16 -0
  57. package/templates/react/add-on/start/assets/postcss.config.ts +5 -0
  58. package/templates/react/add-on/start/assets/src/api.ts +6 -0
  59. package/templates/react/add-on/start/assets/src/client.tsx +10 -0
  60. package/templates/react/add-on/start/assets/src/router.tsx.ejs +51 -0
  61. package/templates/react/add-on/start/assets/src/routes/api.demo-names.ts +11 -0
  62. package/templates/react/add-on/start/assets/src/routes/demo.start.api-request.tsx.ejs +33 -0
  63. package/templates/react/add-on/start/assets/src/routes/demo.start.server-funcs.tsx +49 -0
  64. package/templates/react/add-on/start/assets/src/ssr.tsx +12 -0
  65. package/templates/react/add-on/start/info.json +19 -0
  66. package/templates/react/add-on/start/package.json +14 -0
  67. package/templates/react/add-on/store/assets/src/lib/demo-store.ts +13 -0
  68. package/templates/react/add-on/store/assets/src/routes/demo.store.tsx.ejs +75 -0
  69. package/templates/react/add-on/store/info.json +13 -0
  70. package/templates/react/add-on/store/package.json +6 -0
  71. package/templates/react/add-on/tanstack-query/assets/src/integrations/tanstack-query/layout.tsx +5 -0
  72. package/templates/react/add-on/tanstack-query/assets/src/integrations/tanstack-query/provider.tsx +9 -0
  73. package/templates/react/add-on/tanstack-query/assets/src/routes/demo.tanstack-query.tsx.ejs +38 -0
  74. package/templates/react/add-on/tanstack-query/info.json +13 -0
  75. package/templates/react/add-on/tanstack-query/package.json +6 -0
  76. package/templates/{base → react/base}/README.md.ejs +9 -0
  77. package/templates/react/base/src/components/Header.tsx.ejs +25 -0
  78. package/templates/{base/tsconfig.json → react/base/tsconfig.json.ejs} +5 -1
  79. package/templates/react/base/vite.config.js.ejs +24 -0
  80. package/templates/{code-router → react/code-router}/src/main.tsx.ejs +17 -1
  81. package/templates/react/example/tanchat/README.md +37 -0
  82. package/templates/react/example/tanchat/assets/_dot_env.local.append +2 -0
  83. package/templates/react/example/tanchat/assets/src/components/demo.SettingsDialog.tsx +148 -0
  84. package/templates/react/example/tanchat/assets/src/demo.index.css +220 -0
  85. package/templates/react/example/tanchat/assets/src/routes/example.chat.tsx.ejs +375 -0
  86. package/templates/react/example/tanchat/assets/src/store/demo.hooks.ts +21 -0
  87. package/templates/react/example/tanchat/assets/src/store/demo.store.ts +133 -0
  88. package/templates/react/example/tanchat/assets/src/utils/demo.ai.ts +108 -0
  89. package/templates/react/example/tanchat/info.json +15 -0
  90. package/templates/react/example/tanchat/package.json +10 -0
  91. package/templates/react/file-router/src/routes/__root.tsx.ejs +71 -0
  92. package/templates/solid/add-on/form/assets/src/routes/demo.form.tsx.ejs +148 -0
  93. package/templates/solid/add-on/form/info.json +13 -0
  94. package/templates/solid/add-on/form/package.json +5 -0
  95. package/templates/solid/add-on/module-federation/assets/module-federation.config.js.ejs +27 -0
  96. package/templates/solid/add-on/module-federation/assets/src/demo-mf-component.tsx +3 -0
  97. package/templates/solid/add-on/module-federation/assets/src/demo-mf-self-contained.tsx +9 -0
  98. package/templates/solid/add-on/module-federation/info.json +7 -0
  99. package/templates/solid/add-on/module-federation/package.json +5 -0
  100. package/templates/solid/add-on/sentry/assets/_dot_cursorrules.append +22 -0
  101. package/templates/solid/add-on/sentry/assets/_dot_env.local.append +2 -0
  102. package/templates/solid/add-on/sentry/assets/src/routes/demo.sentry.bad-event-handler.tsx +20 -0
  103. package/templates/solid/add-on/sentry/info.json +13 -0
  104. package/templates/solid/add-on/sentry/package.json +5 -0
  105. package/templates/solid/add-on/solid-ui/README.md +9 -0
  106. package/templates/solid/add-on/solid-ui/assets/src/lib/utils.ts +6 -0
  107. package/templates/solid/add-on/solid-ui/assets/src/styles.css +138 -0
  108. package/templates/solid/add-on/solid-ui/assets/ui.config.json +13 -0
  109. package/templates/solid/add-on/solid-ui/info.json +11 -0
  110. package/templates/solid/add-on/solid-ui/package.json +9 -0
  111. package/templates/solid/add-on/store/assets/src/lib/demo-store.ts +13 -0
  112. package/templates/solid/add-on/store/assets/src/routes/demo.store.tsx.ejs +77 -0
  113. package/templates/solid/add-on/store/info.json +13 -0
  114. package/templates/solid/add-on/store/package.json +6 -0
  115. package/templates/solid/add-on/tanstack-query/assets/src/integrations/tanstack-query/header-user.tsx +5 -0
  116. package/templates/solid/add-on/tanstack-query/assets/src/integrations/tanstack-query/provider.tsx +15 -0
  117. package/templates/solid/add-on/tanstack-query/assets/src/routes/demo.tanstack-query.tsx +30 -0
  118. package/templates/solid/add-on/tanstack-query/info.json +13 -0
  119. package/templates/solid/add-on/tanstack-query/package.json +6 -0
  120. package/templates/solid/base/README.md.ejs +200 -0
  121. package/templates/solid/base/_dot_cursorrules.append +35 -0
  122. package/templates/solid/base/_dot_gitignore +5 -0
  123. package/templates/solid/base/_dot_vscode/settings.json +11 -0
  124. package/templates/solid/base/index.html.ejs +20 -0
  125. package/templates/solid/base/package.json +22 -0
  126. package/templates/solid/base/package.ts.json +5 -0
  127. package/templates/solid/base/package.tw.json +6 -0
  128. package/templates/solid/base/public/favicon.ico +0 -0
  129. package/templates/solid/base/public/logo192.png +0 -0
  130. package/templates/solid/base/public/logo512.png +0 -0
  131. package/templates/solid/base/public/manifest.json +25 -0
  132. package/templates/solid/base/public/robots.txt +3 -0
  133. package/templates/solid/base/src/App.css +0 -0
  134. package/templates/solid/base/src/App.tsx.ejs +47 -0
  135. package/templates/solid/base/src/components/Header.tsx.ejs +26 -0
  136. package/templates/solid/base/src/logo.svg +120 -0
  137. package/templates/solid/base/src/styles.css.ejs +15 -0
  138. package/templates/solid/base/tsconfig.json.ejs +30 -0
  139. package/templates/solid/base/vite.config.js.ejs +22 -0
  140. package/templates/solid/code-router/src/main.tsx.ejs +69 -0
  141. package/templates/solid/file-router/package.fr.json +5 -0
  142. package/templates/solid/file-router/src/main.tsx.ejs +44 -0
  143. package/templates/solid/file-router/src/routes/__root.tsx.ejs +41 -0
  144. package/templates/solid/file-router/src/routes/index.tsx +43 -0
  145. package/templates/base/vite.config.js.ejs +0 -15
  146. package/templates/file-router/src/routes/__root.tsx +0 -11
  147. /package/templates/{base → react/base}/_dot_gitignore +0 -0
  148. /package/templates/{base → react/base}/_dot_vscode/settings.json +0 -0
  149. /package/templates/{base → react/base}/index.html.ejs +0 -0
  150. /package/templates/{base → react/base}/package.json +0 -0
  151. /package/templates/{base → react/base}/package.ts.json +0 -0
  152. /package/templates/{base → react/base}/package.tw.json +0 -0
  153. /package/templates/{base → react/base}/public/favicon.ico +0 -0
  154. /package/templates/{base → react/base}/public/logo192.png +0 -0
  155. /package/templates/{base → react/base}/public/logo512.png +0 -0
  156. /package/templates/{base → react/base}/public/manifest.json +0 -0
  157. /package/templates/{base → react/base}/public/robots.txt +0 -0
  158. /package/templates/{base → react/base}/src/App.css +0 -0
  159. /package/templates/{base → react/base}/src/App.test.tsx.ejs +0 -0
  160. /package/templates/{base → react/base}/src/App.tsx.ejs +0 -0
  161. /package/templates/{base → react/base}/src/logo.svg +0 -0
  162. /package/templates/{base → react/base}/src/reportWebVitals.ts.ejs +0 -0
  163. /package/templates/{base → react/base}/src/styles.css.ejs +0 -0
  164. /package/templates/{file-router → react/file-router}/package.fr.json +0 -0
  165. /package/templates/{file-router → react/file-router}/src/main.tsx.ejs +0 -0
@@ -0,0 +1,138 @@
1
+ @import 'tailwindcss';
2
+
3
+ @plugin "tailwindcss-animate";
4
+
5
+ @custom-variant dark (&:is(.dark *));
6
+
7
+ body {
8
+ @apply m-0;
9
+ font-family:
10
+ -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu',
11
+ 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
12
+ -webkit-font-smoothing: antialiased;
13
+ -moz-osx-font-smoothing: grayscale;
14
+ }
15
+
16
+ code {
17
+ font-family:
18
+ source-code-pro, Menlo, Monaco, Consolas, 'Courier New', monospace;
19
+ }
20
+
21
+ :root {
22
+ --background: oklch(1 0 0);
23
+ --foreground: oklch(0.141 0.005 285.823);
24
+ --card: oklch(1 0 0);
25
+ --card-foreground: oklch(0.141 0.005 285.823);
26
+ --popover: oklch(1 0 0);
27
+ --popover-foreground: oklch(0.141 0.005 285.823);
28
+ --primary: oklch(0.21 0.006 285.885);
29
+ --primary-foreground: oklch(0.985 0 0);
30
+ --secondary: oklch(0.967 0.001 286.375);
31
+ --secondary-foreground: oklch(0.21 0.006 285.885);
32
+ --muted: oklch(0.967 0.001 286.375);
33
+ --muted-foreground: oklch(0.552 0.016 285.938);
34
+ --accent: oklch(0.967 0.001 286.375);
35
+ --accent-foreground: oklch(0.21 0.006 285.885);
36
+ --destructive: oklch(0.577 0.245 27.325);
37
+ --destructive-foreground: oklch(0.577 0.245 27.325);
38
+ --border: oklch(0.92 0.004 286.32);
39
+ --input: oklch(0.92 0.004 286.32);
40
+ --ring: oklch(0.871 0.006 286.286);
41
+ --chart-1: oklch(0.646 0.222 41.116);
42
+ --chart-2: oklch(0.6 0.118 184.704);
43
+ --chart-3: oklch(0.398 0.07 227.392);
44
+ --chart-4: oklch(0.828 0.189 84.429);
45
+ --chart-5: oklch(0.769 0.188 70.08);
46
+ --radius: 0.625rem;
47
+ --sidebar: oklch(0.985 0 0);
48
+ --sidebar-foreground: oklch(0.141 0.005 285.823);
49
+ --sidebar-primary: oklch(0.21 0.006 285.885);
50
+ --sidebar-primary-foreground: oklch(0.985 0 0);
51
+ --sidebar-accent: oklch(0.967 0.001 286.375);
52
+ --sidebar-accent-foreground: oklch(0.21 0.006 285.885);
53
+ --sidebar-border: oklch(0.92 0.004 286.32);
54
+ --sidebar-ring: oklch(0.871 0.006 286.286);
55
+ }
56
+
57
+ .dark {
58
+ --background: oklch(0.141 0.005 285.823);
59
+ --foreground: oklch(0.985 0 0);
60
+ --card: oklch(0.141 0.005 285.823);
61
+ --card-foreground: oklch(0.985 0 0);
62
+ --popover: oklch(0.141 0.005 285.823);
63
+ --popover-foreground: oklch(0.985 0 0);
64
+ --primary: oklch(0.985 0 0);
65
+ --primary-foreground: oklch(0.21 0.006 285.885);
66
+ --secondary: oklch(0.274 0.006 286.033);
67
+ --secondary-foreground: oklch(0.985 0 0);
68
+ --muted: oklch(0.274 0.006 286.033);
69
+ --muted-foreground: oklch(0.705 0.015 286.067);
70
+ --accent: oklch(0.274 0.006 286.033);
71
+ --accent-foreground: oklch(0.985 0 0);
72
+ --destructive: oklch(0.396 0.141 25.723);
73
+ --destructive-foreground: oklch(0.637 0.237 25.331);
74
+ --border: oklch(0.274 0.006 286.033);
75
+ --input: oklch(0.274 0.006 286.033);
76
+ --ring: oklch(0.442 0.017 285.786);
77
+ --chart-1: oklch(0.488 0.243 264.376);
78
+ --chart-2: oklch(0.696 0.17 162.48);
79
+ --chart-3: oklch(0.769 0.188 70.08);
80
+ --chart-4: oklch(0.627 0.265 303.9);
81
+ --chart-5: oklch(0.645 0.246 16.439);
82
+ --sidebar: oklch(0.21 0.006 285.885);
83
+ --sidebar-foreground: oklch(0.985 0 0);
84
+ --sidebar-primary: oklch(0.488 0.243 264.376);
85
+ --sidebar-primary-foreground: oklch(0.985 0 0);
86
+ --sidebar-accent: oklch(0.274 0.006 286.033);
87
+ --sidebar-accent-foreground: oklch(0.985 0 0);
88
+ --sidebar-border: oklch(0.274 0.006 286.033);
89
+ --sidebar-ring: oklch(0.442 0.017 285.786);
90
+ }
91
+
92
+ @theme inline {
93
+ --color-background: var(--background);
94
+ --color-foreground: var(--foreground);
95
+ --color-card: var(--card);
96
+ --color-card-foreground: var(--card-foreground);
97
+ --color-popover: var(--popover);
98
+ --color-popover-foreground: var(--popover-foreground);
99
+ --color-primary: var(--primary);
100
+ --color-primary-foreground: var(--primary-foreground);
101
+ --color-secondary: var(--secondary);
102
+ --color-secondary-foreground: var(--secondary-foreground);
103
+ --color-muted: var(--muted);
104
+ --color-muted-foreground: var(--muted-foreground);
105
+ --color-accent: var(--accent);
106
+ --color-accent-foreground: var(--accent-foreground);
107
+ --color-destructive: var(--destructive);
108
+ --color-destructive-foreground: var(--destructive-foreground);
109
+ --color-border: var(--border);
110
+ --color-input: var(--input);
111
+ --color-ring: var(--ring);
112
+ --color-chart-1: var(--chart-1);
113
+ --color-chart-2: var(--chart-2);
114
+ --color-chart-3: var(--chart-3);
115
+ --color-chart-4: var(--chart-4);
116
+ --color-chart-5: var(--chart-5);
117
+ --radius-sm: calc(var(--radius) - 4px);
118
+ --radius-md: calc(var(--radius) - 2px);
119
+ --radius-lg: var(--radius);
120
+ --radius-xl: calc(var(--radius) + 4px);
121
+ --color-sidebar: var(--sidebar);
122
+ --color-sidebar-foreground: var(--sidebar-foreground);
123
+ --color-sidebar-primary: var(--sidebar-primary);
124
+ --color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
125
+ --color-sidebar-accent: var(--sidebar-accent);
126
+ --color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
127
+ --color-sidebar-border: var(--sidebar-border);
128
+ --color-sidebar-ring: var(--sidebar-ring);
129
+ }
130
+
131
+ @layer base {
132
+ * {
133
+ @apply border-border outline-ring/50;
134
+ }
135
+ body {
136
+ @apply bg-background text-foreground;
137
+ }
138
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "$schema": "https://solid-ui.com/schema.json",
3
+ "tsx": true,
4
+ "tailwind": {
5
+ "css": "src/styles.css",
6
+ "config": "tailwind.config.cjs",
7
+ "prefix": ""
8
+ },
9
+ "aliases": {
10
+ "components": "~/components/ui",
11
+ "utils": "~/lib/utils"
12
+ }
13
+ }
@@ -0,0 +1,11 @@
1
+ {
2
+ "name": "Solid-UI",
3
+ "description": "Add Solid-UI to your application.",
4
+ "phase": "add-on",
5
+ "link": "https://ui.shadcn.com/",
6
+ "templates": ["file-router", "code-router"],
7
+ "command": {
8
+ "command": "npx",
9
+ "args": ["solidui-cli@latest", "add", "button", "input"]
10
+ }
11
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "dependencies": {
3
+ "@fontsource/inter": "^5.1.1",
4
+ "class-variance-authority": "^0.7.1",
5
+ "clsx": "^2.1.1",
6
+ "tailwind-merge": "^3.0.2",
7
+ "tailwindcss-animate": "^1.0.7"
8
+ }
9
+ }
@@ -0,0 +1,13 @@
1
+ import { Derived, Store } from '@tanstack/store'
2
+
3
+ export const store = new Store({
4
+ firstName: 'Jane',
5
+ lastName: 'Smith',
6
+ })
7
+
8
+ export const fullName = new Derived({
9
+ fn: () => `${store.state.firstName} ${store.state.lastName}`,
10
+ deps: [store],
11
+ })
12
+
13
+ fullName.mount()
@@ -0,0 +1,77 @@
1
+ import { <% if (fileRouter) { %>createFileRoute<% } else { %>createRoute<% } %> } from '@tanstack/solid-router'
2
+ import { useStore } from '@tanstack/solid-store'
3
+
4
+ import { fullName, store } from '../lib/demo-store'
5
+
6
+ <% if (codeRouter) { %>
7
+ import type { RootRoute } from '@tanstack/react-router'
8
+ <% } else { %>
9
+ export const Route = createFileRoute('/demo/store')({
10
+ component: DemoStore,
11
+ })
12
+ <% } %>
13
+
14
+ function FirstName() {
15
+ const firstName = useStore(store, (state) => state.firstName)
16
+ return (
17
+ <input
18
+ type="text"
19
+ value={firstName()}
20
+ onInput={(e) =>
21
+ store.setState((state) => ({ ...state, firstName: e.target.value }))
22
+ }
23
+ class="bg-white/10 rounded-lg px-4 py-2 outline-none border border-white/20 hover:border-white/40 focus:border-white/60 transition-colors duration-200 placeholder-white/40"
24
+ />
25
+ )
26
+ }
27
+
28
+ function LastName() {
29
+ const lastName = useStore(store, (state) => state.lastName)
30
+ return (
31
+ <input
32
+ type="text"
33
+ value={lastName()}
34
+ onInput={(e) =>
35
+ store.setState((state) => ({ ...state, lastName: e.target.value }))
36
+ }
37
+ class="bg-white/10 rounded-lg px-4 py-2 outline-none border border-white/20 hover:border-white/40 focus:border-white/60 transition-colors duration-200 placeholder-white/40"
38
+ />
39
+ )
40
+ }
41
+
42
+ function FullName() {
43
+ const fName = useStore(fullName)
44
+ return (
45
+ <div class="bg-white/10 rounded-lg px-4 py-2 outline-none ">
46
+ {fName}
47
+ </div>
48
+ )
49
+ }
50
+
51
+ function DemoStore() {
52
+ return (
53
+ <div
54
+ class="min-h-[calc(100vh-32px)] text-white p-8 flex items-center justify-center w-full h-full"
55
+ style={{
56
+ 'background-image':
57
+ 'radial-gradient(50% 50% at 80% 80%, #f4a460 0%, #8b4513 70%, #1a0f0a 100%)',
58
+ }}
59
+ >
60
+ <div class="bg-white/10 backdrop-blur-lg rounded-xl p-8 shadow-lg flex flex-col gap-4 text-3xl min-w-1/2">
61
+ <h1 class="text-4xl font-bold mb-5">Store Example</h1>
62
+ <FirstName />
63
+ <LastName />
64
+ <FullName />
65
+ </div>
66
+ </div>
67
+ )
68
+ }
69
+
70
+ <% if (codeRouter) { %>
71
+ export default (parentRoute: RootRoute) => createRoute({
72
+ path: '/demo/store',
73
+ component: DemoStore,
74
+ getParentRoute: () => parentRoute,
75
+ })
76
+ <% } %>
77
+
@@ -0,0 +1,13 @@
1
+ {
2
+ "name": "Store",
3
+ "description": "Add TanStack Store to your application.",
4
+ "phase": "add-on",
5
+ "templates": ["file-router", "code-router"],
6
+ "link": "https://tanstack.com/store/latest",
7
+ "routes": [
8
+ {
9
+ "url": "/demo/store",
10
+ "name": "Store"
11
+ }
12
+ ]
13
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "dependencies": {
3
+ "@tanstack/store": "^0.7.0",
4
+ "@tanstack/solid-store": "^0.7.0"
5
+ }
6
+ }
@@ -0,0 +1,5 @@
1
+ import { SolidQueryDevtools } from '@tanstack/solid-query-devtools'
2
+
3
+ export default function AppTanstackQueryHeaderUser() {
4
+ return <SolidQueryDevtools buttonPosition="bottom-right" />
5
+ }
@@ -0,0 +1,15 @@
1
+ import { QueryClient, QueryClientProvider } from '@tanstack/solid-query'
2
+
3
+ import type { JSX } from 'solid-js'
4
+
5
+ const queryClient = new QueryClient()
6
+
7
+ export default function AppTanstackQueryProvider(props: {
8
+ children: JSX.Element
9
+ }) {
10
+ return (
11
+ <QueryClientProvider client={queryClient}>
12
+ {props.children}
13
+ </QueryClientProvider>
14
+ )
15
+ }
@@ -0,0 +1,30 @@
1
+ import { createFileRoute } from '@tanstack/solid-router'
2
+ import { createQuery } from '@tanstack/solid-query'
3
+
4
+ export const Route = createFileRoute('/demo/tanstack-query')({
5
+ component: App,
6
+ })
7
+
8
+ function App() {
9
+ const peopleQuery = createQuery(() => ({
10
+ queryKey: ['people'],
11
+ queryFn: () =>
12
+ fetch('https://swapi.dev/api/people')
13
+ .then((res) => res.json())
14
+ .then((data) => data.results as Array<{ name: string }>),
15
+ initialData: [],
16
+ }))
17
+
18
+ return (
19
+ <div class="p-4">
20
+ <h1 class="text-2xl mb-4">People list from Swapi</h1>
21
+ <ul>
22
+ {peopleQuery.data.map((person) => (
23
+ <li>{person.name}</li>
24
+ ))}
25
+ </ul>
26
+ </div>
27
+ )
28
+ }
29
+
30
+ export default App
@@ -0,0 +1,13 @@
1
+ {
2
+ "name": "TanStack Query",
3
+ "description": "Integrate TanStack Query into your application.",
4
+ "phase": "add-on",
5
+ "templates": ["file-router"],
6
+ "link": "https://tanstack.com/query/latest",
7
+ "routes": [
8
+ {
9
+ "url": "/demo/tanstack-query",
10
+ "name": "TanStack Query"
11
+ }
12
+ ]
13
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "dependencies": {
3
+ "@tanstack/solid-query": "^5.66.0",
4
+ "@tanstack/solid-query-devtools": "^5.66.0"
5
+ }
6
+ }
@@ -0,0 +1,200 @@
1
+ Welcome to your new TanStack app!
2
+
3
+ # Getting Started
4
+
5
+ To run this application:
6
+
7
+ ```bash
8
+ <%= packageManager %> install
9
+ <%= packageManager %> start
10
+ ```
11
+
12
+ # Building For Production
13
+
14
+ To build this application for production:
15
+
16
+ ```bash
17
+ <%= packageManager %> run build
18
+ ```
19
+
20
+ ## Styling
21
+
22
+ This project uses [Tailwind CSS](https://tailwindcss.com/) for styling.
23
+
24
+ <% for(const addon of addOns.filter(addon => addon.readme)) { %>
25
+ <%- addon.readme %>
26
+ <% } %>
27
+
28
+ ## Routing
29
+ <% if (fileRouter) { %>This project uses [TanStack Router](https://tanstack.com/router). The initial setup is a file based router. Which means that the routes are managed as fiels in `src/routes`.<% } else { %>This project uses [TanStack Router](https://tanstack.com/router). The initial setup is a code based router. Which means that the routes are defined in code (in the `./src/main.<%= jsx %>` file). If you like you can also use a file based routing setup by following the [File Based Routing](https://tanstack.com/router/latest/docs/framework/solid/guide/file-based-routing) guide.<% } %>
30
+
31
+ ### Adding A Route
32
+ <% if (fileRouter) { %>
33
+ To add a new route to your application just add another a new file in the `./src/routes` directory.
34
+
35
+ TanStack will automatically generate the content of the route file for you.
36
+ <% } else { %>
37
+ To add a new route to your application just add another `createRoute` call to the `./src/main.<%= jsx %>` file. The example below adds a new `/about`route to the root route.
38
+
39
+ ```tsx
40
+ const aboutRoute = createRoute({
41
+ getParentRoute: () => rootRoute,
42
+ path: "/about",
43
+ component: () => <h1>About</h1>,
44
+ });
45
+ ```
46
+
47
+ You will also need to add the route to the `routeTree` in the `./src/main.<%= jsx %>` file.
48
+
49
+ ```tsx
50
+ const routeTree = rootRoute.addChildren([indexRoute, aboutRoute]);
51
+ ```
52
+
53
+ With this set up you should be able to navigate to `/about` and see the about page.
54
+
55
+ Of course you don't need to implement the About page in the `main.<%= jsx %>` file. You can create that component in another file and import it into the `main.<%= jsx %>` file, then use it in the `component` property of the `createRoute` call, like so:
56
+
57
+ ```tsx
58
+ import About from "./components/About.<%= jsx %>";
59
+
60
+ const aboutRoute = createRoute({
61
+ getParentRoute: () => rootRoute,
62
+ path: "/about",
63
+ component: About,
64
+ });
65
+ ```
66
+
67
+ That is how we have the `App` component set up with the home page.
68
+
69
+ For more information on the options you have when you are creating code based routes check out the [Code Based Routing](https://tanstack.com/router/latest/docs/framework/solid/guide/code-based-routing) documentation.
70
+ <% } %>
71
+ Now that you have two routes you can use a `Link` component to navigate between them.
72
+
73
+ ### Adding Links
74
+
75
+ To use SPA (Single Page Application) navigation you will need to import the `Link` component from `@tanstack/solid-router`.
76
+
77
+ ```tsx
78
+ import { Link } from "@tanstack/solid-router";
79
+ ```
80
+
81
+ Then anywhere in your JSX you can use it like so:
82
+
83
+ ```tsx
84
+ <Link to="/about">About</Link>
85
+ ```
86
+
87
+ This will create a link that will navigate to the `/about` route.
88
+
89
+ More information on the `Link` component can be found in the [Link documentation](https://tanstack.com/router/v1/docs/framework/solid/api/router/linkComponent).
90
+
91
+ ### Using A Layout
92
+
93
+ <% if (codeRouter) { %>
94
+ Layouts can be used to wrap the contents of the routes in menus, headers, footers, etc.
95
+
96
+ There is already a layout in the `src/main.<%= jsx %>` file:
97
+
98
+ ```tsx
99
+ const rootRoute = createRootRoute({
100
+ component: () => (
101
+ <>
102
+ <Outlet />
103
+ <TanStackRouterDevtools />
104
+ </>
105
+ ),
106
+ });
107
+ ```
108
+
109
+ You can use the Soliid component specified in the `component` property of the `rootRoute` to wrap the contents of the routes. The `<Outlet />` component is used to render the current route within the body of the layout. For example you could add a header to the layout like so:
110
+
111
+ ```tsx
112
+ import { Link } from "@tanstack/solid-router";
113
+
114
+ const rootRoute = createRootRoute({
115
+ component: () => (
116
+ <>
117
+ <header>
118
+ <nav>
119
+ <Link to="/">Home</Link>
120
+ <Link to="/about">About</Link>
121
+ </nav>
122
+ </header>
123
+ <Outlet />
124
+ <TanStackRouterDevtools />
125
+ </>
126
+ ),
127
+ });
128
+ ```
129
+ <% } else { %>In the File Based Routing setup the layout is located in `src/routes/__root.tsx`. Anything you add to the root route will appear in all the routes. The route content will appear in the JSX where you use the `<Outlet />` component.
130
+
131
+ Here is an example layout that includes a header:
132
+
133
+ ```tsx
134
+ import { createRootRoute, Outlet } from '@tanstack/solid-router'
135
+ import { TanStackRouterDevtools } from '@tanstack/router-devtools'
136
+
137
+ import { Link } from "@tanstack/solid-router";
138
+
139
+ export const Route = createRootRoute({
140
+ component: () => (
141
+ <>
142
+ <header>
143
+ <nav>
144
+ <Link to="/">Home</Link>
145
+ <Link to="/about">About</Link>
146
+ </nav>
147
+ </header>
148
+ <Outlet />
149
+ <TanStackRouterDevtools />
150
+ </>
151
+ ),
152
+ })
153
+ ```
154
+ <% } %>
155
+ The `<TanStackRouterDevtools />` component is not required so you can remove it if you don't want it in your layout.
156
+
157
+ More information on layouts can be found in the [Layouts documentation](hthttps://tanstack.com/router/latest/docs/framework/solid/guide/routing-concepts#layouts).
158
+
159
+ ## Data Fetching
160
+
161
+ There are multiple ways to fetch data in your application. You can use TanStack Query to fetch data from a server. But you can also use the `loader` functionality built into TanStack Router to load the data for a route before it's rendered.
162
+
163
+ For example:
164
+
165
+ ```tsx
166
+ const peopleRoute = createRoute({
167
+ getParentRoute: () => rootRoute,
168
+ path: "/people",
169
+ loader: async () => {
170
+ const response = await fetch("https://swapi.dev/api/people");<% if (typescript) { %>
171
+ return response.json() as Promise<{
172
+ results: {
173
+ name: string;
174
+ }[];
175
+ }>;
176
+ <% } else { %>
177
+ return response.json();
178
+ <% } %> },
179
+ component: () => {
180
+ const data = peopleRoute.useLoaderData();
181
+ return (
182
+ <ul>
183
+ {data.results.map((person) => (
184
+ <li key={person.name}>{person.name}</li>
185
+ ))}
186
+ </ul>
187
+ );
188
+ },
189
+ });
190
+ ```
191
+
192
+ Loaders simplify your data fetching logic dramatically. Check out more information in the [Loader documentation](https://tanstack.com/router/latest/docs/framework/solid/guide/data-loading#loader-parameters).
193
+
194
+ # Demo files
195
+
196
+ Files prefixed with `demo` can be safely deleted. They are there to provide a starting point for you to play around with the features you've installed.
197
+
198
+ # Learn More
199
+
200
+ You can learn more about all of the offerings from TanStack in the [TanStack documentation](https://tanstack.com).
@@ -0,0 +1,35 @@
1
+ // Solid.js with Tailwind CSS .cursorrules
2
+
3
+ // Prefer functional components
4
+
5
+ const preferFunctionalComponents = true;
6
+
7
+ // Solid.js and Tailwind CSS best practices
8
+
9
+ const solidjsTailwindBestPractices = [
10
+ "Use createSignal() for reactive state",
11
+ "Implement Tailwind CSS classes for styling",
12
+ "Utilize TypeScript's strict mode",
13
+ "Utilize @apply directive in CSS files for reusable styles",
14
+ "Implement responsive design using Tailwind's responsive classes",
15
+ "Use Tailwind's CSS in /src/styles.css for global styles",
16
+ "Implement dark mode using Tailwind's dark variant",
17
+ ];
18
+
19
+ // Additional instructions
20
+
21
+ const additionalInstructions = `
22
+
23
+ 1. Use .tsx extension for files with JSX
24
+ 2. Implement strict TypeScript checks
25
+ 3. Implement proper Tailwind CSS purging for production builds
26
+ 4. Utilize TanStack Router for routing when applicable
27
+ 5. Use type-safe context with createContext
28
+ 6. Implement proper typing for event handlers
29
+ 7. Follow TypeScript best practices and naming conventions
30
+ 8. Use type assertions sparingly and only when necessary
31
+ 9. Use Tailwind's @layer directive for custom styles
32
+ 10. Implement utility-first CSS approach
33
+ 11. Follow both Solid.js and Tailwind naming conventions
34
+ 12. Use JIT (Just-In-Time) mode for faster development
35
+ `;
@@ -0,0 +1,5 @@
1
+ node_modules
2
+ .DS_Store
3
+ dist
4
+ dist-ssr
5
+ *.local
@@ -0,0 +1,11 @@
1
+ {
2
+ "files.watcherExclude": {
3
+ "**/routeTree.gen.ts": true
4
+ },
5
+ "search.exclude": {
6
+ "**/routeTree.gen.ts": true
7
+ },
8
+ "files.readonlyInclude": {
9
+ "**/routeTree.gen.ts": true
10
+ }
11
+ }
@@ -0,0 +1,20 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
+ <link rel="icon" href="/favicon.ico" />
7
+ <meta name="theme-color" content="#000000" />
8
+ <meta
9
+ name="description"
10
+ content="Web site created using create-tsrouter-app"
11
+ />
12
+ <link rel="apple-touch-icon" href="/logo192.png" />
13
+ <link rel="manifest" href="/manifest.json" />
14
+ <title>Create TanStack App - app-ts</title>
15
+ </head>
16
+ <body>
17
+ <div id="app"></div>
18
+ <script type="module" src="/src/main.tsx"></script>
19
+ </body>
20
+ </html>
@@ -0,0 +1,22 @@
1
+ {
2
+ "name": "app-ts",
3
+ "private": true,
4
+ "type": "module",
5
+ "scripts": {
6
+ "start": "vite --port 3000",
7
+ "build": "vite build && tsc",
8
+ "serve": "vite preview",
9
+ "test": "vitest run"
10
+ },
11
+ "dependencies": {
12
+ "@tanstack/solid-router": "^1.110.0",
13
+ "@tanstack/router-devtools": "^1.109.2",
14
+ "@tanstack/router-plugin": "^1.109.2",
15
+ "solid-js": "^1.9.4"
16
+ },
17
+ "devDependencies": {
18
+ "vite-plugin-solid": "^2.11.2",
19
+ "typescript": "^5.7.2",
20
+ "vite": "^6.0.11"
21
+ }
22
+ }
@@ -0,0 +1,5 @@
1
+ {
2
+ "devDependencies": {
3
+ "typescript": "^5.7.2"
4
+ }
5
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "dependencies": {
3
+ "@tailwindcss/vite": "^4.0.6",
4
+ "tailwindcss": "^4.0.6"
5
+ }
6
+ }