@commercetools-frontend/application-config 22.36.0 → 22.38.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/custom-application.schema.json +33 -33
- package/custom-view.schema.json +28 -28
- package/dist/commercetools-frontend-application-config.cjs.dev.js +128 -118
- package/dist/commercetools-frontend-application-config.cjs.prod.js +128 -118
- package/dist/commercetools-frontend-application-config.esm.js +125 -117
- package/dist/declarations/src/load-config.d.ts +5 -2
- package/dist/declarations/src/process-config.d.ts +1 -1
- package/dist/declarations/src/schemas/generated/custom-application.schema.d.ts +32 -32
- package/dist/declarations/src/schemas/generated/custom-view.schema.d.ts +27 -27
- package/package.json +7 -8
- package/scripts/load-js-module.js +0 -34
|
@@ -2,93 +2,93 @@
|
|
|
2
2
|
export type CspDirective = string[];
|
|
3
3
|
export interface JSONSchemaForCustomApplicationConfigurationFiles {
|
|
4
4
|
/**
|
|
5
|
-
* See https://docs.commercetools.com/merchant-center-customizations/
|
|
5
|
+
* See https://docs.commercetools.com/merchant-center-customizations/tooling-and-configuration/custom-application-config#name
|
|
6
6
|
*/
|
|
7
7
|
name: string;
|
|
8
8
|
/**
|
|
9
|
-
* See https://docs.commercetools.com/merchant-center-customizations/
|
|
9
|
+
* See https://docs.commercetools.com/merchant-center-customizations/tooling-and-configuration/custom-application-config#description
|
|
10
10
|
*/
|
|
11
11
|
description?: string;
|
|
12
12
|
/**
|
|
13
|
-
* See https://docs.commercetools.com/merchant-center-customizations/
|
|
13
|
+
* See https://docs.commercetools.com/merchant-center-customizations/tooling-and-configuration/custom-application-config#entrypointuripath
|
|
14
14
|
*/
|
|
15
15
|
entryPointUriPath: string;
|
|
16
16
|
/**
|
|
17
|
-
* See https://docs.commercetools.com/merchant-center-customizations/
|
|
17
|
+
* See https://docs.commercetools.com/merchant-center-customizations/tooling-and-configuration/custom-application-config#cloudidentifier
|
|
18
18
|
*/
|
|
19
19
|
cloudIdentifier: string;
|
|
20
20
|
/**
|
|
21
|
-
* See https://docs.commercetools.com/merchant-center-customizations/
|
|
21
|
+
* See https://docs.commercetools.com/merchant-center-customizations/tooling-and-configuration/custom-application-config#mcapiurl
|
|
22
22
|
*/
|
|
23
23
|
mcApiUrl?: string;
|
|
24
24
|
/**
|
|
25
|
-
* See https://docs.commercetools.com/merchant-center-customizations/
|
|
25
|
+
* See https://docs.commercetools.com/merchant-center-customizations/tooling-and-configuration/custom-application-config#oauthscopes
|
|
26
26
|
*/
|
|
27
27
|
oAuthScopes: {
|
|
28
28
|
/**
|
|
29
|
-
* See https://docs.commercetools.com/merchant-center-customizations/
|
|
29
|
+
* See https://docs.commercetools.com/merchant-center-customizations/tooling-and-configuration/custom-application-config#oauthscopesview
|
|
30
30
|
*/
|
|
31
31
|
view: string[];
|
|
32
32
|
/**
|
|
33
|
-
* See https://docs.commercetools.com/merchant-center-customizations/
|
|
33
|
+
* See https://docs.commercetools.com/merchant-center-customizations/tooling-and-configuration/custom-application-config#oauthscopesmanage
|
|
34
34
|
*/
|
|
35
35
|
manage: string[];
|
|
36
36
|
};
|
|
37
37
|
/**
|
|
38
|
-
* See https://docs.commercetools.com/merchant-center-customizations/
|
|
38
|
+
* See https://docs.commercetools.com/merchant-center-customizations/tooling-and-configuration/custom-application-config#additionaloauthscopes
|
|
39
39
|
*/
|
|
40
40
|
additionalOAuthScopes?: {
|
|
41
41
|
/**
|
|
42
|
-
* See https://docs.commercetools.com/merchant-center-customizations/
|
|
42
|
+
* See https://docs.commercetools.com/merchant-center-customizations/tooling-and-configuration/custom-application-config#additionaloauthscopesname
|
|
43
43
|
*/
|
|
44
44
|
name: string;
|
|
45
45
|
/**
|
|
46
|
-
* See https://docs.commercetools.com/merchant-center-customizations/
|
|
46
|
+
* See https://docs.commercetools.com/merchant-center-customizations/tooling-and-configuration/custom-application-config#additionaloauthscopesview
|
|
47
47
|
*/
|
|
48
48
|
view: string[];
|
|
49
49
|
/**
|
|
50
|
-
* See https://docs.commercetools.com/merchant-center-customizations/
|
|
50
|
+
* See https://docs.commercetools.com/merchant-center-customizations/tooling-and-configuration/custom-application-config#additionaloauthscopesmanage
|
|
51
51
|
*/
|
|
52
52
|
manage: string[];
|
|
53
53
|
}[];
|
|
54
54
|
/**
|
|
55
|
-
* See https://docs.commercetools.com/merchant-center-customizations/
|
|
55
|
+
* See https://docs.commercetools.com/merchant-center-customizations/tooling-and-configuration/custom-application-config#env
|
|
56
56
|
*/
|
|
57
57
|
env: {
|
|
58
58
|
development: {
|
|
59
59
|
/**
|
|
60
|
-
* See https://docs.commercetools.com/merchant-center-customizations/
|
|
60
|
+
* See https://docs.commercetools.com/merchant-center-customizations/tooling-and-configuration/custom-application-config#envdevelopmentinitialprojectkey
|
|
61
61
|
*/
|
|
62
62
|
initialProjectKey: string;
|
|
63
63
|
teamId?: string;
|
|
64
64
|
};
|
|
65
65
|
production: {
|
|
66
66
|
/**
|
|
67
|
-
* See https://docs.commercetools.com/merchant-center-customizations/
|
|
67
|
+
* See https://docs.commercetools.com/merchant-center-customizations/tooling-and-configuration/custom-application-config#envproductionapplicationid
|
|
68
68
|
*/
|
|
69
69
|
applicationId: string;
|
|
70
70
|
/**
|
|
71
|
-
* See https://docs.commercetools.com/merchant-center-customizations/
|
|
71
|
+
* See https://docs.commercetools.com/merchant-center-customizations/tooling-and-configuration/custom-application-config#envproductionurl
|
|
72
72
|
*/
|
|
73
73
|
url: string;
|
|
74
74
|
/**
|
|
75
|
-
* See https://docs.commercetools.com/merchant-center-customizations/
|
|
75
|
+
* See https://docs.commercetools.com/merchant-center-customizations/tooling-and-configuration/custom-application-config#envproductioncdnurl
|
|
76
76
|
*/
|
|
77
77
|
cdnUrl?: string;
|
|
78
78
|
};
|
|
79
79
|
};
|
|
80
80
|
/**
|
|
81
|
-
* See https://docs.commercetools.com/merchant-center-customizations/
|
|
81
|
+
* See https://docs.commercetools.com/merchant-center-customizations/tooling-and-configuration/custom-application-config#additionalenv
|
|
82
82
|
*/
|
|
83
83
|
additionalEnv?: {
|
|
84
84
|
[k: string]: unknown;
|
|
85
85
|
};
|
|
86
86
|
/**
|
|
87
|
-
* See https://docs.commercetools.com/merchant-center-customizations/
|
|
87
|
+
* See https://docs.commercetools.com/merchant-center-customizations/tooling-and-configuration/custom-application-config#headers
|
|
88
88
|
*/
|
|
89
89
|
headers?: {
|
|
90
90
|
/**
|
|
91
|
-
* See https://docs.commercetools.com/merchant-center-customizations/
|
|
91
|
+
* See https://docs.commercetools.com/merchant-center-customizations/tooling-and-configuration/custom-application-config#headerscsp
|
|
92
92
|
*/
|
|
93
93
|
csp?: {
|
|
94
94
|
'connect-src': CspDirective;
|
|
@@ -99,62 +99,62 @@ export interface JSONSchemaForCustomApplicationConfigurationFiles {
|
|
|
99
99
|
'frame-src'?: CspDirective;
|
|
100
100
|
};
|
|
101
101
|
/**
|
|
102
|
-
* See https://docs.commercetools.com/merchant-center-customizations/
|
|
102
|
+
* See https://docs.commercetools.com/merchant-center-customizations/tooling-and-configuration/custom-application-config#headerspermissionspolicies
|
|
103
103
|
*/
|
|
104
104
|
permissionsPolicies?: {
|
|
105
105
|
[k: string]: unknown;
|
|
106
106
|
};
|
|
107
107
|
/**
|
|
108
|
-
*
|
|
108
|
+
* @deprecated
|
|
109
109
|
*/
|
|
110
110
|
strictTransportSecurity?: ('includeSubDomains' | 'preload')[];
|
|
111
111
|
};
|
|
112
112
|
/**
|
|
113
|
-
* See https://docs.commercetools.com/merchant-center-customizations/
|
|
113
|
+
* See https://docs.commercetools.com/merchant-center-customizations/tooling-and-configuration/custom-application-config#icon
|
|
114
114
|
*/
|
|
115
115
|
icon: string;
|
|
116
116
|
/**
|
|
117
|
-
* See https://docs.commercetools.com/merchant-center-customizations/
|
|
117
|
+
* See https://docs.commercetools.com/merchant-center-customizations/tooling-and-configuration/custom-application-config#mainmenulink
|
|
118
118
|
*/
|
|
119
119
|
mainMenuLink: {
|
|
120
120
|
/**
|
|
121
|
-
* See https://docs.commercetools.com/merchant-center-customizations/
|
|
121
|
+
* See https://docs.commercetools.com/merchant-center-customizations/tooling-and-configuration/custom-application-config#mainmenulinkdefaultlabel
|
|
122
122
|
*/
|
|
123
123
|
defaultLabel: string;
|
|
124
124
|
/**
|
|
125
|
-
* See https://docs.commercetools.com/merchant-center-customizations/
|
|
125
|
+
* See https://docs.commercetools.com/merchant-center-customizations/tooling-and-configuration/custom-application-config#mainmenulinklabelalllocales
|
|
126
126
|
*/
|
|
127
127
|
labelAllLocales: {
|
|
128
128
|
locale: 'en' | 'de' | 'es' | 'fr-FR' | 'pt-BR';
|
|
129
129
|
value: string;
|
|
130
130
|
}[];
|
|
131
131
|
/**
|
|
132
|
-
* See https://docs.commercetools.com/merchant-center-customizations/
|
|
132
|
+
* See https://docs.commercetools.com/merchant-center-customizations/tooling-and-configuration/custom-application-config#mainmenulinkpermissions
|
|
133
133
|
*/
|
|
134
134
|
permissions: string[];
|
|
135
135
|
[k: string]: unknown;
|
|
136
136
|
};
|
|
137
137
|
/**
|
|
138
|
-
* See https://docs.commercetools.com/merchant-center-customizations/
|
|
138
|
+
* See https://docs.commercetools.com/merchant-center-customizations/tooling-and-configuration/custom-application-config#submenulinks
|
|
139
139
|
*/
|
|
140
140
|
submenuLinks: {
|
|
141
141
|
/**
|
|
142
|
-
* See https://docs.commercetools.com/merchant-center-customizations/
|
|
142
|
+
* See https://docs.commercetools.com/merchant-center-customizations/tooling-and-configuration/custom-application-config#submenulinksuripath
|
|
143
143
|
*/
|
|
144
144
|
uriPath: string;
|
|
145
145
|
/**
|
|
146
|
-
* See https://docs.commercetools.com/merchant-center-customizations/
|
|
146
|
+
* See https://docs.commercetools.com/merchant-center-customizations/tooling-and-configuration/custom-application-config#submenulinksdefaultlabel
|
|
147
147
|
*/
|
|
148
148
|
defaultLabel: string;
|
|
149
149
|
/**
|
|
150
|
-
* See https://docs.commercetools.com/merchant-center-customizations/
|
|
150
|
+
* See https://docs.commercetools.com/merchant-center-customizations/tooling-and-configuration/custom-application-config#submenulinkslabelalllocales
|
|
151
151
|
*/
|
|
152
152
|
labelAllLocales: {
|
|
153
153
|
locale: 'en' | 'de' | 'es' | 'fr-FR' | 'pt-BR';
|
|
154
154
|
value: string;
|
|
155
155
|
}[];
|
|
156
156
|
/**
|
|
157
|
-
* See https://docs.commercetools.com/merchant-center-customizations/
|
|
157
|
+
* See https://docs.commercetools.com/merchant-center-customizations/tooling-and-configuration/custom-application-config#submenulinkspermissions
|
|
158
158
|
*/
|
|
159
159
|
permissions: string[];
|
|
160
160
|
[k: string]: unknown;
|
|
@@ -2,93 +2,93 @@
|
|
|
2
2
|
export type CspDirective = string[];
|
|
3
3
|
export interface JSONSchemaForCustomViewConfigurationFiles {
|
|
4
4
|
/**
|
|
5
|
-
* See https://docs.commercetools.com/
|
|
5
|
+
* See https://docs.commercetools.com/merchant-center-customizations/tooling-and-configuration/custom-view-config#name
|
|
6
6
|
*/
|
|
7
7
|
name: string;
|
|
8
8
|
/**
|
|
9
|
-
* See https://docs.commercetools.com/
|
|
9
|
+
* See https://docs.commercetools.com/merchant-center-customizations/tooling-and-configuration/custom-view-config#description
|
|
10
10
|
*/
|
|
11
11
|
description?: string;
|
|
12
12
|
/**
|
|
13
|
-
* See https://docs.commercetools.com/
|
|
13
|
+
* See https://docs.commercetools.com/merchant-center-customizations/tooling-and-configuration/custom-view-config#cloudidentifier
|
|
14
14
|
*/
|
|
15
15
|
cloudIdentifier: string;
|
|
16
16
|
/**
|
|
17
|
-
* See https://docs.commercetools.com/
|
|
17
|
+
* See https://docs.commercetools.com/merchant-center-customizations/tooling-and-configuration/custom-view-config#mcapiurl
|
|
18
18
|
*/
|
|
19
19
|
mcApiUrl?: string;
|
|
20
20
|
/**
|
|
21
|
-
* See https://docs.commercetools.com/
|
|
21
|
+
* See https://docs.commercetools.com/merchant-center-customizations/tooling-and-configuration/custom-view-config#oauthscopes
|
|
22
22
|
*/
|
|
23
23
|
oAuthScopes: {
|
|
24
24
|
/**
|
|
25
|
-
* See https://docs.commercetools.com/
|
|
25
|
+
* See https://docs.commercetools.com/merchant-center-customizations/tooling-and-configuration/custom-view-config#oauthscopesview
|
|
26
26
|
*/
|
|
27
27
|
view: string[];
|
|
28
28
|
/**
|
|
29
|
-
* See https://docs.commercetools.com/
|
|
29
|
+
* See https://docs.commercetools.com/merchant-center-customizations/tooling-and-configuration/custom-view-config#oauthscopesmanage
|
|
30
30
|
*/
|
|
31
31
|
manage: string[];
|
|
32
32
|
};
|
|
33
33
|
/**
|
|
34
|
-
* See https://docs.commercetools.com/
|
|
34
|
+
* See https://docs.commercetools.com/merchant-center-customizations/tooling-and-configuration/custom-view-config#additionaloauthscopes
|
|
35
35
|
*/
|
|
36
36
|
additionalOAuthScopes?: {
|
|
37
37
|
/**
|
|
38
|
-
* See https://docs.commercetools.com/
|
|
38
|
+
* See https://docs.commercetools.com/merchant-center-customizations/tooling-and-configuration/custom-view-config#additionaloauthscopesname
|
|
39
39
|
*/
|
|
40
40
|
name: string;
|
|
41
41
|
/**
|
|
42
|
-
* See https://docs.commercetools.com/
|
|
42
|
+
* See https://docs.commercetools.com/merchant-center-customizations/tooling-and-configuration/custom-view-config#additionaloauthscopesview
|
|
43
43
|
*/
|
|
44
44
|
view: string[];
|
|
45
45
|
/**
|
|
46
|
-
* See https://docs.commercetools.com/
|
|
46
|
+
* See https://docs.commercetools.com/merchant-center-customizations/tooling-and-configuration/custom-view-config#additionaloauthscopesmanage
|
|
47
47
|
*/
|
|
48
48
|
manage: string[];
|
|
49
49
|
}[];
|
|
50
50
|
/**
|
|
51
|
-
* See https://docs.commercetools.com/
|
|
51
|
+
* See https://docs.commercetools.com/merchant-center-customizations/tooling-and-configuration/custom-view-config#env
|
|
52
52
|
*/
|
|
53
53
|
env: {
|
|
54
54
|
development: {
|
|
55
55
|
/**
|
|
56
|
-
* See https://docs.commercetools.com/
|
|
56
|
+
* See https://docs.commercetools.com/merchant-center-customizations/tooling-and-configuration/custom-view-config#envdevelopmentinitialprojectkey
|
|
57
57
|
*/
|
|
58
58
|
initialProjectKey: string;
|
|
59
59
|
teamId?: string;
|
|
60
60
|
/**
|
|
61
|
-
* See https://docs.commercetools.com/
|
|
61
|
+
* See https://docs.commercetools.com/merchant-center-customizations/tooling-and-configuration/custom-view-config#envdevelopmenthosturipath
|
|
62
62
|
*/
|
|
63
63
|
hostUriPath?: string;
|
|
64
64
|
};
|
|
65
65
|
production: {
|
|
66
66
|
/**
|
|
67
|
-
* See https://docs.commercetools.com/
|
|
67
|
+
* See https://docs.commercetools.com/merchant-center-customizations/tooling-and-configuration/custom-view-config#envproductioncustomviewid
|
|
68
68
|
*/
|
|
69
69
|
customViewId: string;
|
|
70
70
|
/**
|
|
71
|
-
* See https://docs.commercetools.com/
|
|
71
|
+
* See https://docs.commercetools.com/merchant-center-customizations/tooling-and-configuration/custom-view-config#envproductionurl
|
|
72
72
|
*/
|
|
73
73
|
url: string;
|
|
74
74
|
/**
|
|
75
|
-
* See https://docs.commercetools.com/
|
|
75
|
+
* See https://docs.commercetools.com/merchant-center-customizations/tooling-and-configuration/custom-view-config#envproductioncdnurl
|
|
76
76
|
*/
|
|
77
77
|
cdnUrl?: string;
|
|
78
78
|
};
|
|
79
79
|
};
|
|
80
80
|
/**
|
|
81
|
-
* See https://docs.commercetools.com/
|
|
81
|
+
* See https://docs.commercetools.com/merchant-center-customizations/tooling-and-configuration/custom-view-config#additionalenv
|
|
82
82
|
*/
|
|
83
83
|
additionalEnv?: {
|
|
84
84
|
[k: string]: unknown;
|
|
85
85
|
};
|
|
86
86
|
/**
|
|
87
|
-
* See https://docs.commercetools.com/
|
|
87
|
+
* See https://docs.commercetools.com/merchant-center-customizations/tooling-and-configuration/custom-view-config#headers
|
|
88
88
|
*/
|
|
89
89
|
headers?: {
|
|
90
90
|
/**
|
|
91
|
-
* See https://docs.commercetools.com/
|
|
91
|
+
* See https://docs.commercetools.com/merchant-center-customizations/tooling-and-configuration/custom-view-config#headerscsp
|
|
92
92
|
*/
|
|
93
93
|
csp?: {
|
|
94
94
|
'connect-src': CspDirective;
|
|
@@ -99,39 +99,39 @@ export interface JSONSchemaForCustomViewConfigurationFiles {
|
|
|
99
99
|
'frame-src'?: CspDirective;
|
|
100
100
|
};
|
|
101
101
|
/**
|
|
102
|
-
* See https://docs.commercetools.com/
|
|
102
|
+
* See https://docs.commercetools.com/merchant-center-customizations/tooling-and-configuration/custom-view-config#headerspermissionspolicies
|
|
103
103
|
*/
|
|
104
104
|
permissionsPolicies?: {
|
|
105
105
|
[k: string]: unknown;
|
|
106
106
|
};
|
|
107
107
|
/**
|
|
108
|
-
*
|
|
108
|
+
* @deprecated
|
|
109
109
|
*/
|
|
110
110
|
strictTransportSecurity?: ('includeSubDomains' | 'preload')[];
|
|
111
111
|
};
|
|
112
112
|
/**
|
|
113
|
-
* See https://docs.commercetools.com/
|
|
113
|
+
* See https://docs.commercetools.com/merchant-center-customizations/tooling-and-configuration/custom-view-config#labelalllocales
|
|
114
114
|
*/
|
|
115
115
|
labelAllLocales: {
|
|
116
116
|
locale: 'en' | 'de' | 'es' | 'fr-FR' | 'pt-BR';
|
|
117
117
|
value: string;
|
|
118
118
|
}[];
|
|
119
119
|
/**
|
|
120
|
-
* See https://docs.commercetools.com/
|
|
120
|
+
* See https://docs.commercetools.com/merchant-center-customizations/tooling-and-configuration/custom-view-config#type
|
|
121
121
|
*/
|
|
122
122
|
type: 'CustomPanel';
|
|
123
123
|
/**
|
|
124
|
-
* See https://docs.commercetools.com/
|
|
124
|
+
* See https://docs.commercetools.com/merchant-center-customizations/tooling-and-configuration/custom-view-config#typesettings
|
|
125
125
|
*/
|
|
126
126
|
typeSettings?: {
|
|
127
127
|
/**
|
|
128
|
-
* See https://docs.commercetools.com/
|
|
128
|
+
* See https://docs.commercetools.com/merchant-center-customizations/tooling-and-configuration/custom-view-config#typesettingssize
|
|
129
129
|
*/
|
|
130
130
|
size?: 'SMALL' | 'LARGE';
|
|
131
131
|
[k: string]: unknown;
|
|
132
132
|
};
|
|
133
133
|
/**
|
|
134
|
-
* See https://docs.commercetools.com/
|
|
134
|
+
* See https://docs.commercetools.com/merchant-center-customizations/tooling-and-configuration/custom-view-config#locators
|
|
135
135
|
*/
|
|
136
136
|
locators: string[];
|
|
137
137
|
[k: string]: unknown;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@commercetools-frontend/application-config",
|
|
3
|
-
"version": "22.
|
|
3
|
+
"version": "22.38.0",
|
|
4
4
|
"description": "Configuration utilities for building Custom Applications",
|
|
5
5
|
"bugs": "https://github.com/commercetools/merchant-center-application-kit/issues",
|
|
6
6
|
"repository": {
|
|
@@ -45,14 +45,14 @@
|
|
|
45
45
|
"@babel/register": "^7.22.15",
|
|
46
46
|
"@babel/runtime": "^7.22.15",
|
|
47
47
|
"@babel/runtime-corejs3": "^7.22.15",
|
|
48
|
-
"@commercetools-frontend/
|
|
49
|
-
"@commercetools-frontend/constants": "22.36.0",
|
|
48
|
+
"@commercetools-frontend/constants": "22.38.0",
|
|
50
49
|
"@types/dompurify": "^2.4.0",
|
|
51
50
|
"@types/lodash": "^4.14.198",
|
|
52
|
-
"@types/react": "^17.0.
|
|
51
|
+
"@types/react": "^17.0.83",
|
|
53
52
|
"ajv": "8.16.0",
|
|
54
53
|
"core-js": "^3.32.2",
|
|
55
|
-
"cosmiconfig": "
|
|
54
|
+
"cosmiconfig": "9.0.0",
|
|
55
|
+
"cosmiconfig-typescript-loader": "6.1.0",
|
|
56
56
|
"dompurify": "^2.4.7",
|
|
57
57
|
"jsdom": "^21.1.2",
|
|
58
58
|
"lodash": "4.17.21",
|
|
@@ -60,9 +60,8 @@
|
|
|
60
60
|
},
|
|
61
61
|
"devDependencies": {
|
|
62
62
|
"@types/jsdom": "^21.1.2",
|
|
63
|
-
"json-schema-to-typescript": "
|
|
64
|
-
"
|
|
65
|
-
"@commercetools-frontend/assets": "22.36.0"
|
|
63
|
+
"json-schema-to-typescript": "15.0.3",
|
|
64
|
+
"@commercetools-frontend/assets": "22.38.0"
|
|
66
65
|
},
|
|
67
66
|
"engines": {
|
|
68
67
|
"node": "16.x || >=18.0.0"
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This script file is used to load and parse a JS module in a child process,
|
|
3
|
-
* to isolate the Babel configuration from the main program and avoid causing
|
|
4
|
-
* unnecessary issues.
|
|
5
|
-
*
|
|
6
|
-
* NOTE: keep this file as a `.js` file, as we want to be able to run this
|
|
7
|
-
* in any Node environment.
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
// Ensure there is a babel/node environment variable set, otherwise the
|
|
11
|
-
// babel preset throws an error.
|
|
12
|
-
process.env.BABEL_ENV = 'development';
|
|
13
|
-
|
|
14
|
-
const get = require('lodash/get');
|
|
15
|
-
|
|
16
|
-
// Load JS modules using Babel, as we need to load
|
|
17
|
-
// the config synchronously with `require`, no `await import`.
|
|
18
|
-
require('@babel/register')({
|
|
19
|
-
babelrc: false,
|
|
20
|
-
extensions: ['.js', '.cjs', '.mjs', '.ts'],
|
|
21
|
-
presets: ['@commercetools-frontend/babel-preset-mc-app'],
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
// The file to `require` is passed as the main argument to this script file.
|
|
25
|
-
const [filePath] = process.argv.slice(2);
|
|
26
|
-
|
|
27
|
-
// Require the module. It's expected that the module exports the application config
|
|
28
|
-
const moduleExport = require(filePath);
|
|
29
|
-
|
|
30
|
-
// In case we are loading an ES module, we need to pick the `default` export.
|
|
31
|
-
const result = get(moduleExport, 'default', moduleExport);
|
|
32
|
-
|
|
33
|
-
// Write the application config to `stdout`so that the main program can read it.
|
|
34
|
-
process.stdout.write(JSON.stringify(result));
|