@tanstack/cta-engine 0.10.0-alpha.13 → 0.10.0-alpha.14
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 +21 -20
- package/package.json +1 -1
- package/src/cli.ts +21 -21
package/dist/cli.js
CHANGED
|
@@ -7,29 +7,30 @@ import { SUPPORTED_TOOLCHAINS } from './toolchain.js';
|
|
|
7
7
|
import runServer from './mcp.js';
|
|
8
8
|
import { listAddOns } from './add-ons.js';
|
|
9
9
|
import { DEFAULT_FRAMEWORK, SUPPORTED_FRAMEWORKS } from './constants.js';
|
|
10
|
-
|
|
10
|
+
import { initAddOn } from './custom-add-on.js';
|
|
11
11
|
import { createDefaultEnvironment } from './environment.js';
|
|
12
|
+
import { add } from './add.js';
|
|
12
13
|
export function cli({ name, appName, forcedMode, forcedAddOns, }) {
|
|
13
14
|
const program = new Command();
|
|
14
15
|
program.name(name).description(`CLI to create a new ${appName} application`);
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
16
|
+
program
|
|
17
|
+
.command('add')
|
|
18
|
+
.argument('add-on', 'Name of the add-on (or add-ons separated by commas)')
|
|
19
|
+
.action(async (addOn) => {
|
|
20
|
+
await add(addOn.split(',').map((addon) => addon.trim()));
|
|
21
|
+
});
|
|
22
|
+
program
|
|
23
|
+
.command('update-add-on')
|
|
24
|
+
.description('Create or update an add-on from the current project')
|
|
25
|
+
.action(async () => {
|
|
26
|
+
await initAddOn('add-on');
|
|
27
|
+
});
|
|
28
|
+
program
|
|
29
|
+
.command('update-overlay')
|
|
30
|
+
.description('Create or update a project overlay from the current project')
|
|
31
|
+
.action(async () => {
|
|
32
|
+
await initAddOn('overlay');
|
|
33
|
+
});
|
|
33
34
|
program.argument('[project-name]', 'name of the project');
|
|
34
35
|
if (!forcedMode) {
|
|
35
36
|
program.option('--template <type>', 'project template (typescript, javascript, file-router)', (value) => {
|
|
@@ -48,7 +49,7 @@ export function cli({ name, appName, forcedMode, forcedAddOns, }) {
|
|
|
48
49
|
}
|
|
49
50
|
return value;
|
|
50
51
|
}, DEFAULT_FRAMEWORK)
|
|
51
|
-
|
|
52
|
+
.option('--overlay [url]', 'add an overlay from a URL', false)
|
|
52
53
|
.option(`--package-manager <${SUPPORTED_PACKAGE_MANAGERS.join('|')}>`, `Explicitly tell the CLI to use this package manager`, (value) => {
|
|
53
54
|
if (!SUPPORTED_PACKAGE_MANAGERS.includes(value)) {
|
|
54
55
|
throw new InvalidArgumentError(`Invalid package manager: ${value}. The following are allowed: ${SUPPORTED_PACKAGE_MANAGERS.join(', ')}`);
|
package/package.json
CHANGED
package/src/cli.ts
CHANGED
|
@@ -9,10 +9,10 @@ import { SUPPORTED_TOOLCHAINS } from './toolchain.js'
|
|
|
9
9
|
import runServer from './mcp.js'
|
|
10
10
|
import { listAddOns } from './add-ons.js'
|
|
11
11
|
import { DEFAULT_FRAMEWORK, SUPPORTED_FRAMEWORKS } from './constants.js'
|
|
12
|
-
|
|
12
|
+
import { initAddOn } from './custom-add-on.js'
|
|
13
13
|
|
|
14
14
|
import { createDefaultEnvironment } from './environment.js'
|
|
15
|
-
|
|
15
|
+
import { add } from './add.js'
|
|
16
16
|
|
|
17
17
|
import type { PackageManager } from './package-manager.js'
|
|
18
18
|
import type { ToolChain } from './toolchain.js'
|
|
@@ -33,26 +33,26 @@ export function cli({
|
|
|
33
33
|
|
|
34
34
|
program.name(name).description(`CLI to create a new ${appName} application`)
|
|
35
35
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
36
|
+
program
|
|
37
|
+
.command('add')
|
|
38
|
+
.argument('add-on', 'Name of the add-on (or add-ons separated by commas)')
|
|
39
|
+
.action(async (addOn: string) => {
|
|
40
|
+
await add(addOn.split(',').map((addon) => addon.trim()))
|
|
41
|
+
})
|
|
42
42
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
43
|
+
program
|
|
44
|
+
.command('update-add-on')
|
|
45
|
+
.description('Create or update an add-on from the current project')
|
|
46
|
+
.action(async () => {
|
|
47
|
+
await initAddOn('add-on')
|
|
48
|
+
})
|
|
49
49
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
50
|
+
program
|
|
51
|
+
.command('update-overlay')
|
|
52
|
+
.description('Create or update a project overlay from the current project')
|
|
53
|
+
.action(async () => {
|
|
54
|
+
await initAddOn('overlay')
|
|
55
|
+
})
|
|
56
56
|
|
|
57
57
|
program.argument('[project-name]', 'name of the project')
|
|
58
58
|
|
|
@@ -90,7 +90,7 @@ export function cli({
|
|
|
90
90
|
},
|
|
91
91
|
DEFAULT_FRAMEWORK,
|
|
92
92
|
)
|
|
93
|
-
|
|
93
|
+
.option('--overlay [url]', 'add an overlay from a URL', false)
|
|
94
94
|
.option<PackageManager>(
|
|
95
95
|
`--package-manager <${SUPPORTED_PACKAGE_MANAGERS.join('|')}>`,
|
|
96
96
|
`Explicitly tell the CLI to use this package manager`,
|