@module-federation/observability-plugin 0.0.0-feat-operate-openruntime-20260729082849 → 0.0.0-feat-operate-openruntime-20260803054425
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/dist/CHANGELOG.md +2 -2
- package/dist/browser.d.ts +1 -1
- package/dist/browser.js +1 -1
- package/dist/chrome-devtool.d.ts +1 -1
- package/dist/chrome-devtool.js +1 -1
- package/dist/{core-D19HkX4x.js → core-C0012OCG.js} +61 -74
- package/dist/esm/browser.js +1 -1
- package/dist/esm/chrome-devtool.js +1 -1
- package/dist/esm/{core-DffQtfV3.js → core-t1FzL-KJ.js} +61 -74
- package/dist/esm/index.js +1 -1
- package/dist/esm/node.js +1 -1
- package/dist/{index-fTH8rzAd.d.ts → index-C2QnWnLb.d.ts} +6 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/node.d.ts +1 -1
- package/dist/node.js +1 -1
- package/package.json +4 -4
package/dist/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @module-federation/observability-plugin
|
|
2
2
|
|
|
3
|
-
## 0.0.0-feat-operate-openruntime-
|
|
3
|
+
## 0.0.0-feat-operate-openruntime-20260803054425
|
|
4
4
|
|
|
5
5
|
### Minor Changes
|
|
6
6
|
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
- bdb1531: Extend the existing Bridge render and destroy hooks with semantic context, add a route synchronization hook, and keep timing, sanitization, and correlation in the observability plugin.
|
|
12
12
|
- 6317f28: Extend the semantic shared registration and resolution hooks with explicit load context, while keeping provider, candidate, and selection diagnostics in the observability plugin and ignoring legacy share-scope metadata.
|
|
13
13
|
- 2b5f837: Extend the semantic manifest, remote entry, and preload hooks with resource context and results, while keeping cache, timing, timeout, failure, and recovery diagnostics in the observability plugin.
|
|
14
|
-
- @module-federation/sdk@0.0.0-feat-operate-openruntime-
|
|
14
|
+
- @module-federation/sdk@0.0.0-feat-operate-openruntime-20260803054425
|
|
15
15
|
|
|
16
16
|
## 2.5.5
|
|
17
17
|
|
package/dist/browser.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { J as ObservabilityRuntimePlugin, N as ObservabilityPluginOptions } from "./index-
|
|
1
|
+
import { J as ObservabilityRuntimePlugin, N as ObservabilityPluginOptions } from "./index-C2QnWnLb.js";
|
|
2
2
|
|
|
3
3
|
//#region src/browser.d.ts
|
|
4
4
|
declare function ObservabilityPlugin(options?: ObservabilityPluginOptions): ObservabilityRuntimePlugin;
|
package/dist/browser.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
|
|
2
|
-
const require_core = require('./core-
|
|
2
|
+
const require_core = require('./core-C0012OCG.js');
|
|
3
3
|
|
|
4
4
|
//#region src/browser.ts
|
|
5
5
|
function ObservabilityPlugin(options = {}) {
|
package/dist/chrome-devtool.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { J as ObservabilityRuntimePlugin, N as ObservabilityPluginOptions } from "./index-
|
|
1
|
+
import { J as ObservabilityRuntimePlugin, N as ObservabilityPluginOptions } from "./index-C2QnWnLb.js";
|
|
2
2
|
|
|
3
3
|
//#region src/chrome-devtool.d.ts
|
|
4
4
|
declare function ChromeObservabilityPlugin(options?: ObservabilityPluginOptions): ObservabilityRuntimePlugin;
|
package/dist/chrome-devtool.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
|
|
2
|
-
const require_core = require('./core-
|
|
2
|
+
const require_core = require('./core-C0012OCG.js');
|
|
3
3
|
|
|
4
4
|
//#region src/chrome-devtool.ts
|
|
5
5
|
function ChromeObservabilityPlugin(options = {}) {
|
|
@@ -73,7 +73,6 @@ function registerDivebellActions(runtime, source, reportReader, registeredAction
|
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
75
|
},
|
|
76
|
-
getInputOptions: (inputName) => getReportInputOptions(inputName, reportReader),
|
|
77
76
|
handler: (payload) => listReports(reportReader, payload)
|
|
78
77
|
});
|
|
79
78
|
runtime.registerAction({
|
|
@@ -103,7 +102,6 @@ function registerDivebellActions(runtime, source, reportReader, registeredAction
|
|
|
103
102
|
description: "Report trace id."
|
|
104
103
|
} }
|
|
105
104
|
},
|
|
106
|
-
getInputOptions: (inputName) => getReportInputOptions(inputName, reportReader),
|
|
107
105
|
handler: (payload) => {
|
|
108
106
|
const traceId = getPayloadString(payload, "traceId");
|
|
109
107
|
const report = traceId ? reportReader.getReport(traceId) : void 0;
|
|
@@ -127,7 +125,6 @@ function registerDivebellActions(runtime, source, reportReader, registeredAction
|
|
|
127
125
|
description: "Report trace id. When omitted, exports latest report."
|
|
128
126
|
} }
|
|
129
127
|
},
|
|
130
|
-
getInputOptions: (inputName) => getReportInputOptions(inputName, reportReader),
|
|
131
128
|
handler: (payload) => {
|
|
132
129
|
const traceId = getPayloadString(payload, "traceId");
|
|
133
130
|
const report = reportReader.exportReport(traceId);
|
|
@@ -173,7 +170,6 @@ function registerDivebellActions(runtime, source, reportReader, registeredAction
|
|
|
173
170
|
}
|
|
174
171
|
}
|
|
175
172
|
},
|
|
176
|
-
getInputOptions: (inputName) => getFederationModuleInfoInputOptions(inputName, reportReader.getRuntimeState()),
|
|
177
173
|
handler: (payload) => getFederationModuleInfoActionResult(payload, reportReader.getRuntimeState())
|
|
178
174
|
});
|
|
179
175
|
runtime.registerAction({
|
|
@@ -212,7 +208,6 @@ function registerDivebellActions(runtime, source, reportReader, registeredAction
|
|
|
212
208
|
}
|
|
213
209
|
}
|
|
214
210
|
},
|
|
215
|
-
getInputOptions: (inputName) => getFederationInstanceInputOptions(inputName, reportReader.getRuntimeState()),
|
|
216
211
|
handler: (payload) => getFederationInstanceConfigActionResult(payload, reportReader.getRuntimeState())
|
|
217
212
|
});
|
|
218
213
|
registeredActionRuntimes.add(runtime);
|
|
@@ -271,13 +266,6 @@ function createReportSummary(report) {
|
|
|
271
266
|
errorMessage: report.errorMessage
|
|
272
267
|
});
|
|
273
268
|
}
|
|
274
|
-
function getReportInputOptions(inputName, reportReader) {
|
|
275
|
-
if (inputName !== "traceId") return [];
|
|
276
|
-
return reportReader.getReports({ limit: 20 }).map((report) => ({
|
|
277
|
-
value: report.traceId,
|
|
278
|
-
description: report.remote?.name || report.shared?.name || report.requestAlias || report.requestId || report.summary.outcome
|
|
279
|
-
}));
|
|
280
|
-
}
|
|
281
269
|
function getFederationGlobalSummary(runtimeState) {
|
|
282
270
|
return {
|
|
283
271
|
available: true,
|
|
@@ -319,14 +307,6 @@ function getFederationModuleInfoActionResult(payload, runtimeState) {
|
|
|
319
307
|
moduleInfo: runtimeState.moduleInfo
|
|
320
308
|
});
|
|
321
309
|
}
|
|
322
|
-
function getFederationModuleInfoInputOptions(inputName, runtimeState) {
|
|
323
|
-
if (inputName !== "key" && inputName !== "name" && inputName !== "instanceRef") return [];
|
|
324
|
-
if (inputName === "instanceRef") return runtimeState.instances.map((instance) => ({
|
|
325
|
-
value: instance.instanceRef,
|
|
326
|
-
description: instance.optionsName || instance.name || instance.instanceRef
|
|
327
|
-
}));
|
|
328
|
-
return runtimeState.moduleInfo.map((entry) => ({ value: entry.key }));
|
|
329
|
-
}
|
|
330
310
|
function getFederationInstanceConfigActionResult(payload, runtimeState) {
|
|
331
311
|
const instanceRef = getPayloadString(payload, "instanceRef");
|
|
332
312
|
const name = getPayloadString(payload, "name");
|
|
@@ -348,13 +328,6 @@ function getFederationInstanceConfigActionResult(payload, runtimeState) {
|
|
|
348
328
|
instance
|
|
349
329
|
};
|
|
350
330
|
}
|
|
351
|
-
function getFederationInstanceInputOptions(inputName, runtimeState) {
|
|
352
|
-
if (inputName !== "name" && inputName !== "index" && inputName !== "instanceRef") return [];
|
|
353
|
-
return runtimeState.instances.map((instance, index) => ({
|
|
354
|
-
value: inputName === "instanceRef" ? instance.instanceRef : inputName === "index" ? index : instance.optionsName || instance.name || instance.instanceRef,
|
|
355
|
-
description: `${instance.optionsName || instance.name || "unnamed"} (${instance.instanceRef})`
|
|
356
|
-
}));
|
|
357
|
-
}
|
|
358
331
|
function createInstanceCandidate(instance) {
|
|
359
332
|
return compactObject$1({
|
|
360
333
|
instanceRef: instance.instanceRef,
|
|
@@ -1011,52 +984,6 @@ function omitUndefinedFields(value) {
|
|
|
1011
984
|
return cleanValue;
|
|
1012
985
|
}
|
|
1013
986
|
|
|
1014
|
-
//#endregion
|
|
1015
|
-
//#region src/runtime/remote.ts
|
|
1016
|
-
function sanitizeRemote(remote) {
|
|
1017
|
-
if (!remote || !remote.name) return;
|
|
1018
|
-
return {
|
|
1019
|
-
name: remote.name,
|
|
1020
|
-
alias: sanitizeText(remote.alias, 120),
|
|
1021
|
-
entry: clipText(remote.entry, 320),
|
|
1022
|
-
entryGlobalName: sanitizeText(remote.entryGlobalName, 120),
|
|
1023
|
-
type: sanitizeText(remote.type, 80)
|
|
1024
|
-
};
|
|
1025
|
-
}
|
|
1026
|
-
function sanitizeResource(resource) {
|
|
1027
|
-
if (!resource) return;
|
|
1028
|
-
const type = sanitizeText(resource.type, 80);
|
|
1029
|
-
if (!type) return;
|
|
1030
|
-
return omitUndefinedFields({
|
|
1031
|
-
type,
|
|
1032
|
-
initiator: resource.initiator,
|
|
1033
|
-
outcome: resource.outcome,
|
|
1034
|
-
url: sanitizeUrl(resource.url),
|
|
1035
|
-
startedAt: Number.isFinite(resource.startedAt) ? resource.startedAt : Date.now(),
|
|
1036
|
-
endedAt: resource.endedAt !== void 0 && Number.isFinite(resource.endedAt) ? resource.endedAt : void 0,
|
|
1037
|
-
duration: resource.duration !== void 0 && Number.isFinite(resource.duration) ? Math.max(0, resource.duration) : void 0,
|
|
1038
|
-
httpStatus: resource.httpStatus !== void 0 && Number.isFinite(resource.httpStatus) ? resource.httpStatus : void 0,
|
|
1039
|
-
mimeType: sanitizeText(resource.mimeType, 160),
|
|
1040
|
-
redirected: typeof resource.redirected === "boolean" ? resource.redirected : void 0,
|
|
1041
|
-
cacheSource: sanitizeText(resource.cacheSource, 80),
|
|
1042
|
-
errorType: sanitizeText(resource.errorType, 80)
|
|
1043
|
-
});
|
|
1044
|
-
}
|
|
1045
|
-
function createRemoteInfo(remote) {
|
|
1046
|
-
if (!remote?.name) return;
|
|
1047
|
-
return {
|
|
1048
|
-
name: remote.name,
|
|
1049
|
-
alias: remote.alias,
|
|
1050
|
-
entry: remote.entry,
|
|
1051
|
-
entryGlobalName: remote.entryGlobalName,
|
|
1052
|
-
type: remote.type
|
|
1053
|
-
};
|
|
1054
|
-
}
|
|
1055
|
-
function isManifestUrl(value) {
|
|
1056
|
-
const sanitized = sanitizeUrl(value);
|
|
1057
|
-
return Boolean(sanitized && /manifest.*\.json$/i.test(sanitized));
|
|
1058
|
-
}
|
|
1059
|
-
|
|
1060
987
|
//#endregion
|
|
1061
988
|
//#region src/report/error.ts
|
|
1062
989
|
function normalizeEventSource(value) {
|
|
@@ -1521,6 +1448,66 @@ function sanitizeSharedConflict(conflict) {
|
|
|
1521
1448
|
};
|
|
1522
1449
|
}
|
|
1523
1450
|
|
|
1451
|
+
//#endregion
|
|
1452
|
+
//#region src/runtime/remote.ts
|
|
1453
|
+
const REMOTE_LIFECYCLE_HOOKS = [
|
|
1454
|
+
"afterLoadEntry",
|
|
1455
|
+
"beforeInitRemote",
|
|
1456
|
+
"afterInitRemote",
|
|
1457
|
+
"beforeGetExpose",
|
|
1458
|
+
"afterGetExpose",
|
|
1459
|
+
"beforeExecuteFactory",
|
|
1460
|
+
"afterExecuteFactory"
|
|
1461
|
+
];
|
|
1462
|
+
function supportsRemoteLifecycleObservability(origin) {
|
|
1463
|
+
if (supportsRuntimeObservability(origin)) return true;
|
|
1464
|
+
const lifecycle = origin?.loaderHook?.lifecycle;
|
|
1465
|
+
return Boolean(lifecycle && REMOTE_LIFECYCLE_HOOKS.every((hookName) => lifecycle[hookName] !== void 0));
|
|
1466
|
+
}
|
|
1467
|
+
function sanitizeRemote(remote) {
|
|
1468
|
+
if (!remote || !remote.name) return;
|
|
1469
|
+
return {
|
|
1470
|
+
name: remote.name,
|
|
1471
|
+
alias: sanitizeText(remote.alias, 120),
|
|
1472
|
+
entry: clipText(remote.entry, 320),
|
|
1473
|
+
entryGlobalName: sanitizeText(remote.entryGlobalName, 120),
|
|
1474
|
+
type: sanitizeText(remote.type, 80)
|
|
1475
|
+
};
|
|
1476
|
+
}
|
|
1477
|
+
function sanitizeResource(resource) {
|
|
1478
|
+
if (!resource) return;
|
|
1479
|
+
const type = sanitizeText(resource.type, 80);
|
|
1480
|
+
if (!type) return;
|
|
1481
|
+
return omitUndefinedFields({
|
|
1482
|
+
type,
|
|
1483
|
+
initiator: resource.initiator,
|
|
1484
|
+
outcome: resource.outcome,
|
|
1485
|
+
url: sanitizeUrl(resource.url),
|
|
1486
|
+
startedAt: Number.isFinite(resource.startedAt) ? resource.startedAt : Date.now(),
|
|
1487
|
+
endedAt: resource.endedAt !== void 0 && Number.isFinite(resource.endedAt) ? resource.endedAt : void 0,
|
|
1488
|
+
duration: resource.duration !== void 0 && Number.isFinite(resource.duration) ? Math.max(0, resource.duration) : void 0,
|
|
1489
|
+
httpStatus: resource.httpStatus !== void 0 && Number.isFinite(resource.httpStatus) ? resource.httpStatus : void 0,
|
|
1490
|
+
mimeType: sanitizeText(resource.mimeType, 160),
|
|
1491
|
+
redirected: typeof resource.redirected === "boolean" ? resource.redirected : void 0,
|
|
1492
|
+
cacheSource: sanitizeText(resource.cacheSource, 80),
|
|
1493
|
+
errorType: sanitizeText(resource.errorType, 80)
|
|
1494
|
+
});
|
|
1495
|
+
}
|
|
1496
|
+
function createRemoteInfo(remote) {
|
|
1497
|
+
if (!remote?.name) return;
|
|
1498
|
+
return {
|
|
1499
|
+
name: remote.name,
|
|
1500
|
+
alias: remote.alias,
|
|
1501
|
+
entry: remote.entry,
|
|
1502
|
+
entryGlobalName: remote.entryGlobalName,
|
|
1503
|
+
type: remote.type
|
|
1504
|
+
};
|
|
1505
|
+
}
|
|
1506
|
+
function isManifestUrl(value) {
|
|
1507
|
+
const sanitized = sanitizeUrl(value);
|
|
1508
|
+
return Boolean(sanitized && /manifest.*\.json$/i.test(sanitized));
|
|
1509
|
+
}
|
|
1510
|
+
|
|
1524
1511
|
//#endregion
|
|
1525
1512
|
//#region src/report/copy.ts
|
|
1526
1513
|
function copyEvent(event) {
|
|
@@ -2998,7 +2985,7 @@ function createObservability(rawOptions = {}, adapterOptions = {}) {
|
|
|
2998
2985
|
runtimeObservabilityEnabled = true;
|
|
2999
2986
|
return true;
|
|
3000
2987
|
};
|
|
3001
|
-
const supportsRuntimeHookObservability = (origin) =>
|
|
2988
|
+
const supportsRuntimeHookObservability = (origin) => supportsRemoteLifecycleObservability({
|
|
3002
2989
|
...origin,
|
|
3003
2990
|
version: sanitizeText(origin?.version, 80) || appliedRuntimeVersion || origin?.version
|
|
3004
2991
|
});
|
package/dist/esm/browser.js
CHANGED
|
@@ -72,7 +72,6 @@ function registerDivebellActions(runtime, source, reportReader, registeredAction
|
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
74
|
},
|
|
75
|
-
getInputOptions: (inputName) => getReportInputOptions(inputName, reportReader),
|
|
76
75
|
handler: (payload) => listReports(reportReader, payload)
|
|
77
76
|
});
|
|
78
77
|
runtime.registerAction({
|
|
@@ -102,7 +101,6 @@ function registerDivebellActions(runtime, source, reportReader, registeredAction
|
|
|
102
101
|
description: "Report trace id."
|
|
103
102
|
} }
|
|
104
103
|
},
|
|
105
|
-
getInputOptions: (inputName) => getReportInputOptions(inputName, reportReader),
|
|
106
104
|
handler: (payload) => {
|
|
107
105
|
const traceId = getPayloadString(payload, "traceId");
|
|
108
106
|
const report = traceId ? reportReader.getReport(traceId) : void 0;
|
|
@@ -126,7 +124,6 @@ function registerDivebellActions(runtime, source, reportReader, registeredAction
|
|
|
126
124
|
description: "Report trace id. When omitted, exports latest report."
|
|
127
125
|
} }
|
|
128
126
|
},
|
|
129
|
-
getInputOptions: (inputName) => getReportInputOptions(inputName, reportReader),
|
|
130
127
|
handler: (payload) => {
|
|
131
128
|
const traceId = getPayloadString(payload, "traceId");
|
|
132
129
|
const report = reportReader.exportReport(traceId);
|
|
@@ -172,7 +169,6 @@ function registerDivebellActions(runtime, source, reportReader, registeredAction
|
|
|
172
169
|
}
|
|
173
170
|
}
|
|
174
171
|
},
|
|
175
|
-
getInputOptions: (inputName) => getFederationModuleInfoInputOptions(inputName, reportReader.getRuntimeState()),
|
|
176
172
|
handler: (payload) => getFederationModuleInfoActionResult(payload, reportReader.getRuntimeState())
|
|
177
173
|
});
|
|
178
174
|
runtime.registerAction({
|
|
@@ -211,7 +207,6 @@ function registerDivebellActions(runtime, source, reportReader, registeredAction
|
|
|
211
207
|
}
|
|
212
208
|
}
|
|
213
209
|
},
|
|
214
|
-
getInputOptions: (inputName) => getFederationInstanceInputOptions(inputName, reportReader.getRuntimeState()),
|
|
215
210
|
handler: (payload) => getFederationInstanceConfigActionResult(payload, reportReader.getRuntimeState())
|
|
216
211
|
});
|
|
217
212
|
registeredActionRuntimes.add(runtime);
|
|
@@ -270,13 +265,6 @@ function createReportSummary(report) {
|
|
|
270
265
|
errorMessage: report.errorMessage
|
|
271
266
|
});
|
|
272
267
|
}
|
|
273
|
-
function getReportInputOptions(inputName, reportReader) {
|
|
274
|
-
if (inputName !== "traceId") return [];
|
|
275
|
-
return reportReader.getReports({ limit: 20 }).map((report) => ({
|
|
276
|
-
value: report.traceId,
|
|
277
|
-
description: report.remote?.name || report.shared?.name || report.requestAlias || report.requestId || report.summary.outcome
|
|
278
|
-
}));
|
|
279
|
-
}
|
|
280
268
|
function getFederationGlobalSummary(runtimeState) {
|
|
281
269
|
return {
|
|
282
270
|
available: true,
|
|
@@ -318,14 +306,6 @@ function getFederationModuleInfoActionResult(payload, runtimeState) {
|
|
|
318
306
|
moduleInfo: runtimeState.moduleInfo
|
|
319
307
|
});
|
|
320
308
|
}
|
|
321
|
-
function getFederationModuleInfoInputOptions(inputName, runtimeState) {
|
|
322
|
-
if (inputName !== "key" && inputName !== "name" && inputName !== "instanceRef") return [];
|
|
323
|
-
if (inputName === "instanceRef") return runtimeState.instances.map((instance) => ({
|
|
324
|
-
value: instance.instanceRef,
|
|
325
|
-
description: instance.optionsName || instance.name || instance.instanceRef
|
|
326
|
-
}));
|
|
327
|
-
return runtimeState.moduleInfo.map((entry) => ({ value: entry.key }));
|
|
328
|
-
}
|
|
329
309
|
function getFederationInstanceConfigActionResult(payload, runtimeState) {
|
|
330
310
|
const instanceRef = getPayloadString(payload, "instanceRef");
|
|
331
311
|
const name = getPayloadString(payload, "name");
|
|
@@ -347,13 +327,6 @@ function getFederationInstanceConfigActionResult(payload, runtimeState) {
|
|
|
347
327
|
instance
|
|
348
328
|
};
|
|
349
329
|
}
|
|
350
|
-
function getFederationInstanceInputOptions(inputName, runtimeState) {
|
|
351
|
-
if (inputName !== "name" && inputName !== "index" && inputName !== "instanceRef") return [];
|
|
352
|
-
return runtimeState.instances.map((instance, index) => ({
|
|
353
|
-
value: inputName === "instanceRef" ? instance.instanceRef : inputName === "index" ? index : instance.optionsName || instance.name || instance.instanceRef,
|
|
354
|
-
description: `${instance.optionsName || instance.name || "unnamed"} (${instance.instanceRef})`
|
|
355
|
-
}));
|
|
356
|
-
}
|
|
357
330
|
function createInstanceCandidate(instance) {
|
|
358
331
|
return compactObject$1({
|
|
359
332
|
instanceRef: instance.instanceRef,
|
|
@@ -1010,52 +983,6 @@ function omitUndefinedFields(value) {
|
|
|
1010
983
|
return cleanValue;
|
|
1011
984
|
}
|
|
1012
985
|
|
|
1013
|
-
//#endregion
|
|
1014
|
-
//#region src/runtime/remote.ts
|
|
1015
|
-
function sanitizeRemote(remote) {
|
|
1016
|
-
if (!remote || !remote.name) return;
|
|
1017
|
-
return {
|
|
1018
|
-
name: remote.name,
|
|
1019
|
-
alias: sanitizeText(remote.alias, 120),
|
|
1020
|
-
entry: clipText(remote.entry, 320),
|
|
1021
|
-
entryGlobalName: sanitizeText(remote.entryGlobalName, 120),
|
|
1022
|
-
type: sanitizeText(remote.type, 80)
|
|
1023
|
-
};
|
|
1024
|
-
}
|
|
1025
|
-
function sanitizeResource(resource) {
|
|
1026
|
-
if (!resource) return;
|
|
1027
|
-
const type = sanitizeText(resource.type, 80);
|
|
1028
|
-
if (!type) return;
|
|
1029
|
-
return omitUndefinedFields({
|
|
1030
|
-
type,
|
|
1031
|
-
initiator: resource.initiator,
|
|
1032
|
-
outcome: resource.outcome,
|
|
1033
|
-
url: sanitizeUrl(resource.url),
|
|
1034
|
-
startedAt: Number.isFinite(resource.startedAt) ? resource.startedAt : Date.now(),
|
|
1035
|
-
endedAt: resource.endedAt !== void 0 && Number.isFinite(resource.endedAt) ? resource.endedAt : void 0,
|
|
1036
|
-
duration: resource.duration !== void 0 && Number.isFinite(resource.duration) ? Math.max(0, resource.duration) : void 0,
|
|
1037
|
-
httpStatus: resource.httpStatus !== void 0 && Number.isFinite(resource.httpStatus) ? resource.httpStatus : void 0,
|
|
1038
|
-
mimeType: sanitizeText(resource.mimeType, 160),
|
|
1039
|
-
redirected: typeof resource.redirected === "boolean" ? resource.redirected : void 0,
|
|
1040
|
-
cacheSource: sanitizeText(resource.cacheSource, 80),
|
|
1041
|
-
errorType: sanitizeText(resource.errorType, 80)
|
|
1042
|
-
});
|
|
1043
|
-
}
|
|
1044
|
-
function createRemoteInfo(remote) {
|
|
1045
|
-
if (!remote?.name) return;
|
|
1046
|
-
return {
|
|
1047
|
-
name: remote.name,
|
|
1048
|
-
alias: remote.alias,
|
|
1049
|
-
entry: remote.entry,
|
|
1050
|
-
entryGlobalName: remote.entryGlobalName,
|
|
1051
|
-
type: remote.type
|
|
1052
|
-
};
|
|
1053
|
-
}
|
|
1054
|
-
function isManifestUrl(value) {
|
|
1055
|
-
const sanitized = sanitizeUrl(value);
|
|
1056
|
-
return Boolean(sanitized && /manifest.*\.json$/i.test(sanitized));
|
|
1057
|
-
}
|
|
1058
|
-
|
|
1059
986
|
//#endregion
|
|
1060
987
|
//#region src/report/error.ts
|
|
1061
988
|
function normalizeEventSource(value) {
|
|
@@ -1520,6 +1447,66 @@ function sanitizeSharedConflict(conflict) {
|
|
|
1520
1447
|
};
|
|
1521
1448
|
}
|
|
1522
1449
|
|
|
1450
|
+
//#endregion
|
|
1451
|
+
//#region src/runtime/remote.ts
|
|
1452
|
+
const REMOTE_LIFECYCLE_HOOKS = [
|
|
1453
|
+
"afterLoadEntry",
|
|
1454
|
+
"beforeInitRemote",
|
|
1455
|
+
"afterInitRemote",
|
|
1456
|
+
"beforeGetExpose",
|
|
1457
|
+
"afterGetExpose",
|
|
1458
|
+
"beforeExecuteFactory",
|
|
1459
|
+
"afterExecuteFactory"
|
|
1460
|
+
];
|
|
1461
|
+
function supportsRemoteLifecycleObservability(origin) {
|
|
1462
|
+
if (supportsRuntimeObservability(origin)) return true;
|
|
1463
|
+
const lifecycle = origin?.loaderHook?.lifecycle;
|
|
1464
|
+
return Boolean(lifecycle && REMOTE_LIFECYCLE_HOOKS.every((hookName) => lifecycle[hookName] !== void 0));
|
|
1465
|
+
}
|
|
1466
|
+
function sanitizeRemote(remote) {
|
|
1467
|
+
if (!remote || !remote.name) return;
|
|
1468
|
+
return {
|
|
1469
|
+
name: remote.name,
|
|
1470
|
+
alias: sanitizeText(remote.alias, 120),
|
|
1471
|
+
entry: clipText(remote.entry, 320),
|
|
1472
|
+
entryGlobalName: sanitizeText(remote.entryGlobalName, 120),
|
|
1473
|
+
type: sanitizeText(remote.type, 80)
|
|
1474
|
+
};
|
|
1475
|
+
}
|
|
1476
|
+
function sanitizeResource(resource) {
|
|
1477
|
+
if (!resource) return;
|
|
1478
|
+
const type = sanitizeText(resource.type, 80);
|
|
1479
|
+
if (!type) return;
|
|
1480
|
+
return omitUndefinedFields({
|
|
1481
|
+
type,
|
|
1482
|
+
initiator: resource.initiator,
|
|
1483
|
+
outcome: resource.outcome,
|
|
1484
|
+
url: sanitizeUrl(resource.url),
|
|
1485
|
+
startedAt: Number.isFinite(resource.startedAt) ? resource.startedAt : Date.now(),
|
|
1486
|
+
endedAt: resource.endedAt !== void 0 && Number.isFinite(resource.endedAt) ? resource.endedAt : void 0,
|
|
1487
|
+
duration: resource.duration !== void 0 && Number.isFinite(resource.duration) ? Math.max(0, resource.duration) : void 0,
|
|
1488
|
+
httpStatus: resource.httpStatus !== void 0 && Number.isFinite(resource.httpStatus) ? resource.httpStatus : void 0,
|
|
1489
|
+
mimeType: sanitizeText(resource.mimeType, 160),
|
|
1490
|
+
redirected: typeof resource.redirected === "boolean" ? resource.redirected : void 0,
|
|
1491
|
+
cacheSource: sanitizeText(resource.cacheSource, 80),
|
|
1492
|
+
errorType: sanitizeText(resource.errorType, 80)
|
|
1493
|
+
});
|
|
1494
|
+
}
|
|
1495
|
+
function createRemoteInfo(remote) {
|
|
1496
|
+
if (!remote?.name) return;
|
|
1497
|
+
return {
|
|
1498
|
+
name: remote.name,
|
|
1499
|
+
alias: remote.alias,
|
|
1500
|
+
entry: remote.entry,
|
|
1501
|
+
entryGlobalName: remote.entryGlobalName,
|
|
1502
|
+
type: remote.type
|
|
1503
|
+
};
|
|
1504
|
+
}
|
|
1505
|
+
function isManifestUrl(value) {
|
|
1506
|
+
const sanitized = sanitizeUrl(value);
|
|
1507
|
+
return Boolean(sanitized && /manifest.*\.json$/i.test(sanitized));
|
|
1508
|
+
}
|
|
1509
|
+
|
|
1523
1510
|
//#endregion
|
|
1524
1511
|
//#region src/report/copy.ts
|
|
1525
1512
|
function copyEvent(event) {
|
|
@@ -2997,7 +2984,7 @@ function createObservability(rawOptions = {}, adapterOptions = {}) {
|
|
|
2997
2984
|
runtimeObservabilityEnabled = true;
|
|
2998
2985
|
return true;
|
|
2999
2986
|
};
|
|
3000
|
-
const supportsRuntimeHookObservability = (origin) =>
|
|
2987
|
+
const supportsRuntimeHookObservability = (origin) => supportsRemoteLifecycleObservability({
|
|
3001
2988
|
...origin,
|
|
3002
2989
|
version: sanitizeText(origin?.version, 80) || appliedRuntimeVersion || origin?.version
|
|
3003
2990
|
});
|
package/dist/esm/index.js
CHANGED
package/dist/esm/node.js
CHANGED
|
@@ -535,6 +535,12 @@ interface ObservabilityRuntimeOrigin {
|
|
|
535
535
|
loaderHook?: {
|
|
536
536
|
lifecycle?: {
|
|
537
537
|
afterLoadEntry?: unknown;
|
|
538
|
+
beforeInitRemote?: unknown;
|
|
539
|
+
afterInitRemote?: unknown;
|
|
540
|
+
beforeGetExpose?: unknown;
|
|
541
|
+
afterGetExpose?: unknown;
|
|
542
|
+
beforeExecuteFactory?: unknown;
|
|
543
|
+
afterExecuteFactory?: unknown;
|
|
538
544
|
};
|
|
539
545
|
};
|
|
540
546
|
snapshotHandler?: {
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as ObservabilitySharedCandidate, A as ObservabilityOwnerHint, B as ObservabilityReportOutcome, C as ObservabilityLevel, D as ObservabilityMetadataValue, E as ObservabilityMetadata, F as ObservabilityRelationshipStatus, G as ObservabilityRuntimeEventInput, H as ObservabilityReportStatus, I as ObservabilityRemoteInfo, J as ObservabilityRuntimePlugin, K as ObservabilityRuntimeModuleInfo, L as ObservabilityReport, M as ObservabilityPhaseSummary, N as ObservabilityPluginOptions, O as ObservabilityModuleInfoEntry, P as ObservabilityRawErrorContext, Q as ObservabilityRuntimeStateRemote, R as ObservabilityReportFlags, S as ObservabilityInstanceRole, T as ObservabilityLoadedBeforeInfo, U as ObservabilityResourceInfo, V as ObservabilityReportQuery, W as ObservabilityRuntimeAdapterOptions, X as ObservabilityRuntimeState, Y as ObservabilityRuntimeRelationship, Z as ObservabilityRuntimeStateInstance, _ as ObservabilityEventContext, a as ObservabilityActionId, at as OnMFRemoteLoaded, b as ObservabilityFactReport, c as ObservabilityBridgeState, d as ObservabilityBrowserReader, et as ObservabilitySharedConflictInfo, f as ObservabilityCapability, g as ObservabilityEvent, h as ObservabilityErrorSummary, i as ObservabilityAction, it as ObservabilitySharedSummary, j as ObservabilityPhaseCollection, k as ObservabilityModuleInfoSummary, l as ObservabilityBridgeStatus, m as ObservabilityController, n as MFRemoteLoadedOptions, nt as ObservabilitySharedInfo, o as ObservabilityBridgeInfo, p as ObservabilityCapabilityName, q as ObservabilityRuntimeOrigin, r as MarkComponentLoadedOptions, rt as ObservabilitySharedRegistration, s as ObservabilityBridgeRouteSummary, t as DivebellObservabilityOptions, tt as ObservabilitySharedConflictVersion, u as ObservabilityBrowserMode, v as ObservabilityEventSource, w as ObservabilityLoadedBeforeConsumer, x as ObservabilityInstanceAPI, y as ObservabilityEventStatus, z as ObservabilityReportListOptions } from "./index-
|
|
1
|
+
import { $ as ObservabilitySharedCandidate, A as ObservabilityOwnerHint, B as ObservabilityReportOutcome, C as ObservabilityLevel, D as ObservabilityMetadataValue, E as ObservabilityMetadata, F as ObservabilityRelationshipStatus, G as ObservabilityRuntimeEventInput, H as ObservabilityReportStatus, I as ObservabilityRemoteInfo, J as ObservabilityRuntimePlugin, K as ObservabilityRuntimeModuleInfo, L as ObservabilityReport, M as ObservabilityPhaseSummary, N as ObservabilityPluginOptions, O as ObservabilityModuleInfoEntry, P as ObservabilityRawErrorContext, Q as ObservabilityRuntimeStateRemote, R as ObservabilityReportFlags, S as ObservabilityInstanceRole, T as ObservabilityLoadedBeforeInfo, U as ObservabilityResourceInfo, V as ObservabilityReportQuery, W as ObservabilityRuntimeAdapterOptions, X as ObservabilityRuntimeState, Y as ObservabilityRuntimeRelationship, Z as ObservabilityRuntimeStateInstance, _ as ObservabilityEventContext, a as ObservabilityActionId, at as OnMFRemoteLoaded, b as ObservabilityFactReport, c as ObservabilityBridgeState, d as ObservabilityBrowserReader, et as ObservabilitySharedConflictInfo, f as ObservabilityCapability, g as ObservabilityEvent, h as ObservabilityErrorSummary, i as ObservabilityAction, it as ObservabilitySharedSummary, j as ObservabilityPhaseCollection, k as ObservabilityModuleInfoSummary, l as ObservabilityBridgeStatus, m as ObservabilityController, n as MFRemoteLoadedOptions, nt as ObservabilitySharedInfo, o as ObservabilityBridgeInfo, p as ObservabilityCapabilityName, q as ObservabilityRuntimeOrigin, r as MarkComponentLoadedOptions, rt as ObservabilitySharedRegistration, s as ObservabilityBridgeRouteSummary, t as DivebellObservabilityOptions, tt as ObservabilitySharedConflictVersion, u as ObservabilityBrowserMode, v as ObservabilityEventSource, w as ObservabilityLoadedBeforeConsumer, x as ObservabilityInstanceAPI, y as ObservabilityEventStatus, z as ObservabilityReportListOptions } from "./index-C2QnWnLb.js";
|
|
2
2
|
import { ObservabilityPlugin } from "./browser.js";
|
|
3
3
|
import { ChromeObservabilityPlugin } from "./chrome-devtool.js";
|
|
4
4
|
import { DivebellCore } from "@divebell/core";
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
|
|
2
|
-
const require_core = require('./core-
|
|
2
|
+
const require_core = require('./core-C0012OCG.js');
|
|
3
3
|
const require_browser = require('./browser.js');
|
|
4
4
|
const require_chrome_devtool = require('./chrome-devtool.js');
|
|
5
5
|
|
package/dist/node.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { J as ObservabilityRuntimePlugin, N as ObservabilityPluginOptions, m as ObservabilityController } from "./index-
|
|
1
|
+
import { J as ObservabilityRuntimePlugin, N as ObservabilityPluginOptions, m as ObservabilityController } from "./index-C2QnWnLb.js";
|
|
2
2
|
|
|
3
3
|
//#region src/node.d.ts
|
|
4
4
|
interface ObservabilityNodeOptions extends Omit<ObservabilityPluginOptions, 'browser'> {
|
package/dist/node.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
|
|
2
|
-
const require_core = require('./core-
|
|
2
|
+
const require_core = require('./core-C0012OCG.js');
|
|
3
3
|
|
|
4
4
|
//#region src/node.ts
|
|
5
5
|
const DEFAULT_NODE_DIRECTORY = ".mf/observability";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@module-federation/observability-plugin",
|
|
3
|
-
"version": "0.0.0-feat-operate-openruntime-
|
|
3
|
+
"version": "0.0.0-feat-operate-openruntime-20260803054425",
|
|
4
4
|
"author": "module-federation",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/esm/index.js",
|
|
@@ -66,12 +66,12 @@
|
|
|
66
66
|
},
|
|
67
67
|
"devDependencies": {
|
|
68
68
|
"@types/semver": "^7.5.8",
|
|
69
|
-
"@module-federation/runtime": "0.0.0-feat-operate-openruntime-
|
|
69
|
+
"@module-federation/runtime": "0.0.0-feat-operate-openruntime-20260803054425"
|
|
70
70
|
},
|
|
71
71
|
"dependencies": {
|
|
72
|
-
"@divebell/core": "0.0.
|
|
72
|
+
"@divebell/core": "0.0.3",
|
|
73
73
|
"semver": "^7.7.4",
|
|
74
|
-
"@module-federation/sdk": "0.0.0-feat-operate-openruntime-
|
|
74
|
+
"@module-federation/sdk": "0.0.0-feat-operate-openruntime-20260803054425"
|
|
75
75
|
},
|
|
76
76
|
"scripts": {
|
|
77
77
|
"build": "tsdown --config tsdown.config.ts && cp *.md dist",
|