@commercetools-frontend/application-cli 1.4.0 → 1.6.0
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/README.md +1 -1
- package/bin/cli.js +9 -0
- package/cli/dist/commercetools-frontend-application-cli-cli.cjs.d.ts +2 -0
- package/cli/dist/commercetools-frontend-application-cli-cli.cjs.d.ts.map +1 -0
- package/cli/dist/commercetools-frontend-application-cli-cli.cjs.dev.js +725 -0
- package/cli/dist/commercetools-frontend-application-cli-cli.cjs.js +7 -0
- package/cli/dist/commercetools-frontend-application-cli-cli.cjs.prod.js +725 -0
- package/cli/dist/commercetools-frontend-application-cli-cli.esm.js +699 -0
- package/cli/package.json +4 -0
- package/dist/declarations/src/cli.d.ts +2 -0
- package/dist/declarations/src/commands/compile-deployments.d.ts +3 -0
- package/dist/declarations/src/commands/compile-menu.d.ts +3 -0
- package/dist/declarations/src/commands/create-version.d.ts +3 -0
- package/dist/declarations/src/commands/validate-menu.d.ts +5 -0
- package/dist/declarations/src/schema.d.ts +228 -0
- package/dist/declarations/src/types.d.ts +92 -0
- package/dist/declarations/src/utils/create-application-assets-upload-script.d.ts +3 -0
- package/dist/declarations/src/utils/create-application-index-upload-script.d.ts +3 -0
- package/dist/declarations/src/utils/get-application-directory.d.ts +2 -0
- package/dist/declarations/src/utils/is-ci.d.ts +2 -0
- package/dist/declarations/src/utils/load-dotenv-files.d.ts +5 -0
- package/dist/declarations/src/utils/resolve-in-application.d.ts +2 -0
- package/package.json +31 -13
- package/src/bin/cli.js +0 -100
- package/src/commands/compile-deployments.js +0 -283
- package/src/commands/compile-menu.js +0 -126
- package/src/commands/create-version.js +0 -43
- package/src/commands/validate-menu.js +0 -33
- package/src/commands/validate-menu.spec.js +0 -43
- package/src/schema.js +0 -112
- package/src/utils/create-application-assets-upload-script.js +0 -62
- package/src/utils/create-application-index-upload-script.js +0 -41
- package/src/utils/get-application-directory.js +0 -7
- package/src/utils/is-ci.js +0 -5
- package/src/utils/load-dotenv-files.js +0 -48
- package/src/utils/resolve-in-application.js +0 -8
package/cli/package.json
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { Schema } from 'jsonschema';
|
|
2
|
+
import type { TValidateMenuFlags } from '../types';
|
|
3
|
+
export declare function validateMenu(menuJson: string, schema?: Schema): string;
|
|
4
|
+
declare function command(cliFlags: TValidateMenuFlags): Promise<string>;
|
|
5
|
+
export default command;
|
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
export declare const navbarMenuSchema: {
|
|
2
|
+
$schema: string;
|
|
3
|
+
title: string;
|
|
4
|
+
type: string;
|
|
5
|
+
properties: {
|
|
6
|
+
submenu: {
|
|
7
|
+
type: string;
|
|
8
|
+
items: {
|
|
9
|
+
type: string;
|
|
10
|
+
properties: {
|
|
11
|
+
key: {
|
|
12
|
+
type: string;
|
|
13
|
+
};
|
|
14
|
+
uriPath: {
|
|
15
|
+
type: string;
|
|
16
|
+
};
|
|
17
|
+
icon: {
|
|
18
|
+
type: string;
|
|
19
|
+
};
|
|
20
|
+
featureToggle: {
|
|
21
|
+
type: string[];
|
|
22
|
+
};
|
|
23
|
+
labelAllLocales: {
|
|
24
|
+
type: string;
|
|
25
|
+
items: {
|
|
26
|
+
type: string;
|
|
27
|
+
properties: {
|
|
28
|
+
locale: {
|
|
29
|
+
type: string;
|
|
30
|
+
};
|
|
31
|
+
value: {
|
|
32
|
+
type: string;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
required: string[];
|
|
36
|
+
}[];
|
|
37
|
+
};
|
|
38
|
+
menuVisibility: {
|
|
39
|
+
type: string[];
|
|
40
|
+
};
|
|
41
|
+
permissions: {
|
|
42
|
+
type: string;
|
|
43
|
+
items: {
|
|
44
|
+
type: string;
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
dataFences: {
|
|
48
|
+
type: string[];
|
|
49
|
+
items: {
|
|
50
|
+
type: string[];
|
|
51
|
+
properties: {
|
|
52
|
+
group: {
|
|
53
|
+
type: string;
|
|
54
|
+
};
|
|
55
|
+
name: {
|
|
56
|
+
type: string;
|
|
57
|
+
};
|
|
58
|
+
type: {
|
|
59
|
+
type: string;
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
}[];
|
|
63
|
+
};
|
|
64
|
+
actionRights: {
|
|
65
|
+
type: string[];
|
|
66
|
+
items: {
|
|
67
|
+
type: string[];
|
|
68
|
+
properties: {
|
|
69
|
+
group: {
|
|
70
|
+
type: string;
|
|
71
|
+
};
|
|
72
|
+
name: {
|
|
73
|
+
type: string;
|
|
74
|
+
};
|
|
75
|
+
};
|
|
76
|
+
}[];
|
|
77
|
+
};
|
|
78
|
+
};
|
|
79
|
+
}[];
|
|
80
|
+
};
|
|
81
|
+
key: {
|
|
82
|
+
type: string;
|
|
83
|
+
};
|
|
84
|
+
uriPath: {
|
|
85
|
+
type: string;
|
|
86
|
+
};
|
|
87
|
+
icon: {
|
|
88
|
+
type: string;
|
|
89
|
+
};
|
|
90
|
+
featureToggle: {
|
|
91
|
+
type: string[];
|
|
92
|
+
};
|
|
93
|
+
labelAllLocales: {
|
|
94
|
+
type: string;
|
|
95
|
+
items: {
|
|
96
|
+
type: string;
|
|
97
|
+
properties: {
|
|
98
|
+
locale: {
|
|
99
|
+
type: string;
|
|
100
|
+
};
|
|
101
|
+
value: {
|
|
102
|
+
type: string;
|
|
103
|
+
};
|
|
104
|
+
};
|
|
105
|
+
required: string[];
|
|
106
|
+
}[];
|
|
107
|
+
};
|
|
108
|
+
menuVisibility: {
|
|
109
|
+
type: string[];
|
|
110
|
+
};
|
|
111
|
+
permissions: {
|
|
112
|
+
type: string;
|
|
113
|
+
items: {
|
|
114
|
+
type: string;
|
|
115
|
+
};
|
|
116
|
+
};
|
|
117
|
+
dataFences: {
|
|
118
|
+
type: string[];
|
|
119
|
+
items: {
|
|
120
|
+
type: string[];
|
|
121
|
+
properties: {
|
|
122
|
+
group: {
|
|
123
|
+
type: string;
|
|
124
|
+
};
|
|
125
|
+
name: {
|
|
126
|
+
type: string;
|
|
127
|
+
};
|
|
128
|
+
type: {
|
|
129
|
+
type: string;
|
|
130
|
+
};
|
|
131
|
+
};
|
|
132
|
+
}[];
|
|
133
|
+
};
|
|
134
|
+
actionRights: {
|
|
135
|
+
type: string[];
|
|
136
|
+
items: {
|
|
137
|
+
type: string[];
|
|
138
|
+
properties: {
|
|
139
|
+
group: {
|
|
140
|
+
type: string;
|
|
141
|
+
};
|
|
142
|
+
name: {
|
|
143
|
+
type: string;
|
|
144
|
+
};
|
|
145
|
+
};
|
|
146
|
+
}[];
|
|
147
|
+
};
|
|
148
|
+
};
|
|
149
|
+
required: string[];
|
|
150
|
+
};
|
|
151
|
+
export declare const appbarMenuSchema: {
|
|
152
|
+
$schema: string;
|
|
153
|
+
title: string;
|
|
154
|
+
type: string;
|
|
155
|
+
items: {
|
|
156
|
+
type: string;
|
|
157
|
+
properties: {
|
|
158
|
+
key: {
|
|
159
|
+
type: string;
|
|
160
|
+
};
|
|
161
|
+
uriPath: {
|
|
162
|
+
type: string;
|
|
163
|
+
};
|
|
164
|
+
icon: {
|
|
165
|
+
type: string;
|
|
166
|
+
};
|
|
167
|
+
featureToggle: {
|
|
168
|
+
type: string[];
|
|
169
|
+
};
|
|
170
|
+
labelAllLocales: {
|
|
171
|
+
type: string;
|
|
172
|
+
items: {
|
|
173
|
+
type: string;
|
|
174
|
+
properties: {
|
|
175
|
+
locale: {
|
|
176
|
+
type: string;
|
|
177
|
+
};
|
|
178
|
+
value: {
|
|
179
|
+
type: string;
|
|
180
|
+
};
|
|
181
|
+
};
|
|
182
|
+
required: string[];
|
|
183
|
+
}[];
|
|
184
|
+
};
|
|
185
|
+
menuVisibility: {
|
|
186
|
+
type: string[];
|
|
187
|
+
};
|
|
188
|
+
permissions: {
|
|
189
|
+
type: string;
|
|
190
|
+
items: {
|
|
191
|
+
type: string;
|
|
192
|
+
};
|
|
193
|
+
};
|
|
194
|
+
dataFences: {
|
|
195
|
+
type: string[];
|
|
196
|
+
items: {
|
|
197
|
+
type: string[];
|
|
198
|
+
properties: {
|
|
199
|
+
group: {
|
|
200
|
+
type: string;
|
|
201
|
+
};
|
|
202
|
+
name: {
|
|
203
|
+
type: string;
|
|
204
|
+
};
|
|
205
|
+
type: {
|
|
206
|
+
type: string;
|
|
207
|
+
};
|
|
208
|
+
};
|
|
209
|
+
}[];
|
|
210
|
+
};
|
|
211
|
+
actionRights: {
|
|
212
|
+
type: string[];
|
|
213
|
+
items: {
|
|
214
|
+
type: string[];
|
|
215
|
+
properties: {
|
|
216
|
+
group: {
|
|
217
|
+
type: string;
|
|
218
|
+
};
|
|
219
|
+
name: {
|
|
220
|
+
type: string;
|
|
221
|
+
};
|
|
222
|
+
};
|
|
223
|
+
}[];
|
|
224
|
+
};
|
|
225
|
+
};
|
|
226
|
+
required: string[];
|
|
227
|
+
}[];
|
|
228
|
+
};
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
export type TApplicationAssetsBucketConfig = {
|
|
2
|
+
bucketRegion: string;
|
|
3
|
+
prNumber?: string;
|
|
4
|
+
applicationName: string;
|
|
5
|
+
};
|
|
6
|
+
export type TApplicationIndexBucketConfig = {
|
|
7
|
+
bucketRegion: string;
|
|
8
|
+
prNumber?: string;
|
|
9
|
+
applicationName: string;
|
|
10
|
+
cloudEnvironment: string;
|
|
11
|
+
};
|
|
12
|
+
export type TUploadScriptFile = {
|
|
13
|
+
fileName: string;
|
|
14
|
+
fileContent: string;
|
|
15
|
+
filePath: string;
|
|
16
|
+
};
|
|
17
|
+
type TPaths = {
|
|
18
|
+
publicAssetsPath: string;
|
|
19
|
+
deploymentsPath: string;
|
|
20
|
+
dotenvPath?: string;
|
|
21
|
+
assetsPath: string;
|
|
22
|
+
};
|
|
23
|
+
export type TCompileEnvApplicationIndexes = {
|
|
24
|
+
cliFlags: TCompileDeploymentsFlags;
|
|
25
|
+
paths: TPaths;
|
|
26
|
+
bucketRegion: string;
|
|
27
|
+
cloudEnvironment: string;
|
|
28
|
+
};
|
|
29
|
+
export type TCompileApplicationAssets = {
|
|
30
|
+
cliFlags: TCompileDeploymentsFlags;
|
|
31
|
+
paths: TPaths;
|
|
32
|
+
bucketRegion: string;
|
|
33
|
+
};
|
|
34
|
+
export type TCosmiconfigResult = {
|
|
35
|
+
config: {
|
|
36
|
+
[key: string]: string[];
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
export type TCreateApplicationIndexUploadScript = {
|
|
40
|
+
packageManagerName: string;
|
|
41
|
+
bucketUrl: string;
|
|
42
|
+
cdnUrl: string;
|
|
43
|
+
cloudEnvironment: string;
|
|
44
|
+
buildRevision: string;
|
|
45
|
+
buildNumber: number;
|
|
46
|
+
applicationIndexOutFile: string;
|
|
47
|
+
};
|
|
48
|
+
export type TCreateApplicationAssetsUploadScript = {
|
|
49
|
+
bucketUrl: string;
|
|
50
|
+
assetsPath: string;
|
|
51
|
+
skipMenu: boolean;
|
|
52
|
+
};
|
|
53
|
+
export type TLoadDotDev = {
|
|
54
|
+
dotenvPath?: string;
|
|
55
|
+
cloudEnvironment: string;
|
|
56
|
+
};
|
|
57
|
+
export type TLocalizedField = {
|
|
58
|
+
locale: string;
|
|
59
|
+
value: string;
|
|
60
|
+
};
|
|
61
|
+
export type TCompileDeploymentsFlags = {
|
|
62
|
+
applicationName: string;
|
|
63
|
+
buildRevision: string;
|
|
64
|
+
buildNumber: number;
|
|
65
|
+
dotenvFolder?: string;
|
|
66
|
+
prNumber?: string;
|
|
67
|
+
mcUrl?: string;
|
|
68
|
+
mcApiUrl?: string;
|
|
69
|
+
applicationIndexOutFile: string;
|
|
70
|
+
applicationIndexUploadScriptOutFile: string;
|
|
71
|
+
applicationAssetsUploadScriptOutFile: string;
|
|
72
|
+
ciAssetsRootPath?: string;
|
|
73
|
+
packageManagerName: string;
|
|
74
|
+
skipMenu: boolean;
|
|
75
|
+
};
|
|
76
|
+
export type TCompileMenuFlags = {
|
|
77
|
+
dotenvFolder?: string;
|
|
78
|
+
};
|
|
79
|
+
export type TCreateVersionFlags = {
|
|
80
|
+
versionUrl: string;
|
|
81
|
+
buildRevision: string;
|
|
82
|
+
buildNumber: number;
|
|
83
|
+
rollbacks: number;
|
|
84
|
+
outFile?: string;
|
|
85
|
+
packageManagerName: string;
|
|
86
|
+
};
|
|
87
|
+
export type TValidateMenuFlags = {
|
|
88
|
+
inputFile: string;
|
|
89
|
+
navigation?: string;
|
|
90
|
+
};
|
|
91
|
+
export type TAllCliFlags = TCompileDeploymentsFlags & TCompileMenuFlags & TCreateVersionFlags & TValidateMenuFlags;
|
|
92
|
+
export {};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { TCreateApplicationIndexUploadScript } from '../types';
|
|
2
|
+
declare function createApplicationIndexUploadScript({ packageManagerName, bucketUrl, cdnUrl, cloudEnvironment, buildRevision, buildNumber, applicationIndexOutFile, }: TCreateApplicationIndexUploadScript): string;
|
|
3
|
+
export default createApplicationIndexUploadScript;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@commercetools-frontend/application-cli",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.6.0",
|
|
4
4
|
"description": "Internal CLI to manage Merchant Center application deployments across various environments.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"commercetools",
|
|
@@ -8,26 +8,36 @@
|
|
|
8
8
|
"custom-application"
|
|
9
9
|
],
|
|
10
10
|
"license": "MIT",
|
|
11
|
-
"
|
|
12
|
-
"
|
|
11
|
+
"main": "dist/commercetools-frontend-application-cli.cjs.js",
|
|
12
|
+
"module": "dist/commercetools-frontend-application-cli.esm.js",
|
|
13
|
+
"bin": "bin/cli.js",
|
|
13
14
|
"files": [
|
|
14
|
-
"
|
|
15
|
+
"cli",
|
|
16
|
+
"dist",
|
|
15
17
|
"package.json",
|
|
16
18
|
"LICENSE",
|
|
17
19
|
"README.md"
|
|
18
20
|
],
|
|
19
21
|
"dependencies": {
|
|
20
22
|
"@babel/core": "^7.21.0",
|
|
21
|
-
"@
|
|
22
|
-
"@
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
"
|
|
23
|
+
"@babel/runtime": "^7.21.0",
|
|
24
|
+
"@babel/runtime-corejs3": "^7.21.0",
|
|
25
|
+
"@commercetools-frontend/application-config": "22.3.0",
|
|
26
|
+
"@commercetools-frontend/constants": "22.3.0",
|
|
27
|
+
"@manypkg/find-root": "2.2.0",
|
|
28
|
+
"cac": "^6.7.14",
|
|
29
|
+
"cosmiconfig": "8.2.0",
|
|
30
|
+
"dotenv": "16.3.1",
|
|
31
|
+
"execa": "5.1.1",
|
|
26
32
|
"jsonschema": "^1.4.1",
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
|
|
30
|
-
|
|
33
|
+
"listr2": "^6.4.2",
|
|
34
|
+
"node-fetch": "2.6.11"
|
|
35
|
+
},
|
|
36
|
+
"devDependencies": {
|
|
37
|
+
"@tsconfig/node18": "1.0.3",
|
|
38
|
+
"@types/node": "18.16.18",
|
|
39
|
+
"@types/node-fetch": "2.6.2",
|
|
40
|
+
"typescript": "^5.1.3"
|
|
31
41
|
},
|
|
32
42
|
"engines": {
|
|
33
43
|
"node": ">=14",
|
|
@@ -35,5 +45,13 @@
|
|
|
35
45
|
},
|
|
36
46
|
"publishConfig": {
|
|
37
47
|
"access": "public"
|
|
48
|
+
},
|
|
49
|
+
"preconstruct": {
|
|
50
|
+
"entrypoints": [
|
|
51
|
+
"./cli.ts"
|
|
52
|
+
]
|
|
53
|
+
},
|
|
54
|
+
"scripts": {
|
|
55
|
+
"typecheck": "tsc --noEmit"
|
|
38
56
|
}
|
|
39
57
|
}
|
package/src/bin/cli.js
DELETED
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
import mri from 'mri';
|
|
4
|
-
import compileDeployments from '../commands/compile-deployments.js';
|
|
5
|
-
import compileMenu from '../commands/compile-menu.js';
|
|
6
|
-
import createVersion from '../commands/create-version.js';
|
|
7
|
-
import validateMenu from '../commands/validate-menu.js';
|
|
8
|
-
const cwd = process.cwd();
|
|
9
|
-
|
|
10
|
-
(async () => {
|
|
11
|
-
try {
|
|
12
|
-
const cliFlags = mri(process.argv.slice(2), {
|
|
13
|
-
alias: { help: ['h'] },
|
|
14
|
-
default: {
|
|
15
|
-
rollbacks: 15,
|
|
16
|
-
'build-revision': process.env.CIRCLE_SHA1,
|
|
17
|
-
'build-number': process.env.CIRCLE_BUILD_NUM,
|
|
18
|
-
'application-index-upload-script-out-file': 'upload-index.sh',
|
|
19
|
-
'application-assets-upload-script-out-file': 'upload-assets.sh',
|
|
20
|
-
'application-index-out-file': 'application.html',
|
|
21
|
-
'skip-menu': false,
|
|
22
|
-
'package-manager-name': 'yarn',
|
|
23
|
-
},
|
|
24
|
-
boolean: ['skip-menu'],
|
|
25
|
-
});
|
|
26
|
-
const cliCommands = cliFlags._;
|
|
27
|
-
|
|
28
|
-
if (
|
|
29
|
-
cliCommands.length === 0 ||
|
|
30
|
-
(cliCommands.help && cliCommands.length === 0)
|
|
31
|
-
) {
|
|
32
|
-
console.log(`
|
|
33
|
-
Usage: application-cli [command] [flags]
|
|
34
|
-
|
|
35
|
-
Displays help information.
|
|
36
|
-
|
|
37
|
-
Command:
|
|
38
|
-
compile-deployments Compile the deployments for an application for all environments.
|
|
39
|
-
|
|
40
|
-
Options:
|
|
41
|
-
--application-name <string> (required) The name of the application being compiled for example application-products.
|
|
42
|
-
--build-revision <git-sha> (optional) The git commit SHA which is being built. Defaults to the 'CIRCLE_SHA1' environment variable.
|
|
43
|
-
--build-number <string> (optional) A number of the build on the Continuous Integration system. Defaults to the 'CIRCLE_BUILD_NUM' environment variable.
|
|
44
|
-
--dotenv-folder <string> (optional) The path to a folder containing a dotenv file '.env.production' and a cloud-environment specific dotenv file (for example '.env.gcp-production-eu'). Those values are parsed and merged together to be used by the \`mc-scripts compile-html\` command.
|
|
45
|
-
--pr-number <string> (optional) A pull request number determining a scoped storage bucket for the deployment. Please use it carefully.
|
|
46
|
-
--mc-url <string> (optional) The MC URL of the deployment. This is usually inferred from the env file and overwrites the value. Please use it carefully.
|
|
47
|
-
--mc-api-url <string> (optional) The MC API URL of the deployment. This is usually inferred from the env file and overwrites the value. Please use it carefully.
|
|
48
|
-
--application-index-out-file <path> (optional) The name of the application index file. Defaults to application.html.
|
|
49
|
-
--application-index-upload-script-out-file <path> (optional) The name of the the application index upload script file. Defaults to upload-index.sh.
|
|
50
|
-
--application-assets-upload-script-out-file <path> (optional) The name of the the assets upload script file. Defaults to upload-assets.sh.
|
|
51
|
-
--ci-assets-root-path <path> (optional) A replacement value for the scripts root path only used on CI (e.g. '--ci-assets-root-path=/root/') used in generated scripts.
|
|
52
|
-
--skip-menu (optional) If provided, it will skip uploading the 'menu.json'.
|
|
53
|
-
|
|
54
|
-
Command:
|
|
55
|
-
compile-menu Compile the menu links of an application into a 'menu.json'. This is only required for internal applications
|
|
56
|
-
|
|
57
|
-
Options:
|
|
58
|
-
--dotenv-folder <string> (optional) The path to a folder containing a dotenv file '.env.production' and a cloud-environment specific dotenv file (for example '.env.gcp-production-eu'). Those values are parsed and merged together to be used by the application config.
|
|
59
|
-
|
|
60
|
-
Command:
|
|
61
|
-
create-version Output a JSON string about the information in the 'version.json' for a deployment, including the updated list of rollbacks.
|
|
62
|
-
|
|
63
|
-
Options:
|
|
64
|
-
--version-url <url> (required) The path of an application's current 'version.json' within the storage bucket.
|
|
65
|
-
--build-revision <git-sha> (optional) The git commit SHA that needs to be deployed. Defaults to the 'CIRCLE_SHA1' environment variable.
|
|
66
|
-
--build-number <url> (optional) The number of a Continuous Integration build. Defaults to the 'CIRCLE_BUILD_NUM' environment variable.
|
|
67
|
-
--rollbacks <int> (optional) The number of max rollbacks to keep. Defaults to 5.
|
|
68
|
-
--out-file <path> (optional) The path to the file where to write the JSON. If not specified, the JSON is printed to stdout.
|
|
69
|
-
--package-manager-name <sring> (optional) Name of the binary of the used package manager (e.g. pnpm). Defaults to yarn.
|
|
70
|
-
`);
|
|
71
|
-
process.exit(0);
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
const cliCommand = cliCommands[0];
|
|
75
|
-
|
|
76
|
-
switch (cliCommand) {
|
|
77
|
-
case 'compile-deployments':
|
|
78
|
-
await compileDeployments(cliFlags, cwd);
|
|
79
|
-
process.exit(0);
|
|
80
|
-
break;
|
|
81
|
-
case 'compile-menu':
|
|
82
|
-
await compileMenu(cliFlags, cwd);
|
|
83
|
-
process.exit(0);
|
|
84
|
-
break;
|
|
85
|
-
case 'validate-menu':
|
|
86
|
-
await validateMenu(cliFlags, cwd);
|
|
87
|
-
process.exit(0);
|
|
88
|
-
break;
|
|
89
|
-
case 'create-version':
|
|
90
|
-
await createVersion(cliFlags, cwd);
|
|
91
|
-
process.exit(0);
|
|
92
|
-
break;
|
|
93
|
-
default:
|
|
94
|
-
throw new Error(`💀 Unknown command "${cliCommand}".`);
|
|
95
|
-
}
|
|
96
|
-
} catch (error) {
|
|
97
|
-
console.error(error);
|
|
98
|
-
process.exit(1);
|
|
99
|
-
}
|
|
100
|
-
})();
|