create-tsrouter-app 0.4.3 → 0.5.0-alpha

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/dist/cli.js CHANGED
@@ -43,13 +43,12 @@ export function cli() {
43
43
  })
44
44
  .option('--list-add-ons', 'list all available add-ons', false)
45
45
  .option('--mcp', 'run the MCP server', false)
46
- .option('--mcp-sse', 'run the MCP server in SSE mode', false)
47
46
  .action(async (projectName, options) => {
48
47
  if (options.listAddOns) {
49
48
  await listAddOns(options);
50
49
  }
51
- else if (options.mcp || options.mcpSse) {
52
- await runServer(!!options.mcpSse);
50
+ else if (options.mcp) {
51
+ await runServer();
53
52
  }
54
53
  else {
55
54
  try {
@@ -329,9 +329,7 @@ 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 ||
333
- options.chosenAddOns.length > 0 ||
334
- integrations.length > 0) {
332
+ if (routes.length > 0) {
335
333
  await templateFile(templateDirBase, './src/components/Header.tsx.ejs', './src/components/Header.tsx', {
336
334
  integrations,
337
335
  });
package/dist/mcp.js CHANGED
@@ -1,7 +1,5 @@
1
1
  import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
- import { SSEServerTransport } from '@modelcontextprotocol/sdk/server/sse.js';
3
2
  import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
4
- import express from 'express';
5
3
  import { z } from 'zod';
6
4
  import { createApp } from './create-app.js';
7
5
  import { finalizeAddOns } from './add-ons.js';
@@ -165,26 +163,7 @@ server.tool('createTanStackSolidApplication', {
165
163
  };
166
164
  }
167
165
  });
168
- export default async function runServer(sse) {
169
- if (sse) {
170
- const app = express();
171
- let transport = null;
172
- app.get('/sse', (req, res) => {
173
- transport = new SSEServerTransport('/messages', res);
174
- server.connect(transport);
175
- });
176
- app.post('/messages', (req, res) => {
177
- if (transport) {
178
- transport.handlePostMessage(req, res);
179
- }
180
- });
181
- const port = process.env.PORT || 8080;
182
- app.listen(port, () => {
183
- console.log(`Server is running on port http://localhost:${port}`);
184
- });
185
- }
186
- else {
187
- const transport = new StdioServerTransport();
188
- await server.connect(transport);
189
- }
166
+ export default async function runServer() {
167
+ const transport = new StdioServerTransport();
168
+ await server.connect(transport);
190
169
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-tsrouter-app",
3
- "version": "0.4.3",
3
+ "version": "0.5.0-alpha",
4
4
  "description": "Tanstack Application Builder",
5
5
  "bin": "./dist/index.js",
6
6
  "type": "module",
@@ -28,14 +28,12 @@
28
28
  "commander": "^13.1.0",
29
29
  "ejs": "^3.1.10",
30
30
  "execa": "^9.5.2",
31
- "express": "^4.21.2",
32
31
  "prettier": "^3.5.0",
33
32
  "zod": "^3.24.2"
34
33
  },
35
34
  "devDependencies": {
36
35
  "@tanstack/config": "^0.16.2",
37
36
  "@types/ejs": "^3.1.5",
38
- "@types/express": "^5.0.0",
39
37
  "@types/node": "^22.13.4",
40
38
  "eslint": "^9.20.0",
41
39
  "eslint-plugin-react-hooks": "^5.1.0",
package/src/cli.ts CHANGED
@@ -79,12 +79,11 @@ export function cli() {
79
79
  )
80
80
  .option('--list-add-ons', 'list all available add-ons', false)
81
81
  .option('--mcp', 'run the MCP server', false)
82
- .option('--mcp-sse', 'run the MCP server in SSE mode', false)
83
82
  .action(async (projectName: string, options: CliOptions) => {
84
83
  if (options.listAddOns) {
85
84
  await listAddOns(options)
86
- } else if (options.mcp || options.mcpSse) {
87
- await runServer(!!options.mcpSse)
85
+ } else if (options.mcp) {
86
+ await runServer()
88
87
  } else {
89
88
  try {
90
89
  const cliOptions = {
package/src/create-app.ts CHANGED
@@ -525,11 +525,7 @@ export async function createApp(
525
525
  }
526
526
  }
527
527
 
528
- if (
529
- routes.length > 0 ||
530
- options.chosenAddOns.length > 0 ||
531
- integrations.length > 0
532
- ) {
528
+ if (routes.length > 0) {
533
529
  await templateFile(
534
530
  templateDirBase,
535
531
  './src/components/Header.tsx.ejs',
package/src/mcp.ts CHANGED
@@ -1,7 +1,5 @@
1
1
  import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js'
2
- import { SSEServerTransport } from '@modelcontextprotocol/sdk/server/sse.js'
3
2
  import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js'
4
- import express from 'express'
5
3
  import { z } from 'zod'
6
4
 
7
5
  import { createApp } from './create-app.js'
@@ -201,29 +199,7 @@ server.tool(
201
199
  },
202
200
  )
203
201
 
204
- export default async function runServer(sse: boolean) {
205
- if (sse) {
206
- const app = express()
207
-
208
- let transport: SSEServerTransport | null = null
209
-
210
- app.get('/sse', (req, res) => {
211
- transport = new SSEServerTransport('/messages', res)
212
- server.connect(transport)
213
- })
214
-
215
- app.post('/messages', (req, res) => {
216
- if (transport) {
217
- transport.handlePostMessage(req, res)
218
- }
219
- })
220
-
221
- const port = process.env.PORT || 8080
222
- app.listen(port, () => {
223
- console.log(`Server is running on port http://localhost:${port}`)
224
- })
225
- } else {
226
- const transport = new StdioServerTransport()
227
- await server.connect(transport)
228
- }
202
+ export default async function runServer() {
203
+ const transport = new StdioServerTransport()
204
+ await server.connect(transport)
229
205
  }
package/src/types.ts CHANGED
@@ -27,5 +27,4 @@ export interface CliOptions {
27
27
  addOns?: Array<string> | boolean
28
28
  listAddOns?: boolean
29
29
  mcp?: boolean
30
- mcpSse?: boolean
31
30
  }
@@ -3,5 +3,9 @@
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/"
6
+ "link": "https://ui.shadcn.com/",
7
+ "command": {
8
+ "command": "npx",
9
+ "args": ["shadcn@canary", "init", "-d", "-s"]
10
+ }
7
11
  }
@@ -14,5 +14,6 @@
14
14
  "url": "/demo/start/api-request",
15
15
  "name": "Start - API Request"
16
16
  }
17
- ]
17
+ ],
18
+ "shadcnComponents": ["button", "input"]
18
19
  }
@@ -1,21 +0,0 @@
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
- }
@@ -1,6 +0,0 @@
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
- }
@@ -1,138 +0,0 @@
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
- }
@@ -1,9 +0,0 @@
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
- }