@graphcommerce/next-config 8.1.0-canary.8 → 9.0.0-canary.54
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/CHANGELOG.md +138 -0
- package/Config.graphqls +5 -5
- package/__tests__/config/utils/__snapshots__/mergeEnvIntoConfig.ts.snap +48 -2
- package/__tests__/config/utils/configToImportMeta.ts +0 -4
- package/__tests__/config/utils/mergeEnvIntoConfig.ts +15 -2
- package/__tests__/config/utils/rewriteLegancyEnv.ts +1 -1
- package/__tests__/interceptors/findPlugins.ts +60 -126
- package/__tests__/interceptors/generateInterceptors.ts +136 -57
- package/__tests__/interceptors/parseStructure.ts +50 -0
- package/dist/config/demoConfig.js +5 -0
- package/dist/config/utils/mergeEnvIntoConfig.js +8 -1
- package/dist/generated/config.js +17 -9
- package/dist/interceptors/extractExports.js +21 -18
- package/dist/interceptors/findOriginalSource.js +17 -1
- package/dist/interceptors/generateInterceptor.js +3 -4
- package/dist/interceptors/parseStructure.js +9 -1
- package/dist/interceptors/writeInterceptors.js +7 -7
- package/dist/withGraphCommerce.js +13 -4
- package/package.json +1 -1
- package/src/config/demoConfig.ts +5 -0
- package/src/config/utils/mergeEnvIntoConfig.ts +9 -1
- package/src/generated/config.ts +56 -14
- package/src/interceptors/extractExports.ts +21 -21
- package/src/interceptors/findOriginalSource.ts +16 -1
- package/src/interceptors/generateInterceptor.ts +3 -5
- package/src/interceptors/parseStructure.ts +14 -1
- package/src/interceptors/writeInterceptors.ts +7 -7
- package/src/withGraphCommerce.ts +13 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,143 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
+
## 9.0.0-canary.54
|
|
4
|
+
|
|
5
|
+
## 8.1.0-canary.53
|
|
6
|
+
|
|
7
|
+
## 8.1.0-canary.52
|
|
8
|
+
|
|
9
|
+
## 8.1.0-canary.51
|
|
10
|
+
|
|
11
|
+
## 8.1.0-canary.50
|
|
12
|
+
|
|
13
|
+
## 8.1.0-canary.49
|
|
14
|
+
|
|
15
|
+
## 8.1.0-canary.48
|
|
16
|
+
|
|
17
|
+
## 8.1.0-canary.47
|
|
18
|
+
|
|
19
|
+
## 8.1.0-canary.46
|
|
20
|
+
|
|
21
|
+
### Minor Changes
|
|
22
|
+
|
|
23
|
+
- [#2313](https://github.com/graphcommerce-org/graphcommerce/pull/2313) [`511e75c`](https://github.com/graphcommerce-org/graphcommerce/commit/511e75c3f8c077e617ed17e5042796e2411f312f) - Add the customerNote field to the shipping and customer address forms
|
|
24
|
+
([@Giovanni-Schroevers](https://github.com/Giovanni-Schroevers))
|
|
25
|
+
|
|
26
|
+
### Patch Changes
|
|
27
|
+
|
|
28
|
+
- [#2314](https://github.com/graphcommerce-org/graphcommerce/pull/2314) [`ccd218c`](https://github.com/graphcommerce-org/graphcommerce/commit/ccd218c827d8ba7e632fa40ed75ad63a38620275) - Solve an issue where interceptors were immediately deleted after generating
|
|
29
|
+
([@paales](https://github.com/paales))
|
|
30
|
+
|
|
31
|
+
## 8.1.0-canary.45
|
|
32
|
+
|
|
33
|
+
## 8.1.0-canary.44
|
|
34
|
+
|
|
35
|
+
## 8.1.0-canary.43
|
|
36
|
+
|
|
37
|
+
## 8.1.0-canary.42
|
|
38
|
+
|
|
39
|
+
## 8.1.0-canary.41
|
|
40
|
+
|
|
41
|
+
### Patch Changes
|
|
42
|
+
|
|
43
|
+
- [#2242](https://github.com/graphcommerce-org/graphcommerce/pull/2242) [`a4cce76`](https://github.com/graphcommerce-org/graphcommerce/commit/a4cce76ca37af2bec604e953ada4bb11bd91f55d) - Add option to show an extended version of the pagination component. Configurable via the "productListPaginationVariant" key in your graphcommerce.config.js
|
|
44
|
+
COMPACT means: "< Page X of Y >"
|
|
45
|
+
EXTENDED means: "< 1 2 ... [5] ... 10 11 >" ([@FrankHarland](https://github.com/FrankHarland))
|
|
46
|
+
|
|
47
|
+
## 8.1.0-canary.40
|
|
48
|
+
|
|
49
|
+
### Minor Changes
|
|
50
|
+
|
|
51
|
+
- [#2306](https://github.com/graphcommerce-org/graphcommerce/pull/2306) [`5e188e8`](https://github.com/graphcommerce-org/graphcommerce/commit/5e188e830dca4730c73830858f59a94e9d41ed12) - Add delete account functionality to the account section. Disabled by default and can be enabled through the config.
|
|
52
|
+
([@Giovanni-Schroevers](https://github.com/Giovanni-Schroevers))
|
|
53
|
+
|
|
54
|
+
## 8.1.0-canary.39
|
|
55
|
+
|
|
56
|
+
## 8.1.0-canary.38
|
|
57
|
+
|
|
58
|
+
### Minor Changes
|
|
59
|
+
|
|
60
|
+
- [#2305](https://github.com/graphcommerce-org/graphcommerce/pull/2305) [`77e8297`](https://github.com/graphcommerce-org/graphcommerce/commit/77e82976816994336c616208a651cb18ce9ea270) - Add company and vat fields to shipping and billing forms
|
|
61
|
+
([@Giovanni-Schroevers](https://github.com/Giovanni-Schroevers))
|
|
62
|
+
|
|
63
|
+
## 8.1.0-canary.37
|
|
64
|
+
|
|
65
|
+
## 8.1.0-canary.36
|
|
66
|
+
|
|
67
|
+
## 8.1.0-canary.35
|
|
68
|
+
|
|
69
|
+
## 8.1.0-canary.34
|
|
70
|
+
|
|
71
|
+
## 8.1.0-canary.33
|
|
72
|
+
|
|
73
|
+
## 8.1.0-canary.32
|
|
74
|
+
|
|
75
|
+
### Patch Changes
|
|
76
|
+
|
|
77
|
+
- [#2299](https://github.com/graphcommerce-org/graphcommerce/pull/2299) [`85d258a`](https://github.com/graphcommerce-org/graphcommerce/commit/85d258a0d1a48bb1b502cccba30a9844f2257814) - Solve an issue where an env variable wouldn't be coerced to a Number if a Config.graphqls value is defined as an Int/Float
|
|
78
|
+
([@paales](https://github.com/paales))
|
|
79
|
+
|
|
80
|
+
## 8.1.0-canary.31
|
|
81
|
+
|
|
82
|
+
## 8.1.0-canary.30
|
|
83
|
+
|
|
84
|
+
## 8.1.0-canary.29
|
|
85
|
+
|
|
86
|
+
## 8.1.0-canary.28
|
|
87
|
+
|
|
88
|
+
### Patch Changes
|
|
89
|
+
|
|
90
|
+
- [#2292](https://github.com/graphcommerce-org/graphcommerce/pull/2292) [`6258adb`](https://github.com/graphcommerce-org/graphcommerce/commit/6258adbe294590ba52d3aaf65712cdc561f32c4c) - Be able to handle plugin runtime values values when parsing the source. Also, make sure parsed plugin sources do not return duplicate plugins.
|
|
91
|
+
([@paales](https://github.com/paales))
|
|
92
|
+
|
|
93
|
+
## 8.1.0-canary.27
|
|
94
|
+
|
|
95
|
+
## 8.1.0-canary.26
|
|
96
|
+
|
|
97
|
+
## 8.1.0-canary.25
|
|
98
|
+
|
|
99
|
+
## 8.1.0-canary.24
|
|
100
|
+
|
|
101
|
+
## 8.1.0-canary.23
|
|
102
|
+
|
|
103
|
+
## 8.1.0-canary.22
|
|
104
|
+
|
|
105
|
+
## 8.1.0-canary.21
|
|
106
|
+
|
|
107
|
+
## 8.1.0-canary.20
|
|
108
|
+
|
|
109
|
+
## 8.1.0-canary.19
|
|
110
|
+
|
|
111
|
+
## 8.1.0-canary.18
|
|
112
|
+
|
|
113
|
+
## 8.1.0-canary.17
|
|
114
|
+
|
|
115
|
+
## 8.1.0-canary.16
|
|
116
|
+
|
|
117
|
+
## 8.1.0-canary.15
|
|
118
|
+
|
|
119
|
+
## 8.1.0-canary.14
|
|
120
|
+
|
|
121
|
+
## 8.1.0-canary.13
|
|
122
|
+
|
|
123
|
+
## 8.1.0-canary.12
|
|
124
|
+
|
|
125
|
+
## 8.1.0-canary.11
|
|
126
|
+
|
|
127
|
+
## 8.1.0-canary.10
|
|
128
|
+
|
|
129
|
+
### Patch Changes
|
|
130
|
+
|
|
131
|
+
- [#2251](https://github.com/graphcommerce-org/graphcommerce/pull/2251) [`bc6a9b4`](https://github.com/graphcommerce-org/graphcommerce/commit/bc6a9b4a7e9769977e98449a418bb239f92ec544) - When creating a release PR, make sure it is created against the main branch so it can be directly merged.
|
|
132
|
+
([@paales](https://github.com/paales))
|
|
133
|
+
|
|
134
|
+
## 8.1.0-canary.9
|
|
135
|
+
|
|
136
|
+
### Patch Changes
|
|
137
|
+
|
|
138
|
+
- [#2223](https://github.com/graphcommerce-org/graphcommerce/pull/2223) [`4f7fe02`](https://github.com/graphcommerce-org/graphcommerce/commit/4f7fe02c6f0f017d7a52559df1972551eb0cba47) - Added robotsAllow to storefront config
|
|
139
|
+
([@bramvanderholst](https://github.com/bramvanderholst))
|
|
140
|
+
|
|
3
141
|
## 8.1.0-canary.8
|
|
4
142
|
|
|
5
143
|
### Patch Changes
|
package/Config.graphqls
CHANGED
|
@@ -138,11 +138,11 @@ input GraphCommerceStorefrontConfig {
|
|
|
138
138
|
"""
|
|
139
139
|
locale: String!
|
|
140
140
|
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
141
|
+
"""
|
|
142
|
+
Allow the site to be indexed by search engines.
|
|
143
|
+
If false, the robots.txt file will be set to disallow all.
|
|
144
|
+
"""
|
|
145
|
+
robotsAllow: Boolean
|
|
146
146
|
|
|
147
147
|
"""
|
|
148
148
|
The canonical base URL is used for SEO purposes.
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
exports[`parses an env config object 1`] = `
|
|
4
4
|
{
|
|
5
|
-
"GC_CUSTOMER_REQUIRE_EMAIL_CONFIRMATION": false,
|
|
6
5
|
"GC_DEMO_MODE": true,
|
|
7
6
|
"GC_STOREFRONT": [
|
|
8
7
|
{
|
|
@@ -26,6 +25,7 @@ exports[`parses an env config object 1`] = `
|
|
|
26
25
|
|
|
27
26
|
exports[`traverses a schema and returns a list of env variables that match 1`] = `
|
|
28
27
|
[
|
|
28
|
+
"GC_BREADCRUMBS",
|
|
29
29
|
"GC_CANONICAL_BASE_URL",
|
|
30
30
|
"GC_CART_DISPLAY_PRICES_INCL_TAX",
|
|
31
31
|
"GC_COMPARE",
|
|
@@ -37,7 +37,9 @@ exports[`traverses a schema and returns a list of env variables that match 1`] =
|
|
|
37
37
|
"GC_CONFIGURABLE_VARIANT_VALUES_URL",
|
|
38
38
|
"GC_CROSS_SELLS_HIDE_CART_ITEMS",
|
|
39
39
|
"GC_CROSS_SELLS_REDIRECT_ITEMS",
|
|
40
|
-
"
|
|
40
|
+
"GC_CUSTOMER_ADDRESS_NOTE_ENABLE",
|
|
41
|
+
"GC_CUSTOMER_COMPANY_FIELDS_ENABLE",
|
|
42
|
+
"GC_CUSTOMER_DELETE_ENABLED",
|
|
41
43
|
"GC_DATA_LAYER",
|
|
42
44
|
"GC_DATA_LAYER_CORE_WEB_VITALS",
|
|
43
45
|
"GC_DEBUG",
|
|
@@ -57,9 +59,11 @@ exports[`traverses a schema and returns a list of env variables that match 1`] =
|
|
|
57
59
|
"GC_HYGRAPH_WRITE_ACCESS_TOKEN",
|
|
58
60
|
"GC_LIMIT_SSG",
|
|
59
61
|
"GC_MAGENTO_ENDPOINT",
|
|
62
|
+
"GC_MAGENTO_VERSION",
|
|
60
63
|
"GC_PREVIEW_SECRET",
|
|
61
64
|
"GC_PRODUCT_FILTERS_LAYOUT",
|
|
62
65
|
"GC_PRODUCT_FILTERS_PRO",
|
|
66
|
+
"GC_PRODUCT_LIST_PAGINATION_VARIANT",
|
|
63
67
|
"GC_PRODUCT_ROUTE",
|
|
64
68
|
"GC_RECENTLY_VIEWED_PRODUCTS",
|
|
65
69
|
"GC_RECENTLY_VIEWED_PRODUCTS_ENABLED",
|
|
@@ -71,6 +75,7 @@ exports[`traverses a schema and returns a list of env variables that match 1`] =
|
|
|
71
75
|
"GC_STOREFRONT_0",
|
|
72
76
|
"GC_STOREFRONT_0_CANONICAL_BASE_URL",
|
|
73
77
|
"GC_STOREFRONT_0_CART_DISPLAY_PRICES_INCL_TAX",
|
|
78
|
+
"GC_STOREFRONT_0_CUSTOMER_COMPANY_FIELDS_ENABLE",
|
|
74
79
|
"GC_STOREFRONT_0_DEFAULT_LOCALE",
|
|
75
80
|
"GC_STOREFRONT_0_DOMAIN",
|
|
76
81
|
"GC_STOREFRONT_0_GOOGLE_ANALYTICS_ID",
|
|
@@ -101,9 +106,11 @@ exports[`traverses a schema and returns a list of env variables that match 1`] =
|
|
|
101
106
|
"GC_STOREFRONT_0_LINGUI_LOCALE",
|
|
102
107
|
"GC_STOREFRONT_0_LOCALE",
|
|
103
108
|
"GC_STOREFRONT_0_MAGENTO_STORE_CODE",
|
|
109
|
+
"GC_STOREFRONT_0_ROBOTS_ALLOW",
|
|
104
110
|
"GC_STOREFRONT_1",
|
|
105
111
|
"GC_STOREFRONT_1_CANONICAL_BASE_URL",
|
|
106
112
|
"GC_STOREFRONT_1_CART_DISPLAY_PRICES_INCL_TAX",
|
|
113
|
+
"GC_STOREFRONT_1_CUSTOMER_COMPANY_FIELDS_ENABLE",
|
|
107
114
|
"GC_STOREFRONT_1_DEFAULT_LOCALE",
|
|
108
115
|
"GC_STOREFRONT_1_DOMAIN",
|
|
109
116
|
"GC_STOREFRONT_1_GOOGLE_ANALYTICS_ID",
|
|
@@ -134,9 +141,11 @@ exports[`traverses a schema and returns a list of env variables that match 1`] =
|
|
|
134
141
|
"GC_STOREFRONT_1_LINGUI_LOCALE",
|
|
135
142
|
"GC_STOREFRONT_1_LOCALE",
|
|
136
143
|
"GC_STOREFRONT_1_MAGENTO_STORE_CODE",
|
|
144
|
+
"GC_STOREFRONT_1_ROBOTS_ALLOW",
|
|
137
145
|
"GC_STOREFRONT_2",
|
|
138
146
|
"GC_STOREFRONT_2_CANONICAL_BASE_URL",
|
|
139
147
|
"GC_STOREFRONT_2_CART_DISPLAY_PRICES_INCL_TAX",
|
|
148
|
+
"GC_STOREFRONT_2_CUSTOMER_COMPANY_FIELDS_ENABLE",
|
|
140
149
|
"GC_STOREFRONT_2_DEFAULT_LOCALE",
|
|
141
150
|
"GC_STOREFRONT_2_DOMAIN",
|
|
142
151
|
"GC_STOREFRONT_2_GOOGLE_ANALYTICS_ID",
|
|
@@ -167,9 +176,11 @@ exports[`traverses a schema and returns a list of env variables that match 1`] =
|
|
|
167
176
|
"GC_STOREFRONT_2_LINGUI_LOCALE",
|
|
168
177
|
"GC_STOREFRONT_2_LOCALE",
|
|
169
178
|
"GC_STOREFRONT_2_MAGENTO_STORE_CODE",
|
|
179
|
+
"GC_STOREFRONT_2_ROBOTS_ALLOW",
|
|
170
180
|
"GC_STOREFRONT_3",
|
|
171
181
|
"GC_STOREFRONT_3_CANONICAL_BASE_URL",
|
|
172
182
|
"GC_STOREFRONT_3_CART_DISPLAY_PRICES_INCL_TAX",
|
|
183
|
+
"GC_STOREFRONT_3_CUSTOMER_COMPANY_FIELDS_ENABLE",
|
|
173
184
|
"GC_STOREFRONT_3_DEFAULT_LOCALE",
|
|
174
185
|
"GC_STOREFRONT_3_DOMAIN",
|
|
175
186
|
"GC_STOREFRONT_3_GOOGLE_ANALYTICS_ID",
|
|
@@ -200,9 +211,11 @@ exports[`traverses a schema and returns a list of env variables that match 1`] =
|
|
|
200
211
|
"GC_STOREFRONT_3_LINGUI_LOCALE",
|
|
201
212
|
"GC_STOREFRONT_3_LOCALE",
|
|
202
213
|
"GC_STOREFRONT_3_MAGENTO_STORE_CODE",
|
|
214
|
+
"GC_STOREFRONT_3_ROBOTS_ALLOW",
|
|
203
215
|
"GC_STOREFRONT_4",
|
|
204
216
|
"GC_STOREFRONT_4_CANONICAL_BASE_URL",
|
|
205
217
|
"GC_STOREFRONT_4_CART_DISPLAY_PRICES_INCL_TAX",
|
|
218
|
+
"GC_STOREFRONT_4_CUSTOMER_COMPANY_FIELDS_ENABLE",
|
|
206
219
|
"GC_STOREFRONT_4_DEFAULT_LOCALE",
|
|
207
220
|
"GC_STOREFRONT_4_DOMAIN",
|
|
208
221
|
"GC_STOREFRONT_4_GOOGLE_ANALYTICS_ID",
|
|
@@ -233,9 +246,11 @@ exports[`traverses a schema and returns a list of env variables that match 1`] =
|
|
|
233
246
|
"GC_STOREFRONT_4_LINGUI_LOCALE",
|
|
234
247
|
"GC_STOREFRONT_4_LOCALE",
|
|
235
248
|
"GC_STOREFRONT_4_MAGENTO_STORE_CODE",
|
|
249
|
+
"GC_STOREFRONT_4_ROBOTS_ALLOW",
|
|
236
250
|
"GC_STOREFRONT_5",
|
|
237
251
|
"GC_STOREFRONT_5_CANONICAL_BASE_URL",
|
|
238
252
|
"GC_STOREFRONT_5_CART_DISPLAY_PRICES_INCL_TAX",
|
|
253
|
+
"GC_STOREFRONT_5_CUSTOMER_COMPANY_FIELDS_ENABLE",
|
|
239
254
|
"GC_STOREFRONT_5_DEFAULT_LOCALE",
|
|
240
255
|
"GC_STOREFRONT_5_DOMAIN",
|
|
241
256
|
"GC_STOREFRONT_5_GOOGLE_ANALYTICS_ID",
|
|
@@ -266,9 +281,11 @@ exports[`traverses a schema and returns a list of env variables that match 1`] =
|
|
|
266
281
|
"GC_STOREFRONT_5_LINGUI_LOCALE",
|
|
267
282
|
"GC_STOREFRONT_5_LOCALE",
|
|
268
283
|
"GC_STOREFRONT_5_MAGENTO_STORE_CODE",
|
|
284
|
+
"GC_STOREFRONT_5_ROBOTS_ALLOW",
|
|
269
285
|
"GC_STOREFRONT_6",
|
|
270
286
|
"GC_STOREFRONT_6_CANONICAL_BASE_URL",
|
|
271
287
|
"GC_STOREFRONT_6_CART_DISPLAY_PRICES_INCL_TAX",
|
|
288
|
+
"GC_STOREFRONT_6_CUSTOMER_COMPANY_FIELDS_ENABLE",
|
|
272
289
|
"GC_STOREFRONT_6_DEFAULT_LOCALE",
|
|
273
290
|
"GC_STOREFRONT_6_DOMAIN",
|
|
274
291
|
"GC_STOREFRONT_6_GOOGLE_ANALYTICS_ID",
|
|
@@ -299,9 +316,11 @@ exports[`traverses a schema and returns a list of env variables that match 1`] =
|
|
|
299
316
|
"GC_STOREFRONT_6_LINGUI_LOCALE",
|
|
300
317
|
"GC_STOREFRONT_6_LOCALE",
|
|
301
318
|
"GC_STOREFRONT_6_MAGENTO_STORE_CODE",
|
|
319
|
+
"GC_STOREFRONT_6_ROBOTS_ALLOW",
|
|
302
320
|
"GC_STOREFRONT_7",
|
|
303
321
|
"GC_STOREFRONT_7_CANONICAL_BASE_URL",
|
|
304
322
|
"GC_STOREFRONT_7_CART_DISPLAY_PRICES_INCL_TAX",
|
|
323
|
+
"GC_STOREFRONT_7_CUSTOMER_COMPANY_FIELDS_ENABLE",
|
|
305
324
|
"GC_STOREFRONT_7_DEFAULT_LOCALE",
|
|
306
325
|
"GC_STOREFRONT_7_DOMAIN",
|
|
307
326
|
"GC_STOREFRONT_7_GOOGLE_ANALYTICS_ID",
|
|
@@ -332,9 +351,11 @@ exports[`traverses a schema and returns a list of env variables that match 1`] =
|
|
|
332
351
|
"GC_STOREFRONT_7_LINGUI_LOCALE",
|
|
333
352
|
"GC_STOREFRONT_7_LOCALE",
|
|
334
353
|
"GC_STOREFRONT_7_MAGENTO_STORE_CODE",
|
|
354
|
+
"GC_STOREFRONT_7_ROBOTS_ALLOW",
|
|
335
355
|
"GC_STOREFRONT_8",
|
|
336
356
|
"GC_STOREFRONT_8_CANONICAL_BASE_URL",
|
|
337
357
|
"GC_STOREFRONT_8_CART_DISPLAY_PRICES_INCL_TAX",
|
|
358
|
+
"GC_STOREFRONT_8_CUSTOMER_COMPANY_FIELDS_ENABLE",
|
|
338
359
|
"GC_STOREFRONT_8_DEFAULT_LOCALE",
|
|
339
360
|
"GC_STOREFRONT_8_DOMAIN",
|
|
340
361
|
"GC_STOREFRONT_8_GOOGLE_ANALYTICS_ID",
|
|
@@ -365,9 +386,11 @@ exports[`traverses a schema and returns a list of env variables that match 1`] =
|
|
|
365
386
|
"GC_STOREFRONT_8_LINGUI_LOCALE",
|
|
366
387
|
"GC_STOREFRONT_8_LOCALE",
|
|
367
388
|
"GC_STOREFRONT_8_MAGENTO_STORE_CODE",
|
|
389
|
+
"GC_STOREFRONT_8_ROBOTS_ALLOW",
|
|
368
390
|
"GC_STOREFRONT_9",
|
|
369
391
|
"GC_STOREFRONT_9_CANONICAL_BASE_URL",
|
|
370
392
|
"GC_STOREFRONT_9_CART_DISPLAY_PRICES_INCL_TAX",
|
|
393
|
+
"GC_STOREFRONT_9_CUSTOMER_COMPANY_FIELDS_ENABLE",
|
|
371
394
|
"GC_STOREFRONT_9_DEFAULT_LOCALE",
|
|
372
395
|
"GC_STOREFRONT_9_DOMAIN",
|
|
373
396
|
"GC_STOREFRONT_9_GOOGLE_ANALYTICS_ID",
|
|
@@ -398,9 +421,11 @@ exports[`traverses a schema and returns a list of env variables that match 1`] =
|
|
|
398
421
|
"GC_STOREFRONT_9_LINGUI_LOCALE",
|
|
399
422
|
"GC_STOREFRONT_9_LOCALE",
|
|
400
423
|
"GC_STOREFRONT_9_MAGENTO_STORE_CODE",
|
|
424
|
+
"GC_STOREFRONT_9_ROBOTS_ALLOW",
|
|
401
425
|
"GC_STOREFRONT_10",
|
|
402
426
|
"GC_STOREFRONT_10_CANONICAL_BASE_URL",
|
|
403
427
|
"GC_STOREFRONT_10_CART_DISPLAY_PRICES_INCL_TAX",
|
|
428
|
+
"GC_STOREFRONT_10_CUSTOMER_COMPANY_FIELDS_ENABLE",
|
|
404
429
|
"GC_STOREFRONT_10_DEFAULT_LOCALE",
|
|
405
430
|
"GC_STOREFRONT_10_DOMAIN",
|
|
406
431
|
"GC_STOREFRONT_10_GOOGLE_ANALYTICS_ID",
|
|
@@ -431,9 +456,11 @@ exports[`traverses a schema and returns a list of env variables that match 1`] =
|
|
|
431
456
|
"GC_STOREFRONT_10_LINGUI_LOCALE",
|
|
432
457
|
"GC_STOREFRONT_10_LOCALE",
|
|
433
458
|
"GC_STOREFRONT_10_MAGENTO_STORE_CODE",
|
|
459
|
+
"GC_STOREFRONT_10_ROBOTS_ALLOW",
|
|
434
460
|
"GC_STOREFRONT_11",
|
|
435
461
|
"GC_STOREFRONT_11_CANONICAL_BASE_URL",
|
|
436
462
|
"GC_STOREFRONT_11_CART_DISPLAY_PRICES_INCL_TAX",
|
|
463
|
+
"GC_STOREFRONT_11_CUSTOMER_COMPANY_FIELDS_ENABLE",
|
|
437
464
|
"GC_STOREFRONT_11_DEFAULT_LOCALE",
|
|
438
465
|
"GC_STOREFRONT_11_DOMAIN",
|
|
439
466
|
"GC_STOREFRONT_11_GOOGLE_ANALYTICS_ID",
|
|
@@ -464,9 +491,11 @@ exports[`traverses a schema and returns a list of env variables that match 1`] =
|
|
|
464
491
|
"GC_STOREFRONT_11_LINGUI_LOCALE",
|
|
465
492
|
"GC_STOREFRONT_11_LOCALE",
|
|
466
493
|
"GC_STOREFRONT_11_MAGENTO_STORE_CODE",
|
|
494
|
+
"GC_STOREFRONT_11_ROBOTS_ALLOW",
|
|
467
495
|
"GC_STOREFRONT_12",
|
|
468
496
|
"GC_STOREFRONT_12_CANONICAL_BASE_URL",
|
|
469
497
|
"GC_STOREFRONT_12_CART_DISPLAY_PRICES_INCL_TAX",
|
|
498
|
+
"GC_STOREFRONT_12_CUSTOMER_COMPANY_FIELDS_ENABLE",
|
|
470
499
|
"GC_STOREFRONT_12_DEFAULT_LOCALE",
|
|
471
500
|
"GC_STOREFRONT_12_DOMAIN",
|
|
472
501
|
"GC_STOREFRONT_12_GOOGLE_ANALYTICS_ID",
|
|
@@ -497,9 +526,11 @@ exports[`traverses a schema and returns a list of env variables that match 1`] =
|
|
|
497
526
|
"GC_STOREFRONT_12_LINGUI_LOCALE",
|
|
498
527
|
"GC_STOREFRONT_12_LOCALE",
|
|
499
528
|
"GC_STOREFRONT_12_MAGENTO_STORE_CODE",
|
|
529
|
+
"GC_STOREFRONT_12_ROBOTS_ALLOW",
|
|
500
530
|
"GC_STOREFRONT_13",
|
|
501
531
|
"GC_STOREFRONT_13_CANONICAL_BASE_URL",
|
|
502
532
|
"GC_STOREFRONT_13_CART_DISPLAY_PRICES_INCL_TAX",
|
|
533
|
+
"GC_STOREFRONT_13_CUSTOMER_COMPANY_FIELDS_ENABLE",
|
|
503
534
|
"GC_STOREFRONT_13_DEFAULT_LOCALE",
|
|
504
535
|
"GC_STOREFRONT_13_DOMAIN",
|
|
505
536
|
"GC_STOREFRONT_13_GOOGLE_ANALYTICS_ID",
|
|
@@ -530,9 +561,11 @@ exports[`traverses a schema and returns a list of env variables that match 1`] =
|
|
|
530
561
|
"GC_STOREFRONT_13_LINGUI_LOCALE",
|
|
531
562
|
"GC_STOREFRONT_13_LOCALE",
|
|
532
563
|
"GC_STOREFRONT_13_MAGENTO_STORE_CODE",
|
|
564
|
+
"GC_STOREFRONT_13_ROBOTS_ALLOW",
|
|
533
565
|
"GC_STOREFRONT_14",
|
|
534
566
|
"GC_STOREFRONT_14_CANONICAL_BASE_URL",
|
|
535
567
|
"GC_STOREFRONT_14_CART_DISPLAY_PRICES_INCL_TAX",
|
|
568
|
+
"GC_STOREFRONT_14_CUSTOMER_COMPANY_FIELDS_ENABLE",
|
|
536
569
|
"GC_STOREFRONT_14_DEFAULT_LOCALE",
|
|
537
570
|
"GC_STOREFRONT_14_DOMAIN",
|
|
538
571
|
"GC_STOREFRONT_14_GOOGLE_ANALYTICS_ID",
|
|
@@ -563,9 +596,11 @@ exports[`traverses a schema and returns a list of env variables that match 1`] =
|
|
|
563
596
|
"GC_STOREFRONT_14_LINGUI_LOCALE",
|
|
564
597
|
"GC_STOREFRONT_14_LOCALE",
|
|
565
598
|
"GC_STOREFRONT_14_MAGENTO_STORE_CODE",
|
|
599
|
+
"GC_STOREFRONT_14_ROBOTS_ALLOW",
|
|
566
600
|
"GC_STOREFRONT_15",
|
|
567
601
|
"GC_STOREFRONT_15_CANONICAL_BASE_URL",
|
|
568
602
|
"GC_STOREFRONT_15_CART_DISPLAY_PRICES_INCL_TAX",
|
|
603
|
+
"GC_STOREFRONT_15_CUSTOMER_COMPANY_FIELDS_ENABLE",
|
|
569
604
|
"GC_STOREFRONT_15_DEFAULT_LOCALE",
|
|
570
605
|
"GC_STOREFRONT_15_DOMAIN",
|
|
571
606
|
"GC_STOREFRONT_15_GOOGLE_ANALYTICS_ID",
|
|
@@ -596,9 +631,11 @@ exports[`traverses a schema and returns a list of env variables that match 1`] =
|
|
|
596
631
|
"GC_STOREFRONT_15_LINGUI_LOCALE",
|
|
597
632
|
"GC_STOREFRONT_15_LOCALE",
|
|
598
633
|
"GC_STOREFRONT_15_MAGENTO_STORE_CODE",
|
|
634
|
+
"GC_STOREFRONT_15_ROBOTS_ALLOW",
|
|
599
635
|
"GC_STOREFRONT_16",
|
|
600
636
|
"GC_STOREFRONT_16_CANONICAL_BASE_URL",
|
|
601
637
|
"GC_STOREFRONT_16_CART_DISPLAY_PRICES_INCL_TAX",
|
|
638
|
+
"GC_STOREFRONT_16_CUSTOMER_COMPANY_FIELDS_ENABLE",
|
|
602
639
|
"GC_STOREFRONT_16_DEFAULT_LOCALE",
|
|
603
640
|
"GC_STOREFRONT_16_DOMAIN",
|
|
604
641
|
"GC_STOREFRONT_16_GOOGLE_ANALYTICS_ID",
|
|
@@ -629,9 +666,11 @@ exports[`traverses a schema and returns a list of env variables that match 1`] =
|
|
|
629
666
|
"GC_STOREFRONT_16_LINGUI_LOCALE",
|
|
630
667
|
"GC_STOREFRONT_16_LOCALE",
|
|
631
668
|
"GC_STOREFRONT_16_MAGENTO_STORE_CODE",
|
|
669
|
+
"GC_STOREFRONT_16_ROBOTS_ALLOW",
|
|
632
670
|
"GC_STOREFRONT_17",
|
|
633
671
|
"GC_STOREFRONT_17_CANONICAL_BASE_URL",
|
|
634
672
|
"GC_STOREFRONT_17_CART_DISPLAY_PRICES_INCL_TAX",
|
|
673
|
+
"GC_STOREFRONT_17_CUSTOMER_COMPANY_FIELDS_ENABLE",
|
|
635
674
|
"GC_STOREFRONT_17_DEFAULT_LOCALE",
|
|
636
675
|
"GC_STOREFRONT_17_DOMAIN",
|
|
637
676
|
"GC_STOREFRONT_17_GOOGLE_ANALYTICS_ID",
|
|
@@ -662,9 +701,11 @@ exports[`traverses a schema and returns a list of env variables that match 1`] =
|
|
|
662
701
|
"GC_STOREFRONT_17_LINGUI_LOCALE",
|
|
663
702
|
"GC_STOREFRONT_17_LOCALE",
|
|
664
703
|
"GC_STOREFRONT_17_MAGENTO_STORE_CODE",
|
|
704
|
+
"GC_STOREFRONT_17_ROBOTS_ALLOW",
|
|
665
705
|
"GC_STOREFRONT_18",
|
|
666
706
|
"GC_STOREFRONT_18_CANONICAL_BASE_URL",
|
|
667
707
|
"GC_STOREFRONT_18_CART_DISPLAY_PRICES_INCL_TAX",
|
|
708
|
+
"GC_STOREFRONT_18_CUSTOMER_COMPANY_FIELDS_ENABLE",
|
|
668
709
|
"GC_STOREFRONT_18_DEFAULT_LOCALE",
|
|
669
710
|
"GC_STOREFRONT_18_DOMAIN",
|
|
670
711
|
"GC_STOREFRONT_18_GOOGLE_ANALYTICS_ID",
|
|
@@ -695,9 +736,11 @@ exports[`traverses a schema and returns a list of env variables that match 1`] =
|
|
|
695
736
|
"GC_STOREFRONT_18_LINGUI_LOCALE",
|
|
696
737
|
"GC_STOREFRONT_18_LOCALE",
|
|
697
738
|
"GC_STOREFRONT_18_MAGENTO_STORE_CODE",
|
|
739
|
+
"GC_STOREFRONT_18_ROBOTS_ALLOW",
|
|
698
740
|
"GC_STOREFRONT_19",
|
|
699
741
|
"GC_STOREFRONT_19_CANONICAL_BASE_URL",
|
|
700
742
|
"GC_STOREFRONT_19_CART_DISPLAY_PRICES_INCL_TAX",
|
|
743
|
+
"GC_STOREFRONT_19_CUSTOMER_COMPANY_FIELDS_ENABLE",
|
|
701
744
|
"GC_STOREFRONT_19_DEFAULT_LOCALE",
|
|
702
745
|
"GC_STOREFRONT_19_DOMAIN",
|
|
703
746
|
"GC_STOREFRONT_19_GOOGLE_ANALYTICS_ID",
|
|
@@ -728,9 +771,11 @@ exports[`traverses a schema and returns a list of env variables that match 1`] =
|
|
|
728
771
|
"GC_STOREFRONT_19_LINGUI_LOCALE",
|
|
729
772
|
"GC_STOREFRONT_19_LOCALE",
|
|
730
773
|
"GC_STOREFRONT_19_MAGENTO_STORE_CODE",
|
|
774
|
+
"GC_STOREFRONT_19_ROBOTS_ALLOW",
|
|
731
775
|
"GC_STOREFRONT_20",
|
|
732
776
|
"GC_STOREFRONT_20_CANONICAL_BASE_URL",
|
|
733
777
|
"GC_STOREFRONT_20_CART_DISPLAY_PRICES_INCL_TAX",
|
|
778
|
+
"GC_STOREFRONT_20_CUSTOMER_COMPANY_FIELDS_ENABLE",
|
|
734
779
|
"GC_STOREFRONT_20_DEFAULT_LOCALE",
|
|
735
780
|
"GC_STOREFRONT_20_DOMAIN",
|
|
736
781
|
"GC_STOREFRONT_20_GOOGLE_ANALYTICS_ID",
|
|
@@ -761,6 +806,7 @@ exports[`traverses a schema and returns a list of env variables that match 1`] =
|
|
|
761
806
|
"GC_STOREFRONT_20_LINGUI_LOCALE",
|
|
762
807
|
"GC_STOREFRONT_20_LOCALE",
|
|
763
808
|
"GC_STOREFRONT_20_MAGENTO_STORE_CODE",
|
|
809
|
+
"GC_STOREFRONT_20_ROBOTS_ALLOW",
|
|
764
810
|
"GC_WISHLIST_HIDE_FOR_GUESTS",
|
|
765
811
|
"GC_WISHLIST_SHOW_FEEDBACK_MESSAGE",
|
|
766
812
|
]
|
|
@@ -2,7 +2,6 @@ import { configToImportMeta } from '../../../src/config/utils/configToImportMeta
|
|
|
2
2
|
|
|
3
3
|
const configFile = {
|
|
4
4
|
storefront: [{ locale: 'en', hygraphLocales: ['en'], magentoStoreCode: 'en_us' }],
|
|
5
|
-
customerRequireEmailConfirmation: false,
|
|
6
5
|
demoMode: true,
|
|
7
6
|
googleTagmanagerKey: 'GTM-XXXXXXX',
|
|
8
7
|
productFiltersPro: false,
|
|
@@ -18,7 +17,6 @@ it('flattens a config object', () => {
|
|
|
18
17
|
expect(configToImportMeta(configFile)).toMatchInlineSnapshot(`
|
|
19
18
|
{
|
|
20
19
|
"import.meta.graphCommerce": "{ __debug: "'import.meta.graphCommerce' can not be destructured, please access deeper properties directly" }",
|
|
21
|
-
"import.meta.graphCommerce.customerRequireEmailConfirmation": "false",
|
|
22
20
|
"import.meta.graphCommerce.deeper": "{ __debug: "'import.meta.graphCommerce.deeper' can not be destructured, please access deeper properties directly" }",
|
|
23
21
|
"import.meta.graphCommerce.deeper.arrayvalue": "["test"]",
|
|
24
22
|
"import.meta.graphCommerce.deeper.nested": "{ __debug: "'import.meta.graphCommerce.deeper.nested' can not be destructured, please access deeper properties directly" }",
|
|
@@ -35,7 +33,6 @@ it('creates keys but does not stringify values', () => {
|
|
|
35
33
|
expect(configToImportMeta(configFile, 'graphCommerce', false)).toMatchInlineSnapshot(`
|
|
36
34
|
{
|
|
37
35
|
"graphCommerce": {
|
|
38
|
-
"customerRequireEmailConfirmation": false,
|
|
39
36
|
"deeper": {
|
|
40
37
|
"arrayvalue": [
|
|
41
38
|
"test",
|
|
@@ -57,7 +54,6 @@ it('creates keys but does not stringify values', () => {
|
|
|
57
54
|
},
|
|
58
55
|
],
|
|
59
56
|
},
|
|
60
|
-
"graphCommerce.customerRequireEmailConfirmation": false,
|
|
61
57
|
"graphCommerce.deeper": {
|
|
62
58
|
"arrayvalue": [
|
|
63
59
|
"test",
|
|
@@ -8,7 +8,6 @@ import { removeColor } from './rewriteLegancyEnv'
|
|
|
8
8
|
|
|
9
9
|
const env = {
|
|
10
10
|
GC_ADVANCED_FILTERS: '0',
|
|
11
|
-
GC_CUSTOMER_REQUIRE_EMAIL_CONFIRMATION: 'false',
|
|
12
11
|
GC_DEMO_MODE: '1',
|
|
13
12
|
GC_SINGLE_PRODUCT_ROUTE: '1',
|
|
14
13
|
GC_STOREFRONT_0_LOCALE: 'en',
|
|
@@ -32,6 +31,20 @@ it('parses an env config object', () => {
|
|
|
32
31
|
expect(result).toMatchSnapshot()
|
|
33
32
|
})
|
|
34
33
|
|
|
34
|
+
it('parses an env string value to a number', () => {
|
|
35
|
+
const [envSchema] = configToEnvSchema(GraphCommerceConfigSchema())
|
|
36
|
+
const result = envSchema.safeParse({ GC_MAGENTO_VERSION: '247' })
|
|
37
|
+
|
|
38
|
+
expect(result.success).toBe(true)
|
|
39
|
+
if (result.success) {
|
|
40
|
+
expect(result.data).toMatchInlineSnapshot(`
|
|
41
|
+
{
|
|
42
|
+
"GC_MAGENTO_VERSION": 247,
|
|
43
|
+
}
|
|
44
|
+
`)
|
|
45
|
+
}
|
|
46
|
+
})
|
|
47
|
+
|
|
35
48
|
it('correctly validates if a value is JSON', () => {
|
|
36
49
|
const [envSchema] = configToEnvSchema(GraphCommerceConfigSchema())
|
|
37
50
|
const result = envSchema.safeParse({
|
|
@@ -65,12 +78,12 @@ it('correctly validates if a value is JSON', () => {
|
|
|
65
78
|
it('converts an env schema to a config schema', () => {
|
|
66
79
|
const configFile: GraphCommerceConfig = {
|
|
67
80
|
storefront: [{ locale: 'en', hygraphLocales: ['en'], magentoStoreCode: 'en_us' }],
|
|
68
|
-
customerRequireEmailConfirmation: false,
|
|
69
81
|
productFiltersPro: false,
|
|
70
82
|
canonicalBaseUrl: 'https://example.com',
|
|
71
83
|
hygraphEndpoint: 'https://example.com',
|
|
72
84
|
magentoEndpoint: 'https://example.com',
|
|
73
85
|
previewSecret: 'secret',
|
|
86
|
+
magentoVersion: 247,
|
|
74
87
|
}
|
|
75
88
|
|
|
76
89
|
const environmentVariables = {
|
|
@@ -17,13 +17,13 @@ export const removeColor = (str: string) =>
|
|
|
17
17
|
it('rewrites legacy env', () => {
|
|
18
18
|
const configFile: GraphCommerceConfig = {
|
|
19
19
|
storefront: [{ locale: 'en', hygraphLocales: ['en'], magentoStoreCode: 'en_us' }],
|
|
20
|
-
customerRequireEmailConfirmation: false,
|
|
21
20
|
productFiltersPro: false,
|
|
22
21
|
canonicalBaseUrl: 'https://example.com',
|
|
23
22
|
hygraphEndpoint: 'https://example.com',
|
|
24
23
|
magentoEndpoint: 'https://example.com',
|
|
25
24
|
previewSecret: 'secret',
|
|
26
25
|
robotsAllow: true,
|
|
26
|
+
magentoVersion: 246,
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
const legacyEnv = {
|