create-start-app 0.4.0 → 0.4.2

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.
package/README.md CHANGED
@@ -124,6 +124,18 @@ npx create-tsrouter-app@latest --list-add-ons --framework solid --template file-
124
124
 
125
125
  Will get you a list of all available add-ons for Solid that are compatible with the File Router.
126
126
 
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
+
127
139
  # Contributing
128
140
 
129
141
  Check out the [Contributing](CONTRIBUTING.md) guide.
@@ -329,7 +329,9 @@ export async function createApp(options, { silent = false, } = {}) {
329
329
  await templateFile(templateDirBase, './src/App.test.tsx.ejs', options.typescript ? undefined : './src/App.test.jsx');
330
330
  }
331
331
  }
332
- if (routes.length > 0) {
332
+ if (routes.length > 0 ||
333
+ options.chosenAddOns.length > 0 ||
334
+ integrations.length > 0) {
333
335
  await templateFile(templateDirBase, './src/components/Header.tsx.ejs', './src/components/Header.tsx', {
334
336
  integrations,
335
337
  });
package/dist/options.js CHANGED
@@ -5,7 +5,7 @@ import { finalizeAddOns, getAllAddOns } from './add-ons.js';
5
5
  // If all CLI options are provided, use them directly
6
6
  export async function normalizeOptions(cliOptions) {
7
7
  if (cliOptions.projectName) {
8
- const typescript = cliOptions.template === 'typescript' ||
8
+ let typescript = cliOptions.template === 'typescript' ||
9
9
  cliOptions.template === 'file-router' ||
10
10
  cliOptions.framework === 'solid';
11
11
  let tailwind = !!cliOptions.tailwind;
@@ -18,6 +18,7 @@ export async function normalizeOptions(cliOptions) {
18
18
  addOns = true;
19
19
  chosenAddOns = await finalizeAddOns(cliOptions.framework || DEFAULT_FRAMEWORK, cliOptions.template === 'file-router' ? FILE_ROUTER : CODE_ROUTER, cliOptions.addOns);
20
20
  tailwind = true;
21
+ typescript = true;
21
22
  }
22
23
  return {
23
24
  framework: cliOptions.framework || 'react',
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-start-app",
3
- "version": "0.4.0",
3
+ "version": "0.4.2",
4
4
  "description": "Tanstack Application Builder",
5
5
  "bin": "./dist/index.js",
6
6
  "type": "module",
package/src/create-app.ts CHANGED
@@ -525,7 +525,11 @@ export async function createApp(
525
525
  }
526
526
  }
527
527
 
528
- if (routes.length > 0) {
528
+ if (
529
+ routes.length > 0 ||
530
+ options.chosenAddOns.length > 0 ||
531
+ integrations.length > 0
532
+ ) {
529
533
  await templateFile(
530
534
  templateDirBase,
531
535
  './src/components/Header.tsx.ejs',
package/src/options.ts CHANGED
@@ -23,7 +23,7 @@ export async function normalizeOptions(
23
23
  cliOptions: CliOptions,
24
24
  ): Promise<Required<Options> | undefined> {
25
25
  if (cliOptions.projectName) {
26
- const typescript =
26
+ let typescript =
27
27
  cliOptions.template === 'typescript' ||
28
28
  cliOptions.template === 'file-router' ||
29
29
  cliOptions.framework === 'solid'
@@ -43,6 +43,7 @@ export async function normalizeOptions(
43
43
  cliOptions.addOns,
44
44
  )
45
45
  tailwind = true
46
+ typescript = true
46
47
  }
47
48
 
48
49
  return {
@@ -0,0 +1,21 @@
1
+ {
2
+ "$schema": "https://ui.shadcn.com/schema.json",
3
+ "style": "new-york",
4
+ "rsc": false,
5
+ "tsx": true,
6
+ "tailwind": {
7
+ "config": "",
8
+ "css": "src/styles.css",
9
+ "baseColor": "zinc",
10
+ "cssVariables": true,
11
+ "prefix": ""
12
+ },
13
+ "aliases": {
14
+ "components": "@/components",
15
+ "utils": "@/lib/utils",
16
+ "ui": "@/components/ui",
17
+ "lib": "@/lib",
18
+ "hooks": "@/hooks"
19
+ },
20
+ "iconLibrary": "lucide"
21
+ }
@@ -0,0 +1,6 @@
1
+ import { clsx, type ClassValue } from "clsx"
2
+ import { twMerge } from "tailwind-merge"
3
+
4
+ export function cn(...inputs: ClassValue[]) {
5
+ return twMerge(clsx(inputs))
6
+ }
@@ -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
+ }
@@ -3,9 +3,5 @@
3
3
  "description": "Add Shadcn UI to your application.",
4
4
  "phase": "add-on",
5
5
  "templates": ["file-router", "code-router"],
6
- "link": "https://ui.shadcn.com/",
7
- "command": {
8
- "command": "npx",
9
- "args": ["shadcn@canary", "init", "-d", "-s"]
10
- }
6
+ "link": "https://ui.shadcn.com/"
11
7
  }
@@ -0,0 +1,9 @@
1
+ {
2
+ "dependencies": {
3
+ "class-variance-authority": "^0.7.1",
4
+ "clsx": "^2.1.1",
5
+ "lucide-react": "^0.476.0",
6
+ "tailwind-merge": "^3.0.2",
7
+ "tailwindcss-animate": "^1.0.7"
8
+ }
9
+ }
@@ -3,8 +3,6 @@ import { StartClient } from '@tanstack/start'
3
3
 
4
4
  import { createRouter } from './router'
5
5
 
6
- const router = createRouter({
7
- scrollRestoration: true,
8
- })
6
+ const router = createRouter()
9
7
 
10
- hydrateRoot(document!, <StartClient router={router} />)
8
+ hydrateRoot(document, <StartClient router={router} />)
@@ -11,7 +11,10 @@ import './styles.css'
11
11
 
12
12
  // Create a new router instance
13
13
  export const createRouter = () => {
14
- const router = createTanstackRouter({ routeTree })
14
+ const router = createTanstackRouter({
15
+ routeTree,
16
+ scrollRestoration: true,
17
+ })
15
18
  return router
16
19
  }
17
20
 
@@ -46,6 +49,6 @@ const router = createRouter()
46
49
  // Register the router instance for type safety
47
50
  declare module '@tanstack/react-router' {
48
51
  interface Register {
49
- router: router
52
+ router: typeof router
50
53
  }
51
54
  }
@@ -306,7 +306,7 @@ import "./styles.css";
306
306
  import reportWebVitals from "./reportWebVitals.<%= js %>";
307
307
 
308
308
  // Create a new router instance
309
- const router = createRouter({ routeTree });
309
+ const router = createRouter({ routeTree, defaultPreload: "intent", scrollRestoration: true, defaultStructuralSharing: true });
310
310
  <% if (typescript) { %>
311
311
  // Register the router instance for type safety
312
312
  declare module "@tanstack/react-router" {
@@ -51,6 +51,7 @@ const router = createRouter({
51
51
  routeTree,
52
52
  defaultPreload: "intent",
53
53
  scrollRestoration: true,
54
+ defaultStructuralSharing: true,
54
55
  });
55
56
  <% if (typescript) { %>
56
57
  declare module "@tanstack/react-router" {
@@ -9,7 +9,7 @@ import "./styles.css";
9
9
  import reportWebVitals from "./reportWebVitals.<%= js %>";
10
10
 
11
11
  // Create a new router instance
12
- const router = createRouter({ routeTree });
12
+ const router = createRouter({ routeTree, defaultPreload: "intent", scrollRestoration: true, defaultStructuralSharing: true });
13
13
 
14
14
  // Register the router instance for type safety
15
15
  declare module "@tanstack/react-router" {