@graphcommerce/magento-cart 9.1.0-canary.55 → 10.0.0-canary.57

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
@@ -1,5 +1,87 @@
1
1
  # Change Log
2
2
 
3
+ ## 10.0.0-canary.57
4
+
5
+ ## 10.0.0-canary.56
6
+
7
+ ### Major Changes
8
+
9
+ - [#2546](https://github.com/graphcommerce-org/graphcommerce/pull/2546) [`ed9332a`](https://github.com/graphcommerce-org/graphcommerce/commit/ed9332a7f78966d932041d9a7725641edc92b28d) - ## GraphCommerce 10 - Turbopack Support
10
+
11
+ This major release brings full Turbopack compatibility, dramatically improving development speed.
12
+
13
+ ### 🚀 Turbopack-Compatible Interceptor System
14
+
15
+ The entire plugin/interceptor system has been rewritten to work with Turbopack:
16
+
17
+ - **No more Webpack plugins** - Removed `InterceptorPlugin` webpack plugin entirely
18
+ - **File-based interception** - Original files are moved to `.original.tsx` and replaced with interceptor content
19
+ - **Direct imports** - Interceptors import from `.original` files instead of embedding source
20
+ - **New CLI commands**:
21
+ - `graphcommerce codegen-interceptors` - Generate interceptor files
22
+ - `graphcommerce cleanup-interceptors` - Reset interceptor system, restore original files
23
+ - **Stable file hashing** - Deterministic interceptor generation for better caching
24
+
25
+ ### ⚙️ Treeshakable Configuration System
26
+
27
+ Replaced Webpack `DefinePlugin`-based `import.meta.graphCommerce` with a new generated configuration system:
28
+
29
+ - **New `codegen-config-values` command** - Generates TypeScript files with precise typing
30
+ - **Schema-driven** - Dynamically introspects Zod schemas to determine all available properties
31
+ - **Fully treeshakable** - Unused config values are eliminated from the bundle
32
+ - **Type-safe** - Uses `Get<GraphCommerceConfig, 'path'>` for nested property access
33
+ - **Separate files for nested objects** - Optimal treeshaking for complex configurations
34
+
35
+ ### 🔧 withGraphCommerce Changes
36
+
37
+ - **Removed** `InterceptorPlugin` - No longer needed with file-based interception
38
+ - **Removed** `DefinePlugin` for `import.meta.graphCommerce` - Replaced with generated config
39
+ - **Removed** `@mui/*` alias rewrites - No longer required
40
+ - **Added** Turbopack loader rules for `.yaml`, `.yml`, and `.po` files
41
+ - **Added** `serverExternalPackages` for all `@whatwg-node/*` packages
42
+ - **Added** `optimizePackageImports` for better bundle optimization
43
+ - **Added** `images.qualities: [52, 75]` for Next.js image optimization
44
+
45
+ ### 📦 Lingui Configuration
46
+
47
+ - **Renamed** `lingui.config.js` → `lingui.config.ts` with TypeScript support
48
+ - **Updated** `@graphcommerce/lingui-next/config` to TypeScript with proper exports
49
+ - **Simplified** formatter options
50
+
51
+ ### ⚛️ React 19 & Next.js 16 Compatibility
52
+
53
+ - Updated `RefObject<T>` types for React 19 (now includes `null` by default)
54
+ - Replaced deprecated `React.VFC` with `React.FC`
55
+ - Fixed `useRef` calls to require explicit initial values
56
+ - Updated `MutableRefObject` usage in `framer-scroller`
57
+
58
+ ### 📋 ESLint 9 Flat Config
59
+
60
+ - Migrated from legacy `.eslintrc` to new flat config format (`eslint.config.mjs`)
61
+ - Updated `@typescript-eslint/*` packages to v8
62
+ - Fixed AST selector for `SxProps` rule (`typeParameters` → `typeArguments`)
63
+
64
+ ### 🔄 Apollo Client
65
+
66
+ - Fixed deprecated `name` option → `clientAwareness: { name: 'ssr' }`
67
+ - Updated error handling types to accept `ApolloError | null | undefined`
68
+
69
+ ### ⚠️ Breaking Changes
70
+
71
+ - **Node.js 24.x not supported** - Restricted to `>=20 <24.0.0` due to [nodejs/undici#4290](https://github.com/nodejs/undici/issues/4290)
72
+ - **Interceptor files changed** - Original components now at `.original.tsx`
73
+ - **Config access changed** - Use generated config values instead of `import.meta.graphCommerce`
74
+ - **ESLint config format** - Must use flat config (`eslint.config.mjs`)
75
+ - **Lingui config** - Rename `lingui.config.js` to `lingui.config.ts`
76
+
77
+ ### 🗑️ Removed
78
+
79
+ - `InterceptorPlugin` webpack plugin
80
+ - `configToImportMeta` utility
81
+ - Webpack `DefinePlugin` usage for config
82
+ - `@mui/*` modern alias rewrites
83
+ - Debug plugins (`CircularDependencyPlugin`, `DuplicatesPlugin`) ([@paales](https://github.com/paales))
84
+
3
85
  ## 9.1.0-canary.55
4
86
 
5
87
  ### Patch Changes
@@ -1,4 +1,5 @@
1
1
  import { useQuery } from '@graphcommerce/graphql'
2
+ import { crossSellsHideCartItems } from '@graphcommerce/next-config/config'
2
3
  import { nonNullable } from '@graphcommerce/next-ui'
3
4
  import { useRouter } from 'next/router'
4
5
  import { useMemo } from 'react'
@@ -6,8 +7,6 @@ import { useCartQuery } from '../../hooks'
6
7
  import { CartAddedDocument } from './CartAdded.gql'
7
8
  import { CrosssellsDocument } from './Crosssells.gql'
8
9
 
9
- const crossSellsHideCartItems = Boolean(import.meta.graphCommerce.crossSellsHideCartItems)
10
-
11
10
  export function useCrosssellItems() {
12
11
  const cartAdded = useCartQuery(CartAddedDocument)
13
12
  const items = (cartAdded.data?.cart?.items ?? []).filter(nonNullable)
@@ -3,7 +3,7 @@ import { useQuery } from '@graphcommerce/graphql'
3
3
  import { extendableComponent, FormDiv } from '@graphcommerce/next-ui'
4
4
  import type { UseFormComposeOptions } from '@graphcommerce/react-hook-form'
5
5
  import { FormPersist, useForm, useFormCompose } from '@graphcommerce/react-hook-form'
6
- import { i18n } from '@lingui/core'
6
+ import { t } from '@lingui/core/macro'
7
7
  import type { SxProps, Theme } from '@mui/material'
8
8
  import { Box, Link, Typography } from '@mui/material'
9
9
  import React from 'react'
@@ -110,7 +110,7 @@ export function CartAgreementsForm(props: CartAgreementsFormProps) {
110
110
  formControl={{ sx: { display: 'block' } }}
111
111
  name={`agreement${agreement.agreement_id}`}
112
112
  rules={{
113
- required: i18n._(/* i18n */ 'You have to agree in order to proceed'),
113
+ required: t`You have to agree in order to proceed`,
114
114
  }}
115
115
  label={labelContent}
116
116
  />
@@ -6,7 +6,7 @@ import {
6
6
  useFabSize,
7
7
  useScrollY,
8
8
  } from '@graphcommerce/next-ui'
9
- import { i18n } from '@lingui/core'
9
+ import { t } from '@lingui/core/macro'
10
10
  import type { BadgeProps, FabProps, SxProps, Theme } from '@mui/material'
11
11
  import { alpha, Box, Fab, styled, useTheme } from '@mui/material'
12
12
  import { m, useTransform } from 'framer-motion'
@@ -60,7 +60,7 @@ function CartFabContent(props: CartFabContentProps) {
60
60
  <MotionFab
61
61
  href='/cart'
62
62
  className={classes.cart}
63
- aria-label={i18n._(/* i18n */ 'Cart')}
63
+ aria-label={t`Cart`}
64
64
  color='inherit'
65
65
  size='responsive'
66
66
  style={{ backgroundColor }}
@@ -8,7 +8,7 @@ import {
8
8
  nonNullable,
9
9
  SectionContainer,
10
10
  } from '@graphcommerce/next-ui'
11
- import { Trans } from '@lingui/react'
11
+ import { Trans } from '@lingui/react/macro'
12
12
  import type { SxProps, Theme } from '@mui/material'
13
13
  import { Box, Divider } from '@mui/material'
14
14
  import { useCartQuery } from '../../hooks'
@@ -54,7 +54,7 @@ export function CartItemSummary(props: OrderSummaryProps) {
54
54
  >
55
55
  <SectionContainer
56
56
  sx={{ '& .SectionHeader-root': { mt: 0 } }}
57
- labelLeft={<Trans id='Order summary' />}
57
+ labelLeft={<Trans>Order summary</Trans>}
58
58
  variantLeft='h6'
59
59
  className={classes.items}
60
60
  >
@@ -1,7 +1,7 @@
1
1
  import { Money } from '@graphcommerce/magento-store'
2
2
  import type { ButtonProps } from '@graphcommerce/next-ui'
3
3
  import { Button, extendableComponent, iconChevronRight, IconSvg } from '@graphcommerce/next-ui'
4
- import { Trans } from '@lingui/macro'
4
+ import { Trans } from '@lingui/react/macro'
5
5
  import type { SxProps, Theme } from '@mui/material'
6
6
  import { Box, Link } from '@mui/material'
7
7
  import React from 'react'
@@ -1,6 +1,6 @@
1
1
  import type { LinkOrButtonProps } from '@graphcommerce/next-ui'
2
2
  import { iconChevronRight, IconSvg, LinkOrButton, sxx } from '@graphcommerce/next-ui'
3
- import { Trans } from '@lingui/react'
3
+ import { Trans } from '@lingui/react/macro'
4
4
  import type { SxProps, Theme } from '@mui/material'
5
5
  import React from 'react'
6
6
  import { useCheckoutShouldLoginToContinue } from '../../hooks'
@@ -46,7 +46,7 @@ export function CartStartCheckoutLinkOrButton(props: CartStartCheckoutLinkOrButt
46
46
  endIcon={<IconSvg src={iconChevronRight} />}
47
47
  {...linkOrButtonProps}
48
48
  >
49
- {children ?? <Trans id='Next' />}
49
+ {children ?? <Trans>Next</Trans>}
50
50
  </LinkOrButton>
51
51
  )
52
52
  }
@@ -1,6 +1,6 @@
1
1
  import { useHistoryLink } from '@graphcommerce/framer-next-pages'
2
2
  import { breakpointVal, extendableComponent, SectionContainer } from '@graphcommerce/next-ui'
3
- import { Trans } from '@lingui/react'
3
+ import { Trans } from '@lingui/react/macro'
4
4
  import type { SxProps, Theme } from '@mui/material'
5
5
  import { Box, lighten, Link, Typography } from '@mui/material'
6
6
  import React from 'react'
@@ -89,7 +89,7 @@ export function CartSummary(props: CartSummaryProps) {
89
89
  <SectionContainer
90
90
  variantLeft='h5'
91
91
  labelLeft={
92
- is_virtual ? <Trans id='Confirmation' /> : <Trans id='Confirmation + Track & trace' />
92
+ is_virtual ? <Trans>Confirmation</Trans> : <Trans>Confirmation + Track & trace</Trans>
93
93
  }
94
94
  sx={{ '& .SectionHeader-root': { marginTop: 0, paddingBottom: '8px' } }}
95
95
  />
@@ -99,7 +99,7 @@ export function CartSummary(props: CartSummaryProps) {
99
99
  <Box>
100
100
  <SectionContainer
101
101
  variantLeft='h5'
102
- labelLeft={<Trans id='Shipping method' />}
102
+ labelLeft={<Trans>Shipping method</Trans>}
103
103
  sx={{ '& .SectionHeader-root': { marginTop: 0, paddingBottom: '8px' } }}
104
104
  />
105
105
  <Typography variant='body1'>
@@ -112,7 +112,7 @@ export function CartSummary(props: CartSummaryProps) {
112
112
  <Box>
113
113
  <SectionContainer
114
114
  variantLeft='h5'
115
- labelLeft={<Trans id='Shipping address' />}
115
+ labelLeft={<Trans>Shipping address</Trans>}
116
116
  sx={{ '& .SectionHeader-root': { marginTop: 0, paddingBottom: '8px' } }}
117
117
  labelRight={
118
118
  editable ? (
@@ -123,7 +123,7 @@ export function CartSummary(props: CartSummaryProps) {
123
123
  onClick={historyOnClick}
124
124
  underline='hover'
125
125
  >
126
- <Trans id='Edit' />
126
+ <Trans>Edit</Trans>
127
127
  </Link>
128
128
  ) : undefined
129
129
  }
@@ -134,7 +134,7 @@ export function CartSummary(props: CartSummaryProps) {
134
134
  <Box>
135
135
  <SectionContainer
136
136
  variantLeft='h5'
137
- labelLeft={<Trans id='Billing address' />}
137
+ labelLeft={<Trans>Billing address</Trans>}
138
138
  sx={{ '& .SectionHeader-root': { marginTop: 0, paddingBottom: '8px' } }}
139
139
  labelRight={
140
140
  editable ? (
@@ -144,7 +144,7 @@ export function CartSummary(props: CartSummaryProps) {
144
144
  variant='body2'
145
145
  underline='hover'
146
146
  >
147
- <Trans id='Edit' />
147
+ <Trans>Edit</Trans>
148
148
  </Link>
149
149
  ) : undefined
150
150
  }
@@ -1,6 +1,7 @@
1
1
  import { Money } from '@graphcommerce/magento-store'
2
+ import { magentoVersion } from '@graphcommerce/next-config/config'
2
3
  import { breakpointVal, extendableComponent, sxx } from '@graphcommerce/next-ui'
3
- import { Trans } from '@lingui/react'
4
+ import { Trans } from '@lingui/react/macro'
4
5
  import type { SxProps, Theme } from '@mui/material'
5
6
  import { Box, Divider, lighten } from '@mui/material'
6
7
  import { useCartQuery, useDisplayInclTax } from '../../hooks'
@@ -50,7 +51,7 @@ export function CartTotals(props: CartTotalsProps) {
50
51
  const shippingMethod = shipping_addresses?.[0]?.selected_shipping_method
51
52
 
52
53
  const shippingMethodPrices =
53
- import.meta.graphCommerce.magentoVersion >= 246
54
+ magentoVersion >= 246
54
55
  ? shippingMethod
55
56
  : shipping_addresses?.[0]?.available_shipping_methods?.find(
56
57
  (avail) =>
@@ -92,7 +93,7 @@ export function CartTotals(props: CartTotalsProps) {
92
93
  sx={{ display: 'flex', justifyContent: 'space-between' }}
93
94
  >
94
95
  <Box>
95
- <Trans id='Products' />
96
+ <Trans>Products</Trans>
96
97
  </Box>
97
98
  <Box className={classes.money} sx={{ whiteSpace: 'nowrap' }}>
98
99
  <Money {...(inclTax ? prices.subtotal_including_tax : prices.subtotal_excluding_tax)} />
@@ -131,10 +132,7 @@ export function CartTotals(props: CartTotalsProps) {
131
132
  sx={{ display: 'flex', justifyContent: 'space-between' }}
132
133
  >
133
134
  <Box>
134
- <Trans
135
- id='Shipping ({0} {1})'
136
- values={{ 0: shippingMethod.carrier_title, 1: shippingMethod.method_title }}
137
- />
135
+ <Trans>Shipping ({shippingMethod.carrier_title} {shippingMethod.method_title})</Trans>
138
136
  </Box>
139
137
  <Box className={classes.money} sx={{ whiteSpace: 'nowrap' }}>
140
138
  <Money
@@ -177,7 +175,7 @@ export function CartTotals(props: CartTotalsProps) {
177
175
  })}
178
176
  >
179
177
  <Box>
180
- <Trans id='Grand total' />
178
+ <Trans>Grand total</Trans>
181
179
  </Box>
182
180
  <Box className={classes.money} sx={{ whiteSpace: 'nowrap' }}>
183
181
  <Money {...prices.grand_total} />
@@ -198,7 +196,7 @@ export function CartTotals(props: CartTotalsProps) {
198
196
  }}
199
197
  >
200
198
  <Box>
201
- <Trans id='Including {0}' values={{ 0: tax?.label }} />
199
+ <Trans>Including {tax?.label}</Trans>
202
200
  </Box>
203
201
  <Box className={classes.money} sx={{ whiteSpace: 'nowrap' }}>
204
202
  <Money {...tax?.amount} />
@@ -13,7 +13,7 @@ import {
13
13
  } from '@graphcommerce/magento-customer'
14
14
  import { CountryRegionsDocument } from '@graphcommerce/magento-store'
15
15
  import { Button, Form, FormActions, FormDivider, FormRow } from '@graphcommerce/next-ui'
16
- import { Trans } from '@lingui/react'
16
+ import { Trans } from '@lingui/react/macro'
17
17
  import type { SxProps, Theme } from '@mui/material'
18
18
  import { GetBillingAddressDocument } from '../../graphql'
19
19
  import { useCartQuery, useFormGqlMutationCart } from '../../hooks'
@@ -96,7 +96,7 @@ export function EditBillingAddressForm(props: EditBillingAddressFormProps) {
96
96
  size='large'
97
97
  loading={formState.isSubmitting}
98
98
  >
99
- <Trans id='Save changes' />
99
+ <Trans>Save changes</Trans>
100
100
  </Button>
101
101
  </FormActions>
102
102
  </Form>
@@ -5,7 +5,7 @@ import {
5
5
  IconSvg,
6
6
  OverlayCloseButton,
7
7
  } from '@graphcommerce/next-ui'
8
- import { Trans } from '@lingui/react'
8
+ import { Trans } from '@lingui/react/macro'
9
9
  import type { SxProps, Theme } from '@mui/material'
10
10
  import React from 'react'
11
11
 
@@ -19,18 +19,22 @@ export function EmptyCart(props: EmptyCartProps) {
19
19
 
20
20
  return (
21
21
  <FullPageMessage
22
- title={<Trans id='Your cart is empty' />}
22
+ title={<Trans>Your cart is empty</Trans>}
23
23
  icon={<IconSvg src={iconShoppingBag} size='xxl' />}
24
24
  button={
25
25
  button || (
26
26
  <OverlayCloseButton variant='pill' color='secondary' size='large'>
27
- <Trans id='Continue shopping'>Continue shopping</Trans>
27
+ <Trans>Continue shopping</Trans>
28
28
  </OverlayCloseButton>
29
29
  )
30
30
  }
31
31
  {...rest}
32
32
  >
33
- {children ?? <Trans id='Discover our collection and add items to your cart!' />}
33
+ {children ?? (
34
+ <Trans>
35
+ Discover our collection and add items to your cart!
36
+ </Trans>
37
+ )}
34
38
  </FullPageMessage>
35
39
  )
36
40
  }
@@ -6,7 +6,7 @@ import {
6
6
  useGuestQuery,
7
7
  } from '@graphcommerce/magento-customer'
8
8
  import { Button, extendableComponent, FormRow } from '@graphcommerce/next-ui'
9
- import { Trans } from '@lingui/react'
9
+ import { Trans } from '@lingui/react/macro'
10
10
  import type { SxProps, Theme } from '@mui/material'
11
11
  import { Box, TextField, Typography } from '@mui/material'
12
12
  import React, { useState } from 'react'
@@ -75,9 +75,9 @@ export function InlineAccount(props: InlineAccountProps) {
75
75
  >
76
76
  <div>
77
77
  <Typography variant='h4' className={classes.title} sx={{ paddingBottom: '8px' }}>
78
- {title ?? <Trans id='No account yet?' />}
78
+ {title ?? <Trans>No account yet?</Trans>}
79
79
  </Typography>
80
- {description ?? <Trans id='You can track your order status and much more!' />}
80
+ {description ?? <Trans>You can track your order status and much more!</Trans>}
81
81
  </div>
82
82
  <div>
83
83
  {!toggled && (
@@ -89,7 +89,7 @@ export function InlineAccount(props: InlineAccountProps) {
89
89
  className={classes.button}
90
90
  sx={{ minWidth: 160 }}
91
91
  >
92
- <Trans id='Create an account' />
92
+ <Trans>Create an account</Trans>
93
93
  </Button>
94
94
  )}
95
95
  </div>
@@ -99,7 +99,7 @@ export function InlineAccount(props: InlineAccountProps) {
99
99
  <FormRow>
100
100
  <TextField
101
101
  variant='outlined'
102
- label={<Trans id='Email address' />}
102
+ label={<Trans>Email address</Trans>}
103
103
  value={cart?.email}
104
104
  InputProps={{
105
105
  readOnly: true,
@@ -1,5 +1,6 @@
1
1
  export * from './ApolloCartError'
2
2
  export * from './CartAdded'
3
+ export * from './CartAddress/CartAddress.gql'
3
4
  export * from './CartAddressMultiLine/CartAddressMultiLine'
4
5
  export * from './CartAddressSingleLine/CartAddressSingleLine'
5
6
  export * from './CartAgreementsForm/CartAgreements.gql'
@@ -1,5 +1,5 @@
1
1
  import { useApolloClient } from '@graphcommerce/graphql'
2
- import { i18n } from '@lingui/core'
2
+ import { t } from '@lingui/core/macro'
3
3
  import { CreateEmptyCartDocument } from './CreateEmptyCart.gql'
4
4
  import { readCartId, useAssignCurrentCartId } from './useAssignCurrentCartId'
5
5
 
@@ -13,7 +13,7 @@ export function useCartIdCreate() {
13
13
  if (currentCartId) return currentCartId
14
14
 
15
15
  const { data } = await client.mutate({ mutation: CreateEmptyCartDocument })
16
- if (!data?.createEmptyCart) throw Error(i18n._(/* i18n */ 'Could not create an empty cart'))
16
+ if (!data?.createEmptyCart) throw Error(t`Could not create an empty cart`)
17
17
 
18
18
  // We store the cartId that is returned as the currentCartId result
19
19
  assignCurrentCartId(data.createEmptyCart)
@@ -1,12 +1,9 @@
1
1
  import { useCustomerSession } from '@graphcommerce/magento-customer/hooks/useCustomerSession'
2
+ import { permissions } from '@graphcommerce/next-config/config'
2
3
  import { useStorefrontConfig } from '@graphcommerce/next-ui'
3
4
 
4
5
  function useCartPermissions() {
5
- return (
6
- useStorefrontConfig().permissions?.cart ??
7
- import.meta.graphCommerce.permissions?.cart ??
8
- 'ENABLED'
9
- )
6
+ return useStorefrontConfig().permissions?.cart ?? permissions?.cart ?? 'ENABLED'
10
7
  }
11
8
 
12
9
  export function useCartEnabled() {
@@ -1,12 +1,9 @@
1
1
  import { useCustomerSession } from '@graphcommerce/magento-customer/hooks/useCustomerSession'
2
+ import { permissions } from '@graphcommerce/next-config/config'
2
3
  import { useStorefrontConfig } from '@graphcommerce/next-ui'
3
4
 
4
5
  function useCheckoutPermission() {
5
- return (
6
- useStorefrontConfig().permissions?.checkout ??
7
- import.meta.graphCommerce.permissions?.checkout ??
8
- 'ENABLED'
9
- )
6
+ return useStorefrontConfig().permissions?.checkout ?? permissions?.checkout ?? 'ENABLED'
10
7
  }
11
8
 
12
9
  export function useCheckoutGuestEnabled() {
@@ -1,6 +1,5 @@
1
+ import { cartDisplayPricesInclTax } from '@graphcommerce/next-config/config'
1
2
  import { useStorefrontConfig } from '@graphcommerce/next-ui'
2
3
 
3
4
  export const useDisplayInclTax = () =>
4
- useStorefrontConfig().cartDisplayPricesInclTax ??
5
- import.meta.graphCommerce.cartDisplayPricesInclTax ??
6
- true
5
+ useStorefrontConfig().cartDisplayPricesInclTax ?? cartDisplayPricesInclTax ?? true
package/link/cartLink.ts CHANGED
@@ -5,7 +5,8 @@ import { CustomerTokenDocument, getCustomerAccountCanSignIn } from '@graphcommer
5
5
  import type { PushRouter } from '@graphcommerce/magento-customer/link/customerLink'
6
6
  import { pushWithPromise } from '@graphcommerce/magento-customer/link/customerLink'
7
7
  import type { ErrorCategory } from '@graphcommerce/magento-graphql'
8
- import { t } from '@lingui/macro'
8
+ import { permissions } from '@graphcommerce/next-config/config'
9
+ import { t } from '@lingui/core/macro'
9
10
  import type { GraphQLFormattedError } from 'graphql'
10
11
  import { GraphQLError } from 'graphql'
11
12
  import { writeCartId } from '../hooks'
@@ -122,7 +123,7 @@ const cartPermissionLink = (router: PushRouter) =>
122
123
  export const cartLink = (router: PushRouter) => {
123
124
  const links = [cartErrorLink]
124
125
 
125
- if (!(import.meta.graphCommerce.permissions?.cart === 'ENABLED')) {
126
+ if (!(permissions?.cart === 'ENABLED')) {
126
127
  links.push(cartPermissionLink(router))
127
128
  }
128
129
 
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@graphcommerce/magento-cart",
3
3
  "homepage": "https://www.graphcommerce.org/",
4
4
  "repository": "github:graphcommerce-org/graphcommerce",
5
- "version": "9.1.0-canary.55",
5
+ "version": "10.0.0-canary.57",
6
6
  "sideEffects": false,
7
7
  "prettier": "@graphcommerce/prettier-config-pwa",
8
8
  "eslintConfig": {
@@ -11,29 +11,37 @@
11
11
  "project": "./tsconfig.json"
12
12
  }
13
13
  },
14
+ "exports": {
15
+ ".": "./index.ts",
16
+ "./components/CartAdded/useCrosssellItems": "./components/CartAdded/useCrosssellItems.ts",
17
+ "./hooks": "./hooks/index.ts",
18
+ "./plugins/CartDebuggerPlugin": "./plugins/CartDebuggerPlugin.tsx",
19
+ "./plugins/MagentoCartGraphqlProvider": "./plugins/MagentoCartGraphqlProvider.tsx",
20
+ "./plugins/useSignInFormMergeCart": "./plugins/useSignInFormMergeCart.ts"
21
+ },
14
22
  "peerDependencies": {
15
- "@graphcommerce/ecommerce-ui": "^9.1.0-canary.55",
16
- "@graphcommerce/eslint-config-pwa": "^9.1.0-canary.55",
17
- "@graphcommerce/framer-next-pages": "^9.1.0-canary.55",
18
- "@graphcommerce/framer-scroller": "^9.1.0-canary.55",
19
- "@graphcommerce/framer-utils": "^9.1.0-canary.55",
20
- "@graphcommerce/graphql": "^9.1.0-canary.55",
21
- "@graphcommerce/image": "^9.1.0-canary.55",
22
- "@graphcommerce/magento-customer": "^9.1.0-canary.55",
23
- "@graphcommerce/magento-graphql": "^9.1.0-canary.55",
24
- "@graphcommerce/magento-store": "^9.1.0-canary.55",
25
- "@graphcommerce/next-ui": "^9.1.0-canary.55",
26
- "@graphcommerce/prettier-config-pwa": "^9.1.0-canary.55",
27
- "@graphcommerce/react-hook-form": "^9.1.0-canary.55",
28
- "@graphcommerce/typescript-config-pwa": "^9.1.0-canary.55",
29
- "@lingui/core": "^4.2.1",
30
- "@lingui/macro": "^4.2.1",
31
- "@lingui/react": "^4.2.1",
23
+ "@graphcommerce/ecommerce-ui": "^10.0.0-canary.57",
24
+ "@graphcommerce/eslint-config-pwa": "^10.0.0-canary.57",
25
+ "@graphcommerce/framer-next-pages": "^10.0.0-canary.57",
26
+ "@graphcommerce/framer-scroller": "^10.0.0-canary.57",
27
+ "@graphcommerce/framer-utils": "^10.0.0-canary.57",
28
+ "@graphcommerce/graphql": "^10.0.0-canary.57",
29
+ "@graphcommerce/image": "^10.0.0-canary.57",
30
+ "@graphcommerce/magento-customer": "^10.0.0-canary.57",
31
+ "@graphcommerce/magento-graphql": "^10.0.0-canary.57",
32
+ "@graphcommerce/magento-store": "^10.0.0-canary.57",
33
+ "@graphcommerce/next-ui": "^10.0.0-canary.57",
34
+ "@graphcommerce/prettier-config-pwa": "^10.0.0-canary.57",
35
+ "@graphcommerce/react-hook-form": "^10.0.0-canary.57",
36
+ "@graphcommerce/typescript-config-pwa": "^10.0.0-canary.57",
37
+ "@lingui/core": "^5",
38
+ "@lingui/macro": "^5",
39
+ "@lingui/react": "^5",
32
40
  "@mui/material": "^5.10.16",
33
41
  "framer-motion": "^11.0.0",
34
42
  "graphql": "^16.0.0",
35
43
  "next": "*",
36
- "react": "^18.2.0",
37
- "react-dom": "^18.2.0"
44
+ "react": "^19.2.0",
45
+ "react-dom": "^19.2.0"
38
46
  }
39
47
  }
@@ -1,12 +1,9 @@
1
+ import { permissions } from '@graphcommerce/next-config/config'
1
2
  import { storefrontConfig } from '@graphcommerce/next-ui'
2
3
 
3
4
  /** @public */
4
5
  function getCartPermissions(locale: string | undefined) {
5
- return (
6
- storefrontConfig(locale)?.permissions?.cart ??
7
- import.meta.graphCommerce.permissions?.cart ??
8
- 'ENABLED'
9
- )
6
+ return storefrontConfig(locale)?.permissions?.cart ?? permissions?.cart ?? 'ENABLED'
10
7
  }
11
8
 
12
9
  /** @public */
@@ -1,11 +1,8 @@
1
+ import { permissions } from '@graphcommerce/next-config/config'
1
2
  import { storefrontConfig } from '@graphcommerce/next-ui'
2
3
 
3
4
  function getCheckoutPermission(locale: string | undefined) {
4
- return (
5
- storefrontConfig(locale)?.permissions?.checkout ??
6
- import.meta.graphCommerce.permissions?.checkout ??
7
- 'ENABLED'
8
- )
5
+ return storefrontConfig(locale)?.permissions?.checkout ?? permissions?.checkout ?? 'ENABLED'
9
6
  }
10
7
 
11
8
  export function getCheckoutIsDisabled(locale: string | undefined) {