@bleedingdev/modern-js-app-tools-extensions 3.9.3-ultramodern.2 → 3.9.3-ultramodern.4

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.
@@ -98,9 +98,13 @@ function resolveRendererBuildIdentities(options) {
98
98
  const projectRoot = external_node_path_default().resolve(options.projectRoot);
99
99
  const appId = options.appId ?? JSON.parse(external_node_fs_default().readFileSync(external_node_path_default().join(projectRoot, 'package.json'), 'utf8')).name;
100
100
  if ('string' != typeof appId || !appId || appId.trim() !== appId) throw new Error('Renderer application identity requires a delivery artifact appId or a package name.');
101
+ const unitId = options.unitId;
102
+ if (void 0 !== unitId && ('string' != typeof unitId || !unitId || unitId.trim() !== unitId)) throw new Error('Renderer delivery-unit identity requires a nonempty trimmed unitId.');
101
103
  const profileKey = rendererProfileKey(options.profile);
102
104
  const sourceRevision = (0, external_release_identity_js_namespaceObject.resolveUltramodernSourceRevision)(projectRoot, options.sourceRevision);
103
105
  const buildId = sha256(JSON.stringify([
106
+ appId,
107
+ unitId ?? null,
104
108
  profileKey,
105
109
  lockfileHash(projectRoot),
106
110
  'development' === options.mode || 'workspace' === sourceRevision ? processNonce : sourceRevision
@@ -54,9 +54,13 @@ function resolveRendererBuildIdentities(options) {
54
54
  const projectRoot = node_path.resolve(options.projectRoot);
55
55
  const appId = options.appId ?? JSON.parse(node_fs.readFileSync(node_path.join(projectRoot, 'package.json'), 'utf8')).name;
56
56
  if ('string' != typeof appId || !appId || appId.trim() !== appId) throw new Error('Renderer application identity requires a delivery artifact appId or a package name.');
57
+ const unitId = options.unitId;
58
+ if (void 0 !== unitId && ('string' != typeof unitId || !unitId || unitId.trim() !== unitId)) throw new Error('Renderer delivery-unit identity requires a nonempty trimmed unitId.');
57
59
  const profileKey = rendererProfileKey(options.profile);
58
60
  const sourceRevision = resolveUltramodernSourceRevision(projectRoot, options.sourceRevision);
59
61
  const buildId = sha256(JSON.stringify([
62
+ appId,
63
+ unitId ?? null,
60
64
  profileKey,
61
65
  lockfileHash(projectRoot),
62
66
  'development' === options.mode || 'workspace' === sourceRevision ? processNonce : sourceRevision
@@ -55,9 +55,13 @@ function resolveRendererBuildIdentities(options) {
55
55
  const projectRoot = node_path.resolve(options.projectRoot);
56
56
  const appId = options.appId ?? JSON.parse(node_fs.readFileSync(node_path.join(projectRoot, 'package.json'), 'utf8')).name;
57
57
  if ('string' != typeof appId || !appId || appId.trim() !== appId) throw new Error('Renderer application identity requires a delivery artifact appId or a package name.');
58
+ const unitId = options.unitId;
59
+ if (void 0 !== unitId && ('string' != typeof unitId || !unitId || unitId.trim() !== unitId)) throw new Error('Renderer delivery-unit identity requires a nonempty trimmed unitId.');
58
60
  const profileKey = rendererProfileKey(options.profile);
59
61
  const sourceRevision = resolveUltramodernSourceRevision(projectRoot, options.sourceRevision);
60
62
  const buildId = sha256(JSON.stringify([
63
+ appId,
64
+ unitId ?? null,
61
65
  profileKey,
62
66
  lockfileHash(projectRoot),
63
67
  'development' === options.mode || 'workspace' === sourceRevision ? processNonce : sourceRevision
@@ -10,6 +10,8 @@ export interface RendererBuildIdentityOptions {
10
10
  mode: 'development' | 'production';
11
11
  /** Delivery-unit app id; defaults to the application package name. */
12
12
  appId?: string;
13
+ /** Delivery-unit id from the authoritative topology record, when declared. */
14
+ unitId?: string;
13
15
  /** Externally authenticated source revision (delivery unit or CI). */
14
16
  sourceRevision?: string;
15
17
  /** Actual final entry ownership, supplied by the selected renderer composition. */
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "directory": "packages/solutions/app-tools-extensions"
12
12
  },
13
13
  "license": "MIT",
14
- "version": "3.9.3-ultramodern.2",
14
+ "version": "3.9.3-ultramodern.4",
15
15
  "files": [
16
16
  "dist",
17
17
  "src"
@@ -177,16 +177,16 @@
177
177
  "dependencies": {
178
178
  "@babel/parser": "^8.0.6",
179
179
  "@babel/traverse": "^8.0.6",
180
- "@modern-js/backend-federation-contracts": "npm:@bleedingdev/modern-js-backend-federation-contracts@3.9.3-ultramodern.2",
181
- "@modern-js/builder": "npm:@bleedingdev/modern-js-builder@3.9.3-ultramodern.2",
182
- "@modern-js/plugin": "npm:@bleedingdev/modern-js-plugin@3.9.3-ultramodern.2",
183
- "@modern-js/prod-server": "npm:@bleedingdev/modern-js-prod-server@3.9.3-ultramodern.2",
184
- "@modern-js/runtime-utils": "npm:@bleedingdev/modern-js-runtime-utils@3.9.3-ultramodern.2",
185
- "@modern-js/server-core": "npm:@bleedingdev/modern-js-server-core@3.9.3-ultramodern.2",
186
- "@modern-js/server-runtime-extensions": "npm:@bleedingdev/modern-js-server-runtime-extensions@3.9.3-ultramodern.2",
187
- "@modern-js/surface-resolution": "npm:@bleedingdev/modern-js-surface-resolution@3.9.3-ultramodern.2",
188
- "@modern-js/types": "npm:@bleedingdev/modern-js-types@3.9.3-ultramodern.2",
189
- "@modern-js/utils": "npm:@bleedingdev/modern-js-utils@3.9.3-ultramodern.2",
180
+ "@modern-js/backend-federation-contracts": "npm:@bleedingdev/modern-js-backend-federation-contracts@3.9.3-ultramodern.4",
181
+ "@modern-js/builder": "npm:@bleedingdev/modern-js-builder@3.9.3-ultramodern.4",
182
+ "@modern-js/plugin": "npm:@bleedingdev/modern-js-plugin@3.9.3-ultramodern.4",
183
+ "@modern-js/prod-server": "npm:@bleedingdev/modern-js-prod-server@3.9.3-ultramodern.4",
184
+ "@modern-js/runtime-utils": "npm:@bleedingdev/modern-js-runtime-utils@3.9.3-ultramodern.4",
185
+ "@modern-js/server-core": "npm:@bleedingdev/modern-js-server-core@3.9.3-ultramodern.4",
186
+ "@modern-js/server-runtime-extensions": "npm:@bleedingdev/modern-js-server-runtime-extensions@3.9.3-ultramodern.4",
187
+ "@modern-js/surface-resolution": "npm:@bleedingdev/modern-js-surface-resolution@3.9.3-ultramodern.4",
188
+ "@modern-js/types": "npm:@bleedingdev/modern-js-types@3.9.3-ultramodern.4",
189
+ "@modern-js/utils": "npm:@bleedingdev/modern-js-utils@3.9.3-ultramodern.4",
190
190
  "@swc/helpers": "^0.5.23",
191
191
  "@vercel/nft": "^1.11.0",
192
192
  "compression-webpack-plugin": "^12.0.0",
@@ -196,7 +196,7 @@
196
196
  },
197
197
  "peerDependencies": {
198
198
  "@loadable/component": "5.16.7",
199
- "@modern-js/runtime-renderer-extensions": "3.9.3-ultramodern.2",
199
+ "@modern-js/runtime-renderer-extensions": "3.9.3-ultramodern.4",
200
200
  "@rsbuild/core": "2.2.11",
201
201
  "react": "^19.2.8"
202
202
  },
@@ -213,10 +213,10 @@
213
213
  },
214
214
  "devDependencies": {
215
215
  "@loadable/component": "5.16.7",
216
- "@modern-js/bff-effect": "npm:@bleedingdev/modern-js-bff-effect@3.9.3-ultramodern.2",
217
- "@modern-js/plugin-bff-extensions": "npm:@bleedingdev/modern-js-plugin-bff-extensions@3.9.3-ultramodern.2",
218
- "@modern-js/plugin-data-loader": "npm:@bleedingdev/modern-js-plugin-data-loader@3.9.3-ultramodern.2",
219
- "@modern-js/runtime-renderer-extensions": "npm:@bleedingdev/modern-js-runtime-renderer-extensions@3.9.3-ultramodern.2",
216
+ "@modern-js/bff-effect": "npm:@bleedingdev/modern-js-bff-effect@3.9.3-ultramodern.4",
217
+ "@modern-js/plugin-bff-extensions": "npm:@bleedingdev/modern-js-plugin-bff-extensions@3.9.3-ultramodern.4",
218
+ "@modern-js/plugin-data-loader": "npm:@bleedingdev/modern-js-plugin-data-loader@3.9.3-ultramodern.4",
219
+ "@modern-js/runtime-renderer-extensions": "npm:@bleedingdev/modern-js-runtime-renderer-extensions@3.9.3-ultramodern.4",
220
220
  "@module-federation/modern-js-v3": "2.9.2",
221
221
  "@module-federation/runtime-tools": "2.9.2",
222
222
  "@rsbuild/core": "2.2.11",
@@ -25,6 +25,8 @@ export interface RendererBuildIdentityOptions {
25
25
  mode: 'development' | 'production';
26
26
  /** Delivery-unit app id; defaults to the application package name. */
27
27
  appId?: string;
28
+ /** Delivery-unit id from the authoritative topology record, when declared. */
29
+ unitId?: string;
28
30
  /** Externally authenticated source revision (delivery unit or CI). */
29
31
  sourceRevision?: string;
30
32
  /** Actual final entry ownership, supplied by the selected renderer composition. */
@@ -132,13 +134,25 @@ export function resolveRendererBuildIdentities(
132
134
  throw new Error(
133
135
  'Renderer application identity requires a delivery artifact appId or a package name.',
134
136
  );
137
+ const unitId = options.unitId;
138
+ if (
139
+ unitId !== undefined &&
140
+ (typeof unitId !== 'string' || !unitId || unitId.trim() !== unitId)
141
+ )
142
+ throw new Error(
143
+ 'Renderer delivery-unit identity requires a nonempty trimmed unitId.',
144
+ );
135
145
  const profileKey = rendererProfileKey(options.profile);
136
146
  const sourceRevision = resolveUltramodernSourceRevision(
137
147
  projectRoot,
138
148
  options.sourceRevision,
139
149
  );
150
+ // The buildId is the delivery unit's buildMarker, so it must name the unit:
151
+ // every app of one workspace shares the revision, lockfile and profile.
140
152
  const buildId = sha256(
141
153
  JSON.stringify([
154
+ appId,
155
+ unitId ?? null,
142
156
  profileKey,
143
157
  lockfileHash(projectRoot),
144
158
  options.mode === 'development' || sourceRevision === 'workspace'