@commercetools-frontend/application-cli 2.0.0 → 2.1.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 +34 -29
- package/cli/dist/commercetools-frontend-application-cli-cli.cjs.dev.js +37 -41
- package/cli/dist/commercetools-frontend-application-cli-cli.cjs.prod.js +37 -41
- package/cli/dist/commercetools-frontend-application-cli-cli.esm.js +34 -40
- package/dist/commercetools-frontend-application-cli.cjs.dev.js +13 -0
- package/dist/commercetools-frontend-application-cli.cjs.prod.js +13 -0
- package/dist/commercetools-frontend-application-cli.esm.js +4 -1
- package/dist/declarations/src/constants.d.ts +34 -0
- package/dist/declarations/src/index.d.ts +2 -0
- package/dist/declarations/src/storage-buckets-config.d.ts +11 -0
- package/dist/declarations/src/types.d.ts +17 -16
- package/dist/storage-buckets-config-0b3808a3.cjs.prod.js +111 -0
- package/dist/storage-buckets-config-478b8585.cjs.dev.js +111 -0
- package/dist/storage-buckets-config-7845a091.esm.js +101 -0
- package/package.json +7 -6
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import _forEachInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/for-each';
|
|
2
|
+
import _Object$keys from '@babel/runtime-corejs3/core-js-stable/object/keys';
|
|
3
|
+
import { merge } from 'ts-deepmerge';
|
|
4
|
+
|
|
5
|
+
const clusterContexts = {
|
|
6
|
+
'ctp_staging_gcp_europe-west1_v1': 'ctp_staging_gcp_europe-west1_v1',
|
|
7
|
+
'vw_staging_aws_eu-central-1_v1': 'vw_staging_aws_eu-central-1_v1',
|
|
8
|
+
'ctp_staging_aws_cn-northwest-1_v1': 'ctp_staging_aws_cn-northwest-1_v1',
|
|
9
|
+
'ctp_testing_performance_gcp_europe-west1_v1': 'ctp_testing_performance_gcp_europe-west1_v1',
|
|
10
|
+
'ctp_production_aws_eu-central-1_v1': 'ctp_production_aws_eu-central-1_v1',
|
|
11
|
+
'ctp_production_gcp_europe-west1_v1': 'ctp_production_gcp_europe-west1_v1',
|
|
12
|
+
'vw_production_aws_eu-central-1_v1': 'vw_production_aws_eu-central-1_v1',
|
|
13
|
+
'att_production_aws_us-east-1_v1': 'att_production_aws_us-east-1_v1',
|
|
14
|
+
'ctp_production_aws_us-east-2_v1': 'ctp_production_aws_us-east-2_v1',
|
|
15
|
+
'ctp_production_gcp_us-central1_v1': 'ctp_production_gcp_us-central1_v1',
|
|
16
|
+
'ctp_production_gcp_australia-southeast1_v1': 'ctp_production_gcp_australia-southeast1_v1',
|
|
17
|
+
'ctp_production_aws_cn-northwest-1_v1': 'ctp_production_aws_cn-northwest-1_v1'
|
|
18
|
+
};
|
|
19
|
+
const bucketEnvironments = {
|
|
20
|
+
'ctp-gcp-staging': 'ctp-gcp-staging',
|
|
21
|
+
'ctp-vw-staging-eu': 'ctp-vw-staging-eu',
|
|
22
|
+
'ctp-aws-staging-cn': 'ctp-aws-staging-cn',
|
|
23
|
+
'ctp-gcp-testing-performance-eu': 'ctp-gcp-testing-performance-eu',
|
|
24
|
+
'ctp-aws-production-fra': 'ctp-aws-production-fra',
|
|
25
|
+
'ctp-gcp-production-eu': 'ctp-gcp-production-eu',
|
|
26
|
+
'ctp-vw-production-eu': 'ctp-vw-production-eu',
|
|
27
|
+
'ctp-att-production-va': 'ctp-att-production-va',
|
|
28
|
+
'ctp-aws-production-ohio': 'ctp-aws-production-ohio',
|
|
29
|
+
'ctp-gcp-production-us': 'ctp-gcp-production-us',
|
|
30
|
+
'ctp-gcp-production-au': 'ctp-gcp-production-au',
|
|
31
|
+
'ctp-aws-production-cn': 'ctp-aws-production-cn'
|
|
32
|
+
};
|
|
33
|
+
const bucketRegions = {
|
|
34
|
+
previews: 'merchant-center-previews',
|
|
35
|
+
europe: 'merchant-center-europe',
|
|
36
|
+
northAmerica: 'merchant-center-north-america',
|
|
37
|
+
asia: 'merchant-center-asia'
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
const defaultConfig = {
|
|
41
|
+
[bucketRegions.previews]: [{
|
|
42
|
+
cloudEnvironment: clusterContexts['ctp_staging_gcp_europe-west1_v1'],
|
|
43
|
+
bucketEnvironment: bucketEnvironments['ctp-gcp-staging']
|
|
44
|
+
}, {
|
|
45
|
+
cloudEnvironment: clusterContexts['vw_staging_aws_eu-central-1_v1'],
|
|
46
|
+
bucketEnvironment: bucketEnvironments['ctp-vw-staging-eu']
|
|
47
|
+
}, {
|
|
48
|
+
cloudEnvironment: clusterContexts['ctp_staging_aws_cn-northwest-1_v1'],
|
|
49
|
+
bucketEnvironment: bucketEnvironments['ctp-aws-staging-cn']
|
|
50
|
+
}, {
|
|
51
|
+
cloudEnvironment: clusterContexts['ctp_testing_performance_gcp_europe-west1_v1'],
|
|
52
|
+
bucketEnvironment: bucketEnvironments['ctp-gcp-testing-performance-eu']
|
|
53
|
+
}],
|
|
54
|
+
[bucketRegions.europe]: [{
|
|
55
|
+
cloudEnvironment: clusterContexts['ctp_production_aws_eu-central-1_v1'],
|
|
56
|
+
bucketEnvironment: bucketEnvironments['ctp-aws-production-fra']
|
|
57
|
+
}, {
|
|
58
|
+
cloudEnvironment: clusterContexts['ctp_production_gcp_europe-west1_v1'],
|
|
59
|
+
bucketEnvironment: bucketEnvironments['ctp-gcp-production-eu']
|
|
60
|
+
}, {
|
|
61
|
+
cloudEnvironment: clusterContexts['vw_production_aws_eu-central-1_v1'],
|
|
62
|
+
bucketEnvironment: bucketEnvironments['ctp-vw-production-eu']
|
|
63
|
+
}],
|
|
64
|
+
[bucketRegions.northAmerica]: [{
|
|
65
|
+
cloudEnvironment: clusterContexts['att_production_aws_us-east-1_v1'],
|
|
66
|
+
bucketEnvironment: bucketEnvironments['ctp-att-production-va']
|
|
67
|
+
}, {
|
|
68
|
+
cloudEnvironment: clusterContexts['ctp_production_aws_us-east-2_v1'],
|
|
69
|
+
bucketEnvironment: bucketEnvironments['ctp-aws-production-ohio']
|
|
70
|
+
}, {
|
|
71
|
+
cloudEnvironment: clusterContexts['ctp_production_gcp_us-central1_v1'],
|
|
72
|
+
bucketEnvironment: bucketEnvironments['ctp-gcp-production-us']
|
|
73
|
+
}],
|
|
74
|
+
[bucketRegions.asia]: [{
|
|
75
|
+
cloudEnvironment: clusterContexts['ctp_production_gcp_australia-southeast1_v1'],
|
|
76
|
+
bucketEnvironment: bucketEnvironments['ctp-gcp-production-au']
|
|
77
|
+
}, {
|
|
78
|
+
cloudEnvironment: clusterContexts['ctp_production_aws_cn-northwest-1_v1'],
|
|
79
|
+
bucketEnvironment: bucketEnvironments['ctp-aws-production-cn']
|
|
80
|
+
}]
|
|
81
|
+
};
|
|
82
|
+
function defineStorageBucketsConfig() {
|
|
83
|
+
let _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
84
|
+
regions = _ref.regions,
|
|
85
|
+
options = _ref.options;
|
|
86
|
+
const actualConfig = regions ? merge(defaultConfig, regions) : defaultConfig;
|
|
87
|
+
const disabledBucketRegions = options?.disabledBucketRegions ?? [];
|
|
88
|
+
const disabledEnvironments = options?.disabledEnvironments ?? [];
|
|
89
|
+
_forEachInstanceProperty(disabledBucketRegions).call(disabledBucketRegions, disabledBucketRegion => {
|
|
90
|
+
delete actualConfig[disabledBucketRegion];
|
|
91
|
+
});
|
|
92
|
+
const allBucketRegions = _Object$keys(actualConfig);
|
|
93
|
+
_forEachInstanceProperty(disabledEnvironments).call(disabledEnvironments, disabledEnvrionment => {
|
|
94
|
+
_forEachInstanceProperty(allBucketRegions).call(allBucketRegions, bucketRegionToBeRemoved => {
|
|
95
|
+
actualConfig[bucketRegionToBeRemoved] = actualConfig[bucketRegionToBeRemoved]?.filter(bucketEnvironmentConfig => bucketEnvironmentConfig.cloudEnvironment !== disabledEnvrionment);
|
|
96
|
+
});
|
|
97
|
+
});
|
|
98
|
+
return actualConfig;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
export { bucketRegions as a, bucketEnvironments as b, clusterContexts as c, defineStorageBucketsConfig as d };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@commercetools-frontend/application-cli",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.1.1",
|
|
4
4
|
"description": "Internal CLI to manage Merchant Center application deployments across various environments.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"commercetools",
|
|
@@ -20,11 +20,11 @@
|
|
|
20
20
|
],
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@babel/core": "^7.22.11",
|
|
23
|
-
"@babel/runtime": "^7.21.0",
|
|
24
23
|
"@babel/runtime-corejs3": "^7.21.0",
|
|
25
|
-
"@
|
|
26
|
-
"@commercetools-frontend/
|
|
27
|
-
"@commercetools-frontend/
|
|
24
|
+
"@babel/runtime": "^7.21.0",
|
|
25
|
+
"@commercetools-frontend/application-config": "22.17.0",
|
|
26
|
+
"@commercetools-frontend/constants": "22.17.0",
|
|
27
|
+
"@commercetools-frontend/l10n": "22.17.0",
|
|
28
28
|
"@manypkg/find-root": "2.2.1",
|
|
29
29
|
"cac": "^6.7.14",
|
|
30
30
|
"cosmiconfig": "9.0.0",
|
|
@@ -32,7 +32,8 @@
|
|
|
32
32
|
"execa": "5.1.1",
|
|
33
33
|
"jsonschema": "^1.4.1",
|
|
34
34
|
"listr2": "8.0.1",
|
|
35
|
-
"node-fetch": "2.7.0"
|
|
35
|
+
"node-fetch": "2.7.0",
|
|
36
|
+
"ts-deepmerge": "7.0.0"
|
|
36
37
|
},
|
|
37
38
|
"devDependencies": {
|
|
38
39
|
"@tsconfig/node20": "20.1.2",
|