@commercetools-frontend/application-cli 1.1.0 → 1.2.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/package.json
CHANGED
|
@@ -1,15 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@commercetools-frontend/application-cli",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "Internal CLI to manage Merchant Center application deployments across various environments.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"commercetools",
|
|
7
7
|
"cli",
|
|
8
8
|
"custom-application"
|
|
9
9
|
],
|
|
10
|
-
"publishConfig": {
|
|
11
|
-
"access": "public"
|
|
12
|
-
},
|
|
13
10
|
"license": "MIT",
|
|
14
11
|
"type": "module",
|
|
15
12
|
"bin": "./src/bin/cli.js",
|
|
@@ -20,23 +17,21 @@
|
|
|
20
17
|
"README.md"
|
|
21
18
|
],
|
|
22
19
|
"dependencies": {
|
|
23
|
-
"@commercetools-frontend/application-config": "21.
|
|
24
|
-
"@manypkg/find-root": "
|
|
25
|
-
"
|
|
26
|
-
"cosmiconfig": "8.0.0",
|
|
20
|
+
"@commercetools-frontend/application-config": "21.23.8",
|
|
21
|
+
"@manypkg/find-root": "2.1.0",
|
|
22
|
+
"cosmiconfig": "8.1.0",
|
|
27
23
|
"dotenv": "16.0.3",
|
|
28
24
|
"execa": "6.1.0",
|
|
29
25
|
"listr": "0.14.3",
|
|
30
26
|
"listr-verbose-renderer": "0.6.0",
|
|
31
|
-
"lodash.lowerfirst": "4.3.1",
|
|
32
27
|
"mri": "1.2.0",
|
|
33
|
-
"node-fetch": "2.6.
|
|
34
|
-
"prettier": "2.8.1",
|
|
35
|
-
"prompts": "2.4.2",
|
|
36
|
-
"rcfile": "1.0.3"
|
|
28
|
+
"node-fetch": "2.6.9"
|
|
37
29
|
},
|
|
38
30
|
"engines": {
|
|
39
31
|
"node": ">=14",
|
|
40
32
|
"npm": ">=6"
|
|
33
|
+
},
|
|
34
|
+
"publishConfig": {
|
|
35
|
+
"access": "public"
|
|
41
36
|
}
|
|
42
37
|
}
|
package/src/bin/cli.js
CHANGED
|
@@ -19,6 +19,7 @@ const cwd = process.cwd();
|
|
|
19
19
|
'application-assets-upload-script-out-file': 'upload-assets.sh',
|
|
20
20
|
'application-index-out-file': 'application.html',
|
|
21
21
|
'skip-menu': false,
|
|
22
|
+
'package-manager-name': 'yarn',
|
|
22
23
|
},
|
|
23
24
|
boolean: ['skip-menu'],
|
|
24
25
|
});
|
|
@@ -60,11 +61,12 @@ Command:
|
|
|
60
61
|
create-version Output a JSON string about the information in the 'version.json' for a deployment, including the updated list of rollbacks.
|
|
61
62
|
|
|
62
63
|
Options:
|
|
63
|
-
--version-url <url>
|
|
64
|
-
--build-revision <git-sha>
|
|
65
|
-
--build-number <url>
|
|
66
|
-
--rollbacks <int>
|
|
67
|
-
--out-file <path>
|
|
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.
|
|
68
70
|
`);
|
|
69
71
|
process.exit(0);
|
|
70
72
|
}
|
|
@@ -169,6 +169,7 @@ async function compileEnvironmentApplicationIndexes({
|
|
|
169
169
|
|
|
170
170
|
const applicationIndexUploadScriptContent =
|
|
171
171
|
createApplicationIndexUploadScript({
|
|
172
|
+
packageManagerName: cliFlags['package-manager-name'],
|
|
172
173
|
bucketUrl: getApplicationIndexBucketUrl({
|
|
173
174
|
bucketRegion,
|
|
174
175
|
prNumber: cliFlags['pr-number'],
|
|
@@ -225,12 +226,13 @@ async function command(cliFlags, cwd) {
|
|
|
225
226
|
assetsPath = applicationDirectory;
|
|
226
227
|
}
|
|
227
228
|
|
|
229
|
+
const monorepoRoot = findRootSync(cwd);
|
|
228
230
|
const paths = {
|
|
229
231
|
publicAssetsPath: resolveInApplication('public', cwd),
|
|
230
232
|
deploymentsPath: resolveInApplication('deployments', cwd),
|
|
231
233
|
dotenvPath:
|
|
232
234
|
cliFlags['dotenv-folder'] &&
|
|
233
|
-
path.join(
|
|
235
|
+
path.join(monorepoRoot.rootDir, cliFlags['dotenv-folder']),
|
|
234
236
|
assetsPath,
|
|
235
237
|
};
|
|
236
238
|
|
|
@@ -84,10 +84,10 @@ const mapApplicationMenuConfigToGraqhQLMenuJson = (config) => {
|
|
|
84
84
|
|
|
85
85
|
async function command(cliFlags, cwd) {
|
|
86
86
|
const applicationDirectory = getApplicationDirectory(cwd);
|
|
87
|
-
|
|
87
|
+
const monorepoRoot = findRootSync(cwd);
|
|
88
88
|
const dotenvPath =
|
|
89
89
|
cliFlags['dotenv-folder'] &&
|
|
90
|
-
path.join(
|
|
90
|
+
path.join(monorepoRoot.rootDir, cliFlags['dotenv-folder']);
|
|
91
91
|
|
|
92
92
|
const processEnv = {
|
|
93
93
|
...loadDotenvFiles({
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
function createApplicationIndexUploadScript({
|
|
2
|
+
packageManagerName,
|
|
2
3
|
bucketUrl,
|
|
3
4
|
cdnUrl,
|
|
4
5
|
cloudEnvironment,
|
|
@@ -20,7 +21,7 @@ cp -z html \\
|
|
|
20
21
|
|
|
21
22
|
echo "Creating version.json and uploading it to bucket ${bucketUrl}"
|
|
22
23
|
|
|
23
|
-
|
|
24
|
+
${packageManagerName} application-cli create-version \\
|
|
24
25
|
--version-url=${cdnUrl}/${cloudEnvironment}/version.json \\
|
|
25
26
|
--build-revision=${buildRevision} \\
|
|
26
27
|
--build-number=${buildNumber} \\
|