@tanstack/cta-engine 0.14.0 → 0.14.1

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
@@ -61,6 +61,7 @@ export function cli({ name, appName, forcedMode, forcedAddOns, }) {
61
61
  }
62
62
  return value;
63
63
  })
64
+ .option('--interactive', 'interactive mode', false)
64
65
  .option('--tailwind', 'add Tailwind CSS', false)
65
66
  .option('--add-ons [...add-ons]', 'pick from a list of available add-ons (comma separated list)', (value) => {
66
67
  let addOns = !!value;
@@ -97,7 +98,13 @@ export function cli({ name, appName, forcedMode, forcedAddOns, }) {
97
98
  if (forcedMode) {
98
99
  cliOptions.template = forcedMode;
99
100
  }
100
- let finalOptions = await normalizeOptions(cliOptions, forcedMode, forcedAddOns);
101
+ let finalOptions;
102
+ if (cliOptions.interactive) {
103
+ cliOptions.addOns = true;
104
+ }
105
+ else {
106
+ finalOptions = await normalizeOptions(cliOptions, forcedMode, forcedAddOns);
107
+ }
101
108
  if (finalOptions) {
102
109
  intro(`Creating a new ${appName} app in ${projectName}...`);
103
110
  }
package/dist/options.js CHANGED
@@ -135,6 +135,9 @@ export async function promptForOptions(cliOptions, { forcedAddOns = [], forcedMo
135
135
  }
136
136
  options.projectName = value;
137
137
  }
138
+ else {
139
+ options.projectName = cliOptions.projectName;
140
+ }
138
141
  // Router type selection
139
142
  if (!cliOptions.template && !forcedMode) {
140
143
  const routerType = await select({
@@ -3,4 +3,4 @@ export declare function normalizeOptions(cliOptions: CliOptions, forcedMode?: Mo
3
3
  export declare function promptForOptions(cliOptions: CliOptions, { forcedAddOns, forcedMode, }: {
4
4
  forcedAddOns?: Array<string>;
5
5
  forcedMode?: TemplateOptions;
6
- }): Promise<Required<Options>>;
6
+ }): Promise<Required<Options> | undefined>;
@@ -32,6 +32,7 @@ export interface CliOptions {
32
32
  mcpSse?: boolean;
33
33
  overlay?: string;
34
34
  targetDir?: string;
35
+ interactive?: boolean;
35
36
  }
36
37
  export type Environment = {
37
38
  startRun: () => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tanstack/cta-engine",
3
- "version": "0.14.0",
3
+ "version": "0.14.1",
4
4
  "description": "Tanstack Application Builder Engine",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
package/src/cli.ts CHANGED
@@ -16,7 +16,13 @@ import { createDefaultEnvironment } from './environment.js'
16
16
 
17
17
  import type { PackageManager } from './package-manager.js'
18
18
  import type { ToolChain } from './toolchain.js'
19
- import type { CliOptions, Framework, Mode, TemplateOptions } from './types.js'
19
+ import type {
20
+ CliOptions,
21
+ Framework,
22
+ Mode,
23
+ Options,
24
+ TemplateOptions,
25
+ } from './types.js'
20
26
 
21
27
  export function cli({
22
28
  name,
@@ -119,6 +125,7 @@ export function cli({
119
125
  return value as ToolChain
120
126
  },
121
127
  )
128
+ .option('--interactive', 'interactive mode', false)
122
129
  .option('--tailwind', 'add Tailwind CSS', false)
123
130
  .option<Array<string> | boolean>(
124
131
  '--add-ons [...add-ons]',
@@ -163,11 +170,17 @@ export function cli({
163
170
  cliOptions.template = forcedMode as TemplateOptions
164
171
  }
165
172
 
166
- let finalOptions = await normalizeOptions(
167
- cliOptions,
168
- forcedMode,
169
- forcedAddOns,
170
- )
173
+ let finalOptions: Options | undefined
174
+ if (cliOptions.interactive) {
175
+ cliOptions.addOns = true
176
+ } else {
177
+ finalOptions = await normalizeOptions(
178
+ cliOptions,
179
+ forcedMode,
180
+ forcedAddOns,
181
+ )
182
+ }
183
+
171
184
  if (finalOptions) {
172
185
  intro(`Creating a new ${appName} app in ${projectName}...`)
173
186
  } else {
@@ -177,7 +190,8 @@ export function cli({
177
190
  forcedAddOns,
178
191
  })
179
192
  }
180
- await createApp(finalOptions, {
193
+
194
+ await createApp(finalOptions!, {
181
195
  environment: createDefaultEnvironment(),
182
196
  cwd: options.targetDir || undefined,
183
197
  name,
package/src/options.ts CHANGED
@@ -167,7 +167,7 @@ export async function promptForOptions(
167
167
  forcedAddOns?: Array<string>
168
168
  forcedMode?: TemplateOptions
169
169
  },
170
- ): Promise<Required<Options>> {
170
+ ): Promise<Required<Options> | undefined> {
171
171
  const options = {} as Required<Options>
172
172
 
173
173
  options.framework = cliOptions.framework || DEFAULT_FRAMEWORK
@@ -195,6 +195,8 @@ export async function promptForOptions(
195
195
  process.exit(0)
196
196
  }
197
197
  options.projectName = value
198
+ } else {
199
+ options.projectName = cliOptions.projectName
198
200
  }
199
201
 
200
202
  // Router type selection
package/src/types.ts CHANGED
@@ -37,6 +37,7 @@ export interface CliOptions {
37
37
  mcpSse?: boolean
38
38
  overlay?: string
39
39
  targetDir?: string
40
+ interactive?: boolean
40
41
  }
41
42
 
42
43
  export type Environment = {