@tanstack/cli 0.0.8 → 0.48.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.
Files changed (87) hide show
  1. package/dist/bin.js +7 -0
  2. package/dist/cli.js +481 -0
  3. package/dist/command-line.js +174 -0
  4. package/dist/dev-watch.js +290 -0
  5. package/dist/file-syncer.js +148 -0
  6. package/dist/index.js +1 -0
  7. package/dist/mcp/api.js +31 -0
  8. package/dist/mcp/tools.js +250 -0
  9. package/dist/mcp/types.js +37 -0
  10. package/dist/mcp.js +121 -0
  11. package/dist/options.js +162 -0
  12. package/dist/types/bin.d.ts +2 -0
  13. package/dist/types/cli.d.ts +16 -0
  14. package/dist/types/command-line.d.ts +10 -0
  15. package/dist/types/dev-watch.d.ts +27 -0
  16. package/dist/types/file-syncer.d.ts +18 -0
  17. package/dist/types/index.d.ts +1 -0
  18. package/dist/types/mcp/api.d.ts +4 -0
  19. package/dist/types/mcp/tools.d.ts +2 -0
  20. package/dist/types/mcp/types.d.ts +217 -0
  21. package/dist/types/mcp.d.ts +6 -0
  22. package/dist/types/options.d.ts +8 -0
  23. package/dist/types/types.d.ts +25 -0
  24. package/dist/types/ui-environment.d.ts +2 -0
  25. package/dist/types/ui-prompts.d.ts +12 -0
  26. package/dist/types/utils.d.ts +8 -0
  27. package/dist/types.js +1 -0
  28. package/dist/ui-environment.js +52 -0
  29. package/dist/ui-prompts.js +244 -0
  30. package/dist/utils.js +30 -0
  31. package/package.json +46 -46
  32. package/src/bin.ts +6 -93
  33. package/src/cli.ts +692 -0
  34. package/src/command-line.ts +236 -0
  35. package/src/dev-watch.ts +430 -0
  36. package/src/file-syncer.ts +205 -0
  37. package/src/index.ts +1 -85
  38. package/src/mcp.ts +190 -0
  39. package/src/options.ts +260 -0
  40. package/src/types.ts +27 -0
  41. package/src/ui-environment.ts +74 -0
  42. package/src/ui-prompts.ts +322 -0
  43. package/src/utils.ts +38 -0
  44. package/tests/command-line.test.ts +304 -0
  45. package/tests/index.test.ts +9 -0
  46. package/tests/mcp.test.ts +225 -0
  47. package/tests/options.test.ts +304 -0
  48. package/tests/setupVitest.ts +6 -0
  49. package/tests/ui-environment.test.ts +97 -0
  50. package/tests/ui-prompts.test.ts +238 -0
  51. package/tsconfig.json +17 -0
  52. package/vitest.config.js +7 -0
  53. package/dist/bin.cjs +0 -769
  54. package/dist/bin.d.cts +0 -1
  55. package/dist/bin.d.mts +0 -1
  56. package/dist/bin.mjs +0 -768
  57. package/dist/fetch-CbFFGJEw.cjs +0 -3
  58. package/dist/fetch-DG5dLrsb.cjs +0 -522
  59. package/dist/fetch-DhlVXS6S.mjs +0 -390
  60. package/dist/fetch-I_OVg8JX.mjs +0 -3
  61. package/dist/index.cjs +0 -37
  62. package/dist/index.d.cts +0 -1172
  63. package/dist/index.d.mts +0 -1172
  64. package/dist/index.mjs +0 -4
  65. package/dist/template-Szi7-AZJ.mjs +0 -2202
  66. package/dist/template-lWrIZhCQ.cjs +0 -2314
  67. package/src/api/fetch.test.ts +0 -114
  68. package/src/api/fetch.ts +0 -278
  69. package/src/cache/index.ts +0 -89
  70. package/src/commands/create.ts +0 -470
  71. package/src/commands/mcp.test.ts +0 -152
  72. package/src/commands/mcp.ts +0 -211
  73. package/src/engine/compile-with-addons.test.ts +0 -302
  74. package/src/engine/compile.test.ts +0 -404
  75. package/src/engine/compile.ts +0 -569
  76. package/src/engine/config-file.test.ts +0 -118
  77. package/src/engine/config-file.ts +0 -61
  78. package/src/engine/custom-addons/integration.ts +0 -323
  79. package/src/engine/custom-addons/shared.test.ts +0 -98
  80. package/src/engine/custom-addons/shared.ts +0 -281
  81. package/src/engine/custom-addons/template.test.ts +0 -288
  82. package/src/engine/custom-addons/template.ts +0 -124
  83. package/src/engine/template.test.ts +0 -256
  84. package/src/engine/template.ts +0 -269
  85. package/src/engine/types.ts +0 -336
  86. package/src/parse-gitignore.d.ts +0 -5
  87. package/src/templates/base.ts +0 -883
package/package.json CHANGED
@@ -1,66 +1,66 @@
1
1
  {
2
2
  "name": "@tanstack/cli",
3
- "version": "0.0.8",
4
- "description": "TanStack CLI for scaffolding and tooling",
5
- "author": "Tanner Linsley",
6
- "license": "MIT",
3
+ "version": "0.48.2",
4
+ "description": "TanStack CLI",
5
+ "type": "module",
6
+ "main": "./dist/index.js",
7
+ "types": "./dist/types/index.d.ts",
8
+ "bin": {
9
+ "tanstack": "./dist/bin.js"
10
+ },
11
+ "scripts": {
12
+ "build": "tsc",
13
+ "dev": "tsc --watch",
14
+ "test:lint": "eslint ./src",
15
+ "test": "vitest run",
16
+ "test:watch": "vitest",
17
+ "test:coverage": "vitest run --coverage"
18
+ },
7
19
  "repository": {
8
20
  "type": "git",
9
- "url": "git+https://github.com/TanStack/cli.git",
21
+ "url": "git+https://github.com/TanStack/create-tsrouter-app.git",
10
22
  "directory": "packages/cli"
11
23
  },
12
- "homepage": "https://tanstack.com/cli",
24
+ "homepage": "https://tanstack.com/router",
25
+ "funding": {
26
+ "type": "github",
27
+ "url": "https://github.com/sponsors/tannerlinsley"
28
+ },
13
29
  "keywords": [
30
+ "react",
14
31
  "tanstack",
15
- "cli",
16
- "scaffold",
17
- "mcp",
18
- "create",
19
- "start"
32
+ "router",
33
+ "create-react-app"
20
34
  ],
21
- "type": "module",
22
- "exports": {
23
- ".": {
24
- "import": {
25
- "types": "./dist/index.d.mts",
26
- "default": "./dist/index.mjs"
27
- },
28
- "require": {
29
- "types": "./dist/index.d.cts",
30
- "default": "./dist/index.cjs"
31
- }
32
- }
33
- },
34
- "main": "./dist/index.cjs",
35
- "module": "./dist/index.mjs",
36
- "types": "./dist/index.d.mts",
37
- "bin": {
38
- "tanstack": "./dist/bin.mjs"
39
- },
40
- "files": [
41
- "dist",
42
- "src"
43
- ],
44
- "scripts": {
45
- "build": "tsdown --clean",
46
- "test:types": "tsc --noEmit",
47
- "test:eslint": "eslint ./src",
48
- "test:lib": "vitest run --passWithNoTests"
49
- },
35
+ "author": "Jack Herrington <jherr@pobox.com>",
36
+ "license": "MIT",
37
+ "packageManager": "pnpm@9.15.5",
50
38
  "dependencies": {
51
39
  "@clack/prompts": "^0.10.0",
52
40
  "@modelcontextprotocol/sdk": "^1.6.0",
41
+ "@tanstack/create": "workspace:*",
42
+ "@tanstack/create-ui": "workspace:*",
53
43
  "chalk": "^5.4.1",
44
+ "chokidar": "^3.6.0",
54
45
  "commander": "^13.1.0",
55
- "ejs": "^3.1.10",
46
+ "diff": "^7.0.0",
56
47
  "express": "^4.21.2",
57
- "ignore": "^7.0.5",
58
- "parse-gitignore": "^2.0.0",
59
- "zod": "^3.24.0"
48
+ "semver": "^7.7.2",
49
+ "tempy": "^3.1.0",
50
+ "validate-npm-package-name": "^7.0.0",
51
+ "zod": "^3.24.2"
60
52
  },
61
53
  "devDependencies": {
62
- "@types/ejs": "^3.1.5",
54
+ "@tanstack/config": "^0.16.2",
55
+ "@types/diff": "^5.2.0",
63
56
  "@types/express": "^5.0.1",
64
- "@types/node": "^25.0.7"
57
+ "@types/node": "^22.13.4",
58
+ "@types/semver": "^7.7.0",
59
+ "@types/validate-npm-package-name": "^4.0.2",
60
+ "@vitest/coverage-v8": "3.1.1",
61
+ "eslint": "^9.20.0",
62
+ "typescript": "^5.6.3",
63
+ "vitest": "^3.1.1",
64
+ "vitest-fetch-mock": "^0.4.5"
65
65
  }
66
66
  }
package/src/bin.ts CHANGED
@@ -1,95 +1,8 @@
1
1
  #!/usr/bin/env node
2
+ import { cli } from './cli.js'
2
3
 
3
- import { resolve } from 'node:path'
4
- import { Command } from 'commander'
5
- import { runCreate } from './commands/create.js'
6
- import { runMcp } from './commands/mcp.js'
7
- import { compileIntegration, initIntegration } from './engine/custom-addons/integration.js'
8
- import { compileTemplate, initTemplate } from './engine/custom-addons/template.js'
9
-
10
- const program = new Command()
11
-
12
- program
13
- .name('tanstack')
14
- .description('TanStack CLI for scaffolding and tooling')
15
- .version('0.0.1')
16
-
17
- program
18
- .command('create')
19
- .argument('[project-name]', 'name of the project')
20
- .option('--template <template>', 'URL to a custom template JSON file')
21
- .option('--package-manager <pm>', 'package manager (npm, pnpm, yarn, bun)')
22
- .option('--integrations <integrations>', 'comma-separated list of integration IDs')
23
- .option('--no-install', 'skip installing dependencies')
24
- .option('--no-git', 'skip initializing git repository')
25
- .option('--no-tailwind', 'skip tailwind CSS')
26
- .option('-y, --yes', 'skip prompts and use defaults')
27
- .option('--target-dir <path>', 'target directory for the project')
28
- .option('--integrations-path <path>', 'local path to integrations directory (for development)')
29
- .description('Create a new TanStack Start project')
30
- .action(runCreate)
31
-
32
- program
33
- .command('mcp')
34
- .option('--sse', 'run in SSE mode (for HTTP transport)')
35
- .option('--port <port>', 'port for SSE server', '8080')
36
- .description('Start the MCP server for AI agents')
37
- .action(runMcp)
38
-
39
- // Integration commands
40
- const integrationCommand = program.command('integration')
41
-
42
- integrationCommand
43
- .command('init')
44
- .option('--integrations-path <path>', 'local path to integrations directory (for development)')
45
- .description('Initialize an integration from the current project')
46
- .action(async (options: { integrationsPath?: string }) => {
47
- try {
48
- await initIntegration(resolve(process.cwd()), options.integrationsPath)
49
- } catch (error) {
50
- console.error(error instanceof Error ? error.message : 'An error occurred')
51
- process.exit(1)
52
- }
53
- })
54
-
55
- integrationCommand
56
- .command('compile')
57
- .option('--integrations-path <path>', 'local path to integrations directory (for development)')
58
- .description('Compile/update the integration from the current project')
59
- .action(async (options: { integrationsPath?: string }) => {
60
- try {
61
- await compileIntegration(resolve(process.cwd()), options.integrationsPath)
62
- } catch (error) {
63
- console.error(error instanceof Error ? error.message : 'An error occurred')
64
- process.exit(1)
65
- }
66
- })
67
-
68
- // Custom template commands
69
- const templateCommand = program.command('template')
70
-
71
- templateCommand
72
- .command('init')
73
- .description('Initialize a custom template from the current project')
74
- .action(async () => {
75
- try {
76
- await initTemplate(resolve(process.cwd()))
77
- } catch (error) {
78
- console.error(error instanceof Error ? error.message : 'An error occurred')
79
- process.exit(1)
80
- }
81
- })
82
-
83
- templateCommand
84
- .command('compile')
85
- .description('Compile/update the custom template from the current project')
86
- .action(async () => {
87
- try {
88
- await compileTemplate(resolve(process.cwd()))
89
- } catch (error) {
90
- console.error(error instanceof Error ? error.message : 'An error occurred')
91
- process.exit(1)
92
- }
93
- })
94
-
95
- program.parse()
4
+ cli({
5
+ name: 'tanstack',
6
+ appName: 'TanStack',
7
+ craCompatible: true,
8
+ })