@graphcommerce/next-config 6.2.0-canary.8 → 6.2.0-canary.9
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 +2 -0
- package/__tests__/config/utils/__snapshots__/mergeEnvIntoConfig.ts.snap +47 -0
- package/__tests__/interceptors/findPlugins.ts +28 -6
- package/__tests__/utils/resolveDependenciesSync.ts +1 -1
- package/dist/config/demoConfig.js +1 -0
- package/dist/generated/config.js +4 -1
- package/package.json +1 -1
- package/src/config/demoConfig.ts +1 -0
- package/src/generated/config.ts +15 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,9 +1,35 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
|
+
exports[`parses an env config object 1`] = `
|
|
4
|
+
{
|
|
5
|
+
"GC_CUSTOMER_REQUIRE_EMAIL_CONFIRMATION": false,
|
|
6
|
+
"GC_DEMO_MODE": true,
|
|
7
|
+
"GC_STOREFRONT": [
|
|
8
|
+
{
|
|
9
|
+
"defaultLocale": true,
|
|
10
|
+
"hygraphLocales": [
|
|
11
|
+
"en",
|
|
12
|
+
],
|
|
13
|
+
"locale": "en",
|
|
14
|
+
"magentoStoreCode": "en_us",
|
|
15
|
+
},
|
|
16
|
+
],
|
|
17
|
+
"GC_STOREFRONT_0_DEFAULT_LOCALE": true,
|
|
18
|
+
"GC_STOREFRONT_0_HYGRAPH_LOCALES_0": "en",
|
|
19
|
+
"GC_STOREFRONT_0_LOCALE": "en",
|
|
20
|
+
"GC_STOREFRONT_0_MAGENTO_STORE_CODE": "en_us",
|
|
21
|
+
"GC_STOREFRONT_1_HYGRAPH_LOCALES_0": "de",
|
|
22
|
+
"GC_STOREFRONT_1_LOCALE": "de",
|
|
23
|
+
"GC_STOREFRONT_1_MAGENTO_STORE_CODE": "de_de",
|
|
24
|
+
}
|
|
25
|
+
`;
|
|
26
|
+
|
|
3
27
|
exports[`traverses a schema and returns a list of env variables that match 1`] = `
|
|
4
28
|
[
|
|
5
29
|
"GC_CANONICAL_BASE_URL",
|
|
6
30
|
"GC_CART_DISPLAY_PRICES_INCL_TAX",
|
|
31
|
+
"GC_COMPARE",
|
|
32
|
+
"GC_COMPARE_CHECKBOX",
|
|
7
33
|
"GC_CUSTOMER_REQUIRE_EMAIL_CONFIRMATION",
|
|
8
34
|
"GC_DEBUG",
|
|
9
35
|
"GC_DEBUG_PLUGIN_STATUS",
|
|
@@ -27,6 +53,7 @@ exports[`traverses a schema and returns a list of env variables that match 1`] =
|
|
|
27
53
|
"GC_STOREFRONT_0",
|
|
28
54
|
"GC_STOREFRONT_0_CANONICAL_BASE_URL",
|
|
29
55
|
"GC_STOREFRONT_0_CART_DISPLAY_PRICES_INCL_TAX",
|
|
56
|
+
"GC_STOREFRONT_0_COMPARE_CHECKBOX",
|
|
30
57
|
"GC_STOREFRONT_0_DEFAULT_LOCALE",
|
|
31
58
|
"GC_STOREFRONT_0_DOMAIN",
|
|
32
59
|
"GC_STOREFRONT_0_GOOGLE_ANALYTICS_ID",
|
|
@@ -60,6 +87,7 @@ exports[`traverses a schema and returns a list of env variables that match 1`] =
|
|
|
60
87
|
"GC_STOREFRONT_1",
|
|
61
88
|
"GC_STOREFRONT_1_CANONICAL_BASE_URL",
|
|
62
89
|
"GC_STOREFRONT_1_CART_DISPLAY_PRICES_INCL_TAX",
|
|
90
|
+
"GC_STOREFRONT_1_COMPARE_CHECKBOX",
|
|
63
91
|
"GC_STOREFRONT_1_DEFAULT_LOCALE",
|
|
64
92
|
"GC_STOREFRONT_1_DOMAIN",
|
|
65
93
|
"GC_STOREFRONT_1_GOOGLE_ANALYTICS_ID",
|
|
@@ -93,6 +121,7 @@ exports[`traverses a schema and returns a list of env variables that match 1`] =
|
|
|
93
121
|
"GC_STOREFRONT_2",
|
|
94
122
|
"GC_STOREFRONT_2_CANONICAL_BASE_URL",
|
|
95
123
|
"GC_STOREFRONT_2_CART_DISPLAY_PRICES_INCL_TAX",
|
|
124
|
+
"GC_STOREFRONT_2_COMPARE_CHECKBOX",
|
|
96
125
|
"GC_STOREFRONT_2_DEFAULT_LOCALE",
|
|
97
126
|
"GC_STOREFRONT_2_DOMAIN",
|
|
98
127
|
"GC_STOREFRONT_2_GOOGLE_ANALYTICS_ID",
|
|
@@ -126,6 +155,7 @@ exports[`traverses a schema and returns a list of env variables that match 1`] =
|
|
|
126
155
|
"GC_STOREFRONT_3",
|
|
127
156
|
"GC_STOREFRONT_3_CANONICAL_BASE_URL",
|
|
128
157
|
"GC_STOREFRONT_3_CART_DISPLAY_PRICES_INCL_TAX",
|
|
158
|
+
"GC_STOREFRONT_3_COMPARE_CHECKBOX",
|
|
129
159
|
"GC_STOREFRONT_3_DEFAULT_LOCALE",
|
|
130
160
|
"GC_STOREFRONT_3_DOMAIN",
|
|
131
161
|
"GC_STOREFRONT_3_GOOGLE_ANALYTICS_ID",
|
|
@@ -159,6 +189,7 @@ exports[`traverses a schema and returns a list of env variables that match 1`] =
|
|
|
159
189
|
"GC_STOREFRONT_4",
|
|
160
190
|
"GC_STOREFRONT_4_CANONICAL_BASE_URL",
|
|
161
191
|
"GC_STOREFRONT_4_CART_DISPLAY_PRICES_INCL_TAX",
|
|
192
|
+
"GC_STOREFRONT_4_COMPARE_CHECKBOX",
|
|
162
193
|
"GC_STOREFRONT_4_DEFAULT_LOCALE",
|
|
163
194
|
"GC_STOREFRONT_4_DOMAIN",
|
|
164
195
|
"GC_STOREFRONT_4_GOOGLE_ANALYTICS_ID",
|
|
@@ -192,6 +223,7 @@ exports[`traverses a schema and returns a list of env variables that match 1`] =
|
|
|
192
223
|
"GC_STOREFRONT_5",
|
|
193
224
|
"GC_STOREFRONT_5_CANONICAL_BASE_URL",
|
|
194
225
|
"GC_STOREFRONT_5_CART_DISPLAY_PRICES_INCL_TAX",
|
|
226
|
+
"GC_STOREFRONT_5_COMPARE_CHECKBOX",
|
|
195
227
|
"GC_STOREFRONT_5_DEFAULT_LOCALE",
|
|
196
228
|
"GC_STOREFRONT_5_DOMAIN",
|
|
197
229
|
"GC_STOREFRONT_5_GOOGLE_ANALYTICS_ID",
|
|
@@ -225,6 +257,7 @@ exports[`traverses a schema and returns a list of env variables that match 1`] =
|
|
|
225
257
|
"GC_STOREFRONT_6",
|
|
226
258
|
"GC_STOREFRONT_6_CANONICAL_BASE_URL",
|
|
227
259
|
"GC_STOREFRONT_6_CART_DISPLAY_PRICES_INCL_TAX",
|
|
260
|
+
"GC_STOREFRONT_6_COMPARE_CHECKBOX",
|
|
228
261
|
"GC_STOREFRONT_6_DEFAULT_LOCALE",
|
|
229
262
|
"GC_STOREFRONT_6_DOMAIN",
|
|
230
263
|
"GC_STOREFRONT_6_GOOGLE_ANALYTICS_ID",
|
|
@@ -258,6 +291,7 @@ exports[`traverses a schema and returns a list of env variables that match 1`] =
|
|
|
258
291
|
"GC_STOREFRONT_7",
|
|
259
292
|
"GC_STOREFRONT_7_CANONICAL_BASE_URL",
|
|
260
293
|
"GC_STOREFRONT_7_CART_DISPLAY_PRICES_INCL_TAX",
|
|
294
|
+
"GC_STOREFRONT_7_COMPARE_CHECKBOX",
|
|
261
295
|
"GC_STOREFRONT_7_DEFAULT_LOCALE",
|
|
262
296
|
"GC_STOREFRONT_7_DOMAIN",
|
|
263
297
|
"GC_STOREFRONT_7_GOOGLE_ANALYTICS_ID",
|
|
@@ -291,6 +325,7 @@ exports[`traverses a schema and returns a list of env variables that match 1`] =
|
|
|
291
325
|
"GC_STOREFRONT_8",
|
|
292
326
|
"GC_STOREFRONT_8_CANONICAL_BASE_URL",
|
|
293
327
|
"GC_STOREFRONT_8_CART_DISPLAY_PRICES_INCL_TAX",
|
|
328
|
+
"GC_STOREFRONT_8_COMPARE_CHECKBOX",
|
|
294
329
|
"GC_STOREFRONT_8_DEFAULT_LOCALE",
|
|
295
330
|
"GC_STOREFRONT_8_DOMAIN",
|
|
296
331
|
"GC_STOREFRONT_8_GOOGLE_ANALYTICS_ID",
|
|
@@ -324,6 +359,7 @@ exports[`traverses a schema and returns a list of env variables that match 1`] =
|
|
|
324
359
|
"GC_STOREFRONT_9",
|
|
325
360
|
"GC_STOREFRONT_9_CANONICAL_BASE_URL",
|
|
326
361
|
"GC_STOREFRONT_9_CART_DISPLAY_PRICES_INCL_TAX",
|
|
362
|
+
"GC_STOREFRONT_9_COMPARE_CHECKBOX",
|
|
327
363
|
"GC_STOREFRONT_9_DEFAULT_LOCALE",
|
|
328
364
|
"GC_STOREFRONT_9_DOMAIN",
|
|
329
365
|
"GC_STOREFRONT_9_GOOGLE_ANALYTICS_ID",
|
|
@@ -357,6 +393,7 @@ exports[`traverses a schema and returns a list of env variables that match 1`] =
|
|
|
357
393
|
"GC_STOREFRONT_10",
|
|
358
394
|
"GC_STOREFRONT_10_CANONICAL_BASE_URL",
|
|
359
395
|
"GC_STOREFRONT_10_CART_DISPLAY_PRICES_INCL_TAX",
|
|
396
|
+
"GC_STOREFRONT_10_COMPARE_CHECKBOX",
|
|
360
397
|
"GC_STOREFRONT_10_DEFAULT_LOCALE",
|
|
361
398
|
"GC_STOREFRONT_10_DOMAIN",
|
|
362
399
|
"GC_STOREFRONT_10_GOOGLE_ANALYTICS_ID",
|
|
@@ -390,6 +427,7 @@ exports[`traverses a schema and returns a list of env variables that match 1`] =
|
|
|
390
427
|
"GC_STOREFRONT_11",
|
|
391
428
|
"GC_STOREFRONT_11_CANONICAL_BASE_URL",
|
|
392
429
|
"GC_STOREFRONT_11_CART_DISPLAY_PRICES_INCL_TAX",
|
|
430
|
+
"GC_STOREFRONT_11_COMPARE_CHECKBOX",
|
|
393
431
|
"GC_STOREFRONT_11_DEFAULT_LOCALE",
|
|
394
432
|
"GC_STOREFRONT_11_DOMAIN",
|
|
395
433
|
"GC_STOREFRONT_11_GOOGLE_ANALYTICS_ID",
|
|
@@ -423,6 +461,7 @@ exports[`traverses a schema and returns a list of env variables that match 1`] =
|
|
|
423
461
|
"GC_STOREFRONT_12",
|
|
424
462
|
"GC_STOREFRONT_12_CANONICAL_BASE_URL",
|
|
425
463
|
"GC_STOREFRONT_12_CART_DISPLAY_PRICES_INCL_TAX",
|
|
464
|
+
"GC_STOREFRONT_12_COMPARE_CHECKBOX",
|
|
426
465
|
"GC_STOREFRONT_12_DEFAULT_LOCALE",
|
|
427
466
|
"GC_STOREFRONT_12_DOMAIN",
|
|
428
467
|
"GC_STOREFRONT_12_GOOGLE_ANALYTICS_ID",
|
|
@@ -456,6 +495,7 @@ exports[`traverses a schema and returns a list of env variables that match 1`] =
|
|
|
456
495
|
"GC_STOREFRONT_13",
|
|
457
496
|
"GC_STOREFRONT_13_CANONICAL_BASE_URL",
|
|
458
497
|
"GC_STOREFRONT_13_CART_DISPLAY_PRICES_INCL_TAX",
|
|
498
|
+
"GC_STOREFRONT_13_COMPARE_CHECKBOX",
|
|
459
499
|
"GC_STOREFRONT_13_DEFAULT_LOCALE",
|
|
460
500
|
"GC_STOREFRONT_13_DOMAIN",
|
|
461
501
|
"GC_STOREFRONT_13_GOOGLE_ANALYTICS_ID",
|
|
@@ -489,6 +529,7 @@ exports[`traverses a schema and returns a list of env variables that match 1`] =
|
|
|
489
529
|
"GC_STOREFRONT_14",
|
|
490
530
|
"GC_STOREFRONT_14_CANONICAL_BASE_URL",
|
|
491
531
|
"GC_STOREFRONT_14_CART_DISPLAY_PRICES_INCL_TAX",
|
|
532
|
+
"GC_STOREFRONT_14_COMPARE_CHECKBOX",
|
|
492
533
|
"GC_STOREFRONT_14_DEFAULT_LOCALE",
|
|
493
534
|
"GC_STOREFRONT_14_DOMAIN",
|
|
494
535
|
"GC_STOREFRONT_14_GOOGLE_ANALYTICS_ID",
|
|
@@ -522,6 +563,7 @@ exports[`traverses a schema and returns a list of env variables that match 1`] =
|
|
|
522
563
|
"GC_STOREFRONT_15",
|
|
523
564
|
"GC_STOREFRONT_15_CANONICAL_BASE_URL",
|
|
524
565
|
"GC_STOREFRONT_15_CART_DISPLAY_PRICES_INCL_TAX",
|
|
566
|
+
"GC_STOREFRONT_15_COMPARE_CHECKBOX",
|
|
525
567
|
"GC_STOREFRONT_15_DEFAULT_LOCALE",
|
|
526
568
|
"GC_STOREFRONT_15_DOMAIN",
|
|
527
569
|
"GC_STOREFRONT_15_GOOGLE_ANALYTICS_ID",
|
|
@@ -555,6 +597,7 @@ exports[`traverses a schema and returns a list of env variables that match 1`] =
|
|
|
555
597
|
"GC_STOREFRONT_16",
|
|
556
598
|
"GC_STOREFRONT_16_CANONICAL_BASE_URL",
|
|
557
599
|
"GC_STOREFRONT_16_CART_DISPLAY_PRICES_INCL_TAX",
|
|
600
|
+
"GC_STOREFRONT_16_COMPARE_CHECKBOX",
|
|
558
601
|
"GC_STOREFRONT_16_DEFAULT_LOCALE",
|
|
559
602
|
"GC_STOREFRONT_16_DOMAIN",
|
|
560
603
|
"GC_STOREFRONT_16_GOOGLE_ANALYTICS_ID",
|
|
@@ -588,6 +631,7 @@ exports[`traverses a schema and returns a list of env variables that match 1`] =
|
|
|
588
631
|
"GC_STOREFRONT_17",
|
|
589
632
|
"GC_STOREFRONT_17_CANONICAL_BASE_URL",
|
|
590
633
|
"GC_STOREFRONT_17_CART_DISPLAY_PRICES_INCL_TAX",
|
|
634
|
+
"GC_STOREFRONT_17_COMPARE_CHECKBOX",
|
|
591
635
|
"GC_STOREFRONT_17_DEFAULT_LOCALE",
|
|
592
636
|
"GC_STOREFRONT_17_DOMAIN",
|
|
593
637
|
"GC_STOREFRONT_17_GOOGLE_ANALYTICS_ID",
|
|
@@ -621,6 +665,7 @@ exports[`traverses a schema and returns a list of env variables that match 1`] =
|
|
|
621
665
|
"GC_STOREFRONT_18",
|
|
622
666
|
"GC_STOREFRONT_18_CANONICAL_BASE_URL",
|
|
623
667
|
"GC_STOREFRONT_18_CART_DISPLAY_PRICES_INCL_TAX",
|
|
668
|
+
"GC_STOREFRONT_18_COMPARE_CHECKBOX",
|
|
624
669
|
"GC_STOREFRONT_18_DEFAULT_LOCALE",
|
|
625
670
|
"GC_STOREFRONT_18_DOMAIN",
|
|
626
671
|
"GC_STOREFRONT_18_GOOGLE_ANALYTICS_ID",
|
|
@@ -654,6 +699,7 @@ exports[`traverses a schema and returns a list of env variables that match 1`] =
|
|
|
654
699
|
"GC_STOREFRONT_19",
|
|
655
700
|
"GC_STOREFRONT_19_CANONICAL_BASE_URL",
|
|
656
701
|
"GC_STOREFRONT_19_CART_DISPLAY_PRICES_INCL_TAX",
|
|
702
|
+
"GC_STOREFRONT_19_COMPARE_CHECKBOX",
|
|
657
703
|
"GC_STOREFRONT_19_DEFAULT_LOCALE",
|
|
658
704
|
"GC_STOREFRONT_19_DOMAIN",
|
|
659
705
|
"GC_STOREFRONT_19_GOOGLE_ANALYTICS_ID",
|
|
@@ -687,6 +733,7 @@ exports[`traverses a schema and returns a list of env variables that match 1`] =
|
|
|
687
733
|
"GC_STOREFRONT_20",
|
|
688
734
|
"GC_STOREFRONT_20_CANONICAL_BASE_URL",
|
|
689
735
|
"GC_STOREFRONT_20_CART_DISPLAY_PRICES_INCL_TAX",
|
|
736
|
+
"GC_STOREFRONT_20_COMPARE_CHECKBOX",
|
|
690
737
|
"GC_STOREFRONT_20_DEFAULT_LOCALE",
|
|
691
738
|
"GC_STOREFRONT_20_DOMAIN",
|
|
692
739
|
"GC_STOREFRONT_20_GOOGLE_ANALYTICS_ID",
|
|
@@ -129,12 +129,6 @@ it('finds plugins', () => {
|
|
|
129
129
|
"ifConfig": "googleRecaptchaKey",
|
|
130
130
|
"plugin": "@graphcommerce/googlerecaptcha/plugins/GrecaptchaGraphQLProvider",
|
|
131
131
|
},
|
|
132
|
-
{
|
|
133
|
-
"enabled": true,
|
|
134
|
-
"exported": "@graphcommerce/graphcms-ui",
|
|
135
|
-
"func": "hygraphPageContent",
|
|
136
|
-
"plugin": "@graphcommerce/hygraph-dynamic-rows/plugins/hygraphDynamicRowsPageContent",
|
|
137
|
-
},
|
|
138
132
|
{
|
|
139
133
|
"enabled": true,
|
|
140
134
|
"exported": "@graphcommerce/graphql/config",
|
|
@@ -223,6 +217,34 @@ it('finds plugins', () => {
|
|
|
223
217
|
"ifConfig": "googleTagmanagerId",
|
|
224
218
|
"plugin": "@graphcommerce/googletagmanager/plugins/GtagFramerNextPages",
|
|
225
219
|
},
|
|
220
|
+
{
|
|
221
|
+
"component": "CartFab",
|
|
222
|
+
"enabled": false,
|
|
223
|
+
"exported": "@graphcommerce/magento-cart",
|
|
224
|
+
"ifConfig": "compare",
|
|
225
|
+
"plugin": "@graphcommerce/magento-compare/plugins/AddCompareFabNextToCart",
|
|
226
|
+
},
|
|
227
|
+
{
|
|
228
|
+
"component": "ProductPageAddToCartActionsRow",
|
|
229
|
+
"enabled": false,
|
|
230
|
+
"exported": "@graphcommerce/magento-product",
|
|
231
|
+
"ifConfig": "compare",
|
|
232
|
+
"plugin": "@graphcommerce/magento-compare/plugins/AddCompareToProductPage",
|
|
233
|
+
},
|
|
234
|
+
{
|
|
235
|
+
"component": "GraphQLProvider",
|
|
236
|
+
"enabled": false,
|
|
237
|
+
"exported": "@graphcommerce/graphql",
|
|
238
|
+
"ifConfig": "compare",
|
|
239
|
+
"plugin": "@graphcommerce/magento-compare/plugins/AddCompareTypePolicies",
|
|
240
|
+
},
|
|
241
|
+
{
|
|
242
|
+
"component": "ProductListItem",
|
|
243
|
+
"enabled": false,
|
|
244
|
+
"exported": "@graphcommerce/magento-product",
|
|
245
|
+
"ifConfig": "compare",
|
|
246
|
+
"plugin": "@graphcommerce/magento-compare/plugins/CompareAbleProductListItem",
|
|
247
|
+
},
|
|
226
248
|
]
|
|
227
249
|
`)
|
|
228
250
|
})
|
|
@@ -15,7 +15,6 @@ it('resolves dependences', () => {
|
|
|
15
15
|
"@graphcommerce/magento-cart-shipping-method" => "packages/magento-cart-shipping-method",
|
|
16
16
|
"@graphcommerce/googlerecaptcha" => "packages/googlerecaptcha",
|
|
17
17
|
"@graphcommerce/googletagmanager" => "packages/googletagmanager",
|
|
18
|
-
"@graphcommerce/hygraph-dynamic-rows" => "packages/hygraph-dynamic-rows",
|
|
19
18
|
"@graphcommerce/graphcms-ui" => "packages/hygraph-ui",
|
|
20
19
|
"@graphcommerce/lingui-next" => "packages/lingui-next",
|
|
21
20
|
"@graphcommerce/next-config" => "packagesDev/next-config",
|
|
@@ -24,6 +23,7 @@ it('resolves dependences', () => {
|
|
|
24
23
|
"@graphcommerce/magento-cart-coupon" => "packages/magento-cart-coupon",
|
|
25
24
|
"@graphcommerce/magento-cart-email" => "packages/magento-cart-email",
|
|
26
25
|
"@graphcommerce/magento-cms" => "packages/magento-cms",
|
|
26
|
+
"@graphcommerce/magento-compare" => "packages/magento-compare",
|
|
27
27
|
"@graphcommerce/magento-newsletter" => "packages/magento-newsletter",
|
|
28
28
|
"@graphcommerce/magento-payment-included" => "packages/magento-payment-included",
|
|
29
29
|
"@graphcommerce/magento-cart-payment-method" => "packages/magento-cart-payment-method",
|
package/dist/generated/config.js
CHANGED
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.GraphCommerceStorefrontConfigSchema = exports.GraphCommerceDebugConfigSchema = exports.GraphCommerceConfigSchema = exports.definedNonNullAnySchema = exports.isDefinedNonNullAny = void 0;
|
|
3
|
+
exports.GraphCommerceStorefrontConfigSchema = exports.GraphCommerceDebugConfigSchema = exports.GraphCommerceConfigSchema = exports.CompareVariantSchema = exports.definedNonNullAnySchema = exports.isDefinedNonNullAny = void 0;
|
|
4
4
|
/* eslint-disable */
|
|
5
5
|
const zod_1 = require("zod");
|
|
6
6
|
const isDefinedNonNullAny = (v) => v !== undefined && v !== null;
|
|
7
7
|
exports.isDefinedNonNullAny = isDefinedNonNullAny;
|
|
8
8
|
exports.definedNonNullAnySchema = zod_1.z.any().refine((v) => (0, exports.isDefinedNonNullAny)(v));
|
|
9
|
+
exports.CompareVariantSchema = zod_1.z.enum(['CHECKBOX', 'ICON']);
|
|
9
10
|
function GraphCommerceConfigSchema() {
|
|
10
11
|
return zod_1.z.object({
|
|
11
12
|
canonicalBaseUrl: zod_1.z.string().min(1),
|
|
12
13
|
cartDisplayPricesInclTax: zod_1.z.boolean().nullish(),
|
|
14
|
+
compare: zod_1.z.boolean().nullish(),
|
|
15
|
+
compareVariant: exports.CompareVariantSchema.nullish(),
|
|
13
16
|
customerRequireEmailConfirmation: zod_1.z.boolean().nullish(),
|
|
14
17
|
debug: GraphCommerceDebugConfigSchema().nullish(),
|
|
15
18
|
demoMode: zod_1.z.boolean().nullish(),
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@graphcommerce/next-config",
|
|
3
3
|
"homepage": "https://www.graphcommerce.org/",
|
|
4
4
|
"repository": "github:graphcommerce-org/graphcommerce",
|
|
5
|
-
"version": "6.2.0-canary.
|
|
5
|
+
"version": "6.2.0-canary.9",
|
|
6
6
|
"type": "commonjs",
|
|
7
7
|
"main": "dist/index.js",
|
|
8
8
|
"types": "src/index.ts",
|
package/src/config/demoConfig.ts
CHANGED
package/src/generated/config.ts
CHANGED
|
@@ -14,6 +14,10 @@ export type Scalars = {
|
|
|
14
14
|
Float: number;
|
|
15
15
|
};
|
|
16
16
|
|
|
17
|
+
export type CompareVariant =
|
|
18
|
+
| 'CHECKBOX'
|
|
19
|
+
| 'ICON';
|
|
20
|
+
|
|
17
21
|
/**
|
|
18
22
|
* # GraphCommerce configuration system
|
|
19
23
|
*
|
|
@@ -107,6 +111,13 @@ export type GraphCommerceConfig = {
|
|
|
107
111
|
* When Magento's StoreConfig adds this value, this can be replaced.
|
|
108
112
|
*/
|
|
109
113
|
cartDisplayPricesInclTax?: InputMaybe<Scalars['Boolean']>;
|
|
114
|
+
/** Use compare functionality */
|
|
115
|
+
compare?: InputMaybe<Scalars['Boolean']>;
|
|
116
|
+
/**
|
|
117
|
+
* By default the compare feature is denoted with a 'compare icon' (2 arrows facing one another).
|
|
118
|
+
* This may be fine for experienced users, but for more clarity it's also possible to present the compare feature as a checkbox accompanied by the 'Compare' label
|
|
119
|
+
*/
|
|
120
|
+
compareVariant?: InputMaybe<CompareVariant>;
|
|
110
121
|
/**
|
|
111
122
|
* Due to a limitation in the GraphQL API of Magento 2, we need to know if the
|
|
112
123
|
* customer requires email confirmation.
|
|
@@ -316,10 +327,14 @@ export const isDefinedNonNullAny = (v: any): v is definedNonNullAny => v !== und
|
|
|
316
327
|
|
|
317
328
|
export const definedNonNullAnySchema = z.any().refine((v) => isDefinedNonNullAny(v));
|
|
318
329
|
|
|
330
|
+
export const CompareVariantSchema = z.enum(['CHECKBOX', 'ICON']);
|
|
331
|
+
|
|
319
332
|
export function GraphCommerceConfigSchema(): z.ZodObject<Properties<GraphCommerceConfig>> {
|
|
320
333
|
return z.object<Properties<GraphCommerceConfig>>({
|
|
321
334
|
canonicalBaseUrl: z.string().min(1),
|
|
322
335
|
cartDisplayPricesInclTax: z.boolean().nullish(),
|
|
336
|
+
compare: z.boolean().nullish(),
|
|
337
|
+
compareVariant: CompareVariantSchema.nullish(),
|
|
323
338
|
customerRequireEmailConfirmation: z.boolean().nullish(),
|
|
324
339
|
debug: GraphCommerceDebugConfigSchema().nullish(),
|
|
325
340
|
demoMode: z.boolean().nullish(),
|