@tanstack/cta-cli 0.25.0 → 0.25.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.
@@ -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,17 +149,24 @@ 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({
154
158
  message: 'Select hosting provider',
155
159
  options: [
160
+ {
161
+ value: undefined,
162
+ label: 'None',
163
+ },
156
164
  ...Array.from(hosts).map((h) => ({
157
165
  value: h.id,
158
166
  label: h.name,
159
167
  })),
160
168
  ],
161
- initialValue: undefined,
169
+ initialValue: initialValue,
162
170
  });
163
171
  if (isCancel(hp)) {
164
172
  cancel('Operation cancelled.');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tanstack/cta-cli",
3
- "version": "0.25.0",
3
+ "version": "0.25.2",
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-engine": "0.25.0",
34
- "@tanstack/cta-ui": "0.25.0"
33
+ "@tanstack/cta-engine": "0.25.1",
34
+ "@tanstack/cta-ui": "0.25.2"
35
35
  },
36
36
  "devDependencies": {
37
37
  "@tanstack/config": "^0.16.2",
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,18 +199,25 @@ 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
 
203
208
  const hp = await select({
204
209
  message: 'Select hosting provider',
205
210
  options: [
211
+ {
212
+ value: undefined,
213
+ label: 'None',
214
+ },
206
215
  ...Array.from(hosts).map((h) => ({
207
216
  value: h.id,
208
217
  label: h.name,
209
218
  })),
210
219
  ],
211
- initialValue: undefined,
220
+ initialValue: initialValue,
212
221
  })
213
222
 
214
223
  if (isCancel(hp)) {