create-start-app 0.9.4 → 0.9.7

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.
@@ -5,6 +5,7 @@ import { render } from 'ejs';
5
5
  import { format } from 'prettier';
6
6
  import chalk from 'chalk';
7
7
  import { CODE_ROUTER, FILE_ROUTER } from './constants.js';
8
+ import { packageManagerExecute } from './package-manager.js';
8
9
  function sortObject(obj) {
9
10
  return Object.keys(obj)
10
11
  .sort()
@@ -306,7 +307,7 @@ export async function createApp(options, { silent = false, environment, }) {
306
307
  }
307
308
  if (shadcnComponents.size > 0) {
308
309
  s?.start(`Installing shadcn components (${Array.from(shadcnComponents).join(', ')})...`);
309
- await environment.execute('npx', ['shadcn@canary', 'add', '--silent', '--yes', ...shadcnComponents], resolve(targetDir));
310
+ await packageManagerExecute(environment, options.packageManager, 'shadcn@latest', ['add', '--silent', '--yes', ...shadcnComponents], resolve(targetDir));
310
311
  s?.stop(`Installed additional shadcn components`);
311
312
  }
312
313
  }
@@ -445,6 +446,6 @@ Use the following commands to start your app:
445
446
  % cd ${options.projectName}
446
447
  % ${startCommand}
447
448
 
448
- Please read README.md for more information on testing, styling, adding routes, react-query, etc.${errorStatement}`);
449
+ Please read the README.md for more information on testing, styling, adding routes, react-query, etc.${errorStatement}`);
449
450
  }
450
451
  }
@@ -14,3 +14,17 @@ export function getPackageManager() {
14
14
  const packageManager = SUPPORTED_PACKAGE_MANAGERS.find((manager) => userAgent.startsWith(manager));
15
15
  return packageManager;
16
16
  }
17
+ export function packageManagerExecute(environment, packagerManager, pkg, args, cwd) {
18
+ switch (packagerManager) {
19
+ case 'yarn':
20
+ return environment.execute('yarn', ['dlx', pkg, ...args], cwd);
21
+ case 'pnpm':
22
+ return environment.execute('pnpx', [pkg, ...args], cwd);
23
+ case 'bun':
24
+ return environment.execute('bunx', ['--bun', pkg, ...args], cwd);
25
+ case 'deno':
26
+ return environment.execute('deno', ['run', `npm:${pkg}`, ...args], cwd);
27
+ default:
28
+ return environment.execute('npx', [pkg, ...args], cwd);
29
+ }
30
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-start-app",
3
- "version": "0.9.4",
3
+ "version": "0.9.7",
4
4
  "description": "Tanstack Application Builder",
5
5
  "bin": "./dist/index.js",
6
6
  "type": "module",
package/src/create-app.ts CHANGED
@@ -6,6 +6,7 @@ import { format } from 'prettier'
6
6
  import chalk from 'chalk'
7
7
 
8
8
  import { CODE_ROUTER, FILE_ROUTER } from './constants.js'
9
+ import { packageManagerExecute } from './package-manager.js'
9
10
 
10
11
  import type { Environment } from './environment.js'
11
12
  import type { Options } from './types.js'
@@ -485,9 +486,11 @@ export async function createApp(
485
486
  s?.start(
486
487
  `Installing shadcn components (${Array.from(shadcnComponents).join(', ')})...`,
487
488
  )
488
- await environment.execute(
489
- 'npx',
490
- ['shadcn@canary', 'add', '--silent', '--yes', ...shadcnComponents],
489
+ await packageManagerExecute(
490
+ environment,
491
+ options.packageManager,
492
+ 'shadcn@latest',
493
+ ['add', '--silent', '--yes', ...shadcnComponents],
491
494
  resolve(targetDir),
492
495
  )
493
496
  s?.stop(`Installed additional shadcn components`)
@@ -722,6 +725,6 @@ Use the following commands to start your app:
722
725
  % cd ${options.projectName}
723
726
  % ${startCommand}
724
727
 
725
- Please read README.md for more information on testing, styling, adding routes, react-query, etc.${errorStatement}`)
728
+ Please read the README.md for more information on testing, styling, adding routes, react-query, etc.${errorStatement}`)
726
729
  }
727
730
  }
@@ -1,3 +1,5 @@
1
+ import type { Environment } from './environment'
2
+
1
3
  export const SUPPORTED_PACKAGE_MANAGERS = [
2
4
  'npm',
3
5
  'yarn',
@@ -21,3 +23,24 @@ export function getPackageManager(): PackageManager | undefined {
21
23
 
22
24
  return packageManager
23
25
  }
26
+
27
+ export function packageManagerExecute(
28
+ environment: Environment,
29
+ packagerManager: PackageManager,
30
+ pkg: string,
31
+ args: Array<string>,
32
+ cwd: string,
33
+ ) {
34
+ switch (packagerManager) {
35
+ case 'yarn':
36
+ return environment.execute('yarn', ['dlx', pkg, ...args], cwd)
37
+ case 'pnpm':
38
+ return environment.execute('pnpx', [pkg, ...args], cwd)
39
+ case 'bun':
40
+ return environment.execute('bunx', ['--bun', pkg, ...args], cwd)
41
+ case 'deno':
42
+ return environment.execute('deno', ['run', `npm:${pkg}`, ...args], cwd)
43
+ default:
44
+ return environment.execute('npx', [pkg, ...args], cwd)
45
+ }
46
+ }
@@ -1,7 +1,7 @@
1
1
  ## Shadcn
2
2
 
3
- Add components using the canary version of [Shadcn](https://ui.shadcn.com/).
3
+ Add components using the latest version of [Shadcn](https://ui.shadcn.com/).
4
4
 
5
5
  ```bash
6
- pnpx shadcn@canary add button
6
+ pnpx shadcn@latest add button
7
7
  ```
@@ -1,7 +1,7 @@
1
1
  # shadcn instructions
2
2
 
3
- Use the canary version of Shadcn to install new components, like this command to add a button component:
3
+ Use the latest version of Shadcn to install new components, like this command to add a button component:
4
4
 
5
5
  ```bash
6
- pnpx shadcn@canary add button
6
+ pnpx shadcn@latest add button
7
7
  ```
@@ -10,9 +10,15 @@ export interface Message {
10
10
  content: string
11
11
  }
12
12
 
13
- const SYSTEM_PROMPT = `You are TanStack Chat, an AI assistant using Markdown for clear and structured responses.`
13
+ const SYSTEM_PROMPT = `You are a helpful assistant for a store that sells guitars.
14
14
 
15
- export const genAIResponse = createServerFn({ method: 'GET', response: 'raw' })
15
+ You can use the following tools to help the user:
16
+
17
+ - getGuitars: Get all guitars from the database
18
+ - recommendGuitar: Recommend a guitar to the user
19
+ `
20
+
21
+ export const genAIResponse = createServerFn({ method: 'POST', response: 'raw' })
16
22
  .validator(
17
23
  (d: {
18
24
  messages: Array<Message>
@@ -1,24 +1,28 @@
1
1
  import { experimental_createMCPClient, tool } from 'ai'
2
+ //import { StdioClientTransport } from "@modelcontextprotocol/sdk/client/stdio.js";
2
3
  import { z } from 'zod'
3
4
  import guitars from '../data/example-guitars'
4
5
 
5
- // Example of using an MCP server to get tools
6
- // const mcpCient = await experimental_createMCPClient({
6
+ // Example of using an SSE MCP server
7
+ // const mcpClient = await experimental_createMCPClient({
7
8
  // transport: {
8
- // type: 'stdio',
9
+ // type: "sse",
10
+ // url: "http://localhost:8081/sse",
11
+ // },
12
+ // name: "Demo Service",
13
+ // });
14
+
15
+ // Example of using an STDIO MCP server
16
+ // const mcpClient = await experimental_createMCPClient({
17
+ // transport: new StdioClientTransport({
18
+ // command: "node",
9
19
  // args: [
10
- // '--directory',
11
- // '~/mcp/servers/src/sqlite',
12
- // 'run',
13
- // 'mcp-server-sqlite',
14
- // '--db-path',
15
- // '~/sqlite-example/orders.db',
20
+ // "stdio-server.js",
16
21
  // ],
17
- // command: 'uv',
18
- // },
19
- // })
22
+ // }),
23
+ // });
20
24
 
21
- const getProducts = tool({
25
+ const getGuitars = tool({
22
26
  description: 'Get all products from the database',
23
27
  parameters: z.object({}),
24
28
  execute: async () => {
@@ -37,7 +41,7 @@ export default async function getTools() {
37
41
  // const mcpTools = await mcpCient.tools()
38
42
  return {
39
43
  // ...mcpTools,
40
- getProducts,
44
+ getGuitars,
41
45
  recommendGuitar,
42
46
  }
43
47
  }
@@ -2,13 +2,14 @@
2
2
  "dependencies": {
3
3
  "@ai-sdk/anthropic": "^1.1.17",
4
4
  "@ai-sdk/react": "^1.1.23",
5
- "ai": "^4.1.61",
5
+ "ai": "^4.1.65",
6
6
  "highlight.js": "^11.11.1",
7
7
  "react-markdown": "^9.0.1",
8
8
  "rehype-highlight": "^7.0.0",
9
9
  "rehype-raw": "^7.0.0",
10
10
  "rehype-sanitize": "^6.0.0",
11
11
  "remark-gfm": "^4.0.1",
12
- "lucide-react": "^0.475.0"
12
+ "lucide-react": "^0.475.0",
13
+ "zod": "^3.24.2"
13
14
  }
14
15
  }