@tanstack/cli 0.0.8 → 0.48.3

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 (88) hide show
  1. package/LICENSE +21 -0
  2. package/dist/bin.js +7 -0
  3. package/dist/cli.js +481 -0
  4. package/dist/command-line.js +174 -0
  5. package/dist/dev-watch.js +290 -0
  6. package/dist/file-syncer.js +148 -0
  7. package/dist/index.js +1 -0
  8. package/dist/mcp/api.js +31 -0
  9. package/dist/mcp/tools.js +250 -0
  10. package/dist/mcp/types.js +37 -0
  11. package/dist/mcp.js +121 -0
  12. package/dist/options.js +162 -0
  13. package/dist/types/bin.d.ts +2 -0
  14. package/dist/types/cli.d.ts +16 -0
  15. package/dist/types/command-line.d.ts +10 -0
  16. package/dist/types/dev-watch.d.ts +27 -0
  17. package/dist/types/file-syncer.d.ts +18 -0
  18. package/dist/types/index.d.ts +1 -0
  19. package/dist/types/mcp/api.d.ts +4 -0
  20. package/dist/types/mcp/tools.d.ts +2 -0
  21. package/dist/types/mcp/types.d.ts +217 -0
  22. package/dist/types/mcp.d.ts +6 -0
  23. package/dist/types/options.d.ts +8 -0
  24. package/dist/types/types.d.ts +25 -0
  25. package/dist/types/ui-environment.d.ts +2 -0
  26. package/dist/types/ui-prompts.d.ts +12 -0
  27. package/dist/types/utils.d.ts +8 -0
  28. package/dist/types.js +1 -0
  29. package/dist/ui-environment.js +52 -0
  30. package/dist/ui-prompts.js +244 -0
  31. package/dist/utils.js +30 -0
  32. package/package.json +46 -47
  33. package/src/bin.ts +6 -93
  34. package/src/cli.ts +692 -0
  35. package/src/command-line.ts +236 -0
  36. package/src/dev-watch.ts +430 -0
  37. package/src/file-syncer.ts +205 -0
  38. package/src/index.ts +1 -85
  39. package/src/mcp.ts +190 -0
  40. package/src/options.ts +260 -0
  41. package/src/types.ts +27 -0
  42. package/src/ui-environment.ts +74 -0
  43. package/src/ui-prompts.ts +322 -0
  44. package/src/utils.ts +38 -0
  45. package/tests/command-line.test.ts +304 -0
  46. package/tests/index.test.ts +9 -0
  47. package/tests/mcp.test.ts +225 -0
  48. package/tests/options.test.ts +304 -0
  49. package/tests/setupVitest.ts +6 -0
  50. package/tests/ui-environment.test.ts +97 -0
  51. package/tests/ui-prompts.test.ts +238 -0
  52. package/tsconfig.json +17 -0
  53. package/vitest.config.js +7 -0
  54. package/dist/bin.cjs +0 -769
  55. package/dist/bin.d.cts +0 -1
  56. package/dist/bin.d.mts +0 -1
  57. package/dist/bin.mjs +0 -768
  58. package/dist/fetch-CbFFGJEw.cjs +0 -3
  59. package/dist/fetch-DG5dLrsb.cjs +0 -522
  60. package/dist/fetch-DhlVXS6S.mjs +0 -390
  61. package/dist/fetch-I_OVg8JX.mjs +0 -3
  62. package/dist/index.cjs +0 -37
  63. package/dist/index.d.cts +0 -1172
  64. package/dist/index.d.mts +0 -1172
  65. package/dist/index.mjs +0 -4
  66. package/dist/template-Szi7-AZJ.mjs +0 -2202
  67. package/dist/template-lWrIZhCQ.cjs +0 -2314
  68. package/src/api/fetch.test.ts +0 -114
  69. package/src/api/fetch.ts +0 -278
  70. package/src/cache/index.ts +0 -89
  71. package/src/commands/create.ts +0 -470
  72. package/src/commands/mcp.test.ts +0 -152
  73. package/src/commands/mcp.ts +0 -211
  74. package/src/engine/compile-with-addons.test.ts +0 -302
  75. package/src/engine/compile.test.ts +0 -404
  76. package/src/engine/compile.ts +0 -569
  77. package/src/engine/config-file.test.ts +0 -118
  78. package/src/engine/config-file.ts +0 -61
  79. package/src/engine/custom-addons/integration.ts +0 -323
  80. package/src/engine/custom-addons/shared.test.ts +0 -98
  81. package/src/engine/custom-addons/shared.ts +0 -281
  82. package/src/engine/custom-addons/template.test.ts +0 -288
  83. package/src/engine/custom-addons/template.ts +0 -124
  84. package/src/engine/template.test.ts +0 -256
  85. package/src/engine/template.ts +0 -269
  86. package/src/engine/types.ts +0 -336
  87. package/src/parse-gitignore.d.ts +0 -5
  88. package/src/templates/base.ts +0 -883
package/package.json CHANGED
@@ -1,66 +1,65 @@
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.3",
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
+ },
7
11
  "repository": {
8
12
  "type": "git",
9
- "url": "git+https://github.com/TanStack/cli.git",
13
+ "url": "git+https://github.com/TanStack/create-tsrouter-app.git",
10
14
  "directory": "packages/cli"
11
15
  },
12
- "homepage": "https://tanstack.com/cli",
16
+ "homepage": "https://tanstack.com/router",
17
+ "funding": {
18
+ "type": "github",
19
+ "url": "https://github.com/sponsors/tannerlinsley"
20
+ },
13
21
  "keywords": [
22
+ "react",
14
23
  "tanstack",
15
- "cli",
16
- "scaffold",
17
- "mcp",
18
- "create",
19
- "start"
24
+ "router",
25
+ "create-react-app"
20
26
  ],
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
- },
27
+ "author": "Jack Herrington <jherr@pobox.com>",
28
+ "license": "MIT",
50
29
  "dependencies": {
51
30
  "@clack/prompts": "^0.10.0",
52
31
  "@modelcontextprotocol/sdk": "^1.6.0",
53
32
  "chalk": "^5.4.1",
33
+ "chokidar": "^3.6.0",
54
34
  "commander": "^13.1.0",
55
- "ejs": "^3.1.10",
35
+ "diff": "^7.0.0",
56
36
  "express": "^4.21.2",
57
- "ignore": "^7.0.5",
58
- "parse-gitignore": "^2.0.0",
59
- "zod": "^3.24.0"
37
+ "semver": "^7.7.2",
38
+ "tempy": "^3.1.0",
39
+ "validate-npm-package-name": "^7.0.0",
40
+ "zod": "^3.24.2",
41
+ "@tanstack/create": "0.49.1",
42
+ "@tanstack/create-ui": "0.48.2"
60
43
  },
61
44
  "devDependencies": {
62
- "@types/ejs": "^3.1.5",
45
+ "@tanstack/config": "^0.16.2",
46
+ "@types/diff": "^5.2.0",
63
47
  "@types/express": "^5.0.1",
64
- "@types/node": "^25.0.7"
48
+ "@types/node": "^22.13.4",
49
+ "@types/semver": "^7.7.0",
50
+ "@types/validate-npm-package-name": "^4.0.2",
51
+ "@vitest/coverage-v8": "3.1.1",
52
+ "eslint": "^9.20.0",
53
+ "typescript": "^5.6.3",
54
+ "vitest": "^3.1.1",
55
+ "vitest-fetch-mock": "^0.4.5"
56
+ },
57
+ "scripts": {
58
+ "build": "tsc",
59
+ "dev": "tsc --watch",
60
+ "test:lint": "eslint ./src",
61
+ "test": "vitest run",
62
+ "test:watch": "vitest",
63
+ "test:coverage": "vitest run --coverage"
65
64
  }
66
- }
65
+ }
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
+ })