@tanstack/cli 0.58.5 → 0.59.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/CHANGELOG.md +127 -0
- package/dist/cli.js +1 -1
- package/dist/command-line.js +3 -0
- package/dist/options.js +3 -0
- package/dist/ui-prompts.js +6 -3
- package/package.json +3 -3
- package/src/cli.ts +1 -1
- package/src/command-line.ts +3 -0
- package/src/options.ts +3 -0
- package/src/ui-prompts.ts +10 -3
- package/tests/command-line.test.ts +29 -0
- package/tests/ui-prompts.test.ts +6 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,132 @@
|
|
|
1
1
|
# @tanstack/cli
|
|
2
2
|
|
|
3
|
+
## 0.59.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [[`76a3782`](https://github.com/TanStack/cli/commit/76a3782027c7b89b188b217baa9eaf60f5562090)]:
|
|
8
|
+
- @tanstack/create@0.61.0
|
|
9
|
+
- @tanstack/create-ui@0.59.2
|
|
10
|
+
|
|
11
|
+
## 0.59.1
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- Prevent add-on multiselect options from rendering with pagination markers by showing the full list, which avoids a Clack navigation glitch that could duplicate the second-to-last entry while moving between the bottom options. ([`e384620`](https://github.com/TanStack/cli/commit/e384620ff642be8d4fe78726f0cbe087b9b10556))
|
|
16
|
+
|
|
17
|
+
- Updated dependencies [[`ab740ed`](https://github.com/TanStack/cli/commit/ab740ed2c5510a3266065aa98c8afe3093ea0034)]:
|
|
18
|
+
- @tanstack/create@0.60.1
|
|
19
|
+
- @tanstack/create-ui@0.59.1
|
|
20
|
+
|
|
21
|
+
## 0.59.0
|
|
22
|
+
|
|
23
|
+
### Minor Changes
|
|
24
|
+
|
|
25
|
+
- feat(mcp): add getAddOnDetails tool and expand add-on metadata
|
|
26
|
+
|
|
27
|
+
Add new MCP tool to retrieve detailed add-on information including
|
|
28
|
+
routes, package additions, files, and documentation. Also expand
|
|
29
|
+
listTanStackAddOns to include type, category, link, warning, and
|
|
30
|
+
exclusive fields.
|
|
31
|
+
|
|
32
|
+
- feat: case-insensitive add-on lookup with typo suggestions
|
|
33
|
+
|
|
34
|
+
- feat: force TanStack Start with Tailwind CSS always enabled
|
|
35
|
+
|
|
36
|
+
- Remove code-router mode and --router-only flag (TanStack Start only)
|
|
37
|
+
- Remove start add-on (baked into base templates)
|
|
38
|
+
- Remove module-federation add-on
|
|
39
|
+
- Force Tailwind CSS to always be enabled
|
|
40
|
+
- Remove --tailwind/--no-tailwind CLI flags
|
|
41
|
+
- Remove selectTailwind and selectTypescript prompts
|
|
42
|
+
- Remove forcedMode parameter (mode always file-router)
|
|
43
|
+
- Simplify template conditionals and hardcode typescript/tailwind values
|
|
44
|
+
- Update README.md.ejs with instructions for removing Tailwind
|
|
45
|
+
- Clean up dead code and unused functions
|
|
46
|
+
- Update all CLI wrappers to show deprecation warnings
|
|
47
|
+
|
|
48
|
+
### Patch Changes
|
|
49
|
+
|
|
50
|
+
- ci: Version Packages (#346)
|
|
51
|
+
|
|
52
|
+
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
|
|
53
|
+
Co-authored-by: Tanner Linsley <tannerlinsley@gmail.com>
|
|
54
|
+
|
|
55
|
+
- ci: Version Packages (#348)
|
|
56
|
+
|
|
57
|
+
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
|
|
58
|
+
|
|
59
|
+
- ci: Version Packages (#339)
|
|
60
|
+
|
|
61
|
+
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
|
|
62
|
+
|
|
63
|
+
- ci: Version Packages (#311)
|
|
64
|
+
|
|
65
|
+
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
|
|
66
|
+
|
|
67
|
+
- ci: Version Packages (#313)
|
|
68
|
+
|
|
69
|
+
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
|
|
70
|
+
Co-authored-by: Tanner Linsley <tannerlinsley@gmail.com>
|
|
71
|
+
|
|
72
|
+
- fix(cli): handle deprecated create-tsrouter flags
|
|
73
|
+
|
|
74
|
+
Add explicit compatibility handling for legacy --router-only and --template flags in tanstack create, with deprecation warnings and clear errors for unsupported JavaScript templates.
|
|
75
|
+
|
|
76
|
+
Fixes #331
|
|
77
|
+
|
|
78
|
+
- ci: Version Packages (#327)
|
|
79
|
+
|
|
80
|
+
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
|
|
81
|
+
|
|
82
|
+
- ci: Version Packages (#312)
|
|
83
|
+
|
|
84
|
+
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
|
|
85
|
+
|
|
86
|
+
- ci: Version Packages (#349)
|
|
87
|
+
|
|
88
|
+
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
|
|
89
|
+
|
|
90
|
+
- ci: Version Packages (#341)
|
|
91
|
+
|
|
92
|
+
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
|
|
93
|
+
|
|
94
|
+
- ci: Version Packages (#338)
|
|
95
|
+
|
|
96
|
+
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
|
|
97
|
+
|
|
98
|
+
- ci: Version Packages (#325)
|
|
99
|
+
|
|
100
|
+
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
|
|
101
|
+
|
|
102
|
+
- ci: Version Packages (#335)
|
|
103
|
+
|
|
104
|
+
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
|
|
105
|
+
|
|
106
|
+
- ci: Version Packages (#347)
|
|
107
|
+
|
|
108
|
+
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
|
|
109
|
+
|
|
110
|
+
- ci: Version Packages (#334)
|
|
111
|
+
|
|
112
|
+
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
|
|
113
|
+
|
|
114
|
+
- ci: Version Packages (#336)
|
|
115
|
+
|
|
116
|
+
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
|
|
117
|
+
|
|
118
|
+
- ci: Version Packages (#326)
|
|
119
|
+
|
|
120
|
+
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
|
|
121
|
+
|
|
122
|
+
- ci: Version Packages (#337)
|
|
123
|
+
|
|
124
|
+
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
|
|
125
|
+
|
|
126
|
+
- Updated dependencies []:
|
|
127
|
+
- @tanstack/create@0.60.0
|
|
128
|
+
- @tanstack/create-ui@0.59.0
|
|
129
|
+
|
|
3
130
|
## 0.58.5
|
|
4
131
|
|
|
5
132
|
### Patch Changes
|
package/dist/cli.js
CHANGED
|
@@ -180,7 +180,7 @@ export function cli({ name, appName, forcedAddOns = [], forcedDeployment, defaul
|
|
|
180
180
|
};
|
|
181
181
|
cliOptions.framework = getFrameworkByName(options.framework || defaultFramework || 'React').id;
|
|
182
182
|
let finalOptions;
|
|
183
|
-
if (cliOptions.interactive) {
|
|
183
|
+
if (cliOptions.interactive || cliOptions.addOns === true) {
|
|
184
184
|
cliOptions.addOns = true;
|
|
185
185
|
}
|
|
186
186
|
else {
|
package/dist/command-line.js
CHANGED
|
@@ -84,6 +84,9 @@ export async function normalizeOptions(cliOptions, forcedAddOns, opts) {
|
|
|
84
84
|
]);
|
|
85
85
|
if (cliOptions.addOns && Array.isArray(cliOptions.addOns)) {
|
|
86
86
|
for (const a of cliOptions.addOns) {
|
|
87
|
+
if (a.toLowerCase() === 'start') {
|
|
88
|
+
continue;
|
|
89
|
+
}
|
|
87
90
|
selectedAddOns.add(a);
|
|
88
91
|
}
|
|
89
92
|
}
|
package/dist/options.js
CHANGED
|
@@ -69,6 +69,9 @@ export async function promptForCreateOptions(cliOptions, { forcedAddOns = [], sh
|
|
|
69
69
|
}
|
|
70
70
|
if (Array.isArray(cliOptions.addOns)) {
|
|
71
71
|
for (const addOn of cliOptions.addOns) {
|
|
72
|
+
if (addOn.toLowerCase() === 'start') {
|
|
73
|
+
continue;
|
|
74
|
+
}
|
|
72
75
|
addOns.add(addOn);
|
|
73
76
|
}
|
|
74
77
|
}
|
package/dist/ui-prompts.js
CHANGED
|
@@ -50,15 +50,18 @@ export async function selectAddOns(framework, mode, type, message, forcedAddOns
|
|
|
50
50
|
hasShownMultiselectHelp = true;
|
|
51
51
|
}
|
|
52
52
|
if (allowMultiple) {
|
|
53
|
+
const selectableAddOns = addOns.filter((addOn) => !forcedAddOns.includes(addOn.id));
|
|
54
|
+
if (selectableAddOns.length === 0) {
|
|
55
|
+
return [];
|
|
56
|
+
}
|
|
53
57
|
const value = await multiselect({
|
|
54
58
|
message,
|
|
55
|
-
options:
|
|
56
|
-
.filter((addOn) => !forcedAddOns.includes(addOn.id))
|
|
57
|
-
.map((addOn) => ({
|
|
59
|
+
options: selectableAddOns.map((addOn) => ({
|
|
58
60
|
value: addOn.id,
|
|
59
61
|
label: addOn.name,
|
|
60
62
|
hint: addOn.description,
|
|
61
63
|
})),
|
|
64
|
+
maxItems: selectableAddOns.length,
|
|
62
65
|
required: false,
|
|
63
66
|
});
|
|
64
67
|
if (isCancel(value)) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tanstack/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.59.2",
|
|
4
4
|
"description": "TanStack CLI",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -38,8 +38,8 @@
|
|
|
38
38
|
"tempy": "^3.1.0",
|
|
39
39
|
"validate-npm-package-name": "^7.0.0",
|
|
40
40
|
"zod": "^3.24.2",
|
|
41
|
-
"@tanstack/create": "0.
|
|
42
|
-
"@tanstack/create-ui": "0.
|
|
41
|
+
"@tanstack/create": "0.61.0",
|
|
42
|
+
"@tanstack/create-ui": "0.59.2"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@tanstack/config": "^0.16.2",
|
package/src/cli.ts
CHANGED
|
@@ -280,7 +280,7 @@ export function cli({
|
|
|
280
280
|
)!.id
|
|
281
281
|
|
|
282
282
|
let finalOptions: Options | undefined
|
|
283
|
-
if (cliOptions.interactive) {
|
|
283
|
+
if (cliOptions.interactive || cliOptions.addOns === true) {
|
|
284
284
|
cliOptions.addOns = true
|
|
285
285
|
} else {
|
|
286
286
|
finalOptions = await normalizeOptions(
|
package/src/command-line.ts
CHANGED
package/src/options.ts
CHANGED
package/src/ui-prompts.ts
CHANGED
|
@@ -86,15 +86,22 @@ export async function selectAddOns(
|
|
|
86
86
|
}
|
|
87
87
|
|
|
88
88
|
if (allowMultiple) {
|
|
89
|
+
const selectableAddOns = addOns.filter(
|
|
90
|
+
(addOn) => !forcedAddOns.includes(addOn.id),
|
|
91
|
+
)
|
|
92
|
+
|
|
93
|
+
if (selectableAddOns.length === 0) {
|
|
94
|
+
return []
|
|
95
|
+
}
|
|
96
|
+
|
|
89
97
|
const value = await multiselect({
|
|
90
98
|
message,
|
|
91
|
-
options:
|
|
92
|
-
.filter((addOn) => !forcedAddOns.includes(addOn.id))
|
|
93
|
-
.map((addOn) => ({
|
|
99
|
+
options: selectableAddOns.map((addOn) => ({
|
|
94
100
|
value: addOn.id,
|
|
95
101
|
label: addOn.name,
|
|
96
102
|
hint: addOn.description,
|
|
97
103
|
})),
|
|
104
|
+
maxItems: selectableAddOns.length,
|
|
98
105
|
required: false,
|
|
99
106
|
})
|
|
100
107
|
|
|
@@ -218,6 +218,35 @@ describe('normalizeOptions', () => {
|
|
|
218
218
|
expect(options?.typescript).toBe(true)
|
|
219
219
|
})
|
|
220
220
|
|
|
221
|
+
it('should ignore legacy start add-on id from exported commands', async () => {
|
|
222
|
+
__testRegisterFramework({
|
|
223
|
+
id: 'react-cra',
|
|
224
|
+
name: 'react',
|
|
225
|
+
getAddOns: () => [
|
|
226
|
+
{
|
|
227
|
+
id: 'tanstack-query',
|
|
228
|
+
name: 'TanStack Query',
|
|
229
|
+
modes: ['file-router'],
|
|
230
|
+
},
|
|
231
|
+
{
|
|
232
|
+
id: 'nitro',
|
|
233
|
+
name: 'nitro',
|
|
234
|
+
modes: ['file-router'],
|
|
235
|
+
default: true,
|
|
236
|
+
},
|
|
237
|
+
],
|
|
238
|
+
})
|
|
239
|
+
|
|
240
|
+
const options = await normalizeOptions({
|
|
241
|
+
projectName: 'test',
|
|
242
|
+
addOns: ['start', 'tanstack-query'],
|
|
243
|
+
framework: 'react-cra',
|
|
244
|
+
})
|
|
245
|
+
|
|
246
|
+
expect(options?.chosenAddOns.map((a) => a.id)).toContain('tanstack-query')
|
|
247
|
+
expect(options?.chosenAddOns.map((a) => a.id)).not.toContain('start')
|
|
248
|
+
})
|
|
249
|
+
|
|
221
250
|
it('should handle toolchain as an addon', async () => {
|
|
222
251
|
__testRegisterFramework({
|
|
223
252
|
id: 'react-cra',
|
package/tests/ui-prompts.test.ts
CHANGED
|
@@ -57,7 +57,9 @@ describe('selectPackageManager', () => {
|
|
|
57
57
|
describe('selectAddOns', () => {
|
|
58
58
|
it('should show keyboard shortcuts help and select add-ons', async () => {
|
|
59
59
|
const noteSpy = vi.spyOn(clack, 'note').mockImplementation(() => {})
|
|
60
|
-
|
|
60
|
+
const multiselectSpy = vi
|
|
61
|
+
.spyOn(clack, 'multiselect')
|
|
62
|
+
.mockImplementation(async () => ['add-on-1'])
|
|
61
63
|
vi.spyOn(clack, 'isCancel').mockImplementation(() => false)
|
|
62
64
|
|
|
63
65
|
const packageManager = await selectAddOns(
|
|
@@ -83,6 +85,9 @@ describe('selectAddOns', () => {
|
|
|
83
85
|
'Use ↑/↓ to navigate • Space to select/deselect • Enter to confirm',
|
|
84
86
|
'Keyboard Shortcuts',
|
|
85
87
|
)
|
|
88
|
+
expect(multiselectSpy).toHaveBeenCalledWith(
|
|
89
|
+
expect.objectContaining({ maxItems: 1 }),
|
|
90
|
+
)
|
|
86
91
|
})
|
|
87
92
|
|
|
88
93
|
it('should exit on cancel', async () => {
|