@graphcommerce/next-config 9.0.0-canary.58 → 9.0.0-canary.60
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 +4 -0
- package/__tests__/interceptors/findPlugins.ts +55 -47
- package/__tests__/interceptors/generateInterceptors.ts +2 -2
- package/__tests__/interceptors/parseStructure.ts +2 -2
- package/dist/interceptors/findOriginalSource.js +1 -1
- package/dist/withGraphCommerce.js +8 -9
- package/package.json +1 -1
- package/src/interceptors/findOriginalSource.ts +1 -1
- package/src/withGraphCommerce.ts +8 -8
package/CHANGELOG.md
CHANGED
|
@@ -24,10 +24,10 @@ it('finds plugins', () => {
|
|
|
24
24
|
{
|
|
25
25
|
"enabled": true,
|
|
26
26
|
"ifConfig": "googleAnalyticsId",
|
|
27
|
-
"sourceExport": "
|
|
27
|
+
"sourceExport": "sendEvent",
|
|
28
28
|
"sourceModule": "@graphcommerce/googleanalytics/plugins/gtagEvent",
|
|
29
29
|
"targetExport": "sendEvent",
|
|
30
|
-
"targetModule": "@graphcommerce/google-datalayer
|
|
30
|
+
"targetModule": "@graphcommerce/google-datalayer",
|
|
31
31
|
"type": "function",
|
|
32
32
|
},
|
|
33
33
|
{
|
|
@@ -42,7 +42,7 @@ it('finds plugins', () => {
|
|
|
42
42
|
{
|
|
43
43
|
"enabled": true,
|
|
44
44
|
"ifConfig": "googleRecaptchaKey",
|
|
45
|
-
"sourceExport": "
|
|
45
|
+
"sourceExport": "GraphQLProvider",
|
|
46
46
|
"sourceModule": "@graphcommerce/googlerecaptcha/plugins/GrecaptchaGraphQLProvider",
|
|
47
47
|
"targetExport": "GraphQLProvider",
|
|
48
48
|
"targetModule": "@graphcommerce/graphql",
|
|
@@ -51,7 +51,7 @@ it('finds plugins', () => {
|
|
|
51
51
|
{
|
|
52
52
|
"enabled": true,
|
|
53
53
|
"ifConfig": "googleRecaptchaKey",
|
|
54
|
-
"sourceExport": "
|
|
54
|
+
"sourceExport": "ApolloErrorSnackbar",
|
|
55
55
|
"sourceModule": "@graphcommerce/googlerecaptcha/plugins/GrecaptchaApolloErrorSnackbar",
|
|
56
56
|
"targetExport": "ApolloErrorSnackbar",
|
|
57
57
|
"targetModule": "@graphcommerce/ecommerce-ui",
|
|
@@ -60,7 +60,7 @@ it('finds plugins', () => {
|
|
|
60
60
|
{
|
|
61
61
|
"enabled": true,
|
|
62
62
|
"ifConfig": "googleRecaptchaKey",
|
|
63
|
-
"sourceExport": "
|
|
63
|
+
"sourceExport": "ApolloErrorFullPage",
|
|
64
64
|
"sourceModule": "@graphcommerce/googlerecaptcha/plugins/GrecaptchaApolloErrorFullPage",
|
|
65
65
|
"targetExport": "ApolloErrorFullPage",
|
|
66
66
|
"targetModule": "@graphcommerce/ecommerce-ui",
|
|
@@ -69,7 +69,7 @@ it('finds plugins', () => {
|
|
|
69
69
|
{
|
|
70
70
|
"enabled": true,
|
|
71
71
|
"ifConfig": "googleRecaptchaKey",
|
|
72
|
-
"sourceExport": "
|
|
72
|
+
"sourceExport": "ApolloErrorAlert",
|
|
73
73
|
"sourceModule": "@graphcommerce/googlerecaptcha/plugins/GrecaptchaApolloErrorAlert",
|
|
74
74
|
"targetExport": "ApolloErrorAlert",
|
|
75
75
|
"targetModule": "@graphcommerce/ecommerce-ui",
|
|
@@ -77,7 +77,7 @@ it('finds plugins', () => {
|
|
|
77
77
|
},
|
|
78
78
|
{
|
|
79
79
|
"enabled": true,
|
|
80
|
-
"sourceExport": "
|
|
80
|
+
"sourceExport": "ProductPageMeta",
|
|
81
81
|
"sourceModule": "@graphcommerce/google-datalayer/plugins/GoogleDatalayerViewItem",
|
|
82
82
|
"targetExport": "ProductPageMeta",
|
|
83
83
|
"targetModule": "@graphcommerce/magento-product",
|
|
@@ -85,15 +85,15 @@ it('finds plugins', () => {
|
|
|
85
85
|
},
|
|
86
86
|
{
|
|
87
87
|
"enabled": true,
|
|
88
|
-
"sourceExport": "
|
|
88
|
+
"sourceExport": "UpdateItemQuantity",
|
|
89
89
|
"sourceModule": "@graphcommerce/google-datalayer/plugins/GoogleDatalayerUseRemoveItemFromCart",
|
|
90
90
|
"targetExport": "UpdateItemQuantity",
|
|
91
|
-
"targetModule": "@graphcommerce/magento-cart-items
|
|
91
|
+
"targetModule": "@graphcommerce/magento-cart-items",
|
|
92
92
|
"type": "component",
|
|
93
93
|
},
|
|
94
94
|
{
|
|
95
95
|
"enabled": true,
|
|
96
|
-
"sourceExport": "
|
|
96
|
+
"sourceExport": "ShippingMethodForm",
|
|
97
97
|
"sourceModule": "@graphcommerce/google-datalayer/plugins/GoogleDatalayerShippingMethodForm",
|
|
98
98
|
"targetExport": "ShippingMethodForm",
|
|
99
99
|
"targetModule": "@graphcommerce/magento-cart-shipping-method",
|
|
@@ -109,7 +109,7 @@ it('finds plugins', () => {
|
|
|
109
109
|
},
|
|
110
110
|
{
|
|
111
111
|
"enabled": true,
|
|
112
|
-
"sourceExport": "
|
|
112
|
+
"sourceExport": "ProductListItemsBase",
|
|
113
113
|
"sourceModule": "@graphcommerce/google-datalayer/plugins/GoogleDatalayerProductListItemsBase",
|
|
114
114
|
"targetExport": "ProductListItemsBase",
|
|
115
115
|
"targetModule": "@graphcommerce/magento-product",
|
|
@@ -117,7 +117,7 @@ it('finds plugins', () => {
|
|
|
117
117
|
},
|
|
118
118
|
{
|
|
119
119
|
"enabled": true,
|
|
120
|
-
"sourceExport": "
|
|
120
|
+
"sourceExport": "ProductListItem",
|
|
121
121
|
"sourceModule": "@graphcommerce/google-datalayer/plugins/GoogleDatalayerProductListItem",
|
|
122
122
|
"targetExport": "ProductListItem",
|
|
123
123
|
"targetModule": "@graphcommerce/magento-product",
|
|
@@ -125,7 +125,7 @@ it('finds plugins', () => {
|
|
|
125
125
|
},
|
|
126
126
|
{
|
|
127
127
|
"enabled": true,
|
|
128
|
-
"sourceExport": "
|
|
128
|
+
"sourceExport": "PaymentMethodContextProvider",
|
|
129
129
|
"sourceModule": "@graphcommerce/google-datalayer/plugins/GoogleDatalayerPaymentMethodContextProvider",
|
|
130
130
|
"targetExport": "PaymentMethodContextProvider",
|
|
131
131
|
"targetModule": "@graphcommerce/magento-cart-payment-method",
|
|
@@ -133,7 +133,7 @@ it('finds plugins', () => {
|
|
|
133
133
|
},
|
|
134
134
|
{
|
|
135
135
|
"enabled": true,
|
|
136
|
-
"sourceExport": "
|
|
136
|
+
"sourceExport": "PaymentMethodButton",
|
|
137
137
|
"sourceModule": "@graphcommerce/google-datalayer/plugins/GoogleDatalayerPaymentMethodButton",
|
|
138
138
|
"targetExport": "PaymentMethodButton",
|
|
139
139
|
"targetModule": "@graphcommerce/magento-cart-payment-method",
|
|
@@ -141,7 +141,7 @@ it('finds plugins', () => {
|
|
|
141
141
|
},
|
|
142
142
|
{
|
|
143
143
|
"enabled": true,
|
|
144
|
-
"sourceExport": "
|
|
144
|
+
"sourceExport": "CartStartCheckoutLinkOrButton",
|
|
145
145
|
"sourceModule": "@graphcommerce/google-datalayer/plugins/GoogleDatalayerCartStartCheckoutLinkOrButton",
|
|
146
146
|
"targetExport": "CartStartCheckoutLinkOrButton",
|
|
147
147
|
"targetModule": "@graphcommerce/magento-cart",
|
|
@@ -149,7 +149,7 @@ it('finds plugins', () => {
|
|
|
149
149
|
},
|
|
150
150
|
{
|
|
151
151
|
"enabled": true,
|
|
152
|
-
"sourceExport": "
|
|
152
|
+
"sourceExport": "CartStartCheckout",
|
|
153
153
|
"sourceModule": "@graphcommerce/google-datalayer/plugins/GoogleDatalayerCartStartCheckout",
|
|
154
154
|
"targetExport": "CartStartCheckout",
|
|
155
155
|
"targetModule": "@graphcommerce/magento-cart",
|
|
@@ -157,7 +157,7 @@ it('finds plugins', () => {
|
|
|
157
157
|
},
|
|
158
158
|
{
|
|
159
159
|
"enabled": true,
|
|
160
|
-
"sourceExport": "
|
|
160
|
+
"sourceExport": "AddProductsToCartForm",
|
|
161
161
|
"sourceModule": "@graphcommerce/google-datalayer/plugins/GoogleDatalayerAddProductsToCartForm",
|
|
162
162
|
"targetExport": "AddProductsToCartForm",
|
|
163
163
|
"targetModule": "@graphcommerce/magento-product",
|
|
@@ -173,7 +173,7 @@ it('finds plugins', () => {
|
|
|
173
173
|
},
|
|
174
174
|
{
|
|
175
175
|
"enabled": true,
|
|
176
|
-
"sourceExport": "
|
|
176
|
+
"sourceExport": "graphqlConfig",
|
|
177
177
|
"sourceModule": "@graphcommerce/graphcms-ui/plugins/hygraphGraphqlConfig",
|
|
178
178
|
"targetExport": "graphqlConfig",
|
|
179
179
|
"targetModule": "@graphcommerce/graphql",
|
|
@@ -189,7 +189,15 @@ it('finds plugins', () => {
|
|
|
189
189
|
},
|
|
190
190
|
{
|
|
191
191
|
"enabled": true,
|
|
192
|
-
"sourceExport": "
|
|
192
|
+
"sourceExport": "meshConfig",
|
|
193
|
+
"sourceModule": "@graphcommerce/graphql-mesh/plugins/meshConfigFake",
|
|
194
|
+
"targetExport": "meshConfig",
|
|
195
|
+
"targetModule": "@graphcommerce/graphql-mesh/meshConfig",
|
|
196
|
+
"type": "function",
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
"enabled": true,
|
|
200
|
+
"sourceExport": "hygraphPageContent",
|
|
193
201
|
"sourceModule": "@graphcommerce/hygraph-dynamic-rows/plugins/hygraphDynamicRowsPageContent",
|
|
194
202
|
"targetExport": "hygraphPageContent",
|
|
195
203
|
"targetModule": "@graphcommerce/graphcms-ui",
|
|
@@ -197,7 +205,7 @@ it('finds plugins', () => {
|
|
|
197
205
|
},
|
|
198
206
|
{
|
|
199
207
|
"enabled": true,
|
|
200
|
-
"sourceExport": "
|
|
208
|
+
"sourceExport": "useSignInForm",
|
|
201
209
|
"sourceModule": "@graphcommerce/magento-cart/plugins/useSignInFormMergeCart",
|
|
202
210
|
"targetExport": "useSignInForm",
|
|
203
211
|
"targetModule": "@graphcommerce/magento-customer",
|
|
@@ -249,15 +257,15 @@ it('finds plugins', () => {
|
|
|
249
257
|
},
|
|
250
258
|
{
|
|
251
259
|
"enabled": true,
|
|
252
|
-
"sourceExport": "
|
|
260
|
+
"sourceExport": "graphqlConfig",
|
|
253
261
|
"sourceModule": "@graphcommerce/magento-graphql/plugins/magentoGraphqlConfig",
|
|
254
262
|
"targetExport": "graphqlConfig",
|
|
255
|
-
"targetModule": "@graphcommerce/graphql
|
|
263
|
+
"targetModule": "@graphcommerce/graphql",
|
|
256
264
|
"type": "function",
|
|
257
265
|
},
|
|
258
266
|
{
|
|
259
267
|
"enabled": true,
|
|
260
|
-
"sourceExport": "
|
|
268
|
+
"sourceExport": "PaymentMethodContextProvider",
|
|
261
269
|
"sourceModule": "@graphcommerce/magento-payment-included/plugins/AddIncludedMethods",
|
|
262
270
|
"targetExport": "PaymentMethodContextProvider",
|
|
263
271
|
"targetModule": "@graphcommerce/magento-cart-payment-method",
|
|
@@ -281,7 +289,7 @@ it('finds plugins', () => {
|
|
|
281
289
|
},
|
|
282
290
|
{
|
|
283
291
|
"enabled": true,
|
|
284
|
-
"sourceExport": "
|
|
292
|
+
"sourceExport": "ProductPagePriceTiers",
|
|
285
293
|
"sourceModule": "@graphcommerce/magento-product-configurable/plugins/ConfigurableProductPage/ConfigurableProductPagePriceTiers",
|
|
286
294
|
"targetExport": "ProductPagePriceTiers",
|
|
287
295
|
"targetModule": "@graphcommerce/magento-product",
|
|
@@ -289,7 +297,7 @@ it('finds plugins', () => {
|
|
|
289
297
|
},
|
|
290
298
|
{
|
|
291
299
|
"enabled": true,
|
|
292
|
-
"sourceExport": "
|
|
300
|
+
"sourceExport": "ProductPagePrice",
|
|
293
301
|
"sourceModule": "@graphcommerce/magento-product-configurable/plugins/ConfigurableProductPage/ConfigurableProductPagePrice",
|
|
294
302
|
"targetExport": "ProductPagePrice",
|
|
295
303
|
"targetModule": "@graphcommerce/magento-product",
|
|
@@ -297,7 +305,7 @@ it('finds plugins', () => {
|
|
|
297
305
|
},
|
|
298
306
|
{
|
|
299
307
|
"enabled": true,
|
|
300
|
-
"sourceExport": "
|
|
308
|
+
"sourceExport": "ProductPageGallery",
|
|
301
309
|
"sourceModule": "@graphcommerce/magento-product-configurable/plugins/ConfigurableProductPage/ConfigurableProductPageGallery",
|
|
302
310
|
"targetExport": "ProductPageGallery",
|
|
303
311
|
"targetModule": "@graphcommerce/magento-product",
|
|
@@ -329,7 +337,7 @@ it('finds plugins', () => {
|
|
|
329
337
|
},
|
|
330
338
|
{
|
|
331
339
|
"enabled": true,
|
|
332
|
-
"sourceExport": "
|
|
340
|
+
"sourceExport": "AddProductsToCartForm",
|
|
333
341
|
"sourceModule": "@graphcommerce/magento-wishlist/plugins/WishlistProductAddToCartFormPlugin",
|
|
334
342
|
"targetExport": "AddProductsToCartForm",
|
|
335
343
|
"targetModule": "@graphcommerce/magento-product",
|
|
@@ -337,7 +345,7 @@ it('finds plugins', () => {
|
|
|
337
345
|
},
|
|
338
346
|
{
|
|
339
347
|
"enabled": true,
|
|
340
|
-
"sourceExport": "
|
|
348
|
+
"sourceExport": "WishlistItemActionCard",
|
|
341
349
|
"sourceModule": "@graphcommerce/magento-wishlist/plugins/ConfigurableWishlistItemActionCard",
|
|
342
350
|
"targetExport": "WishlistItemActionCard",
|
|
343
351
|
"targetModule": "@graphcommerce/magento-wishlist",
|
|
@@ -345,7 +353,7 @@ it('finds plugins', () => {
|
|
|
345
353
|
},
|
|
346
354
|
{
|
|
347
355
|
"enabled": true,
|
|
348
|
-
"sourceExport": "
|
|
356
|
+
"sourceExport": "WishlistItemActionCard",
|
|
349
357
|
"sourceModule": "@graphcommerce/magento-wishlist/plugins/BundleWishlistItemActionCard",
|
|
350
358
|
"targetExport": "WishlistItemActionCard",
|
|
351
359
|
"targetModule": "@graphcommerce/magento-wishlist",
|
|
@@ -353,7 +361,7 @@ it('finds plugins', () => {
|
|
|
353
361
|
},
|
|
354
362
|
{
|
|
355
363
|
"enabled": true,
|
|
356
|
-
"sourceExport": "
|
|
364
|
+
"sourceExport": "ShippingMethodForm",
|
|
357
365
|
"sourceModule": "@graphcommerce/magento-cart-pickup/plugins/AddPickupInStore",
|
|
358
366
|
"targetExport": "ShippingMethodForm",
|
|
359
367
|
"targetModule": "@graphcommerce/magento-cart-shipping-method",
|
|
@@ -361,7 +369,7 @@ it('finds plugins', () => {
|
|
|
361
369
|
},
|
|
362
370
|
{
|
|
363
371
|
"enabled": true,
|
|
364
|
-
"sourceExport": "
|
|
372
|
+
"sourceExport": "PaymentMethodContextProvider",
|
|
365
373
|
"sourceModule": "@graphcommerce/magento-payment-braintree/plugins/AddBraintreeMethods",
|
|
366
374
|
"targetExport": "PaymentMethodContextProvider",
|
|
367
375
|
"targetModule": "@graphcommerce/magento-cart-payment-method",
|
|
@@ -369,7 +377,7 @@ it('finds plugins', () => {
|
|
|
369
377
|
},
|
|
370
378
|
{
|
|
371
379
|
"enabled": true,
|
|
372
|
-
"sourceExport": "
|
|
380
|
+
"sourceExport": "PaymentMethodContextProvider",
|
|
373
381
|
"sourceModule": "@graphcommerce/mollie-magento-payment/plugins/AddMollieMethods",
|
|
374
382
|
"targetExport": "PaymentMethodContextProvider",
|
|
375
383
|
"targetModule": "@graphcommerce/magento-cart-payment-method",
|
|
@@ -377,7 +385,7 @@ it('finds plugins', () => {
|
|
|
377
385
|
},
|
|
378
386
|
{
|
|
379
387
|
"enabled": true,
|
|
380
|
-
"sourceExport": "
|
|
388
|
+
"sourceExport": "PaymentMethodContextProvider",
|
|
381
389
|
"sourceModule": "@graphcommerce/magento-payment-paypal/plugins/AddPaypalMethods",
|
|
382
390
|
"targetExport": "PaymentMethodContextProvider",
|
|
383
391
|
"targetModule": "@graphcommerce/magento-cart-payment-method",
|
|
@@ -399,7 +407,7 @@ it('finds plugins', () => {
|
|
|
399
407
|
{
|
|
400
408
|
"enabled": false,
|
|
401
409
|
"ifConfig": "demoMode",
|
|
402
|
-
"sourceExport": "
|
|
410
|
+
"sourceExport": "RowLinks",
|
|
403
411
|
"sourceModule": "@graphcommerce/demo-magento-graphcommerce/plugins/demo/DemoRowLinks",
|
|
404
412
|
"targetExport": "RowLinks",
|
|
405
413
|
"targetModule": "@graphcommerce/next-ui",
|
|
@@ -408,7 +416,7 @@ it('finds plugins', () => {
|
|
|
408
416
|
{
|
|
409
417
|
"enabled": false,
|
|
410
418
|
"ifConfig": "demoMode",
|
|
411
|
-
"sourceExport": "
|
|
419
|
+
"sourceExport": "RecentlyViewedProducts",
|
|
412
420
|
"sourceModule": "@graphcommerce/demo-magento-graphcommerce/plugins/demo/DemoRecentlyViewedProducts",
|
|
413
421
|
"targetExport": "RecentlyViewedProducts",
|
|
414
422
|
"targetModule": "@graphcommerce/magento-recently-viewed-products",
|
|
@@ -417,7 +425,7 @@ it('finds plugins', () => {
|
|
|
417
425
|
{
|
|
418
426
|
"enabled": false,
|
|
419
427
|
"ifConfig": "demoMode",
|
|
420
|
-
"sourceExport": "
|
|
428
|
+
"sourceExport": "ProductListItemConfigurable",
|
|
421
429
|
"sourceModule": "@graphcommerce/demo-magento-graphcommerce/plugins/demo/DemoProductListItemConfigurable",
|
|
422
430
|
"targetExport": "ProductListItemConfigurable",
|
|
423
431
|
"targetModule": "@graphcommerce/magento-product-configurable",
|
|
@@ -435,10 +443,10 @@ it('finds plugins', () => {
|
|
|
435
443
|
{
|
|
436
444
|
"enabled": false,
|
|
437
445
|
"ifConfig": "googleTagmanagerId",
|
|
438
|
-
"sourceExport": "
|
|
446
|
+
"sourceExport": "sendEvent",
|
|
439
447
|
"sourceModule": "@graphcommerce/googletagmanager/plugins/tagmanagerEvent",
|
|
440
448
|
"targetExport": "sendEvent",
|
|
441
|
-
"targetModule": "@graphcommerce/google-datalayer
|
|
449
|
+
"targetModule": "@graphcommerce/google-datalayer",
|
|
442
450
|
"type": "function",
|
|
443
451
|
},
|
|
444
452
|
{
|
|
@@ -471,7 +479,7 @@ it('finds plugins', () => {
|
|
|
471
479
|
{
|
|
472
480
|
"enabled": false,
|
|
473
481
|
"ifConfig": "compare",
|
|
474
|
-
"sourceExport": "
|
|
482
|
+
"sourceExport": "ProductListItem",
|
|
475
483
|
"sourceModule": "@graphcommerce/magento-compare/plugins/CompareAbleProductListItem",
|
|
476
484
|
"targetExport": "ProductListItem",
|
|
477
485
|
"targetModule": "@graphcommerce/magento-product",
|
|
@@ -489,7 +497,7 @@ it('finds plugins', () => {
|
|
|
489
497
|
{
|
|
490
498
|
"enabled": false,
|
|
491
499
|
"ifConfig": "compare",
|
|
492
|
-
"sourceExport": "
|
|
500
|
+
"sourceExport": "ProductPageAddToCartActionsRow",
|
|
493
501
|
"sourceModule": "@graphcommerce/magento-compare/plugins/AddCompareToProductPage",
|
|
494
502
|
"targetExport": "ProductPageAddToCartActionsRow",
|
|
495
503
|
"targetModule": "@graphcommerce/magento-product",
|
|
@@ -498,7 +506,7 @@ it('finds plugins', () => {
|
|
|
498
506
|
{
|
|
499
507
|
"enabled": false,
|
|
500
508
|
"ifConfig": "compare",
|
|
501
|
-
"sourceExport": "
|
|
509
|
+
"sourceExport": "CartFab",
|
|
502
510
|
"sourceModule": "@graphcommerce/magento-compare/plugins/AddCompareFabNextToCart",
|
|
503
511
|
"targetExport": "CartFab",
|
|
504
512
|
"targetModule": "@graphcommerce/magento-cart",
|
|
@@ -516,7 +524,7 @@ it('finds plugins', () => {
|
|
|
516
524
|
{
|
|
517
525
|
"enabled": false,
|
|
518
526
|
"ifConfig": "configurableVariantValues.content",
|
|
519
|
-
"sourceExport": "
|
|
527
|
+
"sourceExport": "ProductShortDescription",
|
|
520
528
|
"sourceModule": "@graphcommerce/magento-product-configurable/plugins/ConfigurableProductPage/ConfigurableProductShortDescription",
|
|
521
529
|
"targetExport": "ProductShortDescription",
|
|
522
530
|
"targetModule": "@graphcommerce/magento-product",
|
|
@@ -525,7 +533,7 @@ it('finds plugins', () => {
|
|
|
525
533
|
{
|
|
526
534
|
"enabled": false,
|
|
527
535
|
"ifConfig": "configurableVariantValues.content",
|
|
528
|
-
"sourceExport": "
|
|
536
|
+
"sourceExport": "ProductPageName",
|
|
529
537
|
"sourceModule": "@graphcommerce/magento-product-configurable/plugins/ConfigurableProductPage/ConfigurableProductPageName",
|
|
530
538
|
"targetExport": "ProductPageName",
|
|
531
539
|
"targetModule": "@graphcommerce/magento-product",
|
|
@@ -534,7 +542,7 @@ it('finds plugins', () => {
|
|
|
534
542
|
{
|
|
535
543
|
"enabled": false,
|
|
536
544
|
"ifConfig": "configurableVariantValues.url",
|
|
537
|
-
"sourceExport": "
|
|
545
|
+
"sourceExport": "ProductPageMeta",
|
|
538
546
|
"sourceModule": "@graphcommerce/magento-product-configurable/plugins/ConfigurableProductPage/ConfigurableProductPageMeta",
|
|
539
547
|
"targetExport": "ProductPageMeta",
|
|
540
548
|
"targetModule": "@graphcommerce/magento-product",
|
|
@@ -543,7 +551,7 @@ it('finds plugins', () => {
|
|
|
543
551
|
{
|
|
544
552
|
"enabled": false,
|
|
545
553
|
"ifConfig": "configurableVariantValues.content",
|
|
546
|
-
"sourceExport": "
|
|
554
|
+
"sourceExport": "ProductPageJsonLd",
|
|
547
555
|
"sourceModule": "@graphcommerce/magento-product-configurable/plugins/ConfigurableProductPage/ConfigurableProductPageJsonLd",
|
|
548
556
|
"targetExport": "ProductPageJsonLd",
|
|
549
557
|
"targetModule": "@graphcommerce/magento-product",
|
|
@@ -552,7 +560,7 @@ it('finds plugins', () => {
|
|
|
552
560
|
{
|
|
553
561
|
"enabled": false,
|
|
554
562
|
"ifConfig": "configurableVariantValues.content",
|
|
555
|
-
"sourceExport": "
|
|
563
|
+
"sourceExport": "ProductPageDescription",
|
|
556
564
|
"sourceModule": "@graphcommerce/magento-product-configurable/plugins/ConfigurableProductPage/ConfigurableProductPageDescription",
|
|
557
565
|
"targetExport": "ProductPageDescription",
|
|
558
566
|
"targetModule": "@graphcommerce/magento-product",
|
|
@@ -561,7 +569,7 @@ it('finds plugins', () => {
|
|
|
561
569
|
{
|
|
562
570
|
"enabled": false,
|
|
563
571
|
"ifConfig": "recentlyViewedProducts.enabled",
|
|
564
|
-
"sourceExport": "
|
|
572
|
+
"sourceExport": "ProductPageMeta",
|
|
565
573
|
"sourceModule": "@graphcommerce/magento-recently-viewed-products/plugins/RegisterProductAsRecentlyViewed",
|
|
566
574
|
"targetExport": "ProductPageMeta",
|
|
567
575
|
"targetModule": "@graphcommerce/magento-product",
|
|
@@ -551,13 +551,13 @@ it('correctly reports an error for an incorrect export', async () => {
|
|
|
551
551
|
|
|
552
552
|
const src = `
|
|
553
553
|
import { getSitemapPaths as getSitemapPathsType } from '@graphcommerce/magento-product'
|
|
554
|
-
import { IfConfig,
|
|
554
|
+
import { IfConfig, FunctionPlugin } from '@graphcommerce/next-config'
|
|
555
555
|
|
|
556
556
|
export const method = 'getSitemapPaths'
|
|
557
557
|
export const exported = '@graphcommerce/magento-product'
|
|
558
558
|
export const ifConfig: IfConfig = 'demoMode'
|
|
559
559
|
|
|
560
|
-
export const plugin:
|
|
560
|
+
export const plugin: FunctionPlugin<typeof getSitemapPathsType> = (prev, ...args) => {
|
|
561
561
|
console.log('getSitemapPaths plugin ran!')
|
|
562
562
|
return prev(...args)
|
|
563
563
|
}
|
|
@@ -77,12 +77,12 @@ export const Plugin = DemoProductListItemConfigurable
|
|
|
77
77
|
it('correctly parses the classic function plugin config', () => {
|
|
78
78
|
const src = `
|
|
79
79
|
import { graphqlConfig, setContext } from '@graphcommerce/graphql'
|
|
80
|
-
import type {
|
|
80
|
+
import type { FunctionPlugin } from '@graphcommerce/next-config'
|
|
81
81
|
|
|
82
82
|
export const func = 'graphqlConfig'
|
|
83
83
|
export const exported = '@graphcommerce/graphql'
|
|
84
84
|
|
|
85
|
-
const hygraphGraphqlConfig:
|
|
85
|
+
const hygraphGraphqlConfig: FunctionPlugin<typeof graphqlConfig> = (prev, config) => {
|
|
86
86
|
const results = prev(config)
|
|
87
87
|
|
|
88
88
|
const locales = config.storefront.hygraphLocales
|
|
@@ -81,7 +81,7 @@ function findOriginalSource(plug, resolved, resolve) {
|
|
|
81
81
|
if (!resolved?.source)
|
|
82
82
|
return {
|
|
83
83
|
resolved: undefined,
|
|
84
|
-
error: new Error(`
|
|
84
|
+
error: new Error(`Plugin: Can not find module ${plug.targetModule} for ${plug.sourceModule}`),
|
|
85
85
|
};
|
|
86
86
|
// const cacheKey = `${plug.targetModule}#${plug.targetExport}`
|
|
87
87
|
// if (cachedResults.has(cacheKey)) {
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.withGraphCommerce = withGraphCommerce;
|
|
7
|
-
|
|
4
|
+
// import CircularDependencyPlugin from 'circular-dependency-plugin'
|
|
8
5
|
const plugin_1 = require("inspectpack/plugin");
|
|
9
6
|
const webpack_1 = require("webpack");
|
|
10
7
|
const loadConfig_1 = require("./config/loadConfig");
|
|
@@ -114,11 +111,13 @@ function withGraphCommerce(nextConfig, cwd) {
|
|
|
114
111
|
// To properly properly treeshake @apollo/client we need to define the __DEV__ property
|
|
115
112
|
config.plugins.push(new webpack_1.DefinePlugin({ 'globalThis.__DEV__': options.dev }));
|
|
116
113
|
if (!options.isServer) {
|
|
117
|
-
if (graphcommerceConfig.debug?.webpackCircularDependencyPlugin) {
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
}
|
|
114
|
+
// if (graphcommerceConfig.debug?.webpackCircularDependencyPlugin) {
|
|
115
|
+
// config.plugins.push(
|
|
116
|
+
// new CircularDependencyPlugin({
|
|
117
|
+
// exclude: /readable-stream|duplexer2|node_modules\/next/,
|
|
118
|
+
// }),
|
|
119
|
+
// )
|
|
120
|
+
// }
|
|
122
121
|
if (graphcommerceConfig.debug?.webpackDuplicatesPlugin) {
|
|
123
122
|
config.plugins.push(new plugin_1.DuplicatesPlugin({
|
|
124
123
|
ignoredPackages: [
|
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": "9.0.0-canary.
|
|
5
|
+
"version": "9.0.0-canary.60",
|
|
6
6
|
"type": "commonjs",
|
|
7
7
|
"main": "dist/index.js",
|
|
8
8
|
"types": "src/index.ts",
|
|
@@ -93,7 +93,7 @@ export function findOriginalSource(
|
|
|
93
93
|
if (!resolved?.source)
|
|
94
94
|
return {
|
|
95
95
|
resolved: undefined,
|
|
96
|
-
error: new Error(`
|
|
96
|
+
error: new Error(`Plugin: Can not find module ${plug.targetModule} for ${plug.sourceModule}`),
|
|
97
97
|
}
|
|
98
98
|
|
|
99
99
|
// const cacheKey = `${plug.targetModule}#${plug.targetExport}`
|
package/src/withGraphCommerce.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import CircularDependencyPlugin from 'circular-dependency-plugin'
|
|
1
|
+
// import CircularDependencyPlugin from 'circular-dependency-plugin'
|
|
2
2
|
import { DuplicatesPlugin } from 'inspectpack/plugin'
|
|
3
3
|
import type { NextConfig } from 'next'
|
|
4
4
|
import { DomainLocale } from 'next/dist/server/config'
|
|
@@ -135,13 +135,13 @@ export function withGraphCommerce(nextConfig: NextConfig, cwd: string): NextConf
|
|
|
135
135
|
config.plugins.push(new DefinePlugin({ 'globalThis.__DEV__': options.dev }))
|
|
136
136
|
|
|
137
137
|
if (!options.isServer) {
|
|
138
|
-
if (graphcommerceConfig.debug?.webpackCircularDependencyPlugin) {
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
}
|
|
138
|
+
// if (graphcommerceConfig.debug?.webpackCircularDependencyPlugin) {
|
|
139
|
+
// config.plugins.push(
|
|
140
|
+
// new CircularDependencyPlugin({
|
|
141
|
+
// exclude: /readable-stream|duplexer2|node_modules\/next/,
|
|
142
|
+
// }),
|
|
143
|
+
// )
|
|
144
|
+
// }
|
|
145
145
|
if (graphcommerceConfig.debug?.webpackDuplicatesPlugin) {
|
|
146
146
|
config.plugins.push(
|
|
147
147
|
new DuplicatesPlugin({
|