@adobe-commerce/elsie 1.9.0-beta.0 → 1.9.0-beta.2

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,19 @@
1
1
  # @adobe-commerce/elsie
2
2
 
3
+ ## 1.9.0-beta.2
4
+
5
+ ### Patch Changes
6
+
7
+ - d2aacc7: Fix: GraphQL fragment source files are no longer incorrectly bundled into `chunks/api.js`. The `manualChunks` function now walks the full importer graph (with cycle protection) to determine whether an api-directory module is owned by the fragments barrel, so fragment files stay in the fragments output chunk even when accessed through intermediate sub-barrels. Boilerplate GraphQL overrides work correctly in all dropin barrel structures.
8
+
9
+ ## 1.9.0-beta.1
10
+
11
+ ### Minor Changes
12
+
13
+ - af62897: Update minimum Node.js requirement to 22 LTS
14
+
15
+ Packages are now built with Node.js 22. `elsie` requires `>=22`; browser-only packages (`fetch-graphql`, `event-bus`, `recaptcha`, `storefront-design`, `build-tools`) do not declare an `engines` field as they do not run in Node.js.
16
+
3
17
  ## 1.9.0-beta.0
4
18
 
5
19
  ### Minor Changes
package/config/vite.mjs CHANGED
@@ -93,6 +93,15 @@ if (paths.fragments) {
93
93
  input.fragments = path.resolve(paths.fragments);
94
94
  }
95
95
 
96
+ function isReachableFrom(targetPath, id, getModuleInfo, visited = new Set()) {
97
+ if (visited.has(id)) return false;
98
+ visited.add(id);
99
+ const info = getModuleInfo(id);
100
+ return info?.importers?.some(
101
+ (imp) => imp === targetPath || isReachableFrom(targetPath, imp, getModuleInfo, visited)
102
+ );
103
+ }
104
+
96
105
  export default {
97
106
  preview: {
98
107
  host: true,
@@ -128,16 +137,24 @@ export default {
128
137
  entryFileNames: '[name].js',
129
138
  assetFileNames: '[name].[ext]',
130
139
  chunkFileNames: 'chunks/[name].js',
131
- manualChunks: (id) => {
132
- // Fragments file does not accept chunking
133
- if (id.includes(paths.fragments)) return 'no-chunk';
140
+ manualChunks: (id, { getModuleInfo }) => {
141
+ // Fragments barrel entry does not accept chunking
142
+ if (paths.fragments && id.includes(paths.fragments)) return 'no-chunk';
134
143
 
135
144
  // API functions → chunks/api.js
136
- if (id.includes(paths.api)) return 'api';
145
+ // All modules under paths.api go to the api chunk, except those imported
146
+ // by the fragments barrel — those must stay in the fragments output so the
147
+ // boilerplate GraphQL override mechanism can replace them independently.
148
+ if (paths.api && id.includes(paths.api)) {
149
+ if (paths.fragments && isReachableFrom(paths.fragments, id, getModuleInfo)) {
150
+ return undefined;
151
+ }
152
+ return 'api';
153
+ }
137
154
 
138
155
  // components → chunks/components.js
139
156
  if (paths.components?.some((component) => id.includes(component))) return 'components';
140
-
157
+
141
158
  return undefined;
142
159
  },
143
160
 
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@adobe-commerce/elsie",
3
- "version": "1.9.0-beta.0",
3
+ "version": "1.9.0-beta.2",
4
4
  "license": "SEE LICENSE IN LICENSE.md",
5
5
  "description": "Domain Package SDK",
6
6
  "engines": {
7
- "node": ">=24"
7
+ "node": ">=22"
8
8
  },
9
9
  "sideEffects": false,
10
10
  "main": "./package.json",
@@ -28,11 +28,11 @@
28
28
  "postpublish": "node ./scripts/publish-tools.mjs"
29
29
  },
30
30
  "devDependencies": {
31
- "@adobe-commerce/event-bus": "~1.1.0-beta.0",
32
- "@adobe-commerce/fetch-graphql": "~1.3.0-beta.0",
33
- "@adobe-commerce/recaptcha": "1.2.0-beta.0",
34
- "@adobe-commerce/storefront-design": "~1.1.0-beta.0",
35
- "@dropins/build-tools": "~1.2.0-beta.0",
31
+ "@adobe-commerce/event-bus": "~1.1.0-beta.1",
32
+ "@adobe-commerce/fetch-graphql": "~1.3.0-beta.1",
33
+ "@adobe-commerce/recaptcha": "1.2.0-beta.1",
34
+ "@adobe-commerce/storefront-design": "~1.1.0-beta.1",
35
+ "@dropins/build-tools": "~1.2.0-beta.1",
36
36
  "preact": "~10.22.1",
37
37
  "vite-plugin-banner": "^0.8.0"
38
38
  },