Skip to content

Commit de2c4e6

Browse files
committed
Main merge into alpha
2 parents 31b368c + 12b3102 commit de2c4e6

File tree

9 files changed

+25
-10
lines changed

9 files changed

+25
-10
lines changed

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,18 @@ npx create-tsrouter-app@latest --list-add-ons --framework solid --template file-
124124

125125
Will get you a list of all available add-ons for Solid that are compatible with the File Router.
126126

127+
## MCP (Model Context Protocol) Support (experimental)
128+
129+
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.
130+
131+
```bash
132+
npx create-tsrouter-app@latest --mcp
133+
```
134+
135+
Shown below is the configuration for MCP support in Cursor.
136+
137+
![MCP Configuration](./images/mcp-configuration.png)
138+
127139
# Contributing
128140

129141
Check out the [Contributing](CONTRIBUTING.md) guide.

images/mcp-configuration.png

62.4 KB
Loading

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "create-tsrouter-app",
3-
"version": "0.3.0-alpha.11",
3+
"version": "0.4.1",
44
"description": "Tanstack Application Builder",
55
"bin": "./dist/index.js",
66
"type": "module",

src/options.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export async function normalizeOptions(
2323
cliOptions: CliOptions,
2424
): Promise<Required<Options> | undefined> {
2525
if (cliOptions.projectName) {
26-
const typescript =
26+
let typescript =
2727
cliOptions.template === 'typescript' ||
2828
cliOptions.template === 'file-router' ||
2929
cliOptions.framework === 'solid'
@@ -43,6 +43,7 @@ export async function normalizeOptions(
4343
cliOptions.addOns,
4444
)
4545
tailwind = true
46+
typescript = true
4647
}
4748

4849
return {

templates/react/add-on/start/assets/src/client.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ import { StartClient } from '@tanstack/start'
33

44
import { createRouter } from './router'
55

6-
const router = createRouter({
7-
scrollRestoration: true,
8-
})
6+
const router = createRouter()
97

10-
hydrateRoot(document!, <StartClient router={router} />)
8+
hydrateRoot(document, <StartClient router={router} />)

templates/react/add-on/start/assets/src/router.tsx.ejs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@ import './styles.css'
1111

1212
// Create a new router instance
1313
export const createRouter = () => {
14-
const router = createTanstackRouter({ routeTree })
14+
const router = createTanstackRouter({
15+
routeTree,
16+
scrollRestoration: true,
17+
})
1518
return router
1619
}
1720

@@ -46,6 +49,6 @@ const router = createRouter()
4649
// Register the router instance for type safety
4750
declare module '@tanstack/react-router' {
4851
interface Register {
49-
router: router
52+
router: typeof router
5053
}
5154
}

templates/react/base/README.md.ejs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ import "./styles.css";
306306
import reportWebVitals from "./reportWebVitals.<%= js %>";
307307
308308
// Create a new router instance
309-
const router = createRouter({ routeTree });
309+
const router = createRouter({ routeTree, defaultPreload: "intent", scrollRestoration: true, defaultStructuralSharing: true });
310310
<% if (typescript) { %>
311311
// Register the router instance for type safety
312312
declare module "@tanstack/react-router" {

templates/react/code-router/src/main.tsx.ejs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ const router = createRouter({
5151
routeTree,
5252
defaultPreload: "intent",
5353
scrollRestoration: true,
54+
defaultStructuralSharing: true,
5455
});
5556
<% if (typescript) { %>
5657
declare module "@tanstack/react-router" {

templates/react/file-router/src/main.tsx.ejs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import "./styles.css";
99
import reportWebVitals from "./reportWebVitals.<%= js %>";
1010

1111
// Create a new router instance
12-
const router = createRouter({ routeTree });
12+
const router = createRouter({ routeTree, defaultPreload: "intent", scrollRestoration: true, defaultStructuralSharing: true });
1313

1414
// Register the router instance for type safety
1515
declare module "@tanstack/react-router" {

0 commit comments

Comments
 (0)