@tanstack/cta-cli 0.25.1 → 0.26.0
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/command-line.js +3 -0
- package/dist/ui-prompts.js +5 -1
- package/package.json +3 -3
- package/src/command-line.ts +4 -0
- package/src/ui-prompts.ts +6 -1
package/dist/command-line.js
CHANGED
|
@@ -57,6 +57,9 @@ export async function normalizeOptions(cliOptions, forcedMode, forcedAddOns, opt
|
|
|
57
57
|
if (cliOptions.host) {
|
|
58
58
|
selectedAddOns.add(cliOptions.host);
|
|
59
59
|
}
|
|
60
|
+
if (!cliOptions.host) {
|
|
61
|
+
selectedAddOns.add('nitro');
|
|
62
|
+
}
|
|
60
63
|
return await finalizeAddOns(framework, mode, Array.from(selectedAddOns));
|
|
61
64
|
}
|
|
62
65
|
return [];
|
package/dist/ui-prompts.js
CHANGED
|
@@ -140,6 +140,7 @@ export async function selectToolchain(framework, toolchain) {
|
|
|
140
140
|
}
|
|
141
141
|
export async function selectHost(framework, host) {
|
|
142
142
|
const hosts = new Set();
|
|
143
|
+
let initialValue = undefined;
|
|
143
144
|
for (const addOn of framework
|
|
144
145
|
.getAddOns()
|
|
145
146
|
.sort((a, b) => a.name.localeCompare(b.name))) {
|
|
@@ -148,6 +149,9 @@ export async function selectHost(framework, host) {
|
|
|
148
149
|
if (host && addOn.id === host) {
|
|
149
150
|
return host;
|
|
150
151
|
}
|
|
152
|
+
if (addOn.default) {
|
|
153
|
+
initialValue = addOn.id;
|
|
154
|
+
}
|
|
151
155
|
}
|
|
152
156
|
}
|
|
153
157
|
const hp = await select({
|
|
@@ -162,7 +166,7 @@ export async function selectHost(framework, host) {
|
|
|
162
166
|
label: h.name,
|
|
163
167
|
})),
|
|
164
168
|
],
|
|
165
|
-
initialValue:
|
|
169
|
+
initialValue: initialValue,
|
|
166
170
|
});
|
|
167
171
|
if (isCancel(hp)) {
|
|
168
172
|
cancel('Operation cancelled.');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tanstack/cta-cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.26.0",
|
|
4
4
|
"description": "Tanstack Application Builder CLI",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -30,8 +30,8 @@
|
|
|
30
30
|
"express": "^4.21.2",
|
|
31
31
|
"semver": "^7.7.2",
|
|
32
32
|
"zod": "^3.24.2",
|
|
33
|
-
"@tanstack/cta-
|
|
34
|
-
"@tanstack/cta-
|
|
33
|
+
"@tanstack/cta-engine": "0.26.0",
|
|
34
|
+
"@tanstack/cta-ui": "0.26.0"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"@tanstack/config": "^0.16.2",
|
package/src/command-line.ts
CHANGED
package/src/ui-prompts.ts
CHANGED
|
@@ -16,6 +16,7 @@ import {
|
|
|
16
16
|
import type { AddOn, PackageManager } from '@tanstack/cta-engine'
|
|
17
17
|
|
|
18
18
|
import type { Framework } from '@tanstack/cta-engine/dist/types/types.js'
|
|
19
|
+
import { InitialData } from '../../cta-ui/src/types'
|
|
19
20
|
|
|
20
21
|
export async function getProjectName(): Promise<string> {
|
|
21
22
|
const value = await text({
|
|
@@ -189,6 +190,7 @@ export async function selectHost(
|
|
|
189
190
|
host?: string,
|
|
190
191
|
): Promise<string | undefined> {
|
|
191
192
|
const hosts = new Set<AddOn>()
|
|
193
|
+
let initialValue: string | undefined = undefined
|
|
192
194
|
for (const addOn of framework
|
|
193
195
|
.getAddOns()
|
|
194
196
|
.sort((a, b) => a.name.localeCompare(b.name))) {
|
|
@@ -197,6 +199,9 @@ export async function selectHost(
|
|
|
197
199
|
if (host && addOn.id === host) {
|
|
198
200
|
return host
|
|
199
201
|
}
|
|
202
|
+
if (addOn.default) {
|
|
203
|
+
initialValue = addOn.id
|
|
204
|
+
}
|
|
200
205
|
}
|
|
201
206
|
}
|
|
202
207
|
|
|
@@ -212,7 +217,7 @@ export async function selectHost(
|
|
|
212
217
|
label: h.name,
|
|
213
218
|
})),
|
|
214
219
|
],
|
|
215
|
-
initialValue:
|
|
220
|
+
initialValue: initialValue,
|
|
216
221
|
})
|
|
217
222
|
|
|
218
223
|
if (isCancel(hp)) {
|