@graphcommerce/magento-product-downloadable 9.1.0-canary.55 → 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,85 @@
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
+
3
83
  ## 9.1.0-canary.55
4
84
 
5
85
  ## 9.1.0-canary.54
@@ -5,7 +5,7 @@ import {
5
5
  type AccountMenuItemProps,
6
6
  } from '@graphcommerce/magento-customer'
7
7
  import { filterNonNullableKeys, iconDownload } from '@graphcommerce/next-ui'
8
- import { Trans } from '@lingui/macro'
8
+ import { Trans } from '@lingui/react/macro'
9
9
  import type { SetOptional } from 'type-fest'
10
10
 
11
11
  type StoreCreditAccountMenuItemProps = SetOptional<
@@ -26,7 +26,7 @@ export function DownloadableAccountMenuItem(props: StoreCreditAccountMenuItemPro
26
26
  <AccountMenuItem
27
27
  href='/account/downloads'
28
28
  iconSrc={iconDownload}
29
- title={<Trans id='Downloads'>Downloads</Trans>}
29
+ title={<Trans>Downloads</Trans>}
30
30
  subtitle={<Trans>You have {count} downloads available.</Trans>}
31
31
  {...props}
32
32
  />
@@ -7,10 +7,7 @@ import {
7
7
  } from '@graphcommerce/magento-customer'
8
8
  import { PageMeta, StoreConfigDocument } from '@graphcommerce/magento-store'
9
9
  import {
10
- Button,
11
- DateFormat,
12
10
  filterNonNullableKeys,
13
- iconCreditCard,
14
11
  iconDownload,
15
12
  LayoutOverlayHeader,
16
13
  LayoutTitle,
@@ -18,8 +15,8 @@ import {
18
15
  SectionContainer,
19
16
  type GetStaticProps,
20
17
  } from '@graphcommerce/next-ui'
21
- import { i18n } from '@lingui/core'
22
- import { t, Trans } from '@lingui/macro'
18
+ import { t } from '@lingui/core/macro'
19
+ import { Trans } from '@lingui/react/macro'
23
20
  import { Box, Container, Link, Typography } from '@mui/material'
24
21
  import React from 'react'
25
22
  import { DownloadsPageDocument } from '../../graphql/queries/DownloadsPage.gql'
@@ -40,7 +37,7 @@ export function DownloadsPage() {
40
37
  <>
41
38
  <LayoutOverlayHeader>
42
39
  <LayoutTitle size='small' component='span' icon={iconDownload}>
43
- <Trans id='Downloads'>Downloads</Trans>
40
+ <Trans>Downloads</Trans>
44
41
  </LayoutTitle>
45
42
  </LayoutOverlayHeader>
46
43
 
@@ -53,11 +50,11 @@ export function DownloadsPage() {
53
50
  sx={(theme) => ({ mb: theme.spacings.xs })}
54
51
  gutterBottom={false}
55
52
  >
56
- <Trans id='Downloads'>Downloads</Trans>
53
+ <Trans>Downloads</Trans>
57
54
  </LayoutTitle>
58
55
 
59
56
  <Box>
60
- <SectionContainer labelLeft={<Trans id='Downloads'>Downloads</Trans>}>
57
+ <SectionContainer labelLeft={<Trans>Downloads</Trans>}>
61
58
  <Box
62
59
  sx={{
63
60
  display: 'grid',
@@ -67,19 +64,19 @@ export function DownloadsPage() {
67
64
  }}
68
65
  >
69
66
  <Typography variant='subtitle1'>
70
- <Trans id='Order'>Order</Trans>
67
+ <Trans>Order</Trans>
71
68
  </Typography>
72
69
  <Typography variant='subtitle1'>
73
- <Trans id='Download'>Download</Trans>
70
+ <Trans>Download</Trans>
74
71
  </Typography>
75
72
  <Typography variant='subtitle1'>
76
- <Trans id='Remaining'>Remaining</Trans>
73
+ <Trans>Remaining</Trans>
77
74
  </Typography>
78
75
  <Typography variant='subtitle1'>
79
- <Trans id='Status'>Status</Trans>
76
+ <Trans>Status</Trans>
80
77
  </Typography>
81
78
  <Typography variant='subtitle1'>
82
- <Trans id='Date'>Date</Trans>
79
+ <Trans>Date</Trans>
83
80
  </Typography>
84
81
 
85
82
  {downloads.map((item, index) => (
@@ -127,7 +124,7 @@ export function createGetStaticProps(
127
124
  props: {
128
125
  apolloState: await conf.then(() => client.cache.extract()),
129
126
  variantMd: 'bottom',
130
- up: { href: '/account', title: i18n._('Account') },
127
+ up: { href: '/account', title: t`Account` },
131
128
  },
132
129
  }
133
130
  }
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@graphcommerce/magento-product-downloadable",
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.56",
6
6
  "sideEffects": false,
7
7
  "prettier": "@graphcommerce/prettier-config-pwa",
8
8
  "eslintConfig": {
@@ -12,23 +12,33 @@
12
12
  }
13
13
  },
14
14
  "peerDependencies": {
15
- "@graphcommerce/ecommerce-ui": "^9.1.0-canary.55",
16
- "@graphcommerce/eslint-config-pwa": "^9.1.0-canary.55",
17
- "@graphcommerce/graphql": "^9.1.0-canary.55",
18
- "@graphcommerce/magento-cart": "^9.1.0-canary.55",
19
- "@graphcommerce/magento-cart-items": "^9.1.0-canary.55",
20
- "@graphcommerce/magento-customer": "^9.1.0-canary.55",
21
- "@graphcommerce/magento-product": "^9.1.0-canary.55",
22
- "@graphcommerce/magento-store": "^9.1.0-canary.55",
23
- "@graphcommerce/next-ui": "^9.1.0-canary.55",
24
- "@graphcommerce/prettier-config-pwa": "^9.1.0-canary.55",
25
- "@graphcommerce/typescript-config-pwa": "^9.1.0-canary.55",
26
- "@lingui/core": "^4.2.1",
27
- "@lingui/macro": "^4.2.1",
28
- "@lingui/react": "^4.2.1",
15
+ "@graphcommerce/ecommerce-ui": "^10.0.0-canary.56",
16
+ "@graphcommerce/eslint-config-pwa": "^10.0.0-canary.56",
17
+ "@graphcommerce/graphql": "^10.0.0-canary.56",
18
+ "@graphcommerce/magento-cart": "^10.0.0-canary.56",
19
+ "@graphcommerce/magento-cart-items": "^10.0.0-canary.56",
20
+ "@graphcommerce/magento-customer": "^10.0.0-canary.56",
21
+ "@graphcommerce/magento-product": "^10.0.0-canary.56",
22
+ "@graphcommerce/magento-store": "^10.0.0-canary.56",
23
+ "@graphcommerce/next-ui": "^10.0.0-canary.56",
24
+ "@graphcommerce/prettier-config-pwa": "^10.0.0-canary.56",
25
+ "@graphcommerce/typescript-config-pwa": "^10.0.0-canary.56",
26
+ "@lingui/core": "^5",
27
+ "@lingui/macro": "^5",
28
+ "@lingui/react": "^5",
29
29
  "@mui/material": "^5.10.16",
30
30
  "next": "*",
31
- "react": "^18.2.0",
32
- "react-dom": "^18.2.0"
31
+ "react": "^19.2.0",
32
+ "react-dom": "^19.2.0"
33
+ },
34
+ "exports": {
35
+ ".": "./index.ts",
36
+ "./plugins/DownloadableCartItemActionCard": "./plugins/DownloadableCartItemActionCard.tsx",
37
+ "./plugins/Downloadable_cartItemToCartItemInput": "./plugins/Downloadable_cartItemToCartItemInput.ts",
38
+ "./plugins/DownloadableCreditMemoItem": "./plugins/DownloadableCreditMemoItem.tsx",
39
+ "./plugins/DownloadableInvoiceItem": "./plugins/DownloadableInvoiceItem.tsx",
40
+ "./plugins/DownloadableOrderItem": "./plugins/DownloadableOrderItem.tsx",
41
+ "./plugins/DownloadableProductPagePrice": "./plugins/DownloadableProductPagePrice.tsx",
42
+ "./plugins/DownloadableAccountMenuItem": "./plugins/DownloadableAccountMenuItem.tsx"
33
43
  }
34
44
  }
@@ -1,7 +1,7 @@
1
1
  import type { CreditMemoItemProps } from '@graphcommerce/magento-customer'
2
2
  import type { PluginConfig, PluginProps } from '@graphcommerce/next-config'
3
3
  import { filterNonNullableKeys } from '@graphcommerce/next-ui'
4
- import { Trans } from '@lingui/macro'
4
+ import { Trans } from '@lingui/react/macro'
5
5
 
6
6
  export const config: PluginConfig = {
7
7
  type: 'component',
@@ -20,7 +20,7 @@ export function CreditMemoItem(props: PluginProps<CreditMemoItemProps>) {
20
20
  ...(rest.priceModifiers ?? []),
21
21
  {
22
22
  key: 'downloadable-links',
23
- label: <Trans id='Downloads'>Downloads</Trans>,
23
+ label: <Trans>Downloads</Trans>,
24
24
  items: filterNonNullableKeys(rest.item.downloadable_links)
25
25
  .sort((a, b) => a.sort_order - b.sort_order)
26
26
  .map((link) => ({
@@ -1,7 +1,7 @@
1
1
  import type { InvoiceItemProps } from '@graphcommerce/magento-customer'
2
2
  import type { PluginConfig, PluginProps } from '@graphcommerce/next-config'
3
3
  import { filterNonNullableKeys } from '@graphcommerce/next-ui'
4
- import { Trans } from '@lingui/macro'
4
+ import { Trans } from '@lingui/react/macro'
5
5
 
6
6
  export const config: PluginConfig = {
7
7
  type: 'component',
@@ -20,7 +20,7 @@ export function InvoiceItem(props: PluginProps<InvoiceItemProps>) {
20
20
  ...(rest.priceModifiers ?? []),
21
21
  {
22
22
  key: 'downloadable-links',
23
- label: <Trans id='Downloads'>Downloads</Trans>,
23
+ label: <Trans>Downloads</Trans>,
24
24
  items: filterNonNullableKeys(rest.item.downloadable_links)
25
25
  .sort((a, b) => a.sort_order - b.sort_order)
26
26
  .map((link) => ({