@graphcommerce/next-config 10.1.0-canary.31 → 10.1.0-canary.34

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,17 @@
1
1
  # Change Log
2
2
 
3
+ ## 10.1.0-canary.34
4
+
5
+ ### Patch Changes
6
+
7
+ - [#2647](https://github.com/graphcommerce-org/graphcommerce/pull/2647) [`789e69c`](https://github.com/graphcommerce-org/graphcommerce/commit/789e69c87ed260ee87f62e64c1bc830c0cf7f58d) - Fix plugin interceptor resolution for components exported via a non-aliased re-export.
8
+
9
+ The interceptor scanner (`findOriginalSource`) only inspected an export specifier's `exported` field, which SWC leaves `null` for a non-aliased re-export such as `export { Image }` (the name lives in `orig`; `exported` is only populated by an aliased `export { Foo as Image }`). As a result, any component re-exported without an alias — e.g. `Image` from `@graphcommerce/image` — could not be targeted by a plugin and failed with "Plugin target not found". The scanner now falls back to `orig` when `exported` is absent. ([@paales](https://github.com/paales))
10
+
11
+ ## 10.1.0-canary.33
12
+
13
+ ## 10.1.0-canary.32
14
+
3
15
  ## 10.1.0-canary.31
4
16
 
5
17
  ## 10.1.0-canary.30
package/dist/index.js CHANGED
@@ -623,7 +623,7 @@ function parseAndFindExport(resolved, findExport, resolve) {
623
623
  if (node.type === "ExportNamedDeclaration") {
624
624
  for (const specifier of node.specifiers) {
625
625
  if (specifier.type === "ExportSpecifier") {
626
- if (specifier.exported?.value === findExport) return resolved;
626
+ if ((specifier.exported?.value ?? specifier.orig.value) === findExport) return resolved;
627
627
  } else if (specifier.type === "ExportDefaultSpecifier") ; else if (specifier.type === "ExportNamespaceSpecifier") ;
628
628
  }
629
629
  }
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": "10.1.0-canary.31",
5
+ "version": "10.1.0-canary.34",
6
6
  "type": "module",
7
7
  "exports": {
8
8
  ".": {
@@ -63,7 +63,7 @@
63
63
  },
64
64
  "peerDependencies": {
65
65
  "@apollo/client": "*",
66
- "@graphcommerce/prettier-config-pwa": "^10.1.0-canary.31",
66
+ "@graphcommerce/prettier-config-pwa": "^10.1.0-canary.34",
67
67
  "@lingui/loader": "*",
68
68
  "@lingui/macro": "*",
69
69
  "@lingui/react": "*",
@@ -37,7 +37,11 @@ function parseAndFindExport(
37
37
  if (node.type === 'ExportNamedDeclaration') {
38
38
  for (const specifier of node.specifiers) {
39
39
  if (specifier.type === 'ExportSpecifier') {
40
- if (specifier.exported?.value === findExport) return resolved
40
+ // A non-aliased re-export (`export { Image }`) carries the name in
41
+ // `orig`, with `exported` left null; only an aliased re-export
42
+ // (`export { Foo as Image }`) populates `exported`. Fall back to
43
+ // `orig` so components exported without an alias remain interceptable.
44
+ if ((specifier.exported?.value ?? specifier.orig.value) === findExport) return resolved
41
45
  } else if (specifier.type === 'ExportDefaultSpecifier') {
42
46
  // todo
43
47
  } else if (specifier.type === 'ExportNamespaceSpecifier') {