@commercetools-frontend/application-cli 2.4.0 → 3.0.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/bin/cli.js +2 -2
- package/cli/dist/commercetools-frontend-application-cli-cli.cjs.dev.js +215 -42
- package/cli/dist/commercetools-frontend-application-cli-cli.cjs.prod.js +215 -42
- package/cli/dist/commercetools-frontend-application-cli-cli.esm.js +209 -43
- package/dist/commercetools-frontend-application-cli.cjs.dev.js +3 -1
- package/dist/commercetools-frontend-application-cli.cjs.prod.js +3 -1
- package/dist/commercetools-frontend-application-cli.esm.js +3 -1
- package/dist/declarations/src/constants.d.ts +2 -0
- package/dist/declarations/src/storage-buckets-config.d.ts +2 -1
- package/dist/declarations/src/types.d.ts +17 -0
- package/dist/{storage-buckets-config-91932b24.cjs.dev.js → storage-buckets-config-2f9a9168.cjs.prod.js} +26 -1
- package/dist/{storage-buckets-config-2fc2b441.esm.js → storage-buckets-config-6e04b3d3.esm.js} +24 -2
- package/dist/{storage-buckets-config-b6d36938.cjs.prod.js → storage-buckets-config-89962880.cjs.dev.js} +26 -1
- package/package.json +12 -7
|
@@ -3,14 +3,18 @@
|
|
|
3
3
|
var _forEachInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/for-each');
|
|
4
4
|
var _Object$keys = require('@babel/runtime-corejs3/core-js-stable/object/keys');
|
|
5
5
|
var _filterInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/filter');
|
|
6
|
+
var _concatInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/concat');
|
|
6
7
|
var cosmiconfig = require('cosmiconfig');
|
|
7
8
|
var tsDeepmerge = require('ts-deepmerge');
|
|
9
|
+
var lodash = require('lodash');
|
|
8
10
|
|
|
9
11
|
function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
|
|
10
12
|
|
|
11
13
|
var _forEachInstanceProperty__default = /*#__PURE__*/_interopDefault(_forEachInstanceProperty);
|
|
12
14
|
var _Object$keys__default = /*#__PURE__*/_interopDefault(_Object$keys);
|
|
13
15
|
var _filterInstanceProperty__default = /*#__PURE__*/_interopDefault(_filterInstanceProperty);
|
|
16
|
+
var _concatInstanceProperty__default = /*#__PURE__*/_interopDefault(_concatInstanceProperty);
|
|
17
|
+
var lodash__default = /*#__PURE__*/_interopDefault(lodash);
|
|
14
18
|
|
|
15
19
|
const clusterContexts = {
|
|
16
20
|
'ctp_staging_gcp_europe-west1_v1': 'ctp_staging_gcp_europe-west1_v1',
|
|
@@ -25,7 +29,8 @@ const clusterContexts = {
|
|
|
25
29
|
'ctp_production_gcp_us-central1_v1': 'ctp_production_gcp_us-central1_v1',
|
|
26
30
|
'ctp_production_gcp_australia-southeast1_v1': 'ctp_production_gcp_australia-southeast1_v1',
|
|
27
31
|
'ctp_production_aws_cn-northwest-1_v1': 'ctp_production_aws_cn-northwest-1_v1',
|
|
28
|
-
ctp_staging_azure_northeurope_v1: 'ctp_staging_azure_northeurope_v1'
|
|
32
|
+
ctp_staging_azure_northeurope_v1: 'ctp_staging_azure_northeurope_v1',
|
|
33
|
+
ctp_production_azure_eastus_v1: 'ctp_production_azure_eastus_v1'
|
|
29
34
|
};
|
|
30
35
|
const bucketEnvironments = {
|
|
31
36
|
'ctp-gcp-staging': 'ctp-gcp-staging',
|
|
@@ -33,6 +38,7 @@ const bucketEnvironments = {
|
|
|
33
38
|
'ctp-aws-staging-cn': 'ctp-aws-staging-cn',
|
|
34
39
|
'ctp-gcp-testing-performance-eu': 'ctp-gcp-testing-performance-eu',
|
|
35
40
|
'ctp-azure-staging': 'ctp-azure-staging',
|
|
41
|
+
'ctp-azure-production-us': 'ctp-azure-production-us',
|
|
36
42
|
'ctp-aws-production-fra': 'ctp-aws-production-fra',
|
|
37
43
|
'ctp-gcp-production-eu': 'ctp-gcp-production-eu',
|
|
38
44
|
'ctp-vw-production-eu': 'ctp-vw-production-eu',
|
|
@@ -115,6 +121,9 @@ const defaultConfig = {
|
|
|
115
121
|
}, {
|
|
116
122
|
cloudEnvironment: clusterContexts['ctp_production_gcp_us-central1_v1'],
|
|
117
123
|
bucketEnvironment: bucketEnvironments['ctp-gcp-production-us']
|
|
124
|
+
}, {
|
|
125
|
+
cloudEnvironment: clusterContexts['ctp_production_azure_eastus_v1'],
|
|
126
|
+
bucketEnvironment: bucketEnvironments['ctp-azure-production-us']
|
|
118
127
|
}],
|
|
119
128
|
[bucketRegions.asia]: [{
|
|
120
129
|
cloudEnvironment: clusterContexts['ctp_production_gcp_australia-southeast1_v1'],
|
|
@@ -170,10 +179,26 @@ async function loadStorageBucketsConfig() {
|
|
|
170
179
|
}
|
|
171
180
|
return (_explorerResult = explorerResult) === null || _explorerResult === void 0 ? void 0 : _explorerResult.config;
|
|
172
181
|
}
|
|
182
|
+
async function loadConfig(moduleName, defaultConfig) {
|
|
183
|
+
const configExplorer = cosmiconfig.cosmiconfig(moduleName, {
|
|
184
|
+
searchStrategy: 'project'
|
|
185
|
+
});
|
|
186
|
+
try {
|
|
187
|
+
const cosmiconfigResult = await configExplorer.search();
|
|
188
|
+
const mergedConfig = lodash__default["default"].merge(defaultConfig, cosmiconfigResult === null || cosmiconfigResult === void 0 ? void 0 : cosmiconfigResult.config);
|
|
189
|
+
console.log("\u2139\uFE0F Merged and loaded cosmiconfig file for '".concat(moduleName, "'."));
|
|
190
|
+
return mergedConfig;
|
|
191
|
+
} catch (e) {
|
|
192
|
+
var _context, _context2;
|
|
193
|
+
console.warn(e);
|
|
194
|
+
throw new Error(_concatInstanceProperty__default["default"](_context = _concatInstanceProperty__default["default"](_context2 = "Failed loading a ".concat(moduleName, " configuration. Create a cosmiconfig for '")).call(_context2, moduleName, "' for example '")).call(_context, moduleName, ".config.cjs.'"));
|
|
195
|
+
}
|
|
196
|
+
}
|
|
173
197
|
|
|
174
198
|
exports.bucketEnvironments = bucketEnvironments;
|
|
175
199
|
exports.bucketRegions = bucketRegions;
|
|
176
200
|
exports.clusterContexts = clusterContexts;
|
|
177
201
|
exports.defineStorageBucketsConfig = defineStorageBucketsConfig;
|
|
202
|
+
exports.loadConfig = loadConfig;
|
|
178
203
|
exports.loadStorageBucketsConfig = loadStorageBucketsConfig;
|
|
179
204
|
exports.storageProviders = storageProviders;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@commercetools-frontend/application-cli",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"description": "Internal CLI to manage Merchant Center application deployments across various environments.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"commercetools",
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
"module": "dist/commercetools-frontend-application-cli.esm.js",
|
|
13
13
|
"bin": "bin/cli.js",
|
|
14
14
|
"files": [
|
|
15
|
+
"bin",
|
|
15
16
|
"cli",
|
|
16
17
|
"dist",
|
|
17
18
|
"package.json",
|
|
@@ -22,26 +23,30 @@
|
|
|
22
23
|
"@babel/core": "^7.22.11",
|
|
23
24
|
"@babel/runtime": "^7.21.0",
|
|
24
25
|
"@babel/runtime-corejs3": "^7.21.0",
|
|
25
|
-
"@commercetools-frontend/application-config": "22.
|
|
26
|
-
"@commercetools-frontend/constants": "22.
|
|
27
|
-
"@commercetools-frontend/l10n": "22.
|
|
26
|
+
"@commercetools-frontend/application-config": "22.27.0",
|
|
27
|
+
"@commercetools-frontend/constants": "22.27.0",
|
|
28
|
+
"@commercetools-frontend/l10n": "22.27.0",
|
|
28
29
|
"@manypkg/find-root": "2.2.1",
|
|
29
30
|
"cac": "^6.7.14",
|
|
30
31
|
"cosmiconfig": "9.0.0",
|
|
31
32
|
"dotenv": "16.4.5",
|
|
32
33
|
"execa": "5.1.1",
|
|
33
34
|
"jsonschema": "^1.4.1",
|
|
34
|
-
"listr2": "8.2.
|
|
35
|
+
"listr2": "8.2.1",
|
|
36
|
+
"lodash": "4.17.21",
|
|
37
|
+
"micromatch": "4.0.7",
|
|
35
38
|
"node-fetch": "2.7.0",
|
|
36
39
|
"ts-deepmerge": "7.0.0"
|
|
37
40
|
},
|
|
38
41
|
"devDependencies": {
|
|
39
42
|
"@tsconfig/node20": "20.1.4",
|
|
40
|
-
"@types/
|
|
43
|
+
"@types/lodash": "^4.14.198",
|
|
44
|
+
"@types/micromatch": "4.0.7",
|
|
45
|
+
"@types/node": "20.12.12",
|
|
41
46
|
"typescript": "5.2.2"
|
|
42
47
|
},
|
|
43
48
|
"engines": {
|
|
44
|
-
"node": ">=
|
|
49
|
+
"node": ">=21",
|
|
45
50
|
"npm": ">=6"
|
|
46
51
|
},
|
|
47
52
|
"publishConfig": {
|