@module-federation/devtools 0.0.0-fix-capture-timeout-20260324112210 → 0.0.0-fix-valid-same-id-20260429034727

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.
@@ -49,6 +49,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
49
49
  ));
50
50
  var import_helpers = __toESM(require("@module-federation/runtime/helpers"));
51
51
  var import_sdk = require("../sdk");
52
+ var import_safe_post_message = require("./safe-post-message");
52
53
  var _a;
53
54
  const getModuleInfo = () => {
54
55
  return {
@@ -66,10 +67,10 @@ const getModuleInfo = () => {
66
67
  const globalSnapshot = import_helpers.default.global.getGlobalSnapshot();
67
68
  if (!options || options.inBrowser) {
68
69
  window.postMessage(
69
- {
70
+ (0, import_safe_post_message.sanitizePostMessagePayload)({
70
71
  moduleInfo: globalSnapshot,
71
72
  updateModule: moduleInfo
72
- },
73
+ }),
73
74
  "*"
74
75
  );
75
76
  }
@@ -0,0 +1,148 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var safe_post_message_exports = {};
20
+ __export(safe_post_message_exports, {
21
+ sanitizePostMessagePayload: () => sanitizePostMessagePayload
22
+ });
23
+ module.exports = __toCommonJS(safe_post_message_exports);
24
+ const FUNCTION_PLACEHOLDER = "function(){}";
25
+ const UNDEFINED_PLACEHOLDER = "[undefined]";
26
+ const CIRCULAR_PLACEHOLDER = "[circular]";
27
+ const NON_SERIALIZABLE_PLACEHOLDER = "[unserializable]";
28
+ const toStringTag = (value) => Object.prototype.toString.call(value).slice(8, -1);
29
+ const isPlainObject = (value) => {
30
+ if (!value || typeof value !== "object") {
31
+ return false;
32
+ }
33
+ const proto = Object.getPrototypeOf(value);
34
+ return proto === Object.prototype || proto === null;
35
+ };
36
+ const sanitizeValue = (value, seen) => {
37
+ if (value === null || typeof value === "string" || typeof value === "number") {
38
+ return Number.isNaN(value) ? "[NaN]" : value;
39
+ }
40
+ if (typeof value === "boolean") {
41
+ return value;
42
+ }
43
+ if (typeof value === "function") {
44
+ return FUNCTION_PLACEHOLDER;
45
+ }
46
+ if (typeof value === "undefined") {
47
+ return UNDEFINED_PLACEHOLDER;
48
+ }
49
+ if (typeof value === "bigint" || typeof value === "symbol") {
50
+ return String(value);
51
+ }
52
+ if (!(value instanceof Object)) {
53
+ return NON_SERIALIZABLE_PLACEHOLDER;
54
+ }
55
+ if (seen.has(value)) {
56
+ return CIRCULAR_PLACEHOLDER;
57
+ }
58
+ if (Array.isArray(value)) {
59
+ const next2 = [];
60
+ seen.set(value, next2);
61
+ value.forEach((item, index) => {
62
+ next2[index] = sanitizeValue(item, seen);
63
+ });
64
+ return next2;
65
+ }
66
+ if (value instanceof Date) {
67
+ return value.toISOString();
68
+ }
69
+ if (value instanceof RegExp) {
70
+ return value.toString();
71
+ }
72
+ if (value instanceof Error) {
73
+ const next2 = {
74
+ name: value.name,
75
+ message: value.message,
76
+ stack: value.stack || ""
77
+ };
78
+ seen.set(value, next2);
79
+ return next2;
80
+ }
81
+ if (value instanceof Map) {
82
+ const next2 = [];
83
+ seen.set(value, next2);
84
+ next2.push(
85
+ ...Array.from(value.entries()).map(([key, item]) => [
86
+ sanitizeValue(key, seen),
87
+ sanitizeValue(item, seen)
88
+ ])
89
+ );
90
+ return next2;
91
+ }
92
+ if (value instanceof Set) {
93
+ const next2 = [];
94
+ seen.set(value, next2);
95
+ next2.push(
96
+ ...Array.from(value.values()).map((item) => sanitizeValue(item, seen))
97
+ );
98
+ return next2;
99
+ }
100
+ if (ArrayBuffer.isView(value)) {
101
+ return Array.from(new Uint8Array(value.buffer));
102
+ }
103
+ if (value instanceof ArrayBuffer) {
104
+ return Array.from(new Uint8Array(value));
105
+ }
106
+ if (typeof Node !== "undefined" && value instanceof Node) {
107
+ return `[${toStringTag(value)}]`;
108
+ }
109
+ if (typeof Window !== "undefined" && value instanceof Window) {
110
+ return "[Window]";
111
+ }
112
+ if (typeof Document !== "undefined" && value instanceof Document) {
113
+ return "[Document]";
114
+ }
115
+ const next = {};
116
+ seen.set(value, next);
117
+ const entries = isPlainObject(value) ? Object.keys(value).map((key) => {
118
+ try {
119
+ return [key, value[key]];
120
+ } catch (_error) {
121
+ return [key, NON_SERIALIZABLE_PLACEHOLDER];
122
+ }
123
+ }) : Reflect.ownKeys(value).map((key) => {
124
+ try {
125
+ return [
126
+ String(key),
127
+ value[key]
128
+ ];
129
+ } catch (_error) {
130
+ return [String(key), NON_SERIALIZABLE_PLACEHOLDER];
131
+ }
132
+ });
133
+ entries.forEach(([key, item]) => {
134
+ try {
135
+ next[key] = sanitizeValue(item, seen);
136
+ } catch (_error) {
137
+ next[key] = NON_SERIALIZABLE_PLACEHOLDER;
138
+ }
139
+ });
140
+ return next;
141
+ };
142
+ const sanitizePostMessagePayload = (payload) => {
143
+ return sanitizeValue(payload, /* @__PURE__ */ new WeakMap());
144
+ };
145
+ // Annotate the CommonJS export names for ESM import in node:
146
+ 0 && (module.exports = {
147
+ sanitizePostMessagePayload
148
+ });
@@ -1 +1 @@
1
- declare const moduleInfo: import("@module-federation/sdk/.").GlobalModuleInfo;
1
+ export {};
@@ -0,0 +1 @@
1
+ export declare const sanitizePostMessagePayload: <T>(payload: T) => T;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@module-federation/devtools",
3
- "version": "0.0.0-fix-capture-timeout-20260324112210",
3
+ "version": "0.0.0-fix-valid-same-id-20260429034727",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -39,15 +39,15 @@
39
39
  "dependencies": {
40
40
  "@modern-js/runtime": "2.70.8",
41
41
  "@arco-design/web-react": "2.66.7",
42
- "ahooks": "^3.7.10",
43
- "dagre": "^0.8.5",
42
+ "ahooks": "3.7.10",
43
+ "dagre": "0.8.5",
44
44
  "reactflow": "11.11.4",
45
- "echarts": "^6.0.0",
46
- "lucide-react": "^0.364.0",
47
- "echarts-for-react": "^3.0.5",
48
- "i18next": "^23.0.0",
49
- "react-i18next": "^15.0.0",
50
- "@module-federation/sdk": "0.0.0-fix-capture-timeout-20260324112210"
45
+ "echarts": "6.0.0",
46
+ "lucide-react": "0.364.0",
47
+ "echarts-for-react": "3.0.5",
48
+ "i18next": "23.0.0",
49
+ "react-i18next": "15.0.0",
50
+ "@module-federation/sdk": "0.0.0-fix-valid-same-id-20260429034727"
51
51
  },
52
52
  "peerDependencies": {
53
53
  "react": "^18 || ^19",
@@ -82,7 +82,7 @@
82
82
  "typescript": "5.9.3",
83
83
  "rimraf": "~6.0.1",
84
84
  "vitest": "1.2.2",
85
- "@module-federation/runtime": "0.0.0-fix-capture-timeout-20260324112210"
85
+ "@module-federation/runtime": "0.0.0-fix-valid-same-id-20260429034727"
86
86
  },
87
87
  "scripts": {
88
88
  "build:storybook": "storybook build",