@tanstack/cta-cli 0.10.0-alpha.18 → 0.10.0-alpha.19

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/cli.js CHANGED
@@ -84,6 +84,7 @@ export function cli({ name, appName, forcedMode, forcedAddOns, }) {
84
84
  }
85
85
  return value;
86
86
  })
87
+ .option('--interactive', 'interactive mode', false)
87
88
  .option('--tailwind', 'add Tailwind CSS', false)
88
89
  .option('--add-ons [...add-ons]', 'pick from a list of available add-ons (comma separated list)', (value) => {
89
90
  let addOns = !!value;
@@ -121,7 +122,13 @@ export function cli({ name, appName, forcedMode, forcedAddOns, }) {
121
122
  if (forcedMode) {
122
123
  cliOptions.template = forcedMode;
123
124
  }
124
- let finalOptions = await normalizeOptions(cliOptions, forcedMode, forcedAddOns);
125
+ let finalOptions;
126
+ if (cliOptions.interactive) {
127
+ cliOptions.addOns = true;
128
+ }
129
+ else {
130
+ finalOptions = await normalizeOptions(cliOptions, forcedMode, forcedAddOns);
131
+ }
125
132
  if (finalOptions) {
126
133
  intro(`Creating a new ${appName} app in ${projectName}...`);
127
134
  }
package/dist/options.js CHANGED
@@ -139,6 +139,9 @@ export async function promptForOptions(cliOptions, { forcedAddOns = [], forcedMo
139
139
  }
140
140
  options.projectName = value;
141
141
  }
142
+ else {
143
+ options.projectName = cliOptions.projectName;
144
+ }
142
145
  // Router type selection
143
146
  if (!cliOptions.template && !forcedMode) {
144
147
  const routerType = await select({
@@ -4,4 +4,4 @@ export declare function normalizeOptions(cliOptions: CliOptions, forcedMode?: Mo
4
4
  export declare function promptForOptions(cliOptions: CliOptions, { forcedAddOns, forcedMode, }: {
5
5
  forcedAddOns?: Array<string>;
6
6
  forcedMode?: TemplateOptions;
7
- }): Promise<Required<Options>>;
7
+ }): Promise<Required<Options> | undefined>;
@@ -13,4 +13,5 @@ export interface CliOptions {
13
13
  mcpSse?: boolean;
14
14
  starter?: string;
15
15
  targetDir?: string;
16
+ interactive?: boolean;
16
17
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tanstack/cta-cli",
3
- "version": "0.10.0-alpha.18",
3
+ "version": "0.10.0-alpha.19",
4
4
  "description": "Tanstack Application Builder CLI",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -26,10 +26,10 @@
26
26
  "@clack/prompts": "^0.10.0",
27
27
  "chalk": "^5.4.1",
28
28
  "commander": "^13.1.0",
29
- "@tanstack/cta-engine": "0.10.0-alpha.18",
30
- "@tanstack/cta-mcp": "0.10.0-alpha.18",
31
- "@tanstack/cta-ui": "0.10.0-alpha.18",
32
- "@tanstack/cta-custom-add-on": "0.10.0-alpha.18"
29
+ "@tanstack/cta-engine": "0.10.0-alpha.19",
30
+ "@tanstack/cta-custom-add-on": "0.10.0-alpha.19",
31
+ "@tanstack/cta-mcp": "0.10.0-alpha.19",
32
+ "@tanstack/cta-ui": "0.10.0-alpha.19"
33
33
  },
34
34
  "devDependencies": {
35
35
  "@tanstack/config": "^0.16.2",
package/src/cli.ts CHANGED
@@ -23,6 +23,7 @@ import { createUIEnvironment } from './ui-environment.js'
23
23
 
24
24
  import type {
25
25
  Mode,
26
+ Options,
26
27
  PackageManager,
27
28
  TemplateOptions,
28
29
  } from '@tanstack/cta-engine'
@@ -179,6 +180,7 @@ export function cli({
179
180
  return value
180
181
  },
181
182
  )
183
+ .option('--interactive', 'interactive mode', false)
182
184
  .option('--tailwind', 'add Tailwind CSS', false)
183
185
  .option<Array<string> | boolean>(
184
186
  '--add-ons [...add-ons]',
@@ -227,11 +229,17 @@ export function cli({
227
229
  cliOptions.template = forcedMode as TemplateOptions
228
230
  }
229
231
 
230
- let finalOptions = await normalizeOptions(
231
- cliOptions,
232
- forcedMode,
233
- forcedAddOns,
234
- )
232
+ let finalOptions: Options | undefined
233
+ if (cliOptions.interactive) {
234
+ cliOptions.addOns = true
235
+ } else {
236
+ finalOptions = await normalizeOptions(
237
+ cliOptions,
238
+ forcedMode,
239
+ forcedAddOns,
240
+ )
241
+ }
242
+
235
243
  if (finalOptions) {
236
244
  intro(`Creating a new ${appName} app in ${projectName}...`)
237
245
  } else {
@@ -241,7 +249,8 @@ export function cli({
241
249
  forcedAddOns,
242
250
  })
243
251
  }
244
- await createApp(finalOptions, {
252
+
253
+ await createApp(finalOptions!, {
245
254
  environment: createUIEnvironment(),
246
255
  cwd: options.targetDir || undefined,
247
256
  name,
package/src/options.ts CHANGED
@@ -178,7 +178,7 @@ export async function promptForOptions(
178
178
  forcedAddOns?: Array<string>
179
179
  forcedMode?: TemplateOptions
180
180
  },
181
- ): Promise<Required<Options>> {
181
+ ): Promise<Required<Options> | undefined> {
182
182
  const options = {} as Required<Options>
183
183
 
184
184
  const framework = getFrameworkById(cliOptions.framework || 'react-cra')!
@@ -208,6 +208,8 @@ export async function promptForOptions(
208
208
  process.exit(0)
209
209
  }
210
210
  options.projectName = value
211
+ } else {
212
+ options.projectName = cliOptions.projectName
211
213
  }
212
214
 
213
215
  // Router type selection
package/src/types.ts CHANGED
@@ -14,4 +14,5 @@ export interface CliOptions {
14
14
  mcpSse?: boolean
15
15
  starter?: string
16
16
  targetDir?: string
17
+ interactive?: boolean
17
18
  }