@tanstack/cta-cli 0.33.1 → 0.33.3
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 +4 -1
- package/dist/options.js +4 -2
- package/dist/types/cli.d.ts +2 -1
- package/dist/types/options.d.ts +2 -1
- package/package.json +3 -3
- package/src/cli.ts +5 -0
- package/src/options.ts +5 -1
package/dist/cli.js
CHANGED
|
@@ -12,7 +12,7 @@ import { normalizeOptions } from './command-line.js';
|
|
|
12
12
|
import { createUIEnvironment } from './ui-environment.js';
|
|
13
13
|
import { convertTemplateToMode } from './utils.js';
|
|
14
14
|
// This CLI assumes that all of the registered frameworks have the same set of toolchains, hosts, modes, etc.
|
|
15
|
-
export function cli({ name, appName, forcedMode, forcedAddOns = [], defaultTemplate = 'javascript', forcedHost, defaultFramework, craCompatible = false, webBase, }) {
|
|
15
|
+
export function cli({ name, appName, forcedMode, forcedAddOns = [], defaultTemplate = 'javascript', forcedHost, defaultFramework, craCompatible = false, webBase, showHostingOptions = false, }) {
|
|
16
16
|
const environment = createUIEnvironment(appName, false);
|
|
17
17
|
const program = new Command();
|
|
18
18
|
const availableFrameworks = getFrameworks().map((f) => f.name);
|
|
@@ -130,6 +130,7 @@ Remove your node_modules directory and package lock file and re-install.`);
|
|
|
130
130
|
forcedAddOns,
|
|
131
131
|
environmentFactory: () => createUIEnvironment(appName, false),
|
|
132
132
|
webBase,
|
|
133
|
+
showHostingOptions,
|
|
133
134
|
});
|
|
134
135
|
}
|
|
135
136
|
else if (parsedAddOns.length < 1) {
|
|
@@ -339,6 +340,7 @@ Remove your node_modules directory and package lock file and re-install.`);
|
|
|
339
340
|
forcedAddOns,
|
|
340
341
|
environmentFactory: () => createUIEnvironment(appName, false),
|
|
341
342
|
webBase,
|
|
343
|
+
showHostingOptions,
|
|
342
344
|
});
|
|
343
345
|
return;
|
|
344
346
|
}
|
|
@@ -350,6 +352,7 @@ Remove your node_modules directory and package lock file and re-install.`);
|
|
|
350
352
|
finalOptions = await promptForCreateOptions(cliOptions, {
|
|
351
353
|
forcedMode: defaultMode,
|
|
352
354
|
forcedAddOns,
|
|
355
|
+
showHostingOptions,
|
|
353
356
|
});
|
|
354
357
|
}
|
|
355
358
|
if (!finalOptions) {
|
package/dist/options.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { intro } from '@clack/prompts';
|
|
2
2
|
import { finalizeAddOns, getFrameworkById, getPackageManager, populateAddOnOptionsDefaults, readConfigFile, } from '@tanstack/cta-engine';
|
|
3
3
|
import { getProjectName, promptForAddOnOptions, selectAddOns, selectGit, selectHost, selectPackageManager, selectRouterType, selectTailwind, selectToolchain, selectTypescript, } from './ui-prompts.js';
|
|
4
|
-
export async function promptForCreateOptions(cliOptions, { forcedAddOns = [], forcedMode, }) {
|
|
4
|
+
export async function promptForCreateOptions(cliOptions, { forcedAddOns = [], forcedMode, showHostingOptions = false, }) {
|
|
5
5
|
const options = {};
|
|
6
6
|
options.framework = getFrameworkById(cliOptions.framework || 'react-cra');
|
|
7
7
|
options.projectName = cliOptions.projectName || (await getProjectName());
|
|
@@ -46,7 +46,9 @@ export async function promptForCreateOptions(cliOptions, { forcedAddOns = [], fo
|
|
|
46
46
|
// Toolchain selection
|
|
47
47
|
const toolchain = await selectToolchain(options.framework, cliOptions.toolchain);
|
|
48
48
|
// Host selection
|
|
49
|
-
const host =
|
|
49
|
+
const host = showHostingOptions
|
|
50
|
+
? await selectHost(options.framework, cliOptions.host)
|
|
51
|
+
: undefined;
|
|
50
52
|
// Add-ons selection
|
|
51
53
|
const addOns = new Set();
|
|
52
54
|
if (toolchain) {
|
package/dist/types/cli.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { TemplateOptions } from './types.js';
|
|
2
|
-
export declare function cli({ name, appName, forcedMode, forcedAddOns, defaultTemplate, forcedHost, defaultFramework, craCompatible, webBase, }: {
|
|
2
|
+
export declare function cli({ name, appName, forcedMode, forcedAddOns, defaultTemplate, forcedHost, defaultFramework, craCompatible, webBase, showHostingOptions, }: {
|
|
3
3
|
name: string;
|
|
4
4
|
appName: string;
|
|
5
5
|
forcedMode?: string;
|
|
@@ -9,4 +9,5 @@ export declare function cli({ name, appName, forcedMode, forcedAddOns, defaultTe
|
|
|
9
9
|
defaultFramework?: string;
|
|
10
10
|
craCompatible?: boolean;
|
|
11
11
|
webBase?: string;
|
|
12
|
+
showHostingOptions?: boolean;
|
|
12
13
|
}): void;
|
package/dist/types/options.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { Options } from '@tanstack/cta-engine';
|
|
2
2
|
import type { CliOptions } from './types.js';
|
|
3
|
-
export declare function promptForCreateOptions(cliOptions: CliOptions, { forcedAddOns, forcedMode, }: {
|
|
3
|
+
export declare function promptForCreateOptions(cliOptions: CliOptions, { forcedAddOns, forcedMode, showHostingOptions, }: {
|
|
4
4
|
forcedAddOns?: Array<string>;
|
|
5
5
|
forcedMode?: string;
|
|
6
|
+
showHostingOptions?: boolean;
|
|
6
7
|
}): Promise<Required<Options> | undefined>;
|
|
7
8
|
export declare function promptForAddOns(): Promise<Array<string>>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tanstack/cta-cli",
|
|
3
|
-
"version": "0.33.
|
|
3
|
+
"version": "0.33.3",
|
|
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.33.
|
|
34
|
-
"@tanstack/cta-ui": "0.33.
|
|
33
|
+
"@tanstack/cta-engine": "0.33.3",
|
|
34
|
+
"@tanstack/cta-ui": "0.33.3"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"@tanstack/config": "^0.16.2",
|
package/src/cli.ts
CHANGED
|
@@ -44,6 +44,7 @@ export function cli({
|
|
|
44
44
|
defaultFramework,
|
|
45
45
|
craCompatible = false,
|
|
46
46
|
webBase,
|
|
47
|
+
showHostingOptions = false,
|
|
47
48
|
}: {
|
|
48
49
|
name: string
|
|
49
50
|
appName: string
|
|
@@ -54,6 +55,7 @@ export function cli({
|
|
|
54
55
|
defaultFramework?: string
|
|
55
56
|
craCompatible?: boolean
|
|
56
57
|
webBase?: string
|
|
58
|
+
showHostingOptions?: boolean
|
|
57
59
|
}) {
|
|
58
60
|
const environment = createUIEnvironment(appName, false)
|
|
59
61
|
|
|
@@ -200,6 +202,7 @@ Remove your node_modules directory and package lock file and re-install.`,
|
|
|
200
202
|
forcedAddOns,
|
|
201
203
|
environmentFactory: () => createUIEnvironment(appName, false),
|
|
202
204
|
webBase,
|
|
205
|
+
showHostingOptions,
|
|
203
206
|
})
|
|
204
207
|
} else if (parsedAddOns.length < 1) {
|
|
205
208
|
const addOns = await promptForAddOns()
|
|
@@ -505,6 +508,7 @@ Remove your node_modules directory and package lock file and re-install.`,
|
|
|
505
508
|
forcedAddOns,
|
|
506
509
|
environmentFactory: () => createUIEnvironment(appName, false),
|
|
507
510
|
webBase,
|
|
511
|
+
showHostingOptions,
|
|
508
512
|
})
|
|
509
513
|
return
|
|
510
514
|
}
|
|
@@ -516,6 +520,7 @@ Remove your node_modules directory and package lock file and re-install.`,
|
|
|
516
520
|
finalOptions = await promptForCreateOptions(cliOptions, {
|
|
517
521
|
forcedMode: defaultMode,
|
|
518
522
|
forcedAddOns,
|
|
523
|
+
showHostingOptions,
|
|
519
524
|
})
|
|
520
525
|
}
|
|
521
526
|
|
package/src/options.ts
CHANGED
|
@@ -30,9 +30,11 @@ export async function promptForCreateOptions(
|
|
|
30
30
|
{
|
|
31
31
|
forcedAddOns = [],
|
|
32
32
|
forcedMode,
|
|
33
|
+
showHostingOptions = false,
|
|
33
34
|
}: {
|
|
34
35
|
forcedAddOns?: Array<string>
|
|
35
36
|
forcedMode?: string
|
|
37
|
+
showHostingOptions?: boolean
|
|
36
38
|
},
|
|
37
39
|
): Promise<Required<Options> | undefined> {
|
|
38
40
|
const options = {} as Required<Options>
|
|
@@ -88,7 +90,9 @@ export async function promptForCreateOptions(
|
|
|
88
90
|
)
|
|
89
91
|
|
|
90
92
|
// Host selection
|
|
91
|
-
const host =
|
|
93
|
+
const host = showHostingOptions
|
|
94
|
+
? await selectHost(options.framework, cliOptions.host)
|
|
95
|
+
: undefined
|
|
92
96
|
|
|
93
97
|
// Add-ons selection
|
|
94
98
|
const addOns: Set<string> = new Set()
|