create-start-app 0.9.2 → 0.9.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
1
  blank_issues_enabled: false
2
2
  contact_links:
3
3
  - name: 🤔 Feature Requests & Questions
4
- url: https://github.com/tanstack/router/discussions
4
+ url: https://github.com/tanstack/create-tsrouter-app/discussions
5
5
  about: Please ask and answer questions here.
6
6
  - name: 💬 Community Chat
7
7
  url: https://discord.gg/mQd7egN
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  This CLI application builds Tanstack Router applications that are the functional equivalent of [Create React App](https://create-react-app.dev/).
4
4
 
5
- To help accelerate the migration away from `create-react-app` we created the `create-tsrouter-app` CLI which is a plug-n-play replacement for CRA.
5
+ To help accelerate the migration away from `create-react-app` we created the `create-start-app` CLI which is a plug-n-play replacement for CRA.
6
6
 
7
7
  ## Quick Start
8
8
 
@@ -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
+ | `npx create-start-app@latest my-app` | Create a new app |
14
+ | `npx create-start-app@latest my-app --template file-router` | Create a new file based app |
15
+ | `npx create-start-app@latest my-app --template typescript` | Create a new TypeScript app using the Code Router |
16
+ | `npx create-start-app@latest my-app --tailwind` | Add Tailwind CSS support |
17
+ | `npx create-start-app@latest my-app --framework solid` | Create a Solid app |
18
+ | `npx create-start-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
+ npx create-start-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
+ npx create-start-app@latest my-app --template file-router --tailwind --package-manager pnpm
42
42
  ```
43
43
 
44
44
  Available options:
@@ -56,7 +56,7 @@ When using flags, the CLI will display which options were provided and only prom
56
56
 
57
57
  What you'll get is a Vite application that uses TanStack Router. All the files will still be in the same place as in CRA, but you'll get a fully functional Router setup under in `app/main.tsx`.
58
58
 
59
- `create-tsrouter-app` is everything you loved about CRA but implemented with modern tools and best practices, on top of the popular TanStack set of libraries. Which includes [@tanstack/react-query](https://tanstack.com/query/latest) and [@tanstack/react-router](https://tanstack.com/router/latest).
59
+ `create-start-app` is everything you loved about CRA but implemented with modern tools and best practices, on top of the popular TanStack set of libraries. Which includes [@tanstack/react-query](https://tanstack.com/query/latest) and [@tanstack/react-router](https://tanstack.com/router/latest).
60
60
 
61
61
  ## Routing Options
62
62
 
@@ -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
+ npx create-start-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
+ npx create-start-app@latest my-app --template typescript
79
79
  ```
80
80
 
81
81
  ## Additional Configuration
@@ -107,7 +107,7 @@ Setting this flag to `biome` will configure it as your toolchain of choice, addi
107
107
  You can enable add-on selection:
108
108
 
109
109
  ```bash
110
- npx create-tsrouter-app@latest --add-ons
110
+ npx create-start-app@latest --add-ons
111
111
  ```
112
112
 
113
113
  This will prompt you to select the add-ons you want to enable during application creation.
@@ -115,29 +115,29 @@ This will prompt you to select the add-ons you want to enable during application
115
115
  You can enable specific add-ons directly by adding a comma separated list of add-on names to the `--add-ons` flag. For example:
116
116
 
117
117
  ```bash
118
- npx create-tsrouter-app@latest my-app --add-ons shadcn,tanstack-query
118
+ npx create-start-app@latest my-app --add-ons shadcn,tanstack-query
119
119
  ```
120
120
 
121
121
  You can get a list of all available add-ons by running:
122
122
 
123
123
  ```bash
124
- npx create-tsrouter-app@latest --list-add-ons
124
+ npx create-start-app@latest --list-add-ons
125
125
  ```
126
126
 
127
127
  This will display a list of all available add-ons for React that are compatible with the Code Router.
128
128
 
129
129
  ```bash
130
- npx create-tsrouter-app@latest --list-add-ons --framework solid --template file-router
130
+ npx create-start-app@latest --list-add-ons --framework solid --template file-router
131
131
  ```
132
132
 
133
133
  Will get you a list of all available add-ons for Solid that are compatible with the File Router.
134
134
 
135
135
  ## MCP (Model Context Protocol) Support (experimental)
136
136
 
137
- 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.
137
+ You can launch the `create-start-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.
138
138
 
139
139
  ```bash
140
- npx create-tsrouter-app@latest --mcp
140
+ npx create-start-app@latest --mcp
141
141
  ```
142
142
 
143
143
  Shown below is the configuration for MCP support in Cursor.
@@ -306,7 +306,7 @@ export async function createApp(options, { silent = false, environment, }) {
306
306
  }
307
307
  if (shadcnComponents.size > 0) {
308
308
  s?.start(`Installing shadcn components (${Array.from(shadcnComponents).join(', ')})...`);
309
- await environment.execute('npx', ['shadcn@canary', 'add', '--force', ...shadcnComponents], resolve(targetDir));
309
+ await environment.execute('npx', ['shadcn@canary', 'add', '--silent', '--yes', ...shadcnComponents], resolve(targetDir));
310
310
  s?.stop(`Installed additional shadcn components`);
311
311
  }
312
312
  }
package/dist/options.js CHANGED
@@ -5,6 +5,15 @@ import { CODE_ROUTER, DEFAULT_FRAMEWORK, FILE_ROUTER } from './constants.js';
5
5
  import { finalizeAddOns, getAllAddOns } from './add-ons.js';
6
6
  // If all CLI options are provided, use them directly
7
7
  export async function normalizeOptions(cliOptions) {
8
+ // in some cases, if you use windows/powershell, the argument for addons
9
+ // if sepparated by comma is not really passed as an array, but as a string
10
+ // with spaces, We need to normalize this edge case.
11
+ if (Array.isArray(cliOptions.addOns) && cliOptions.addOns.length === 1) {
12
+ const parseSeparatedArgs = cliOptions.addOns[0].split(' ');
13
+ if (parseSeparatedArgs.length > 1) {
14
+ cliOptions.addOns = parseSeparatedArgs;
15
+ }
16
+ }
8
17
  if (cliOptions.projectName) {
9
18
  let typescript = cliOptions.template === 'typescript' ||
10
19
  cliOptions.template === 'file-router' ||
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-start-app",
3
- "version": "0.9.2",
3
+ "version": "0.9.4",
4
4
  "description": "Tanstack Application Builder",
5
5
  "bin": "./dist/index.js",
6
6
  "type": "module",
package/src/create-app.ts CHANGED
@@ -487,7 +487,7 @@ export async function createApp(
487
487
  )
488
488
  await environment.execute(
489
489
  'npx',
490
- ['shadcn@canary', 'add', '--force', ...shadcnComponents],
490
+ ['shadcn@canary', 'add', '--silent', '--yes', ...shadcnComponents],
491
491
  resolve(targetDir),
492
492
  )
493
493
  s?.stop(`Installed additional shadcn components`)
package/src/options.ts CHANGED
@@ -23,6 +23,15 @@ import type { CliOptions, Options } from './types.js'
23
23
  export async function normalizeOptions(
24
24
  cliOptions: CliOptions,
25
25
  ): Promise<Required<Options> | undefined> {
26
+ // in some cases, if you use windows/powershell, the argument for addons
27
+ // if sepparated by comma is not really passed as an array, but as a string
28
+ // with spaces, We need to normalize this edge case.
29
+ if (Array.isArray(cliOptions.addOns) && cliOptions.addOns.length === 1) {
30
+ const parseSeparatedArgs = cliOptions.addOns[0].split(' ');
31
+ if (parseSeparatedArgs.length > 1) {
32
+ cliOptions.addOns = parseSeparatedArgs;
33
+ }
34
+ }
26
35
  if (cliOptions.projectName) {
27
36
  let typescript =
28
37
  cliOptions.template === 'typescript' ||
@@ -154,7 +154,7 @@ export const Route = createRootRoute({
154
154
  <% } %>
155
155
  The `<TanStackRouterDevtools />` component is not required so you can remove it if you don't want it in your layout.
156
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).
157
+ More information on layouts can be found in the [Layouts documentation](https://tanstack.com/router/latest/docs/framework/solid/guide/routing-concepts#layouts).
158
158
 
159
159
  ## Data Fetching
160
160
 
package/tests/cra.test.ts CHANGED
@@ -1,116 +1,232 @@
1
- import { expect, test } from 'vitest'
1
+ import { describe, expect, test } from 'vitest'
2
2
 
3
3
  import { createApp } from '../src/create-app.js'
4
4
  import { cleanupOutput, createTestEnvironment } from './test-utilities.js'
5
5
 
6
- test('code router in javascript on npm', async () => {
7
- const projectName = 'TEST'
8
- const { environment, output } = createTestEnvironment(projectName)
9
- await createApp(
10
- {
11
- addOns: false,
12
- framework: 'react',
13
- chosenAddOns: [],
14
- git: true,
15
- mode: 'code-router',
16
- packageManager: 'npm',
17
- projectName,
18
- tailwind: false,
19
- toolchain: 'none',
20
- typescript: false,
21
- variableValues: {},
22
- },
23
- {
24
- silent: true,
25
- environment,
26
- },
27
- )
28
- cleanupOutput(output)
29
- await expect(JSON.stringify(output, null, 2)).toMatchFileSnapshot(
30
- './snapshots/cra/cr-js-npm.json',
31
- )
32
- })
6
+ describe('React Templates', () => {
7
+ test('code router in javascript on npm', async () => {
8
+ const projectName = 'TEST'
9
+ const { environment, output } = createTestEnvironment(projectName)
10
+ await createApp(
11
+ {
12
+ addOns: false,
13
+ framework: 'react',
14
+ chosenAddOns: [],
15
+ git: true,
16
+ mode: 'code-router',
17
+ packageManager: 'npm',
18
+ projectName,
19
+ tailwind: false,
20
+ toolchain: 'none',
21
+ typescript: false,
22
+ variableValues: {},
23
+ },
24
+ {
25
+ silent: true,
26
+ environment,
27
+ },
28
+ )
29
+ cleanupOutput(output)
30
+ await expect(JSON.stringify(output, null, 2)).toMatchFileSnapshot(
31
+ './snapshots/cra/cr-js-npm.json',
32
+ )
33
+ })
33
34
 
34
- test('code router in typescript on npm', async () => {
35
- const projectName = 'TEST'
36
- const { environment, output } = createTestEnvironment(projectName)
37
- await createApp(
38
- {
39
- addOns: false,
40
- framework: 'react',
41
- chosenAddOns: [],
42
- git: true,
43
- mode: 'code-router',
44
- packageManager: 'npm',
45
- projectName,
46
- tailwind: false,
47
- toolchain: 'none',
48
- typescript: true,
49
- variableValues: {},
50
- },
51
- {
52
- silent: true,
53
- environment,
54
- },
55
- )
56
- cleanupOutput(output)
57
- await expect(JSON.stringify(output, null, 2)).toMatchFileSnapshot(
58
- './snapshots/cra/cr-ts-npm.json',
59
- )
60
- })
35
+ test('code router in typescript on npm', async () => {
36
+ const projectName = 'TEST'
37
+ const { environment, output } = createTestEnvironment(projectName)
38
+ await createApp(
39
+ {
40
+ addOns: false,
41
+ framework: 'react',
42
+ chosenAddOns: [],
43
+ git: true,
44
+ mode: 'code-router',
45
+ packageManager: 'npm',
46
+ projectName,
47
+ tailwind: false,
48
+ toolchain: 'none',
49
+ typescript: true,
50
+ variableValues: {},
51
+ },
52
+ {
53
+ silent: true,
54
+ environment,
55
+ },
56
+ )
57
+ cleanupOutput(output)
58
+ await expect(JSON.stringify(output, null, 2)).toMatchFileSnapshot(
59
+ './snapshots/cra/cr-ts-npm.json',
60
+ )
61
+ })
62
+
63
+ test('file router on npm', async () => {
64
+ const projectName = 'TEST'
65
+ const { environment, output } = createTestEnvironment(projectName)
66
+ await createApp(
67
+ {
68
+ addOns: false,
69
+ framework: 'react',
70
+ chosenAddOns: [],
71
+ git: true,
72
+ mode: 'file-router',
73
+ packageManager: 'npm',
74
+ projectName,
75
+ tailwind: false,
76
+ toolchain: 'none',
77
+ typescript: true,
78
+ variableValues: {},
79
+ },
80
+ {
81
+ silent: true,
82
+ environment,
83
+ },
84
+ )
85
+ cleanupOutput(output)
86
+ await expect(JSON.stringify(output, null, 2)).toMatchFileSnapshot(
87
+ './snapshots/cra/fr-ts-npm.json',
88
+ )
89
+ })
61
90
 
62
- test('file router on npm', async () => {
63
- const projectName = 'TEST'
64
- const { environment, output } = createTestEnvironment(projectName)
65
- await createApp(
66
- {
67
- addOns: false,
68
- framework: 'react',
69
- chosenAddOns: [],
70
- git: true,
71
- mode: 'file-router',
72
- packageManager: 'npm',
73
- projectName,
74
- tailwind: false,
75
- toolchain: 'none',
76
- typescript: true,
77
- variableValues: {},
78
- },
79
- {
80
- silent: true,
81
- environment,
82
- },
83
- )
84
- cleanupOutput(output)
85
- await expect(JSON.stringify(output, null, 2)).toMatchFileSnapshot(
86
- './snapshots/cra/fr-ts-npm.json',
87
- )
91
+ test('file router with tailwind on npm', async () => {
92
+ const projectName = 'TEST'
93
+ const { environment, output } = createTestEnvironment(projectName)
94
+ await createApp(
95
+ {
96
+ addOns: false,
97
+ framework: 'react',
98
+ chosenAddOns: [],
99
+ git: true,
100
+ mode: 'file-router',
101
+ packageManager: 'npm',
102
+ projectName,
103
+ tailwind: true,
104
+ toolchain: 'none',
105
+ typescript: true,
106
+ variableValues: {},
107
+ },
108
+ {
109
+ silent: true,
110
+ environment,
111
+ },
112
+ )
113
+ cleanupOutput(output)
114
+ await expect(JSON.stringify(output, null, 2)).toMatchFileSnapshot(
115
+ './snapshots/cra/fr-ts-tw-npm.json',
116
+ )
117
+ })
88
118
  })
89
119
 
90
- test('file router with tailwind on npm', async () => {
91
- const projectName = 'TEST'
92
- const { environment, output } = createTestEnvironment(projectName)
93
- await createApp(
94
- {
95
- addOns: false,
96
- framework: 'react',
97
- chosenAddOns: [],
98
- git: true,
99
- mode: 'file-router',
100
- packageManager: 'npm',
101
- projectName,
102
- tailwind: true,
103
- toolchain: 'none',
104
- typescript: true,
105
- variableValues: {},
106
- },
107
- {
108
- silent: true,
109
- environment,
110
- },
111
- )
112
- cleanupOutput(output)
113
- await expect(JSON.stringify(output, null, 2)).toMatchFileSnapshot(
114
- './snapshots/cra/fr-ts-tw-npm.json',
115
- )
120
+ describe('Solid Templates', () => {
121
+ test('code router in javascript on npm', async () => {
122
+ const projectName = 'TEST'
123
+ const { environment, output } = createTestEnvironment(projectName)
124
+ await createApp(
125
+ {
126
+ addOns: false,
127
+ framework: 'solid',
128
+ chosenAddOns: [],
129
+ git: true,
130
+ mode: 'code-router',
131
+ packageManager: 'npm',
132
+ projectName,
133
+ tailwind: false,
134
+ toolchain: 'none',
135
+ typescript: false,
136
+ variableValues: {},
137
+ },
138
+ {
139
+ silent: true,
140
+ environment,
141
+ },
142
+ )
143
+ cleanupOutput(output)
144
+ await expect(JSON.stringify(output, null, 2)).toMatchFileSnapshot(
145
+ './snapshots/cra/solid-cr-js-npm.json',
146
+ )
147
+ })
148
+
149
+ test('code router in typescript on npm', async () => {
150
+ const projectName = 'TEST'
151
+ const { environment, output } = createTestEnvironment(projectName)
152
+ await createApp(
153
+ {
154
+ addOns: false,
155
+ framework: 'solid',
156
+ chosenAddOns: [],
157
+ git: true,
158
+ mode: 'code-router',
159
+ packageManager: 'npm',
160
+ projectName,
161
+ tailwind: false,
162
+ toolchain: 'none',
163
+ typescript: true,
164
+ variableValues: {},
165
+ },
166
+ {
167
+ silent: true,
168
+ environment,
169
+ },
170
+ )
171
+ cleanupOutput(output)
172
+ await expect(JSON.stringify(output, null, 2)).toMatchFileSnapshot(
173
+ './snapshots/cra/solid-cr-ts-npm.json',
174
+ )
175
+ })
176
+
177
+ test('file router on npm', async () => {
178
+ const projectName = 'TEST'
179
+ const { environment, output } = createTestEnvironment(projectName)
180
+ await createApp(
181
+ {
182
+ addOns: false,
183
+ framework: 'solid',
184
+ chosenAddOns: [],
185
+ git: true,
186
+ mode: 'file-router',
187
+ packageManager: 'npm',
188
+ projectName,
189
+ tailwind: false,
190
+ toolchain: 'none',
191
+ typescript: true,
192
+ variableValues: {},
193
+ },
194
+ {
195
+ silent: true,
196
+ environment,
197
+ },
198
+ )
199
+ cleanupOutput(output)
200
+ await expect(JSON.stringify(output, null, 2)).toMatchFileSnapshot(
201
+ './snapshots/cra/solid-fr-ts-npm.json',
202
+ )
203
+ })
204
+
205
+ test('file router with tailwind on npm', async () => {
206
+ const projectName = 'TEST'
207
+ const { environment, output } = createTestEnvironment(projectName)
208
+ await createApp(
209
+ {
210
+ addOns: false,
211
+ framework: 'solid',
212
+ chosenAddOns: [],
213
+ git: true,
214
+ mode: 'file-router',
215
+ packageManager: 'npm',
216
+ projectName,
217
+ tailwind: true,
218
+ toolchain: 'none',
219
+ typescript: true,
220
+ variableValues: {},
221
+ },
222
+ {
223
+ silent: true,
224
+ environment,
225
+ },
226
+ )
227
+ cleanupOutput(output)
228
+ await expect(JSON.stringify(output, null, 2)).toMatchFileSnapshot(
229
+ './snapshots/cra/solid-fr-ts-tw-npm.json',
230
+ )
231
+ })
116
232
  })
@@ -0,0 +1,30 @@
1
+ {
2
+ "files": {
3
+ ".gitignore": "node_modules\n.DS_Store\ndist\ndist-ssr\n*.local\n",
4
+ "/.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",
5
+ "/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",
6
+ "/public/robots.txt": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n",
7
+ "/src/App.css": "",
8
+ "/src/App.jsx": "\nimport logo from \"./logo.svg\";\n\n\n\n\n\nfunction App() {\n return (\n <main class=\"min-h-screen flex flex-col items-center justify-center bg-[#282c34] text-white text-[calc(10px+2vmin)] text-center\">\n <img\n src={logo}\n class=\"h-[40vmin] pointer-events-none animate-[spin_20s_linear_infinite]\"\n alt=\"logo\"\n />\n <p>\n Edit <code>src/App.jsx</code> and save to reload.\n </p>\n <a\n class=\"text-[#61dafb] hover:underline\"\n href=\"https://solidjs.com\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n Learn Solid\n </a>\n <a\n class=\"text-[#61dafb] hover:underline\"\n href=\"https://tanstack.com\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n Learn TanStack\n </a>\n </main>\n );\n}\n\n\nexport default App;\n\n",
9
+ "/src/main.jsx": "import {\n Outlet,\n RouterProvider,\n createRootRoute,\n createRoute,\n createRouter,\n} from \"@tanstack/solid-router\";\nimport { TanStackRouterDevtools } from \"@tanstack/solid-router-devtools\";\nimport { render } from 'solid-js/web'\n\n\nimport \"./styles.css\";\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 defaultPreload: \"intent\",\n scrollRestoration: true,\n});\n\ndeclare module '@tanstack/solid-router' {\n interface Register {\n router: typeof router\n }\n}\n\nfunction MainApp() {\n return (\n <>\n <RouterProvider router={router} />\n </>\n )\n}\n\nconst rootElement = document.getElementById('app')\nif(rootElement) {\n render(() => <MainApp />, rootElement)\n}\n",
10
+ "/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",
11
+ "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## Styling\n\nThis project uses [Tailwind CSS](https://tailwindcss.com/) for styling.\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/solid/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/solid/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/solid-router`.\n\n```tsx\nimport { Link } from \"@tanstack/solid-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/solid/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 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:\n\n```tsx\nimport { Link } from \"@tanstack/solid-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/solid/guide/routing-concepts#layouts).\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/solid/guide/data-loading#loader-parameters).\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",
12
+ "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 - app-ts</title>\n </head>\n <body>\n <div id=\"app\"></div>\n <script type=\"module\" src=\"/src/main.tsx\"></script>\n </body>\n</html>\n",
13
+ "package.json": "{\n \"name\": \"TEST\",\n \"private\": true,\n \"type\": \"module\",\n \"scripts\": {\n \"start\": \"vite --port 3000\",\n \"build\": \"vite build && tsc\",\n \"serve\": \"vite preview\",\n \"test\": \"vitest run\"\n },\n \"dependencies\": {\n \"@tanstack/router-plugin\": \"^1.109.2\",\n \"@tanstack/solid-router\": \"^1.110.0\",\n \"@tanstack/solid-router-devtools\": \"^1.109.2\",\n \"solid-js\": \"^1.9.4\"\n },\n \"devDependencies\": {\n \"typescript\": \"^5.7.2\",\n \"vite\": \"^6.0.11\",\n \"vite-plugin-solid\": \"^2.11.2\"\n }\n}",
14
+ "vite.config.js": "import { defineConfig } from 'vite'\n\nimport solidPlugin from 'vite-plugin-solid'\nimport tailwindcss from '@tailwindcss/vite'\n\n// https://vitejs.dev/config/\nexport default defineConfig({\n plugins: [\n solidPlugin(),\n tailwindcss(),\n ],\n})\n"
15
+ },
16
+ "commands": [
17
+ {
18
+ "command": "npm",
19
+ "args": [
20
+ "install"
21
+ ]
22
+ },
23
+ {
24
+ "command": "git",
25
+ "args": [
26
+ "init"
27
+ ]
28
+ }
29
+ ]
30
+ }
@@ -0,0 +1,31 @@
1
+ {
2
+ "files": {
3
+ ".gitignore": "node_modules\n.DS_Store\ndist\ndist-ssr\n*.local\n",
4
+ "/.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",
5
+ "/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",
6
+ "/public/robots.txt": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n",
7
+ "/src/App.css": "",
8
+ "/src/App.tsx": "import logo from './logo.svg'\n\nfunction App() {\n return (\n <main class=\"min-h-screen flex flex-col items-center justify-center bg-[#282c34] text-white text-[calc(10px+2vmin)] text-center\">\n <img\n src={logo}\n class=\"h-[40vmin] pointer-events-none animate-[spin_20s_linear_infinite]\"\n alt=\"logo\"\n />\n <p>\n Edit <code>src/App.tsx</code> and save to reload.\n </p>\n <a\n class=\"text-[#61dafb] hover:underline\"\n href=\"https://solidjs.com\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n Learn Solid\n </a>\n <a\n class=\"text-[#61dafb] hover:underline\"\n href=\"https://tanstack.com\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n Learn TanStack\n </a>\n </main>\n )\n}\n\nexport default App\n",
9
+ "/src/main.tsx": "import {\n Outlet,\n RouterProvider,\n createRootRoute,\n createRoute,\n createRouter,\n} from '@tanstack/solid-router'\nimport { TanStackRouterDevtools } from '@tanstack/solid-router-devtools'\nimport { render } from 'solid-js/web'\n\nimport './styles.css'\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 defaultPreload: 'intent',\n scrollRestoration: true,\n})\n\ndeclare module '@tanstack/solid-router' {\n interface Register {\n router: typeof router\n }\n}\n\nfunction MainApp() {\n return (\n <>\n <RouterProvider router={router} />\n </>\n )\n}\n\nconst rootElement = document.getElementById('app')\nif (rootElement) {\n render(() => <MainApp />, rootElement)\n}\n",
10
+ "/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",
11
+ "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## Styling\n\nThis project uses [Tailwind CSS](https://tailwindcss.com/) for styling.\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/solid/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/solid/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/solid-router`.\n\n```tsx\nimport { Link } from \"@tanstack/solid-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/solid/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 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:\n\n```tsx\nimport { Link } from \"@tanstack/solid-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/solid/guide/routing-concepts#layouts).\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/solid/guide/data-loading#loader-parameters).\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",
12
+ "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 - app-ts</title>\n </head>\n <body>\n <div id=\"app\"></div>\n <script type=\"module\" src=\"/src/main.tsx\"></script>\n </body>\n</html>\n",
13
+ "package.json": "{\n \"name\": \"TEST\",\n \"private\": true,\n \"type\": \"module\",\n \"scripts\": {\n \"start\": \"vite --port 3000\",\n \"build\": \"vite build && tsc\",\n \"serve\": \"vite preview\",\n \"test\": \"vitest run\"\n },\n \"dependencies\": {\n \"@tanstack/router-plugin\": \"^1.109.2\",\n \"@tanstack/solid-router\": \"^1.110.0\",\n \"@tanstack/solid-router-devtools\": \"^1.109.2\",\n \"solid-js\": \"^1.9.4\"\n },\n \"devDependencies\": {\n \"typescript\": \"^5.7.2\",\n \"vite\": \"^6.0.11\",\n \"vite-plugin-solid\": \"^2.11.2\"\n }\n}",
14
+ "tsconfig.json": "{\n \"include\": [\"**/*.ts\", \"**/*.tsx\"],\n \"compilerOptions\": {\n \"target\": \"ES2022\",\n \"jsx\": \"preserve\",\n \"jsxImportSource\": \"solid-js\",\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 }\n}\n",
15
+ "vite.config.js": "import { defineConfig } from 'vite'\n\nimport solidPlugin from 'vite-plugin-solid'\nimport tailwindcss from '@tailwindcss/vite'\n\n// https://vitejs.dev/config/\nexport default defineConfig({\n plugins: [\n solidPlugin(),\n tailwindcss(),\n ],\n})\n"
16
+ },
17
+ "commands": [
18
+ {
19
+ "command": "npm",
20
+ "args": [
21
+ "install"
22
+ ]
23
+ },
24
+ {
25
+ "command": "git",
26
+ "args": [
27
+ "init"
28
+ ]
29
+ }
30
+ ]
31
+ }
@@ -0,0 +1,32 @@
1
+ {
2
+ "files": {
3
+ ".gitignore": "node_modules\n.DS_Store\ndist\ndist-ssr\n*.local\n",
4
+ "/.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",
5
+ "/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",
6
+ "/public/robots.txt": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n",
7
+ "/src/App.css": "",
8
+ "/src/main.tsx": "import { RouterProvider, createRouter } from '@tanstack/solid-router'\nimport { render } from 'solid-js/web'\n\nimport { routeTree } from './routeTree.gen'\nimport './styles.css'\n\nconst router = createRouter({\n routeTree,\n defaultPreload: 'intent',\n scrollRestoration: true,\n defaultPreloadStaleTime: 0,\n})\n\ndeclare module '@tanstack/solid-router' {\n interface Register {\n router: typeof router\n }\n}\n\nfunction App() {\n return (\n <>\n <RouterProvider router={router} />\n </>\n )\n}\n\nconst rootElement = document.getElementById('app')\nif (rootElement) {\n render(() => <App />, rootElement)\n}\n",
9
+ "/src/routes/__root.tsx": "import { Outlet, createRootRouteWithContext } from '@tanstack/solid-router'\nimport { TanStackRouterDevtools } from '@tanstack/solid-router-devtools'\n\nexport const Route = createRootRouteWithContext()({\n component: RootComponent,\n})\n\nfunction RootComponent() {\n return (\n <>\n <Outlet />\n {/* <TanStackRouterDevtools /> */}\n </>\n )\n}\n",
10
+ "/src/routes/index.tsx": "import { createFileRoute } from '@tanstack/solid-router'\nimport logo from '../logo.svg'\n\nexport const Route = createFileRoute('/')({\n component: App,\n})\n\nfunction App() {\n return (\n <main class=\"min-h-screen flex flex-col items-center justify-center bg-[#282c34] text-white text-[calc(10px+2vmin)] text-center\">\n <img\n src={logo}\n class=\"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 class=\"text-[#61dafb] hover:underline\"\n href=\"https://solidjs.com\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n Learn Solid\n </a>\n <a\n class=\"text-[#61dafb] hover:underline\"\n href=\"https://tanstack.com\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n Learn TanStack\n </a>\n </main>\n )\n}\n",
11
+ "/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",
12
+ "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## Styling\n\nThis project uses [Tailwind CSS](https://tailwindcss.com/) for styling.\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 fiels 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/solid-router`.\n\n```tsx\nimport { Link } from \"@tanstack/solid-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/solid/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/solid-router'\nimport { TanStackRouterDevtools } from '@tanstack/solid-router-devtools'\n\nimport { Link } from \"@tanstack/solid-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/solid/guide/routing-concepts#layouts).\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/solid/guide/data-loading#loader-parameters).\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",
13
+ "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 - app-ts</title>\n </head>\n <body>\n <div id=\"app\"></div>\n <script type=\"module\" src=\"/src/main.tsx\"></script>\n </body>\n</html>\n",
14
+ "package.json": "{\n \"name\": \"TEST\",\n \"private\": true,\n \"type\": \"module\",\n \"scripts\": {\n \"start\": \"vite --port 3000\",\n \"build\": \"vite build && tsc\",\n \"serve\": \"vite preview\",\n \"test\": \"vitest run\"\n },\n \"dependencies\": {\n \"@tanstack/router-plugin\": \"^1.109.2\",\n \"@tanstack/solid-router\": \"^1.110.0\",\n \"@tanstack/solid-router-devtools\": \"^1.109.2\",\n \"solid-js\": \"^1.9.4\"\n },\n \"devDependencies\": {\n \"typescript\": \"^5.7.2\",\n \"vite\": \"^6.0.11\",\n \"vite-plugin-solid\": \"^2.11.2\"\n }\n}",
15
+ "tsconfig.json": "{\n \"include\": [\"**/*.ts\", \"**/*.tsx\"],\n \"compilerOptions\": {\n \"target\": \"ES2022\",\n \"jsx\": \"preserve\",\n \"jsxImportSource\": \"solid-js\",\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 }\n}\n",
16
+ "vite.config.js": "import { defineConfig } from 'vite'\nimport { TanStackRouterVite } from '@tanstack/router-plugin/vite'\nimport solidPlugin from 'vite-plugin-solid'\nimport tailwindcss from '@tailwindcss/vite'\n\n// https://vitejs.dev/config/\nexport default defineConfig({\n plugins: [\n TanStackRouterVite({ target: 'solid', autoCodeSplitting: true }),\n solidPlugin(),\n tailwindcss(),\n ],\n})\n"
17
+ },
18
+ "commands": [
19
+ {
20
+ "command": "npm",
21
+ "args": [
22
+ "install"
23
+ ]
24
+ },
25
+ {
26
+ "command": "git",
27
+ "args": [
28
+ "init"
29
+ ]
30
+ }
31
+ ]
32
+ }
@@ -0,0 +1,31 @@
1
+ {
2
+ "files": {
3
+ ".gitignore": "node_modules\n.DS_Store\ndist\ndist-ssr\n*.local\n",
4
+ "/.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",
5
+ "/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",
6
+ "/public/robots.txt": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n",
7
+ "/src/main.tsx": "import { RouterProvider, createRouter } from '@tanstack/solid-router'\nimport { render } from 'solid-js/web'\n\nimport { routeTree } from './routeTree.gen'\nimport './styles.css'\n\nconst router = createRouter({\n routeTree,\n defaultPreload: 'intent',\n scrollRestoration: true,\n defaultPreloadStaleTime: 0,\n})\n\ndeclare module '@tanstack/solid-router' {\n interface Register {\n router: typeof router\n }\n}\n\nfunction App() {\n return (\n <>\n <RouterProvider router={router} />\n </>\n )\n}\n\nconst rootElement = document.getElementById('app')\nif (rootElement) {\n render(() => <App />, rootElement)\n}\n",
8
+ "/src/routes/__root.tsx": "import { Outlet, createRootRouteWithContext } from '@tanstack/solid-router'\nimport { TanStackRouterDevtools } from '@tanstack/solid-router-devtools'\n\nexport const Route = createRootRouteWithContext()({\n component: RootComponent,\n})\n\nfunction RootComponent() {\n return (\n <>\n <Outlet />\n {/* <TanStackRouterDevtools /> */}\n </>\n )\n}\n",
9
+ "/src/routes/index.tsx": "import { createFileRoute } from '@tanstack/solid-router'\nimport logo from '../logo.svg'\n\nexport const Route = createFileRoute('/')({\n component: App,\n})\n\nfunction App() {\n return (\n <main class=\"min-h-screen flex flex-col items-center justify-center bg-[#282c34] text-white text-[calc(10px+2vmin)] text-center\">\n <img\n src={logo}\n class=\"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 class=\"text-[#61dafb] hover:underline\"\n href=\"https://solidjs.com\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n Learn Solid\n </a>\n <a\n class=\"text-[#61dafb] hover:underline\"\n href=\"https://tanstack.com\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n Learn TanStack\n </a>\n </main>\n )\n}\n",
10
+ "/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",
11
+ "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## Styling\n\nThis project uses [Tailwind CSS](https://tailwindcss.com/) for styling.\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 fiels 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/solid-router`.\n\n```tsx\nimport { Link } from \"@tanstack/solid-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/solid/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/solid-router'\nimport { TanStackRouterDevtools } from '@tanstack/solid-router-devtools'\n\nimport { Link } from \"@tanstack/solid-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/solid/guide/routing-concepts#layouts).\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/solid/guide/data-loading#loader-parameters).\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",
12
+ "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 - app-ts</title>\n </head>\n <body>\n <div id=\"app\"></div>\n <script type=\"module\" src=\"/src/main.tsx\"></script>\n </body>\n</html>\n",
13
+ "package.json": "{\n \"name\": \"TEST\",\n \"private\": true,\n \"type\": \"module\",\n \"scripts\": {\n \"start\": \"vite --port 3000\",\n \"build\": \"vite build && tsc\",\n \"serve\": \"vite preview\",\n \"test\": \"vitest run\"\n },\n \"dependencies\": {\n \"@tailwindcss/vite\": \"^4.0.6\",\n \"@tanstack/router-plugin\": \"^1.109.2\",\n \"@tanstack/solid-router\": \"^1.110.0\",\n \"@tanstack/solid-router-devtools\": \"^1.109.2\",\n \"solid-js\": \"^1.9.4\",\n \"tailwindcss\": \"^4.0.6\"\n },\n \"devDependencies\": {\n \"typescript\": \"^5.7.2\",\n \"vite\": \"^6.0.11\",\n \"vite-plugin-solid\": \"^2.11.2\"\n }\n}",
14
+ "tsconfig.json": "{\n \"include\": [\"**/*.ts\", \"**/*.tsx\"],\n \"compilerOptions\": {\n \"target\": \"ES2022\",\n \"jsx\": \"preserve\",\n \"jsxImportSource\": \"solid-js\",\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 }\n}\n",
15
+ "vite.config.js": "import { defineConfig } from 'vite'\nimport { TanStackRouterVite } from '@tanstack/router-plugin/vite'\nimport solidPlugin from 'vite-plugin-solid'\nimport tailwindcss from '@tailwindcss/vite'\n\n// https://vitejs.dev/config/\nexport default defineConfig({\n plugins: [\n TanStackRouterVite({ target: 'solid', autoCodeSplitting: true }),\n solidPlugin(),\n tailwindcss(),\n ],\n})\n"
16
+ },
17
+ "commands": [
18
+ {
19
+ "command": "npm",
20
+ "args": [
21
+ "install"
22
+ ]
23
+ },
24
+ {
25
+ "command": "git",
26
+ "args": [
27
+ "init"
28
+ ]
29
+ }
30
+ ]
31
+ }