@commercetools-frontend/application-cli 1.1.1 → 1.2.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/README.md CHANGED
@@ -19,7 +19,7 @@ $ npm install --save @commercetools-frontend/application-cli
19
19
  This command compiles the deployments for each of the given cloud environments.
20
20
 
21
21
  ```bash
22
- yarn application-cli compile-deployments \
22
+ pnpm application-cli compile-deployments \
23
23
  --build-revision=<git_sha>
24
24
  ```
25
25
 
@@ -64,7 +64,7 @@ This command compiles the menu configuration [defined in the application config]
64
64
  > This is mostly useful for internal Merchant Center applications.
65
65
 
66
66
  ```bash
67
- yarn application-cli compile-menu
67
+ pnpm application-cli compile-menu
68
68
  ```
69
69
 
70
70
  ### Command: `create-version`
@@ -74,7 +74,7 @@ This command outputs a JSON string containing a list of deployed versions.
74
74
  > This is mostly useful for internal Merchant Center applications.
75
75
 
76
76
  ```bash
77
- yarn application-cli create-version \
77
+ pnpm application-cli create-version \
78
78
  --version-url=https://cdn/version.json
79
79
  --build-revision=<git_sha>
80
80
  ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@commercetools-frontend/application-cli",
3
- "version": "1.1.1",
3
+ "version": "1.2.1",
4
4
  "description": "Internal CLI to manage Merchant Center application deployments across various environments.",
5
5
  "keywords": [
6
6
  "commercetools",
@@ -17,9 +17,10 @@
17
17
  "README.md"
18
18
  ],
19
19
  "dependencies": {
20
- "@commercetools-frontend/application-config": "21.23.8",
20
+ "@babel/core": "^7.21.0",
21
+ "@commercetools-frontend/application-config": "21.24.1",
21
22
  "@manypkg/find-root": "2.1.0",
22
- "cosmiconfig": "8.1.0",
23
+ "cosmiconfig": "8.1.3",
23
24
  "dotenv": "16.0.3",
24
25
  "execa": "6.1.0",
25
26
  "listr": "0.14.3",
@@ -34,4 +35,4 @@
34
35
  "publishConfig": {
35
36
  "access": "public"
36
37
  }
37
- }
38
+ }
package/src/bin/cli.js CHANGED
@@ -12,13 +12,14 @@ const cwd = process.cwd();
12
12
  const cliFlags = mri(process.argv.slice(2), {
13
13
  alias: { help: ['h'] },
14
14
  default: {
15
- rollbacks: 5,
15
+ rollbacks: 15,
16
16
  'build-revision': process.env.CIRCLE_SHA1,
17
17
  'build-number': process.env.CIRCLE_BUILD_NUM,
18
18
  'application-index-upload-script-out-file': 'upload-index.sh',
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': 'pnpm',
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> (required) The path of an application's current 'version.json' within the storage bucket.
64
- --build-revision <git-sha> (optional) The git commit SHA that needs to be deployed. Defaults to the 'CIRCLE_SHA1' environment variable.
65
- --build-number <url> (optional) The number of a Continuous Integration build. Defaults to the 'CIRCLE_BUILD_NUM' environment variable.
66
- --rollbacks <int> (optional) The number of max rollbacks to keep. Defaults to 5.
67
- --out-file <path> (optional) The path to the file where to write the JSON. If not specified, the JSON is printed to stdout.
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'],
@@ -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
- yarn application-cli create-version \\
24
+ ${packageManagerName} application-cli create-version \\
24
25
  --version-url=${cdnUrl}/${cloudEnvironment}/version.json \\
25
26
  --build-revision=${buildRevision} \\
26
27
  --build-number=${buildNumber} \\