@commercetools-frontend/application-cli 6.1.3 → 6.1.5
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/bin/cli.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var commander = require('commander');
|
|
6
6
|
var _Object$keys = require('@babel/runtime-corejs3/core-js-stable/object/keys');
|
|
7
7
|
var _Object$getOwnPropertySymbols = require('@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols');
|
|
8
8
|
var _filterInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/filter');
|
|
@@ -1305,7 +1305,7 @@ async function command(cliFlags) {
|
|
|
1305
1305
|
|
|
1306
1306
|
var pkgJson = {
|
|
1307
1307
|
name: "@commercetools-frontend/application-cli",
|
|
1308
|
-
version: "6.1.
|
|
1308
|
+
version: "6.1.5",
|
|
1309
1309
|
description: "Internal CLI to manage Merchant Center application deployments across various environments.",
|
|
1310
1310
|
keywords: [
|
|
1311
1311
|
"commercetools",
|
|
@@ -1330,11 +1330,11 @@ var pkgJson = {
|
|
|
1330
1330
|
dependencies: {
|
|
1331
1331
|
"@babel/core": "^7.22.11",
|
|
1332
1332
|
"@babel/runtime-corejs3": "^7.21.0",
|
|
1333
|
-
"@commercetools-frontend/application-config": "23.
|
|
1334
|
-
"@commercetools-frontend/constants": "23.
|
|
1335
|
-
"@commercetools-frontend/l10n": "23.
|
|
1333
|
+
"@commercetools-frontend/application-config": "23.2.2",
|
|
1334
|
+
"@commercetools-frontend/constants": "23.2.2",
|
|
1335
|
+
"@commercetools-frontend/l10n": "23.2.2",
|
|
1336
1336
|
"@manypkg/find-root": "2.2.3",
|
|
1337
|
-
|
|
1337
|
+
commander: "^13.1.0",
|
|
1338
1338
|
cosmiconfig: "9.0.0",
|
|
1339
1339
|
dotenv: "16.4.7",
|
|
1340
1340
|
execa: "5.1.1",
|
|
@@ -1349,7 +1349,7 @@ var pkgJson = {
|
|
|
1349
1349
|
"@tsconfig/node20": "20.1.4",
|
|
1350
1350
|
"@types/lodash": "^4.14.198",
|
|
1351
1351
|
"@types/micromatch": "4.0.9",
|
|
1352
|
-
"@types/node": "22.13.
|
|
1352
|
+
"@types/node": "22.13.14",
|
|
1353
1353
|
typescript: "5.2.2"
|
|
1354
1354
|
},
|
|
1355
1355
|
engines: {
|
|
@@ -1367,64 +1367,28 @@ var pkgJson = {
|
|
|
1367
1367
|
}
|
|
1368
1368
|
};
|
|
1369
1369
|
|
|
1370
|
-
|
|
1370
|
+
commander.program.name('application-cli').description('CLI to manage Merchant Center application deployments across various environments.').version(pkgJson.version);
|
|
1371
1371
|
const cwd = process.cwd();
|
|
1372
1372
|
const run = async () => {
|
|
1373
|
-
|
|
1374
|
-
default: process.env.CIRCLE_SHA1
|
|
1375
|
-
}).option('--build-number [string]', '(optional) A number of the build on the Continuous Integration system.', {
|
|
1376
|
-
default: process.env.CIRCLE_BUILD_NUM
|
|
1377
|
-
}).option('--package-manager-name [string]', '(optional) Name of the binary of the used package manager (e.g. pnpm).', {
|
|
1378
|
-
default: 'yarn'
|
|
1379
|
-
});
|
|
1380
|
-
|
|
1381
|
-
// Default command
|
|
1382
|
-
cli.command('').usage('\n\n Compile deployments and menus and create versions for MC applications').action(cli.outputHelp);
|
|
1383
|
-
const usageCompileDeployment = 'Compile the deployments for an application for all environments.';
|
|
1384
|
-
cli.command('compile-deployments', usageCompileDeployment).usage(`compile-deployments \n\n ${usageCompileDeployment}`).option('--application-name <string>', '(required) The name of the application being compiled for example application-products.').option('--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.').option('--pr-number [string]', '(optional) A pull request number determining a scoped storage bucket for the deployment. Please use it carefully.').option('--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.').option('--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.').option('--application-index-out-file [path]', '(optional) The name of the application index file.', {
|
|
1385
|
-
default: 'application.html'
|
|
1386
|
-
}).option('--application-index-upload-script-out-file [path]', '(optional) The name of the the application index upload script file.', {
|
|
1387
|
-
default: 'upload-index.sh'
|
|
1388
|
-
}).option('--application-assets-upload-script-out-file [path]', '(optional) The name of the the assets upload script file.', {
|
|
1389
|
-
default: 'upload-assets.sh'
|
|
1390
|
-
}).option('--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.').option('--skip-menu', '(optional) If provided, it will skip uploading the `menu.json`.', {
|
|
1391
|
-
default: false
|
|
1392
|
-
}).action(async options => {
|
|
1373
|
+
commander.program.command('compile-deployments').description('Compile the deployments for an application for all environments.').requiredOption('--application-name <string>', '(required) The name of the application being compiled for example application-products.').option('--build-revision [git-sha]', '(optional) The git commit SHA which is being built.', process.env.CIRCLE_SHA1).option('--build-number [string]', '(optional) A number of the build on the Continuous Integration system.', process.env.CIRCLE_BUILD_NUM).option('--package-manager-name [string]', '(optional) Name of the binary of the used package manager (e.g. pnpm).', 'yarn').option('--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.').option('--pr-number [string]', '(optional) A pull request number determining a scoped storage bucket for the deployment. Please use it carefully.').option('--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.').option('--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.').option('--application-index-out-file [path]', '(optional) The name of the application index file.', 'application.html').option('--application-index-upload-script-out-file [path]', '(optional) The name of the the application index upload script file.', 'upload-index.sh').option('--application-assets-upload-script-out-file [path]', '(optional) The name of the the assets upload script file.', 'upload-assets.sh').option('--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.').option('--skip-menu', '(optional) If provided, it will skip uploading the `menu.json`.', false).action(async options => {
|
|
1393
1374
|
await command$4(options, cwd);
|
|
1394
1375
|
});
|
|
1395
|
-
|
|
1396
|
-
cli.command('compile-menu', usageCompileMenu).usage(`compile-menu \n\n ${usageCompileMenu}`).option('--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.').action(async options => {
|
|
1376
|
+
commander.program.command('compile-menu').description('Compile the menu links of an application into a `menu.json`. This is only required for internal applications').option('--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.').action(async options => {
|
|
1397
1377
|
await command$3(options, cwd);
|
|
1398
1378
|
});
|
|
1399
|
-
|
|
1400
|
-
cli.command('validate-menu', usageValidateMenu).usage(`validate-menu \n\n ${usageValidateMenu}`).option('--input-file <path>', '(required) The path to the `menu.json` file to be validated.').option('--navigation [string]', '(optional) Location of the menu navigation. Possible values are `top`.').action(async options => {
|
|
1379
|
+
commander.program.command('validate-menu').description('Validate compiled `menu.json` file').requiredOption('--input-file <path>', '(required) The path to the `menu.json` file to be validated.').option('--navigation [string]', '(optional) Location of the menu navigation. Possible values are `top`.').action(async options => {
|
|
1401
1380
|
await command(options);
|
|
1402
1381
|
});
|
|
1403
|
-
|
|
1404
|
-
cli.command('create-version', usageCreateVersion).usage(`create-version \n\n ${usageCreateVersion}`).option('--version-url <url>', "(required) The path of an application's current `version.json` within the storage bucket.").option('--rollbacks [int]', '(optional) The number of max rollbacks to keep', {
|
|
1405
|
-
default: 15
|
|
1406
|
-
}).option('--out-file [path]', '(optional) The path to the file where to write the JSON. If not specified, the JSON is printed to stdout.').action(async options => {
|
|
1382
|
+
commander.program.command('create-version').description('Output a JSON string about the information in the `version.json` for a deployment, including the updated list of rollbacks.').requiredOption('--version-url <url>', "(required) The path of an application's current `version.json` within the storage bucket.").option('--build-revision [git-sha]', '(optional) The git commit SHA which is being built.', process.env.CIRCLE_SHA1).option('--build-number [string]', '(optional) A number of the build on the Continuous Integration system.', process.env.CIRCLE_BUILD_NUM).option('--rollbacks [int]', '(optional) The number of max rollbacks to keep', value => Number(value), 15).option('--out-file [path]', '(optional) The path to the file where to write the JSON. If not specified, the JSON is printed to stdout.').option('--package-manager-name [string]', '(optional) Name of the binary of the used package manager (e.g. pnpm).', 'yarn').action(async options => {
|
|
1407
1383
|
await command$2(options);
|
|
1408
1384
|
});
|
|
1409
1385
|
|
|
1410
1386
|
// Command: Evaluate change triggers
|
|
1411
|
-
|
|
1412
|
-
cli.command('evaluate-change-triggers', usageEvaluateChangeTriggers).usage(`evaluate-change-triggers \n\n ${usageEvaluateChangeTriggers}`).option('--branch <string>', 'The branch of the pull request', {
|
|
1413
|
-
default: process.env.CIRCLE_BRANCH
|
|
1414
|
-
}).option('--base-branch <string>', 'The base revision of the git commit compare against (e.g. "main")').option('--head-revision <string>', 'The revision of the git head to compare with', {
|
|
1415
|
-
default: process.env.CIRCLE_SHA1
|
|
1416
|
-
}).option('--trigger-name <string>', 'The trigger to evaluate for.').option('--silent', '(optional) Disable logging', {
|
|
1417
|
-
default: false
|
|
1418
|
-
}).option('--out-env-file [string]', '(optional) A file path where the matched triggers are written as a dotenv file.').action(async options => {
|
|
1387
|
+
commander.program.command('evaluate-change-triggers').description('Evaluates changed files against a base and evaluates them against defined triggers.').requiredOption('--base-branch <string>', 'The base revision of the git commit compare against (e.g. "main")').requiredOption('--trigger-name <string>', 'The trigger to evaluate for.').option('--branch [string]', 'The branch of the pull request', process.env.CIRCLE_BRANCH).option('--head-revision [string]', 'The revision of the git head to compare with', process.env.CIRCLE_SHA1).option('--silent', '(optional) Disable logging', false).option('--out-env-file [string]', '(optional) A file path where the matched triggers are written as a dotenv file.').action(async options => {
|
|
1419
1388
|
const config = await storageBucketsConfig.loadConfig('circleci-change-triggers', []);
|
|
1420
1389
|
await command$1(options, config, cwd);
|
|
1421
1390
|
});
|
|
1422
|
-
|
|
1423
|
-
cli.version(pkgJson.version);
|
|
1424
|
-
cli.parse(process.argv, {
|
|
1425
|
-
run: false
|
|
1426
|
-
});
|
|
1427
|
-
await cli.runMatchedCommand();
|
|
1391
|
+
commander.program.parse();
|
|
1428
1392
|
};
|
|
1429
1393
|
|
|
1430
1394
|
exports.run = run;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var commander = require('commander');
|
|
6
6
|
var _Object$keys = require('@babel/runtime-corejs3/core-js-stable/object/keys');
|
|
7
7
|
var _Object$getOwnPropertySymbols = require('@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols');
|
|
8
8
|
var _filterInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/filter');
|
|
@@ -1305,7 +1305,7 @@ async function command(cliFlags) {
|
|
|
1305
1305
|
|
|
1306
1306
|
var pkgJson = {
|
|
1307
1307
|
name: "@commercetools-frontend/application-cli",
|
|
1308
|
-
version: "6.1.
|
|
1308
|
+
version: "6.1.5",
|
|
1309
1309
|
description: "Internal CLI to manage Merchant Center application deployments across various environments.",
|
|
1310
1310
|
keywords: [
|
|
1311
1311
|
"commercetools",
|
|
@@ -1330,11 +1330,11 @@ var pkgJson = {
|
|
|
1330
1330
|
dependencies: {
|
|
1331
1331
|
"@babel/core": "^7.22.11",
|
|
1332
1332
|
"@babel/runtime-corejs3": "^7.21.0",
|
|
1333
|
-
"@commercetools-frontend/application-config": "23.
|
|
1334
|
-
"@commercetools-frontend/constants": "23.
|
|
1335
|
-
"@commercetools-frontend/l10n": "23.
|
|
1333
|
+
"@commercetools-frontend/application-config": "23.2.2",
|
|
1334
|
+
"@commercetools-frontend/constants": "23.2.2",
|
|
1335
|
+
"@commercetools-frontend/l10n": "23.2.2",
|
|
1336
1336
|
"@manypkg/find-root": "2.2.3",
|
|
1337
|
-
|
|
1337
|
+
commander: "^13.1.0",
|
|
1338
1338
|
cosmiconfig: "9.0.0",
|
|
1339
1339
|
dotenv: "16.4.7",
|
|
1340
1340
|
execa: "5.1.1",
|
|
@@ -1349,7 +1349,7 @@ var pkgJson = {
|
|
|
1349
1349
|
"@tsconfig/node20": "20.1.4",
|
|
1350
1350
|
"@types/lodash": "^4.14.198",
|
|
1351
1351
|
"@types/micromatch": "4.0.9",
|
|
1352
|
-
"@types/node": "22.13.
|
|
1352
|
+
"@types/node": "22.13.14",
|
|
1353
1353
|
typescript: "5.2.2"
|
|
1354
1354
|
},
|
|
1355
1355
|
engines: {
|
|
@@ -1367,64 +1367,28 @@ var pkgJson = {
|
|
|
1367
1367
|
}
|
|
1368
1368
|
};
|
|
1369
1369
|
|
|
1370
|
-
|
|
1370
|
+
commander.program.name('application-cli').description('CLI to manage Merchant Center application deployments across various environments.').version(pkgJson.version);
|
|
1371
1371
|
const cwd = process.cwd();
|
|
1372
1372
|
const run = async () => {
|
|
1373
|
-
|
|
1374
|
-
default: process.env.CIRCLE_SHA1
|
|
1375
|
-
}).option('--build-number [string]', '(optional) A number of the build on the Continuous Integration system.', {
|
|
1376
|
-
default: process.env.CIRCLE_BUILD_NUM
|
|
1377
|
-
}).option('--package-manager-name [string]', '(optional) Name of the binary of the used package manager (e.g. pnpm).', {
|
|
1378
|
-
default: 'yarn'
|
|
1379
|
-
});
|
|
1380
|
-
|
|
1381
|
-
// Default command
|
|
1382
|
-
cli.command('').usage('\n\n Compile deployments and menus and create versions for MC applications').action(cli.outputHelp);
|
|
1383
|
-
const usageCompileDeployment = 'Compile the deployments for an application for all environments.';
|
|
1384
|
-
cli.command('compile-deployments', usageCompileDeployment).usage(`compile-deployments \n\n ${usageCompileDeployment}`).option('--application-name <string>', '(required) The name of the application being compiled for example application-products.').option('--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.').option('--pr-number [string]', '(optional) A pull request number determining a scoped storage bucket for the deployment. Please use it carefully.').option('--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.').option('--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.').option('--application-index-out-file [path]', '(optional) The name of the application index file.', {
|
|
1385
|
-
default: 'application.html'
|
|
1386
|
-
}).option('--application-index-upload-script-out-file [path]', '(optional) The name of the the application index upload script file.', {
|
|
1387
|
-
default: 'upload-index.sh'
|
|
1388
|
-
}).option('--application-assets-upload-script-out-file [path]', '(optional) The name of the the assets upload script file.', {
|
|
1389
|
-
default: 'upload-assets.sh'
|
|
1390
|
-
}).option('--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.').option('--skip-menu', '(optional) If provided, it will skip uploading the `menu.json`.', {
|
|
1391
|
-
default: false
|
|
1392
|
-
}).action(async options => {
|
|
1373
|
+
commander.program.command('compile-deployments').description('Compile the deployments for an application for all environments.').requiredOption('--application-name <string>', '(required) The name of the application being compiled for example application-products.').option('--build-revision [git-sha]', '(optional) The git commit SHA which is being built.', process.env.CIRCLE_SHA1).option('--build-number [string]', '(optional) A number of the build on the Continuous Integration system.', process.env.CIRCLE_BUILD_NUM).option('--package-manager-name [string]', '(optional) Name of the binary of the used package manager (e.g. pnpm).', 'yarn').option('--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.').option('--pr-number [string]', '(optional) A pull request number determining a scoped storage bucket for the deployment. Please use it carefully.').option('--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.').option('--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.').option('--application-index-out-file [path]', '(optional) The name of the application index file.', 'application.html').option('--application-index-upload-script-out-file [path]', '(optional) The name of the the application index upload script file.', 'upload-index.sh').option('--application-assets-upload-script-out-file [path]', '(optional) The name of the the assets upload script file.', 'upload-assets.sh').option('--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.').option('--skip-menu', '(optional) If provided, it will skip uploading the `menu.json`.', false).action(async options => {
|
|
1393
1374
|
await command$4(options, cwd);
|
|
1394
1375
|
});
|
|
1395
|
-
|
|
1396
|
-
cli.command('compile-menu', usageCompileMenu).usage(`compile-menu \n\n ${usageCompileMenu}`).option('--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.').action(async options => {
|
|
1376
|
+
commander.program.command('compile-menu').description('Compile the menu links of an application into a `menu.json`. This is only required for internal applications').option('--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.').action(async options => {
|
|
1397
1377
|
await command$3(options, cwd);
|
|
1398
1378
|
});
|
|
1399
|
-
|
|
1400
|
-
cli.command('validate-menu', usageValidateMenu).usage(`validate-menu \n\n ${usageValidateMenu}`).option('--input-file <path>', '(required) The path to the `menu.json` file to be validated.').option('--navigation [string]', '(optional) Location of the menu navigation. Possible values are `top`.').action(async options => {
|
|
1379
|
+
commander.program.command('validate-menu').description('Validate compiled `menu.json` file').requiredOption('--input-file <path>', '(required) The path to the `menu.json` file to be validated.').option('--navigation [string]', '(optional) Location of the menu navigation. Possible values are `top`.').action(async options => {
|
|
1401
1380
|
await command(options);
|
|
1402
1381
|
});
|
|
1403
|
-
|
|
1404
|
-
cli.command('create-version', usageCreateVersion).usage(`create-version \n\n ${usageCreateVersion}`).option('--version-url <url>', "(required) The path of an application's current `version.json` within the storage bucket.").option('--rollbacks [int]', '(optional) The number of max rollbacks to keep', {
|
|
1405
|
-
default: 15
|
|
1406
|
-
}).option('--out-file [path]', '(optional) The path to the file where to write the JSON. If not specified, the JSON is printed to stdout.').action(async options => {
|
|
1382
|
+
commander.program.command('create-version').description('Output a JSON string about the information in the `version.json` for a deployment, including the updated list of rollbacks.').requiredOption('--version-url <url>', "(required) The path of an application's current `version.json` within the storage bucket.").option('--build-revision [git-sha]', '(optional) The git commit SHA which is being built.', process.env.CIRCLE_SHA1).option('--build-number [string]', '(optional) A number of the build on the Continuous Integration system.', process.env.CIRCLE_BUILD_NUM).option('--rollbacks [int]', '(optional) The number of max rollbacks to keep', value => Number(value), 15).option('--out-file [path]', '(optional) The path to the file where to write the JSON. If not specified, the JSON is printed to stdout.').option('--package-manager-name [string]', '(optional) Name of the binary of the used package manager (e.g. pnpm).', 'yarn').action(async options => {
|
|
1407
1383
|
await command$2(options);
|
|
1408
1384
|
});
|
|
1409
1385
|
|
|
1410
1386
|
// Command: Evaluate change triggers
|
|
1411
|
-
|
|
1412
|
-
cli.command('evaluate-change-triggers', usageEvaluateChangeTriggers).usage(`evaluate-change-triggers \n\n ${usageEvaluateChangeTriggers}`).option('--branch <string>', 'The branch of the pull request', {
|
|
1413
|
-
default: process.env.CIRCLE_BRANCH
|
|
1414
|
-
}).option('--base-branch <string>', 'The base revision of the git commit compare against (e.g. "main")').option('--head-revision <string>', 'The revision of the git head to compare with', {
|
|
1415
|
-
default: process.env.CIRCLE_SHA1
|
|
1416
|
-
}).option('--trigger-name <string>', 'The trigger to evaluate for.').option('--silent', '(optional) Disable logging', {
|
|
1417
|
-
default: false
|
|
1418
|
-
}).option('--out-env-file [string]', '(optional) A file path where the matched triggers are written as a dotenv file.').action(async options => {
|
|
1387
|
+
commander.program.command('evaluate-change-triggers').description('Evaluates changed files against a base and evaluates them against defined triggers.').requiredOption('--base-branch <string>', 'The base revision of the git commit compare against (e.g. "main")').requiredOption('--trigger-name <string>', 'The trigger to evaluate for.').option('--branch [string]', 'The branch of the pull request', process.env.CIRCLE_BRANCH).option('--head-revision [string]', 'The revision of the git head to compare with', process.env.CIRCLE_SHA1).option('--silent', '(optional) Disable logging', false).option('--out-env-file [string]', '(optional) A file path where the matched triggers are written as a dotenv file.').action(async options => {
|
|
1419
1388
|
const config = await storageBucketsConfig.loadConfig('circleci-change-triggers', []);
|
|
1420
1389
|
await command$1(options, config, cwd);
|
|
1421
1390
|
});
|
|
1422
|
-
|
|
1423
|
-
cli.version(pkgJson.version);
|
|
1424
|
-
cli.parse(process.argv, {
|
|
1425
|
-
run: false
|
|
1426
|
-
});
|
|
1427
|
-
await cli.runMatchedCommand();
|
|
1391
|
+
commander.program.parse();
|
|
1428
1392
|
};
|
|
1429
1393
|
|
|
1430
1394
|
exports.run = run;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { program } from 'commander';
|
|
2
2
|
import _Object$keys from '@babel/runtime-corejs3/core-js-stable/object/keys';
|
|
3
3
|
import _Object$getOwnPropertySymbols from '@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols';
|
|
4
4
|
import _filterInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/filter';
|
|
@@ -1269,7 +1269,7 @@ async function command(cliFlags) {
|
|
|
1269
1269
|
|
|
1270
1270
|
var pkgJson = {
|
|
1271
1271
|
name: "@commercetools-frontend/application-cli",
|
|
1272
|
-
version: "6.1.
|
|
1272
|
+
version: "6.1.5",
|
|
1273
1273
|
description: "Internal CLI to manage Merchant Center application deployments across various environments.",
|
|
1274
1274
|
keywords: [
|
|
1275
1275
|
"commercetools",
|
|
@@ -1294,11 +1294,11 @@ var pkgJson = {
|
|
|
1294
1294
|
dependencies: {
|
|
1295
1295
|
"@babel/core": "^7.22.11",
|
|
1296
1296
|
"@babel/runtime-corejs3": "^7.21.0",
|
|
1297
|
-
"@commercetools-frontend/application-config": "23.
|
|
1298
|
-
"@commercetools-frontend/constants": "23.
|
|
1299
|
-
"@commercetools-frontend/l10n": "23.
|
|
1297
|
+
"@commercetools-frontend/application-config": "23.2.2",
|
|
1298
|
+
"@commercetools-frontend/constants": "23.2.2",
|
|
1299
|
+
"@commercetools-frontend/l10n": "23.2.2",
|
|
1300
1300
|
"@manypkg/find-root": "2.2.3",
|
|
1301
|
-
|
|
1301
|
+
commander: "^13.1.0",
|
|
1302
1302
|
cosmiconfig: "9.0.0",
|
|
1303
1303
|
dotenv: "16.4.7",
|
|
1304
1304
|
execa: "5.1.1",
|
|
@@ -1313,7 +1313,7 @@ var pkgJson = {
|
|
|
1313
1313
|
"@tsconfig/node20": "20.1.4",
|
|
1314
1314
|
"@types/lodash": "^4.14.198",
|
|
1315
1315
|
"@types/micromatch": "4.0.9",
|
|
1316
|
-
"@types/node": "22.13.
|
|
1316
|
+
"@types/node": "22.13.14",
|
|
1317
1317
|
typescript: "5.2.2"
|
|
1318
1318
|
},
|
|
1319
1319
|
engines: {
|
|
@@ -1331,64 +1331,28 @@ var pkgJson = {
|
|
|
1331
1331
|
}
|
|
1332
1332
|
};
|
|
1333
1333
|
|
|
1334
|
-
|
|
1334
|
+
program.name('application-cli').description('CLI to manage Merchant Center application deployments across various environments.').version(pkgJson.version);
|
|
1335
1335
|
const cwd = process.cwd();
|
|
1336
1336
|
const run = async () => {
|
|
1337
|
-
|
|
1338
|
-
default: process.env.CIRCLE_SHA1
|
|
1339
|
-
}).option('--build-number [string]', '(optional) A number of the build on the Continuous Integration system.', {
|
|
1340
|
-
default: process.env.CIRCLE_BUILD_NUM
|
|
1341
|
-
}).option('--package-manager-name [string]', '(optional) Name of the binary of the used package manager (e.g. pnpm).', {
|
|
1342
|
-
default: 'yarn'
|
|
1343
|
-
});
|
|
1344
|
-
|
|
1345
|
-
// Default command
|
|
1346
|
-
cli.command('').usage('\n\n Compile deployments and menus and create versions for MC applications').action(cli.outputHelp);
|
|
1347
|
-
const usageCompileDeployment = 'Compile the deployments for an application for all environments.';
|
|
1348
|
-
cli.command('compile-deployments', usageCompileDeployment).usage(`compile-deployments \n\n ${usageCompileDeployment}`).option('--application-name <string>', '(required) The name of the application being compiled for example application-products.').option('--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.').option('--pr-number [string]', '(optional) A pull request number determining a scoped storage bucket for the deployment. Please use it carefully.').option('--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.').option('--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.').option('--application-index-out-file [path]', '(optional) The name of the application index file.', {
|
|
1349
|
-
default: 'application.html'
|
|
1350
|
-
}).option('--application-index-upload-script-out-file [path]', '(optional) The name of the the application index upload script file.', {
|
|
1351
|
-
default: 'upload-index.sh'
|
|
1352
|
-
}).option('--application-assets-upload-script-out-file [path]', '(optional) The name of the the assets upload script file.', {
|
|
1353
|
-
default: 'upload-assets.sh'
|
|
1354
|
-
}).option('--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.').option('--skip-menu', '(optional) If provided, it will skip uploading the `menu.json`.', {
|
|
1355
|
-
default: false
|
|
1356
|
-
}).action(async options => {
|
|
1337
|
+
program.command('compile-deployments').description('Compile the deployments for an application for all environments.').requiredOption('--application-name <string>', '(required) The name of the application being compiled for example application-products.').option('--build-revision [git-sha]', '(optional) The git commit SHA which is being built.', process.env.CIRCLE_SHA1).option('--build-number [string]', '(optional) A number of the build on the Continuous Integration system.', process.env.CIRCLE_BUILD_NUM).option('--package-manager-name [string]', '(optional) Name of the binary of the used package manager (e.g. pnpm).', 'yarn').option('--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.').option('--pr-number [string]', '(optional) A pull request number determining a scoped storage bucket for the deployment. Please use it carefully.').option('--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.').option('--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.').option('--application-index-out-file [path]', '(optional) The name of the application index file.', 'application.html').option('--application-index-upload-script-out-file [path]', '(optional) The name of the the application index upload script file.', 'upload-index.sh').option('--application-assets-upload-script-out-file [path]', '(optional) The name of the the assets upload script file.', 'upload-assets.sh').option('--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.').option('--skip-menu', '(optional) If provided, it will skip uploading the `menu.json`.', false).action(async options => {
|
|
1357
1338
|
await command$4(options, cwd);
|
|
1358
1339
|
});
|
|
1359
|
-
|
|
1360
|
-
cli.command('compile-menu', usageCompileMenu).usage(`compile-menu \n\n ${usageCompileMenu}`).option('--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.').action(async options => {
|
|
1340
|
+
program.command('compile-menu').description('Compile the menu links of an application into a `menu.json`. This is only required for internal applications').option('--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.').action(async options => {
|
|
1361
1341
|
await command$3(options, cwd);
|
|
1362
1342
|
});
|
|
1363
|
-
|
|
1364
|
-
cli.command('validate-menu', usageValidateMenu).usage(`validate-menu \n\n ${usageValidateMenu}`).option('--input-file <path>', '(required) The path to the `menu.json` file to be validated.').option('--navigation [string]', '(optional) Location of the menu navigation. Possible values are `top`.').action(async options => {
|
|
1343
|
+
program.command('validate-menu').description('Validate compiled `menu.json` file').requiredOption('--input-file <path>', '(required) The path to the `menu.json` file to be validated.').option('--navigation [string]', '(optional) Location of the menu navigation. Possible values are `top`.').action(async options => {
|
|
1365
1344
|
await command(options);
|
|
1366
1345
|
});
|
|
1367
|
-
|
|
1368
|
-
cli.command('create-version', usageCreateVersion).usage(`create-version \n\n ${usageCreateVersion}`).option('--version-url <url>', "(required) The path of an application's current `version.json` within the storage bucket.").option('--rollbacks [int]', '(optional) The number of max rollbacks to keep', {
|
|
1369
|
-
default: 15
|
|
1370
|
-
}).option('--out-file [path]', '(optional) The path to the file where to write the JSON. If not specified, the JSON is printed to stdout.').action(async options => {
|
|
1346
|
+
program.command('create-version').description('Output a JSON string about the information in the `version.json` for a deployment, including the updated list of rollbacks.').requiredOption('--version-url <url>', "(required) The path of an application's current `version.json` within the storage bucket.").option('--build-revision [git-sha]', '(optional) The git commit SHA which is being built.', process.env.CIRCLE_SHA1).option('--build-number [string]', '(optional) A number of the build on the Continuous Integration system.', process.env.CIRCLE_BUILD_NUM).option('--rollbacks [int]', '(optional) The number of max rollbacks to keep', value => Number(value), 15).option('--out-file [path]', '(optional) The path to the file where to write the JSON. If not specified, the JSON is printed to stdout.').option('--package-manager-name [string]', '(optional) Name of the binary of the used package manager (e.g. pnpm).', 'yarn').action(async options => {
|
|
1371
1347
|
await command$2(options);
|
|
1372
1348
|
});
|
|
1373
1349
|
|
|
1374
1350
|
// Command: Evaluate change triggers
|
|
1375
|
-
|
|
1376
|
-
cli.command('evaluate-change-triggers', usageEvaluateChangeTriggers).usage(`evaluate-change-triggers \n\n ${usageEvaluateChangeTriggers}`).option('--branch <string>', 'The branch of the pull request', {
|
|
1377
|
-
default: process.env.CIRCLE_BRANCH
|
|
1378
|
-
}).option('--base-branch <string>', 'The base revision of the git commit compare against (e.g. "main")').option('--head-revision <string>', 'The revision of the git head to compare with', {
|
|
1379
|
-
default: process.env.CIRCLE_SHA1
|
|
1380
|
-
}).option('--trigger-name <string>', 'The trigger to evaluate for.').option('--silent', '(optional) Disable logging', {
|
|
1381
|
-
default: false
|
|
1382
|
-
}).option('--out-env-file [string]', '(optional) A file path where the matched triggers are written as a dotenv file.').action(async options => {
|
|
1351
|
+
program.command('evaluate-change-triggers').description('Evaluates changed files against a base and evaluates them against defined triggers.').requiredOption('--base-branch <string>', 'The base revision of the git commit compare against (e.g. "main")').requiredOption('--trigger-name <string>', 'The trigger to evaluate for.').option('--branch [string]', 'The branch of the pull request', process.env.CIRCLE_BRANCH).option('--head-revision [string]', 'The revision of the git head to compare with', process.env.CIRCLE_SHA1).option('--silent', '(optional) Disable logging', false).option('--out-env-file [string]', '(optional) A file path where the matched triggers are written as a dotenv file.').action(async options => {
|
|
1383
1352
|
const config = await loadConfig('circleci-change-triggers', []);
|
|
1384
1353
|
await command$1(options, config, cwd);
|
|
1385
1354
|
});
|
|
1386
|
-
|
|
1387
|
-
cli.version(pkgJson.version);
|
|
1388
|
-
cli.parse(process.argv, {
|
|
1389
|
-
run: false
|
|
1390
|
-
});
|
|
1391
|
-
await cli.runMatchedCommand();
|
|
1355
|
+
program.parse();
|
|
1392
1356
|
};
|
|
1393
1357
|
|
|
1394
1358
|
export { run };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@commercetools-frontend/application-cli",
|
|
3
|
-
"version": "6.1.
|
|
3
|
+
"version": "6.1.5",
|
|
4
4
|
"description": "Internal CLI to manage Merchant Center application deployments across various environments.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"commercetools",
|
|
@@ -22,11 +22,11 @@
|
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"@babel/core": "^7.22.11",
|
|
24
24
|
"@babel/runtime-corejs3": "^7.21.0",
|
|
25
|
-
"@commercetools-frontend/application-config": "23.
|
|
26
|
-
"@commercetools-frontend/constants": "23.
|
|
27
|
-
"@commercetools-frontend/l10n": "23.
|
|
25
|
+
"@commercetools-frontend/application-config": "23.2.2",
|
|
26
|
+
"@commercetools-frontend/constants": "23.2.2",
|
|
27
|
+
"@commercetools-frontend/l10n": "23.2.2",
|
|
28
28
|
"@manypkg/find-root": "2.2.3",
|
|
29
|
-
"
|
|
29
|
+
"commander": "^13.1.0",
|
|
30
30
|
"cosmiconfig": "9.0.0",
|
|
31
31
|
"dotenv": "16.4.7",
|
|
32
32
|
"execa": "5.1.1",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"@tsconfig/node20": "20.1.4",
|
|
42
42
|
"@types/lodash": "^4.14.198",
|
|
43
43
|
"@types/micromatch": "4.0.9",
|
|
44
|
-
"@types/node": "22.13.
|
|
44
|
+
"@types/node": "22.13.14",
|
|
45
45
|
"typescript": "5.2.2"
|
|
46
46
|
},
|
|
47
47
|
"engines": {
|