@module-federation/devtools 0.0.0-next-20250926024003 → 0.0.0-perf-devtools-20260106124142
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/es/App.js +328 -22
- package/dist/es/App.module.js +1 -1
- package/dist/es/App_module.css +291 -5
- package/dist/es/component/DependencyGraph/index.js +205 -0
- package/dist/es/component/DependencyGraph/index.module.js +5 -0
- package/dist/es/component/DependencyGraph/index_module.css +97 -0
- package/dist/es/component/{GraphItem → DependencyGraphItem}/index.js +15 -6
- package/dist/es/component/DependencyGraphItem/index.module.js +5 -0
- package/dist/es/component/DependencyGraphItem/index_module.css +95 -0
- package/dist/es/component/Form/index.js +191 -109
- package/dist/es/component/Form/index.module.js +1 -1
- package/dist/es/component/Form/index_module.css +179 -25
- package/dist/es/component/Layout/index.js +288 -51
- package/dist/es/component/Layout/index.module.js +1 -1
- package/dist/es/component/Layout/index_module.css +52 -32
- package/dist/es/component/ModuleInfo/index.js +289 -0
- package/dist/es/component/ModuleInfo/index.module.js +5 -0
- package/dist/es/component/ModuleInfo/index_module.css +183 -0
- package/dist/es/component/SharedDepsExplorer/FocusResultDisplay.js +39 -0
- package/dist/es/component/SharedDepsExplorer/index.js +505 -0
- package/dist/es/component/SharedDepsExplorer/share-utils.js +206 -0
- package/dist/es/index.css +15 -0
- package/dist/es/template/constant.js +5 -19
- package/dist/es/utils/chrome/fast-refresh.js +80 -7
- package/dist/es/utils/chrome/index.js +91 -38
- package/dist/es/utils/chrome/messages.js +6 -0
- package/dist/es/utils/chrome/post-message-listener.js +2 -1
- package/dist/es/utils/chrome/post-message-start.js +10 -2
- package/dist/es/utils/chrome/storage.js +6 -1
- package/dist/es/utils/sdk/graph.js +25 -4
- package/dist/es/utils/sdk/index.js +9 -0
- package/dist/es/worker/index.js +168 -1
- package/dist/lib/App.js +318 -17
- package/dist/lib/App.module.js +1 -1
- package/dist/lib/App_module.css +291 -5
- package/dist/lib/component/DependencyGraph/index.js +227 -0
- package/dist/lib/component/{GraphItem → DependencyGraph}/index.module.js +1 -1
- package/dist/lib/component/DependencyGraph/index_module.css +97 -0
- package/dist/lib/component/{GraphItem → DependencyGraphItem}/index.js +18 -9
- package/dist/lib/component/{Graph → DependencyGraphItem}/index.module.js +1 -1
- package/dist/lib/component/DependencyGraphItem/index_module.css +95 -0
- package/dist/lib/component/Form/index.js +188 -107
- package/dist/lib/component/Form/index.module.js +1 -1
- package/dist/lib/component/Form/index_module.css +179 -25
- package/dist/lib/component/Layout/index.js +280 -48
- package/dist/lib/component/Layout/index.module.js +1 -1
- package/dist/lib/component/Layout/index_module.css +52 -32
- package/dist/lib/component/ModuleInfo/index.js +319 -0
- package/dist/lib/component/ModuleInfo/index.module.js +25 -0
- package/dist/lib/component/ModuleInfo/index_module.css +183 -0
- package/dist/lib/component/SharedDepsExplorer/FocusResultDisplay.js +59 -0
- package/dist/lib/component/SharedDepsExplorer/index.js +512 -0
- package/dist/lib/component/SharedDepsExplorer/share-utils.js +237 -0
- package/dist/lib/index.css +15 -0
- package/dist/lib/template/constant.js +7 -17
- package/dist/lib/utils/chrome/fast-refresh.js +77 -8
- package/dist/lib/utils/chrome/index.js +94 -38
- package/dist/lib/utils/chrome/messages.js +31 -0
- package/dist/lib/utils/chrome/post-message-listener.js +2 -1
- package/dist/lib/utils/chrome/post-message-start.js +10 -2
- package/dist/lib/utils/chrome/storage.js +5 -0
- package/dist/lib/utils/sdk/graph.js +25 -4
- package/dist/lib/utils/sdk/index.js +10 -0
- package/dist/lib/worker/index.js +156 -1
- package/dist/types/src/App.d.ts +0 -1
- package/dist/types/src/component/{Graph → DependencyGraph}/index.d.ts +0 -1
- package/dist/types/src/component/{GraphItem → DependencyGraphItem}/index.d.ts +0 -1
- package/dist/types/src/component/Form/index.d.ts +2 -0
- package/dist/types/src/component/Layout/index.d.ts +0 -1
- package/dist/types/src/component/ModuleInfo/index.d.ts +8 -0
- package/dist/types/src/component/SharedDepsExplorer/FocusResultDisplay.d.ts +15 -0
- package/dist/types/src/component/SharedDepsExplorer/index.d.ts +6 -0
- package/dist/types/src/component/SharedDepsExplorer/share-utils.d.ts +44 -0
- package/dist/types/src/index.d.ts +2 -1
- package/dist/types/src/init.d.ts +0 -1
- package/dist/types/src/template/constant.d.ts +3 -5
- package/dist/types/src/utils/chrome/index.d.ts +5 -3
- package/dist/types/src/utils/chrome/messages.d.ts +2 -0
- package/dist/types/src/utils/chrome/storage.d.ts +5 -4
- package/dist/types/src/utils/sdk/graph.d.ts +2 -1
- package/dist/types/src/utils/sdk/index.d.ts +1 -0
- package/dist/types/src/utils/types/common.d.ts +4 -0
- package/dist/types/src/worker/index.d.ts +1 -0
- package/package.json +18 -14
- package/dist/es/component/Graph/index.js +0 -127
- package/dist/es/component/Graph/index.module.js +0 -5
- package/dist/es/component/Graph/index_module.css +0 -12
- package/dist/es/component/GraphItem/index.module.js +0 -5
- package/dist/es/component/GraphItem/index_module.css +0 -61
- package/dist/lib/component/Graph/index.js +0 -149
- package/dist/lib/component/Graph/index_module.css +0 -12
- package/dist/lib/component/GraphItem/index_module.css +0 -61
|
@@ -1,9 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var _a;
|
|
2
|
+
var _a, _b;
|
|
3
3
|
const moduleInfo = (_a = window == null ? void 0 : window.__FEDERATION__) == null ? void 0 : _a.moduleInfo;
|
|
4
4
|
window.postMessage(
|
|
5
5
|
{
|
|
6
|
-
moduleInfo
|
|
6
|
+
moduleInfo,
|
|
7
|
+
share: JSON.parse(
|
|
8
|
+
JSON.stringify((_b = window == null ? void 0 : window.__FEDERATION__) == null ? void 0 : _b.__SHARE__, (_key, value) => {
|
|
9
|
+
if (typeof value === "function") {
|
|
10
|
+
return "Function";
|
|
11
|
+
}
|
|
12
|
+
return value;
|
|
13
|
+
})
|
|
14
|
+
)
|
|
7
15
|
},
|
|
8
16
|
"*"
|
|
9
17
|
);
|
|
@@ -38,6 +38,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
38
38
|
};
|
|
39
39
|
var storage_exports = {};
|
|
40
40
|
__export(storage_exports, {
|
|
41
|
+
getStorageValue: () => getStorageValue,
|
|
41
42
|
mergeStorage: () => mergeStorage,
|
|
42
43
|
removeStorage: () => removeStorage,
|
|
43
44
|
removeStorageKey: () => removeStorageKey,
|
|
@@ -58,8 +59,12 @@ const removeStorage = (...args) => __async(void 0, null, function* () {
|
|
|
58
59
|
const setStorage = (...args) => __async(void 0, null, function* () {
|
|
59
60
|
return (0, import_index.injectScript)(import_sdk.setLocalStorage, false, ...args);
|
|
60
61
|
});
|
|
62
|
+
const getStorageValue = (...args) => __async(void 0, null, function* () {
|
|
63
|
+
return (0, import_index.injectScript)(import_sdk.getLocalStorage, false, ...args);
|
|
64
|
+
});
|
|
61
65
|
// Annotate the CommonJS export names for ESM import in node:
|
|
62
66
|
0 && (module.exports = {
|
|
67
|
+
getStorageValue,
|
|
63
68
|
mergeStorage,
|
|
64
69
|
removeStorage,
|
|
65
70
|
removeStorageKey,
|
|
@@ -88,8 +88,8 @@ class DependencyGraph {
|
|
|
88
88
|
if (!remotesInfo) {
|
|
89
89
|
return;
|
|
90
90
|
}
|
|
91
|
-
Object.
|
|
92
|
-
const { matchedVersion } =
|
|
91
|
+
Object.entries(remotesInfo).forEach(([dep, remoteInfo]) => {
|
|
92
|
+
const { matchedVersion } = remoteInfo;
|
|
93
93
|
let childId = dep;
|
|
94
94
|
if (matchedVersion && matchedVersion !== "") {
|
|
95
95
|
childId = `${childId}:${matchedVersion}`;
|
|
@@ -130,7 +130,7 @@ class DependencyGraph {
|
|
|
130
130
|
type
|
|
131
131
|
});
|
|
132
132
|
}
|
|
133
|
-
run(targetGraph, target = this.initTarget, type, id = this.initTarget) {
|
|
133
|
+
run(targetGraph, target = this.initTarget, type, id = this.initTarget, depth = 0, maxDepth = Infinity) {
|
|
134
134
|
var _a;
|
|
135
135
|
if (!targetGraph || !((_a = Object.keys(targetGraph)) == null ? void 0 : _a.length)) {
|
|
136
136
|
return;
|
|
@@ -154,12 +154,17 @@ class DependencyGraph {
|
|
|
154
154
|
targetGraph[targetWithoutType] || targetGraph[target] || {}
|
|
155
155
|
);
|
|
156
156
|
graphChilden.forEach((dep) => {
|
|
157
|
+
if (depth + 1 > maxDepth) {
|
|
158
|
+
return;
|
|
159
|
+
}
|
|
157
160
|
this.addEdge(id + dep, id, id + dep);
|
|
158
161
|
this.run(
|
|
159
162
|
targetGraph[targetWithoutType] || targetGraph[target],
|
|
160
163
|
dep,
|
|
161
164
|
type,
|
|
162
|
-
id + dep
|
|
165
|
+
id + dep,
|
|
166
|
+
depth + 1,
|
|
167
|
+
maxDepth
|
|
163
168
|
);
|
|
164
169
|
});
|
|
165
170
|
}
|
|
@@ -170,6 +175,22 @@ class DependencyGraph {
|
|
|
170
175
|
const color = `rgba(${r},${g},${b},0.8)`;
|
|
171
176
|
return color;
|
|
172
177
|
}
|
|
178
|
+
calculateDepth(target = this.initTarget, visited = /* @__PURE__ */ new Set()) {
|
|
179
|
+
if (visited.has(target)) {
|
|
180
|
+
return 0;
|
|
181
|
+
}
|
|
182
|
+
visited.add(target);
|
|
183
|
+
const children = this.graph[target] ? Object.keys(this.graph[target]) : [];
|
|
184
|
+
if (children.length === 0) {
|
|
185
|
+
visited.delete(target);
|
|
186
|
+
return 0;
|
|
187
|
+
}
|
|
188
|
+
const maxChildDepth = Math.max(
|
|
189
|
+
...children.map((child) => this.calculateDepth(child, visited))
|
|
190
|
+
);
|
|
191
|
+
visited.delete(target);
|
|
192
|
+
return 1 + maxChildDepth;
|
|
193
|
+
}
|
|
173
194
|
}
|
|
174
195
|
// Annotate the CommonJS export names for ESM import in node:
|
|
175
196
|
0 && (module.exports = {
|
|
@@ -20,6 +20,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
20
20
|
var sdk_exports = {};
|
|
21
21
|
__export(sdk_exports, {
|
|
22
22
|
definePropertyGlobalVal: () => definePropertyGlobalVal,
|
|
23
|
+
getLocalStorage: () => getLocalStorage,
|
|
23
24
|
getUnpkgUrl: () => getUnpkgUrl,
|
|
24
25
|
isObject: () => isObject,
|
|
25
26
|
mergeLocalStorage: () => mergeLocalStorage,
|
|
@@ -34,6 +35,14 @@ __reExport(sdk_exports, require("./graph"), module.exports);
|
|
|
34
35
|
const setLocalStorage = (key, value) => {
|
|
35
36
|
localStorage.setItem(key, value);
|
|
36
37
|
};
|
|
38
|
+
const getLocalStorage = (key) => {
|
|
39
|
+
try {
|
|
40
|
+
return localStorage.getItem(key);
|
|
41
|
+
} catch (error) {
|
|
42
|
+
console.warn("[MF Devtools] getLocalStorage failed", error);
|
|
43
|
+
return null;
|
|
44
|
+
}
|
|
45
|
+
};
|
|
37
46
|
const removeLocalStorage = (key) => {
|
|
38
47
|
const data = localStorage.getItem(key);
|
|
39
48
|
if (data) {
|
|
@@ -83,6 +92,7 @@ const definePropertyGlobalVal = (target, key, val) => {
|
|
|
83
92
|
// Annotate the CommonJS export names for ESM import in node:
|
|
84
93
|
0 && (module.exports = {
|
|
85
94
|
definePropertyGlobalVal,
|
|
95
|
+
getLocalStorage,
|
|
86
96
|
getUnpkgUrl,
|
|
87
97
|
isObject,
|
|
88
98
|
mergeLocalStorage,
|
package/dist/lib/worker/index.js
CHANGED
|
@@ -1,2 +1,157 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
2
|
+
var __async = (__this, __arguments, generator) => {
|
|
3
|
+
return new Promise((resolve, reject) => {
|
|
4
|
+
var fulfilled = (value) => {
|
|
5
|
+
try {
|
|
6
|
+
step(generator.next(value));
|
|
7
|
+
} catch (e) {
|
|
8
|
+
reject(e);
|
|
9
|
+
}
|
|
10
|
+
};
|
|
11
|
+
var rejected = (value) => {
|
|
12
|
+
try {
|
|
13
|
+
step(generator.throw(value));
|
|
14
|
+
} catch (e) {
|
|
15
|
+
reject(e);
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
19
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
var import_messages = require("../utils/chrome/messages");
|
|
23
|
+
const SIDE_PANEL_PATH = "html/main/index.html";
|
|
24
|
+
const getSidePanel = () => chrome == null ? void 0 : chrome.sidePanel;
|
|
25
|
+
const resolveTabId = (tabId) => __async(exports, null, function* () {
|
|
26
|
+
if (typeof tabId === "number") {
|
|
27
|
+
return tabId;
|
|
28
|
+
}
|
|
29
|
+
const [activeTab] = yield chrome.tabs.query({
|
|
30
|
+
active: true,
|
|
31
|
+
lastFocusedWindow: true
|
|
32
|
+
});
|
|
33
|
+
return activeTab == null ? void 0 : activeTab.id;
|
|
34
|
+
});
|
|
35
|
+
const broadcastActiveTab = (tabId) => {
|
|
36
|
+
try {
|
|
37
|
+
chrome.runtime.sendMessage({
|
|
38
|
+
type: import_messages.MESSAGE_ACTIVE_TAB_CHANGED,
|
|
39
|
+
tabId
|
|
40
|
+
});
|
|
41
|
+
} catch (error) {
|
|
42
|
+
console.warn(
|
|
43
|
+
"[Module Federation Devtools] Failed to broadcast active tab",
|
|
44
|
+
error
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
const openSidePanel = (tabId) => __async(exports, null, function* () {
|
|
49
|
+
const sidePanel = getSidePanel();
|
|
50
|
+
if (!sidePanel) {
|
|
51
|
+
throw new Error("sidePanel api not available");
|
|
52
|
+
}
|
|
53
|
+
const targetTabId = yield resolveTabId(tabId);
|
|
54
|
+
if (typeof targetTabId !== "number") {
|
|
55
|
+
throw new Error("No active tab available");
|
|
56
|
+
}
|
|
57
|
+
yield sidePanel.setOptions({
|
|
58
|
+
tabId: targetTabId,
|
|
59
|
+
path: SIDE_PANEL_PATH,
|
|
60
|
+
enabled: true
|
|
61
|
+
});
|
|
62
|
+
if (sidePanel.open) {
|
|
63
|
+
yield sidePanel.open({ tabId: targetTabId });
|
|
64
|
+
}
|
|
65
|
+
broadcastActiveTab(targetTabId);
|
|
66
|
+
if (sidePanel.getOptions) {
|
|
67
|
+
try {
|
|
68
|
+
const options = yield sidePanel.getOptions({ tabId: targetTabId });
|
|
69
|
+
broadcastActiveTab(targetTabId);
|
|
70
|
+
return options;
|
|
71
|
+
} catch (error) {
|
|
72
|
+
console.warn("[Module Federation Devtools] getOptions failed", error);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
return {
|
|
76
|
+
path: SIDE_PANEL_PATH,
|
|
77
|
+
enabled: true
|
|
78
|
+
};
|
|
79
|
+
});
|
|
80
|
+
chrome.runtime.onInstalled.addListener(() => {
|
|
81
|
+
const sidePanel = getSidePanel();
|
|
82
|
+
if (sidePanel == null ? void 0 : sidePanel.setPanelBehavior) {
|
|
83
|
+
sidePanel.setPanelBehavior({ openPanelOnActionClick: true }).catch((error) => {
|
|
84
|
+
console.warn(
|
|
85
|
+
"[Module Federation Devtools] setPanelBehavior failed",
|
|
86
|
+
error
|
|
87
|
+
);
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
chrome.action.onClicked.addListener((tab) => __async(exports, null, function* () {
|
|
92
|
+
try {
|
|
93
|
+
yield openSidePanel(tab.id);
|
|
94
|
+
} catch (error) {
|
|
95
|
+
console.warn(
|
|
96
|
+
"[Module Federation Devtools] Failed to open side panel",
|
|
97
|
+
error
|
|
98
|
+
);
|
|
99
|
+
}
|
|
100
|
+
}));
|
|
101
|
+
chrome.runtime.onMessage.addListener((message, _sender, sendResponse) => {
|
|
102
|
+
if ((message == null ? void 0 : message.type) === import_messages.MESSAGE_OPEN_SIDE_PANEL) {
|
|
103
|
+
openSidePanel(message.tabId).then((options) => sendResponse({ ok: true, options })).catch(
|
|
104
|
+
(error) => sendResponse({ ok: false, message: String(error) })
|
|
105
|
+
);
|
|
106
|
+
return true;
|
|
107
|
+
}
|
|
108
|
+
return void 0;
|
|
109
|
+
});
|
|
110
|
+
chrome.tabs.onActivated.addListener((activeInfo) => __async(exports, null, function* () {
|
|
111
|
+
const tabId = activeInfo == null ? void 0 : activeInfo.tabId;
|
|
112
|
+
if (typeof tabId !== "number") {
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
try {
|
|
116
|
+
broadcastActiveTab(tabId);
|
|
117
|
+
} catch (error) {
|
|
118
|
+
console.warn(
|
|
119
|
+
"[Module Federation Devtools] Failed to handle tab activation",
|
|
120
|
+
error
|
|
121
|
+
);
|
|
122
|
+
}
|
|
123
|
+
}));
|
|
124
|
+
chrome.tabs.onUpdated.addListener((tabId, changeInfo, tab) => {
|
|
125
|
+
if (changeInfo.status !== "complete") {
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
128
|
+
if (tab == null ? void 0 : tab.active) {
|
|
129
|
+
try {
|
|
130
|
+
broadcastActiveTab(tabId);
|
|
131
|
+
} catch (error) {
|
|
132
|
+
console.warn(
|
|
133
|
+
"[Module Federation Devtools] Failed to handle tab update",
|
|
134
|
+
error
|
|
135
|
+
);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
});
|
|
139
|
+
chrome.tabs.onRemoved.addListener((tabId) => __async(exports, null, function* () {
|
|
140
|
+
try {
|
|
141
|
+
const FormID = "FormID";
|
|
142
|
+
const data = yield chrome.storage.sync.get(FormID);
|
|
143
|
+
const storeData = data[FormID];
|
|
144
|
+
if (storeData == null ? void 0 : storeData[String(tabId)]) {
|
|
145
|
+
delete storeData[String(tabId)];
|
|
146
|
+
yield chrome.storage.sync.set({
|
|
147
|
+
[FormID]: storeData
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
} catch (error) {
|
|
151
|
+
console.warn(
|
|
152
|
+
"[Module Federation Devtools] Failed to handle tab removal",
|
|
153
|
+
error
|
|
154
|
+
);
|
|
155
|
+
}
|
|
156
|
+
}));
|
|
157
|
+
console.log("Module Federation Worker ready");
|
package/dist/types/src/App.d.ts
CHANGED
|
@@ -13,6 +13,8 @@ interface FormProps {
|
|
|
13
13
|
validateForm: any;
|
|
14
14
|
enableHMR: string;
|
|
15
15
|
onHMRChange: (on: boolean) => void;
|
|
16
|
+
enableClip: boolean;
|
|
17
|
+
onClipChange: (on: boolean) => void;
|
|
16
18
|
headerSlot?: ReactNode;
|
|
17
19
|
}
|
|
18
20
|
declare const FormComponent: (props: FormProps & RootComponentProps) => import("react").JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { GlobalModuleInfo } from '@module-federation/sdk';
|
|
2
|
+
interface HomeProps {
|
|
3
|
+
moduleInfo: GlobalModuleInfo;
|
|
4
|
+
selectedModuleId: string | null;
|
|
5
|
+
onSelectModule: (moduleId: string) => void;
|
|
6
|
+
}
|
|
7
|
+
declare const Home: (props: HomeProps) => import("react").JSX.Element;
|
|
8
|
+
export default Home;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { LoadedStatus } from './share-utils';
|
|
3
|
+
interface FocusResult {
|
|
4
|
+
packageName: string;
|
|
5
|
+
version: string;
|
|
6
|
+
status: LoadedStatus;
|
|
7
|
+
providers: string[];
|
|
8
|
+
}
|
|
9
|
+
interface FocusResultDisplayProps {
|
|
10
|
+
focusResult: FocusResult | null;
|
|
11
|
+
hasData: boolean;
|
|
12
|
+
loadedStatusLabel: (status: LoadedStatus) => string;
|
|
13
|
+
}
|
|
14
|
+
declare const FocusResultDisplay: React.FC<FocusResultDisplayProps>;
|
|
15
|
+
export default FocusResultDisplay;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { GlobalShareScopeMap } from '@module-federation/runtime/types';
|
|
2
|
+
interface SharedDepsExplorerProps {
|
|
3
|
+
shareData?: GlobalShareScopeMap;
|
|
4
|
+
}
|
|
5
|
+
declare function SharedDepsExplorer({ shareData: shareDataProp, }: SharedDepsExplorerProps): import("react").JSX.Element;
|
|
6
|
+
export default SharedDepsExplorer;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { GlobalShareScopeMap, Shared, SharedConfig } from '@module-federation/runtime/types';
|
|
2
|
+
export type LoadedStatus = 'loaded' | 'loading' | 'not-loaded';
|
|
3
|
+
export type ReuseStatus = boolean;
|
|
4
|
+
export interface ShareStats {
|
|
5
|
+
totalProviders: number;
|
|
6
|
+
totalScopes: number;
|
|
7
|
+
totalPackages: number;
|
|
8
|
+
totalVersions: number;
|
|
9
|
+
loadedCount: number;
|
|
10
|
+
reusedCount: number;
|
|
11
|
+
}
|
|
12
|
+
export interface NormalizedSharedVersion {
|
|
13
|
+
id: string;
|
|
14
|
+
provider: string;
|
|
15
|
+
scope: string;
|
|
16
|
+
packageName: string;
|
|
17
|
+
version: string;
|
|
18
|
+
from: string;
|
|
19
|
+
useIn: string[];
|
|
20
|
+
shareConfig: SharedConfig;
|
|
21
|
+
strategy?: string;
|
|
22
|
+
loaded?: boolean;
|
|
23
|
+
loading?: unknown;
|
|
24
|
+
loadedStatus: LoadedStatus;
|
|
25
|
+
reuseStatus: ReuseStatus;
|
|
26
|
+
}
|
|
27
|
+
export declare function computeLoadedStatus(entry: Shared): LoadedStatus;
|
|
28
|
+
export declare function computeReuseStatus(entry: Shared): ReuseStatus;
|
|
29
|
+
export declare function normalizeShareData(raw: GlobalShareScopeMap | null | undefined): NormalizedSharedVersion[];
|
|
30
|
+
export declare function computeShareStats(versions: NormalizedSharedVersion[]): ShareStats;
|
|
31
|
+
export declare function groupByProviderScopePackage(versions: NormalizedSharedVersion[]): Record<string, Record<string, Record<string, NormalizedSharedVersion[]>>>;
|
|
32
|
+
export declare function getFilterOptions(versions: NormalizedSharedVersion[]): {
|
|
33
|
+
providers: string[];
|
|
34
|
+
scopes: string[];
|
|
35
|
+
packages: string[];
|
|
36
|
+
versions: string[];
|
|
37
|
+
};
|
|
38
|
+
export declare function findPackageProvider(versions: NormalizedSharedVersion[], packageName: string, version?: string): {
|
|
39
|
+
packageName: string;
|
|
40
|
+
version: string;
|
|
41
|
+
providers: string[];
|
|
42
|
+
status: LoadedStatus;
|
|
43
|
+
} | null;
|
|
44
|
+
export declare function getReusedVersions(versions: NormalizedSharedVersion[]): NormalizedSharedVersion[];
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import '@arco-design/web-react/es/_util/react-19-adapter';
|
|
2
|
+
import './index.css';
|
package/dist/types/src/init.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export declare const FormID = "FormID";
|
|
2
2
|
export declare const ENABLEHMR = "enableHMR";
|
|
3
|
+
export declare const ENABLE_CLIP = "enableClip";
|
|
3
4
|
export declare const proxyFormField = "proxyFormField";
|
|
4
5
|
export declare const defaultDataItem: {
|
|
5
6
|
key: string;
|
|
@@ -7,11 +8,7 @@ export declare const defaultDataItem: {
|
|
|
7
8
|
checked: boolean;
|
|
8
9
|
};
|
|
9
10
|
export declare const defaultModuleData: {
|
|
10
|
-
proxyFormField:
|
|
11
|
-
key: string;
|
|
12
|
-
value: string;
|
|
13
|
-
checked: boolean;
|
|
14
|
-
}[];
|
|
11
|
+
proxyFormField: never[];
|
|
15
12
|
};
|
|
16
13
|
export declare const statusInfo: Record<string, {
|
|
17
14
|
status: string;
|
|
@@ -19,5 +16,6 @@ export declare const statusInfo: Record<string, {
|
|
|
19
16
|
color: string;
|
|
20
17
|
}>;
|
|
21
18
|
export declare const __ENABLE_FAST_REFRESH__ = "enableFastRefresh";
|
|
19
|
+
export declare const __EAGER_SHARE__ = "eagerShare";
|
|
22
20
|
export declare const BROWSER_ENV_KEY = "MF_ENV";
|
|
23
21
|
export declare const __FEDERATION_DEVTOOLS__ = "__MF_DEVTOOLS__";
|
|
@@ -1,16 +1,18 @@
|
|
|
1
|
-
/// <reference types="chrome" />
|
|
2
1
|
import { GlobalModuleInfo } from '@module-federation/sdk';
|
|
3
2
|
export * from './storage';
|
|
4
3
|
export declare const injectPostMessage: (postMessageUrl: string) => void;
|
|
5
4
|
export declare const TabInfo: {
|
|
6
5
|
currentTabId: number;
|
|
7
6
|
};
|
|
7
|
+
export declare const setTargetTab: (tab?: chrome.tabs.Tab | null) => void;
|
|
8
|
+
export declare const syncActiveTab: (tabId?: number) => Promise<chrome.tabs.Tab | undefined>;
|
|
8
9
|
export declare function getCurrentTabId(): number;
|
|
9
10
|
export declare function getInspectWindowTabId(): Promise<unknown>;
|
|
10
|
-
export declare const
|
|
11
|
+
export declare const refreshModuleInfo: () => Promise<void>;
|
|
12
|
+
export declare const getGlobalModuleInfo: (callback: (moduleInfo: GlobalModuleInfo) => void) => Promise<() => void>;
|
|
11
13
|
export declare const getTabs: (queryOptions?: {}) => Promise<chrome.tabs.Tab[]>;
|
|
12
14
|
export declare const getScope: () => Promise<string>;
|
|
13
|
-
export declare const injectScript: (excuteScript: (...args: Array<any>) => any, world?: boolean, ...args: any) => Promise<
|
|
15
|
+
export declare const injectScript: (excuteScript: (...args: Array<any>) => any, world?: boolean, ...args: any) => Promise<any>;
|
|
14
16
|
export declare const getUrl: (file: string) => string;
|
|
15
17
|
export declare const injectToast: (toastUtilUrl: string, e2eFlag: string) => void;
|
|
16
18
|
export declare const setChromeStorage: (formData: Record<string, any>) => void;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
export declare const mergeStorage: (...args: any[]) => Promise<
|
|
2
|
-
export declare const removeStorageKey: (...args: any[]) => Promise<
|
|
3
|
-
export declare const removeStorage: (...args: any[]) => Promise<
|
|
4
|
-
export declare const setStorage: (...args: any[]) => Promise<
|
|
1
|
+
export declare const mergeStorage: (...args: any[]) => Promise<any>;
|
|
2
|
+
export declare const removeStorageKey: (...args: any[]) => Promise<any>;
|
|
3
|
+
export declare const removeStorage: (...args: any[]) => Promise<any>;
|
|
4
|
+
export declare const setStorage: (...args: any[]) => Promise<any>;
|
|
5
|
+
export declare const getStorageValue: (...args: any[]) => Promise<any>;
|
|
@@ -40,6 +40,7 @@ export declare class DependencyGraph {
|
|
|
40
40
|
createGraph(target?: string): void;
|
|
41
41
|
addNode(id: string, type: string, x: number, y: number, nodeData: NodeCustomData): void;
|
|
42
42
|
addEdge(id: string, source: string, target: string, type?: Edge): void;
|
|
43
|
-
run(targetGraph: any, target: string | undefined, type: string, id?: string): void;
|
|
43
|
+
run(targetGraph: any, target: string | undefined, type: string, id?: string, depth?: number, maxDepth?: number): void;
|
|
44
44
|
identify(): string;
|
|
45
|
+
calculateDepth(target?: string, visited?: Set<string>): number;
|
|
45
46
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export * from './graph';
|
|
2
2
|
export declare const setLocalStorage: (key: string, value: any) => void;
|
|
3
|
+
export declare const getLocalStorage: (key: string) => string | null;
|
|
3
4
|
export declare const removeLocalStorage: (key: string) => void;
|
|
4
5
|
export declare const mergeLocalStorage: (target: string, key: string, value: any) => void;
|
|
5
6
|
export declare const removeLocalStorageKey: (target: string, key: string) => void;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
|
+
import type { GlobalModuleInfo } from '@module-federation/sdk';
|
|
2
3
|
import { getModuleInfo } from '../index';
|
|
3
4
|
export interface FormItemStatus {
|
|
4
5
|
keyStatus: boolean;
|
|
@@ -14,5 +15,8 @@ export interface RootComponentProps {
|
|
|
14
15
|
handleProxyAddress?: (address: string) => string;
|
|
15
16
|
customValueValidate?: (schema: string) => boolean;
|
|
16
17
|
headerSlot?: ReactNode;
|
|
18
|
+
onModuleInfoChange?: (moduleInfo: GlobalModuleInfo) => void;
|
|
19
|
+
onModuleInfoReset?: () => void;
|
|
20
|
+
tabId?: number;
|
|
17
21
|
}
|
|
18
22
|
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@module-federation/devtools",
|
|
3
|
-
"version": "0.0.0-
|
|
3
|
+
"version": "0.0.0-perf-devtools-20260106124142",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -37,35 +37,39 @@
|
|
|
37
37
|
"access": "public"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@
|
|
41
|
-
"@
|
|
40
|
+
"@modern-js/runtime": "2.69.3",
|
|
41
|
+
"@arco-design/web-react": "2.66.7",
|
|
42
42
|
"ahooks": "^3.7.10",
|
|
43
43
|
"dagre": "^0.8.5",
|
|
44
|
-
"react": "
|
|
45
|
-
"react-dom": "
|
|
44
|
+
"react": "^19.2.0",
|
|
45
|
+
"react-dom": "^19.2.0",
|
|
46
46
|
"reactflow": "11.11.4",
|
|
47
|
-
"
|
|
47
|
+
"echarts": "^6.0.0",
|
|
48
|
+
"lucide-react": "^0.364.0",
|
|
49
|
+
"tailwindcss-animate": "^1.0.7",
|
|
50
|
+
"echarts-for-react": "^3.0.5",
|
|
51
|
+
"@module-federation/sdk": "0.0.0-perf-devtools-20260106124142"
|
|
48
52
|
},
|
|
49
53
|
"devDependencies": {
|
|
50
54
|
"@modern-js-app/eslint-config": "2.59.0",
|
|
51
|
-
"@modern-js/app-tools": "2.
|
|
55
|
+
"@modern-js/app-tools": "2.69.3",
|
|
56
|
+
"@modern-js/plugin-tailwindcss": "2.69.3",
|
|
52
57
|
"@modern-js/eslint-config": "2.59.0",
|
|
53
|
-
"@modern-js/module-tools": "2.
|
|
54
|
-
"@modern-js/storybook": "2.
|
|
55
|
-
"@modern-js/tsconfig": "2.
|
|
58
|
+
"@modern-js/module-tools": "2.69.3",
|
|
59
|
+
"@modern-js/storybook": "2.69.3",
|
|
60
|
+
"@modern-js/tsconfig": "2.69.3",
|
|
56
61
|
"@playwright/test": "1.49.1",
|
|
57
62
|
"@types/chrome": "^0.0.272",
|
|
58
63
|
"@types/dagre": "^0.7.52",
|
|
59
64
|
"@types/jest": "~29.2.4",
|
|
60
65
|
"@types/node": "~20.12.12",
|
|
61
|
-
"@types/react": "
|
|
62
|
-
"@types/react-dom": "
|
|
66
|
+
"@types/react": "^19.2.2",
|
|
67
|
+
"@types/react-dom": "^19.2.2",
|
|
63
68
|
"lint-staged": "~13.1.0",
|
|
64
69
|
"prettier": "~3.3.3",
|
|
65
70
|
"rimraf": "~6.0.1",
|
|
66
|
-
"typescript": "~5.0.4",
|
|
67
71
|
"vitest": "1.2.2",
|
|
68
|
-
"@module-federation/runtime": "0.0.0-
|
|
72
|
+
"@module-federation/runtime": "0.0.0-perf-devtools-20260106124142"
|
|
69
73
|
},
|
|
70
74
|
"scripts": {
|
|
71
75
|
"build:storybook": "storybook build",
|