@graphcommerce/magento-cart-shipping-address 9.1.0-canary.54 → 10.0.0-canary.56

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,91 @@
1
1
  # Change Log
2
2
 
3
+ ## 10.0.0-canary.56
4
+
5
+ ### Major Changes
6
+
7
+ - [#2546](https://github.com/graphcommerce-org/graphcommerce/pull/2546) [`ed9332a`](https://github.com/graphcommerce-org/graphcommerce/commit/ed9332a7f78966d932041d9a7725641edc92b28d) - ## GraphCommerce 10 - Turbopack Support
8
+
9
+ This major release brings full Turbopack compatibility, dramatically improving development speed.
10
+
11
+ ### 🚀 Turbopack-Compatible Interceptor System
12
+
13
+ The entire plugin/interceptor system has been rewritten to work with Turbopack:
14
+
15
+ - **No more Webpack plugins** - Removed `InterceptorPlugin` webpack plugin entirely
16
+ - **File-based interception** - Original files are moved to `.original.tsx` and replaced with interceptor content
17
+ - **Direct imports** - Interceptors import from `.original` files instead of embedding source
18
+ - **New CLI commands**:
19
+ - `graphcommerce codegen-interceptors` - Generate interceptor files
20
+ - `graphcommerce cleanup-interceptors` - Reset interceptor system, restore original files
21
+ - **Stable file hashing** - Deterministic interceptor generation for better caching
22
+
23
+ ### ⚙️ Treeshakable Configuration System
24
+
25
+ Replaced Webpack `DefinePlugin`-based `import.meta.graphCommerce` with a new generated configuration system:
26
+
27
+ - **New `codegen-config-values` command** - Generates TypeScript files with precise typing
28
+ - **Schema-driven** - Dynamically introspects Zod schemas to determine all available properties
29
+ - **Fully treeshakable** - Unused config values are eliminated from the bundle
30
+ - **Type-safe** - Uses `Get<GraphCommerceConfig, 'path'>` for nested property access
31
+ - **Separate files for nested objects** - Optimal treeshaking for complex configurations
32
+
33
+ ### 🔧 withGraphCommerce Changes
34
+
35
+ - **Removed** `InterceptorPlugin` - No longer needed with file-based interception
36
+ - **Removed** `DefinePlugin` for `import.meta.graphCommerce` - Replaced with generated config
37
+ - **Removed** `@mui/*` alias rewrites - No longer required
38
+ - **Added** Turbopack loader rules for `.yaml`, `.yml`, and `.po` files
39
+ - **Added** `serverExternalPackages` for all `@whatwg-node/*` packages
40
+ - **Added** `optimizePackageImports` for better bundle optimization
41
+ - **Added** `images.qualities: [52, 75]` for Next.js image optimization
42
+
43
+ ### 📦 Lingui Configuration
44
+
45
+ - **Renamed** `lingui.config.js` → `lingui.config.ts` with TypeScript support
46
+ - **Updated** `@graphcommerce/lingui-next/config` to TypeScript with proper exports
47
+ - **Simplified** formatter options
48
+
49
+ ### ⚛️ React 19 & Next.js 16 Compatibility
50
+
51
+ - Updated `RefObject<T>` types for React 19 (now includes `null` by default)
52
+ - Replaced deprecated `React.VFC` with `React.FC`
53
+ - Fixed `useRef` calls to require explicit initial values
54
+ - Updated `MutableRefObject` usage in `framer-scroller`
55
+
56
+ ### 📋 ESLint 9 Flat Config
57
+
58
+ - Migrated from legacy `.eslintrc` to new flat config format (`eslint.config.mjs`)
59
+ - Updated `@typescript-eslint/*` packages to v8
60
+ - Fixed AST selector for `SxProps` rule (`typeParameters` → `typeArguments`)
61
+
62
+ ### 🔄 Apollo Client
63
+
64
+ - Fixed deprecated `name` option → `clientAwareness: { name: 'ssr' }`
65
+ - Updated error handling types to accept `ApolloError | null | undefined`
66
+
67
+ ### ⚠️ Breaking Changes
68
+
69
+ - **Node.js 24.x not supported** - Restricted to `>=20 <24.0.0` due to [nodejs/undici#4290](https://github.com/nodejs/undici/issues/4290)
70
+ - **Interceptor files changed** - Original components now at `.original.tsx`
71
+ - **Config access changed** - Use generated config values instead of `import.meta.graphCommerce`
72
+ - **ESLint config format** - Must use flat config (`eslint.config.mjs`)
73
+ - **Lingui config** - Rename `lingui.config.js` to `lingui.config.ts`
74
+
75
+ ### 🗑️ Removed
76
+
77
+ - `InterceptorPlugin` webpack plugin
78
+ - `configToImportMeta` utility
79
+ - Webpack `DefinePlugin` usage for config
80
+ - `@mui/*` modern alias rewrites
81
+ - Debug plugins (`CircularDependencyPlugin`, `DuplicatesPlugin`) ([@paales](https://github.com/paales))
82
+
83
+ ## 9.1.0-canary.55
84
+
85
+ ### Patch Changes
86
+
87
+ - [#2539](https://github.com/graphcommerce-org/graphcommerce/pull/2539) [`415f9fb`](https://github.com/graphcommerce-org/graphcommerce/commit/415f9fb50454fb20cb533235969dd9ab4ffc134b) - Allow setting the cartId in the form for useFormGqlMutationCart by setting the cartId in the form AND allow setting the cartId for a whole context by wrapping with CartIdProvider ([@paales](https://github.com/paales))
88
+
3
89
  ## 9.1.0-canary.54
4
90
 
5
91
  ## 9.1.0-canary.53
@@ -1,8 +1,8 @@
1
1
  import type { ActionCardItemRenderProps } from '@graphcommerce/ecommerce-ui'
2
- import type { CustomerAddressFragment } from '@graphcommerce/magento-customer/components/CreateCustomerAddressForm/CustomerAddress.gql'
2
+ import type { CustomerAddressFragment } from '@graphcommerce/magento-customer'
3
3
  import { useFindCountry } from '@graphcommerce/magento-store'
4
4
  import { ActionCard, iconHome, IconSvg } from '@graphcommerce/next-ui'
5
- import { Trans } from '@lingui/react'
5
+ import { Trans } from '@lingui/react/macro'
6
6
  import { Button } from '@mui/material'
7
7
  import { useRouter } from 'next/router'
8
8
 
@@ -22,16 +22,16 @@ export function CustomerAddressActionCard(props: CustomerAddressActionCardProps)
22
22
  return (
23
23
  <ActionCard
24
24
  image={<IconSvg src={iconHome} size='large' />}
25
- title={<Trans id='New address' />}
26
- details={<Trans id='Add new address' />}
25
+ title={<Trans>New address</Trans>}
26
+ details={<Trans>Add new address</Trans>}
27
27
  action={
28
28
  <Button disableRipple variant='inline' color='secondary' tabIndex={-1}>
29
- <Trans id='Select' />
29
+ <Trans>Select</Trans>
30
30
  </Button>
31
31
  }
32
32
  reset={
33
33
  <Button disableRipple variant='inline' color='secondary' onClick={onReset}>
34
- <Trans id='Change' />
34
+ <Trans>Change</Trans>
35
35
  </Button>
36
36
  }
37
37
  {...cardProps}
@@ -55,12 +55,12 @@ export function CustomerAddressActionCard(props: CustomerAddressActionCardProps)
55
55
  }
56
56
  action={
57
57
  <Button disableRipple variant='inline' color='secondary' tabIndex={-1}>
58
- <Trans id='Select' />
58
+ <Trans>Select</Trans>
59
59
  </Button>
60
60
  }
61
61
  reset={
62
62
  <Button disableRipple variant='inline' color='secondary' onClick={onReset}>
63
- <Trans id='Change' />
63
+ <Trans>Change</Trans>
64
64
  </Button>
65
65
  }
66
66
  secondaryAction={
@@ -77,7 +77,7 @@ export function CustomerAddressActionCard(props: CustomerAddressActionCardProps)
77
77
  push(`/checkout/customer/addresses/edit?addressId=${id}`)
78
78
  }}
79
79
  >
80
- <Trans id='Edit address' />
80
+ <Trans>Edit address</Trans>
81
81
  </Button>
82
82
  }
83
83
  {...cardProps}
@@ -13,9 +13,10 @@ import {
13
13
  useFormGqlMutationCart,
14
14
  } from '@graphcommerce/magento-cart'
15
15
  import { CustomerDocument } from '@graphcommerce/magento-customer'
16
+ import { customerAddressNoteEnable } from '@graphcommerce/next-config/config'
16
17
  import { filterNonNullableKeys, FormRow } from '@graphcommerce/next-ui'
17
- import { i18n } from '@lingui/core'
18
- import { Trans } from '@lingui/macro'
18
+ import { t } from '@lingui/core/macro'
19
+ import { Trans } from '@lingui/react/macro'
19
20
  import type { SxProps, Theme } from '@mui/material'
20
21
  import { Box } from '@mui/material'
21
22
  import React, { useEffect } from 'react'
@@ -153,7 +154,7 @@ export function CustomerAddressForm(props: CustomerAddressListProps) {
153
154
  <ActionCardListForm
154
155
  control={control}
155
156
  name='customer_address_id'
156
- errorMessage={i18n._(/* i18n */ 'Please select a shipping address')}
157
+ errorMessage={t`Please select a shipping address`}
157
158
  collapse
158
159
  size='large'
159
160
  color='secondary'
@@ -164,19 +165,17 @@ export function CustomerAddressForm(props: CustomerAddressListProps) {
164
165
  ]}
165
166
  render={CustomerAddressActionCard}
166
167
  />
167
- {!isVirtual &&
168
- formAddressId !== -1 &&
169
- import.meta.graphCommerce.customerAddressNoteEnable && (
170
- <FormRow>
171
- <TextFieldElement
172
- control={form.control}
173
- name='shippingAddress.customer_notes'
174
- label={<Trans>Shipping Note</Trans>}
175
- multiline
176
- minRows={3}
177
- />
178
- </FormRow>
179
- )}
168
+ {!isVirtual && formAddressId !== -1 && customerAddressNoteEnable && (
169
+ <FormRow>
170
+ <TextFieldElement
171
+ control={form.control}
172
+ name='shippingAddress.customer_notes'
173
+ label={<Trans>Shipping Note</Trans>}
174
+ multiline
175
+ minRows={3}
176
+ />
177
+ </FormRow>
178
+ )}
180
179
  <ApolloCartErrorAlert error={error} />
181
180
  </Box>
182
181
  {formAddressId === -1 && children}
@@ -13,7 +13,7 @@ import {
13
13
  useCartQuery,
14
14
  useFormGqlMutationCart,
15
15
  } from '@graphcommerce/magento-cart'
16
- import type { CartAddressFragment } from '@graphcommerce/magento-cart/components/CartAddress/CartAddress.gql'
16
+ import type { CartAddressFragment } from '@graphcommerce/magento-cart'
17
17
  import {
18
18
  AddressFields,
19
19
  CompanyFields,
@@ -22,8 +22,9 @@ import {
22
22
  useCustomerQuery,
23
23
  } from '@graphcommerce/magento-customer'
24
24
  import { CountryRegionsDocument, StoreConfigDocument } from '@graphcommerce/magento-store'
25
+ import { customerAddressNoteEnable } from '@graphcommerce/next-config/config'
25
26
  import { Form, FormRow } from '@graphcommerce/next-ui'
26
- import { Trans } from '@lingui/macro'
27
+ import { Trans } from '@lingui/react/macro'
27
28
  import type { SxProps, Theme } from '@mui/material'
28
29
  import React from 'react'
29
30
  import { isCartAddressACustomerAddress } from '../../utils/findCustomerAddressFromCartAddress'
@@ -161,7 +162,7 @@ export const ShippingAddressForm = React.memo<ShippingAddressFormProps>((props)
161
162
  />
162
163
  )}
163
164
 
164
- {!isVirtual && import.meta.graphCommerce.customerAddressNoteEnable && (
165
+ {!isVirtual && customerAddressNoteEnable && (
165
166
  <FormRow>
166
167
  <TextFieldElement
167
168
  control={form.control}
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@graphcommerce/magento-cart-shipping-address",
3
3
  "homepage": "https://www.graphcommerce.org/",
4
4
  "repository": "github:graphcommerce-org/graphcommerce",
5
- "version": "9.1.0-canary.54",
5
+ "version": "10.0.0-canary.56",
6
6
  "sideEffects": false,
7
7
  "prettier": "@graphcommerce/prettier-config-pwa",
8
8
  "eslintConfig": {
@@ -11,25 +11,28 @@
11
11
  "project": "./tsconfig.json"
12
12
  }
13
13
  },
14
+ "exports": {
15
+ ".": "./index.ts"
16
+ },
14
17
  "peerDependencies": {
15
- "@graphcommerce/ecommerce-ui": "^9.1.0-canary.54",
16
- "@graphcommerce/eslint-config-pwa": "^9.1.0-canary.54",
17
- "@graphcommerce/graphql": "^9.1.0-canary.54",
18
- "@graphcommerce/graphql-mesh": "^9.1.0-canary.54",
19
- "@graphcommerce/image": "^9.1.0-canary.54",
20
- "@graphcommerce/magento-cart": "^9.1.0-canary.54",
21
- "@graphcommerce/magento-customer": "^9.1.0-canary.54",
22
- "@graphcommerce/magento-store": "^9.1.0-canary.54",
23
- "@graphcommerce/next-ui": "^9.1.0-canary.54",
24
- "@graphcommerce/prettier-config-pwa": "^9.1.0-canary.54",
25
- "@graphcommerce/typescript-config-pwa": "^9.1.0-canary.54",
26
- "@lingui/core": "^4.2.1",
27
- "@lingui/macro": "^4.2.1",
28
- "@lingui/react": "^4.2.1",
18
+ "@graphcommerce/ecommerce-ui": "^10.0.0-canary.56",
19
+ "@graphcommerce/eslint-config-pwa": "^10.0.0-canary.56",
20
+ "@graphcommerce/graphql": "^10.0.0-canary.56",
21
+ "@graphcommerce/graphql-mesh": "^10.0.0-canary.56",
22
+ "@graphcommerce/image": "^10.0.0-canary.56",
23
+ "@graphcommerce/magento-cart": "^10.0.0-canary.56",
24
+ "@graphcommerce/magento-customer": "^10.0.0-canary.56",
25
+ "@graphcommerce/magento-store": "^10.0.0-canary.56",
26
+ "@graphcommerce/next-ui": "^10.0.0-canary.56",
27
+ "@graphcommerce/prettier-config-pwa": "^10.0.0-canary.56",
28
+ "@graphcommerce/typescript-config-pwa": "^10.0.0-canary.56",
29
+ "@lingui/core": "^5",
30
+ "@lingui/macro": "^5",
31
+ "@lingui/react": "^5",
29
32
  "@mui/material": "^5.10.16",
30
33
  "framer-motion": "^11.0.0",
31
34
  "next": "*",
32
- "react": "^18.2.0",
33
- "react-dom": "^18.2.0"
35
+ "react": "^19.2.0",
36
+ "react-dom": "^19.2.0"
34
37
  }
35
38
  }
@@ -1,5 +1,5 @@
1
- import type { CartAddressFragment } from '@graphcommerce/magento-cart/components/CartAddress/CartAddress.gql'
2
- import type { CustomerAddressFragment } from '@graphcommerce/magento-customer/components/CreateCustomerAddressForm/CustomerAddress.gql'
1
+ import type { CartAddressFragment } from '@graphcommerce/magento-cart'
2
+ import type { CustomerAddressFragment } from '@graphcommerce/magento-customer'
3
3
  import { filterNonNullableKeys } from '@graphcommerce/next-ui'
4
4
 
5
5
  export function findCustomerAddressFromCartAddress<CustomerAddress extends CustomerAddressFragment>(
@@ -1,4 +1,4 @@
1
- import type { CartAddressFragment } from '@graphcommerce/magento-cart/components/CartAddress/CartAddress.gql'
1
+ import type { CartAddressFragment } from '@graphcommerce/magento-cart'
2
2
 
3
3
  type PartialNullable<T> = {
4
4
  [P in keyof T]?: T[P] | null