@graphcommerce/next-config 9.0.0-canary.104 → 9.0.0-canary.105
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
CHANGED
|
@@ -121,14 +121,12 @@ it("resolves a 'root plugin' to be relative to the interceptor", async () => {
|
|
|
121
121
|
expect(Object.keys(interceptors)[0]).toMatchInlineSnapshot(
|
|
122
122
|
'"packages/magento-cart-payment-method/PaymentMethodContext/PaymentMethodContext"',
|
|
123
123
|
)
|
|
124
|
-
|
|
124
|
+
expect(
|
|
125
125
|
interceptors['packages/magento-cart-payment-method/PaymentMethodContext/PaymentMethodContext']
|
|
126
126
|
?.template,
|
|
127
|
-
).
|
|
128
|
-
"import
|
|
129
|
-
|
|
130
|
-
import { Plugin as PluginAddPaymentMethodEnhancer } from '../../../plugins/AddPaymentMethodEnhancer'"
|
|
131
|
-
`)
|
|
127
|
+
).toContain(
|
|
128
|
+
"import { Plugin as PluginAddPaymentMethodEnhancer } from '../../../plugins/AddPaymentMethodEnhancer'",
|
|
129
|
+
)
|
|
132
130
|
})
|
|
133
131
|
|
|
134
132
|
it('it can apply multiple plugins to a single export', async () => {
|
|
@@ -157,13 +155,12 @@ it('it can apply multiple plugins to a single export', async () => {
|
|
|
157
155
|
const result =
|
|
158
156
|
interceptors['packages/magento-cart-payment-method/PaymentMethodContext/PaymentMethodContext']
|
|
159
157
|
?.template
|
|
160
|
-
|
|
161
|
-
"import
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
import { Plugin as PluginAddMollieMethods } from '@graphcommerce/mollie-magento-payment/plugins/AddMollieMethods'"
|
|
165
|
-
|
|
166
|
-
|
|
158
|
+
expect(result).toContain(
|
|
159
|
+
"import { Plugin as PluginAddAdyenMethods } from '@graphcommerce/magento-payment-adyen/plugins/AddAdyenMethods'",
|
|
160
|
+
)
|
|
161
|
+
expect(result).toContain(
|
|
162
|
+
"import { Plugin as PluginAddMollieMethods } from '@graphcommerce/mollie-magento-payment/plugins/AddMollieMethods'",
|
|
163
|
+
)
|
|
167
164
|
expectOriginal(result).toContain('PaymentMethodContextProviderOriginal')
|
|
168
165
|
|
|
169
166
|
expectInterceptor(result).toMatchInlineSnapshot(`
|
|
@@ -351,12 +348,15 @@ it('generates method interceptors alognside component interceptors', async () =>
|
|
|
351
348
|
resolve,
|
|
352
349
|
)
|
|
353
350
|
|
|
354
|
-
expect(Object.keys(interceptors)).toMatchInlineSnapshot(
|
|
351
|
+
expect(Object.keys(interceptors)).toMatchInlineSnapshot(
|
|
352
|
+
`
|
|
355
353
|
[
|
|
356
354
|
"packages/graphql/components/GraphQLProvider/GraphQLProvider",
|
|
357
355
|
"packages/graphql/config",
|
|
358
356
|
]
|
|
359
|
-
|
|
357
|
+
`,
|
|
358
|
+
)
|
|
359
|
+
|
|
360
360
|
expect(
|
|
361
361
|
interceptors['packages/graphql/components/GraphQLProvider/GraphQLProvider']?.template,
|
|
362
362
|
).toContain('MagentoGraphqlGraphqlProvider')
|
|
@@ -403,10 +403,11 @@ it('adds debug logging to interceptors for components', async () => {
|
|
|
403
403
|
`)
|
|
404
404
|
|
|
405
405
|
expectOriginal(interceptors['packages/graphql/config']?.template).toMatchInlineSnapshot(`
|
|
406
|
-
"import type {
|
|
407
|
-
import type {
|
|
406
|
+
"import type { GraphCommerceStorefrontConfig } from '@graphcommerce/next-config'
|
|
407
|
+
import type { ApolloLink, TypePolicies } from '@apollo/client'
|
|
408
408
|
import type { SetRequired } from 'type-fest'
|
|
409
409
|
import type { MigrateCache } from './components/GraphQLProvider/migrateCache'
|
|
410
|
+
|
|
410
411
|
export interface PreviewData {}
|
|
411
412
|
export type PreviewConfig = {
|
|
412
413
|
preview?: boolean
|
|
@@ -433,7 +434,6 @@ it('adds debug logging to interceptors for components', async () => {
|
|
|
433
434
|
}
|
|
434
435
|
}"
|
|
435
436
|
`)
|
|
436
|
-
|
|
437
437
|
expectInterceptor(interceptors['packages/graphql/config']?.template).toMatchInlineSnapshot(`
|
|
438
438
|
"const logged: Set<string> = new Set()
|
|
439
439
|
const logOnce = (log: string, ...additional: unknown[]) => {
|
|
@@ -535,8 +535,8 @@ it('Should apply overrides to the correct file', async () => {
|
|
|
535
535
|
const result =
|
|
536
536
|
interceptors['packages/magento-product/components/ProductStaticPaths/getProductStaticPaths']
|
|
537
537
|
?.template
|
|
538
|
-
|
|
539
|
-
|
|
538
|
+
expect(result).toContain(
|
|
539
|
+
"import { getProductStaticPaths as getProductStaticPathsreplaceGetProductStaticPaths } from '../../../../plugins/replaceGetProductStaticPaths'",
|
|
540
540
|
)
|
|
541
541
|
|
|
542
542
|
expectOriginal(result).toContain('getProductStaticPathsDisabled')
|
|
@@ -626,8 +626,8 @@ export const Plugin = ConfigurableProductPageName
|
|
|
626
626
|
)
|
|
627
627
|
|
|
628
628
|
const plugins = [...firstFile, ...secondFile]
|
|
629
|
-
|
|
630
|
-
|
|
629
|
+
expect(plugins).toMatchInlineSnapshot(
|
|
630
|
+
`
|
|
631
631
|
[
|
|
632
632
|
{
|
|
633
633
|
"enabled": true,
|
|
@@ -648,8 +648,8 @@ export const Plugin = ConfigurableProductPageName
|
|
|
648
648
|
"type": "component",
|
|
649
649
|
},
|
|
650
650
|
]
|
|
651
|
-
|
|
652
|
-
|
|
651
|
+
`,
|
|
652
|
+
)
|
|
653
653
|
const interceptors = await generateInterceptors(plugins, resolveDependency(projectRoot))
|
|
654
654
|
|
|
655
655
|
expect(Object.keys(interceptors)[0]).toMatchInlineSnapshot(
|
|
@@ -660,14 +660,14 @@ export const Plugin = ConfigurableProductPageName
|
|
|
660
660
|
interceptors['packages/magento-product/components/ProductPageName/ProductPageName']?.template
|
|
661
661
|
|
|
662
662
|
expectImport(result).toMatchInlineSnapshot(`
|
|
663
|
-
"import
|
|
664
|
-
|
|
665
|
-
import { Plugin as PluginConfigurableProductPageName } from '@graphcommerce/magento-product-configurable/plugins/ConfigurableProductPage/ConfigurableProductPageName'
|
|
663
|
+
"import { Plugin as PluginConfigurableProductPageName } from '@graphcommerce/magento-product-configurable/plugins/ConfigurableProductPage/ConfigurableProductPageName'
|
|
664
|
+
import type { DistributedOmit as OmitPrev } from 'type-fest'
|
|
666
665
|
import { ProductPageName as ProductPageNameMyPlugin } from '../../../../plugins/MyPlugin'"
|
|
667
666
|
`)
|
|
668
667
|
|
|
669
668
|
expectOriginal(result).toMatchInlineSnapshot(`
|
|
670
669
|
"import type { ProductPageNameFragment } from './ProductPageName.gql'
|
|
670
|
+
|
|
671
671
|
export type ProductPageNameProps = {
|
|
672
672
|
product: ProductPageNameFragment
|
|
673
673
|
}
|
|
@@ -736,7 +736,6 @@ it('Can correctly find exports that are default exports', async () => {
|
|
|
736
736
|
export const iconChevronLeft = accessibilityHuman
|
|
737
737
|
export const iconChevronRight = alarm
|
|
738
738
|
`
|
|
739
|
-
|
|
740
739
|
const config = {
|
|
741
740
|
demoMode: true,
|
|
742
741
|
configurableVariantForSimple: true,
|
|
@@ -751,8 +750,10 @@ it('Can correctly find exports that are default exports', async () => {
|
|
|
751
750
|
const result = interceptors['packages/next-ui/icons']?.template
|
|
752
751
|
|
|
753
752
|
expectImport(result).toMatchInlineSnapshot(`
|
|
754
|
-
"import {
|
|
755
|
-
|
|
753
|
+
"import {
|
|
754
|
+
iconChevronLeft as iconChevronLeftMyProjectIcon,
|
|
755
|
+
iconChevronRight as iconChevronRightMyProjectIcon,
|
|
756
|
+
} from '../../plugins/MyProjectIcon'"
|
|
756
757
|
`)
|
|
757
758
|
|
|
758
759
|
expectOriginal(result).toContain('iconChevronLeftDisabled')
|
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.105",
|
|
6
6
|
"type": "commonjs",
|
|
7
7
|
"main": "dist/index.js",
|
|
8
8
|
"types": "src/index.ts",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"lodash": "^4.17.21",
|
|
31
31
|
"react": "^18.3.1",
|
|
32
32
|
"typescript": "5.6.2",
|
|
33
|
-
"webpack": "
|
|
33
|
+
"webpack": "^5.96.1",
|
|
34
34
|
"znv": "^0.4.0",
|
|
35
35
|
"zod": "^3.23.8"
|
|
36
36
|
},
|
package/src/config/demoConfig.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
// eslint-disable-next-line import/no-extraneous-dependencies
|
|
2
2
|
import type { PartialDeep } from 'type-fest'
|
|
3
|
-
import type { GraphCommerceConfig } from '../generated/config'
|
|
3
|
+
import type { GraphCommerceConfig, GraphCommerceStorefrontConfig } from '../generated/config'
|
|
4
4
|
|
|
5
5
|
export const demoConfig: PartialDeep<GraphCommerceConfig, { recurseIntoArrays: true }> &
|
|
6
|
-
Record<string, unknown> = {
|
|
6
|
+
Record<string, unknown> & { storefront: PartialDeep<GraphCommerceStorefrontConfig>[] } = {
|
|
7
7
|
canonicalBaseUrl: 'https://graphcommerce.vercel.app',
|
|
8
8
|
hygraphEndpoint: 'https://eu-central-1.cdn.hygraph.com/content/ckhx7xadya6xs01yxdujt8i80/master',
|
|
9
9
|
magentoEndpoint: 'https://backend.reachdigital.dev/graphql',
|