@bleedingdev/modern-js-server 3.9.0-ultramodern.12 → 3.9.0-ultramodern.14
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/cjs/helpers/mock.js
CHANGED
|
@@ -129,7 +129,7 @@ async function getMockMiddleware(pwd, mockDir) {
|
|
|
129
129
|
if (matchedMockAPI) {
|
|
130
130
|
const { handler } = matchedMockAPI;
|
|
131
131
|
if ('function' == typeof handler) return await (0, node_namespaceObject.connectMockMid2HonoMid)(handler)(c, next);
|
|
132
|
-
return c.json(handler);
|
|
132
|
+
else return c.json(handler);
|
|
133
133
|
}
|
|
134
134
|
return next();
|
|
135
135
|
};
|
|
@@ -36,8 +36,25 @@ const cleanSSRCache = (distDir)=>{
|
|
|
36
36
|
if (key.startsWith(distDir)) delete require.cache[key];
|
|
37
37
|
});
|
|
38
38
|
};
|
|
39
|
+
const cleanFederationRuntime = ()=>{
|
|
40
|
+
const runtime = globalThis;
|
|
41
|
+
const federation = runtime.__FEDERATION__;
|
|
42
|
+
if (!federation) return;
|
|
43
|
+
for (const instance of federation.__INSTANCES__)instance.moduleCache.forEach(({ remoteInfo })=>{
|
|
44
|
+
if (remoteInfo.entryGlobalName) delete runtime[remoteInfo.entryGlobalName];
|
|
45
|
+
});
|
|
46
|
+
federation.__INSTANCES__ = [];
|
|
47
|
+
federation.__SHARE__ = {};
|
|
48
|
+
federation.__GLOBAL_PLUGIN__ = [];
|
|
49
|
+
federation.moduleInfo = {};
|
|
50
|
+
federation.__MANIFEST_LOADING__ = {};
|
|
51
|
+
federation.__PRELOADED_ASSETS__?.clear();
|
|
52
|
+
const remoteEntries = runtime.__GLOBAL_LOADING_REMOTE_ENTRY__ ?? {};
|
|
53
|
+
for (const key of Object.keys(remoteEntries))delete remoteEntries[key];
|
|
54
|
+
};
|
|
39
55
|
const onRepack = (distDir, hooks)=>{
|
|
40
56
|
cleanSSRCache(distDir);
|
|
57
|
+
cleanFederationRuntime();
|
|
41
58
|
fileReader_namespaceObject.fileReader.reset();
|
|
42
59
|
hooks.onReset.call({
|
|
43
60
|
event: {
|
|
@@ -83,7 +83,7 @@ async function getMockMiddleware(pwd, mockDir) {
|
|
|
83
83
|
if (matchedMockAPI) {
|
|
84
84
|
const { handler } = matchedMockAPI;
|
|
85
85
|
if ('function' == typeof handler) return await connectMockMid2HonoMid(handler)(c, next);
|
|
86
|
-
return c.json(handler);
|
|
86
|
+
else return c.json(handler);
|
|
87
87
|
}
|
|
88
88
|
return next();
|
|
89
89
|
};
|
|
@@ -4,8 +4,25 @@ const cleanSSRCache = (distDir)=>{
|
|
|
4
4
|
if (key.startsWith(distDir)) delete require.cache[key];
|
|
5
5
|
});
|
|
6
6
|
};
|
|
7
|
+
const cleanFederationRuntime = ()=>{
|
|
8
|
+
const runtime = globalThis;
|
|
9
|
+
const federation = runtime.__FEDERATION__;
|
|
10
|
+
if (!federation) return;
|
|
11
|
+
for (const instance of federation.__INSTANCES__)instance.moduleCache.forEach(({ remoteInfo })=>{
|
|
12
|
+
if (remoteInfo.entryGlobalName) delete runtime[remoteInfo.entryGlobalName];
|
|
13
|
+
});
|
|
14
|
+
federation.__INSTANCES__ = [];
|
|
15
|
+
federation.__SHARE__ = {};
|
|
16
|
+
federation.__GLOBAL_PLUGIN__ = [];
|
|
17
|
+
federation.moduleInfo = {};
|
|
18
|
+
federation.__MANIFEST_LOADING__ = {};
|
|
19
|
+
federation.__PRELOADED_ASSETS__?.clear();
|
|
20
|
+
const remoteEntries = runtime.__GLOBAL_LOADING_REMOTE_ENTRY__ ?? {};
|
|
21
|
+
for (const key of Object.keys(remoteEntries))delete remoteEntries[key];
|
|
22
|
+
};
|
|
7
23
|
const onRepack = (distDir, hooks)=>{
|
|
8
24
|
cleanSSRCache(distDir);
|
|
25
|
+
cleanFederationRuntime();
|
|
9
26
|
fileReader.reset();
|
|
10
27
|
hooks.onReset.call({
|
|
11
28
|
event: {
|
|
@@ -84,7 +84,7 @@ async function getMockMiddleware(pwd, mockDir) {
|
|
|
84
84
|
if (matchedMockAPI) {
|
|
85
85
|
const { handler } = matchedMockAPI;
|
|
86
86
|
if ('function' == typeof handler) return await connectMockMid2HonoMid(handler)(c, next);
|
|
87
|
-
return c.json(handler);
|
|
87
|
+
else return c.json(handler);
|
|
88
88
|
}
|
|
89
89
|
return next();
|
|
90
90
|
};
|
|
@@ -6,8 +6,25 @@ const cleanSSRCache = (distDir)=>{
|
|
|
6
6
|
if (key.startsWith(distDir)) delete require.cache[key];
|
|
7
7
|
});
|
|
8
8
|
};
|
|
9
|
+
const cleanFederationRuntime = ()=>{
|
|
10
|
+
const runtime = globalThis;
|
|
11
|
+
const federation = runtime.__FEDERATION__;
|
|
12
|
+
if (!federation) return;
|
|
13
|
+
for (const instance of federation.__INSTANCES__)instance.moduleCache.forEach(({ remoteInfo })=>{
|
|
14
|
+
if (remoteInfo.entryGlobalName) delete runtime[remoteInfo.entryGlobalName];
|
|
15
|
+
});
|
|
16
|
+
federation.__INSTANCES__ = [];
|
|
17
|
+
federation.__SHARE__ = {};
|
|
18
|
+
federation.__GLOBAL_PLUGIN__ = [];
|
|
19
|
+
federation.moduleInfo = {};
|
|
20
|
+
federation.__MANIFEST_LOADING__ = {};
|
|
21
|
+
federation.__PRELOADED_ASSETS__?.clear();
|
|
22
|
+
const remoteEntries = runtime.__GLOBAL_LOADING_REMOTE_ENTRY__ ?? {};
|
|
23
|
+
for (const key of Object.keys(remoteEntries))delete remoteEntries[key];
|
|
24
|
+
};
|
|
9
25
|
const onRepack = (distDir, hooks)=>{
|
|
10
26
|
cleanSSRCache(distDir);
|
|
27
|
+
cleanFederationRuntime();
|
|
11
28
|
fileReader.reset();
|
|
12
29
|
hooks.onReset.call({
|
|
13
30
|
event: {
|
package/package.json
CHANGED
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"modern",
|
|
18
18
|
"modern.js"
|
|
19
19
|
],
|
|
20
|
-
"version": "3.9.0-ultramodern.
|
|
20
|
+
"version": "3.9.0-ultramodern.14",
|
|
21
21
|
"types": "./dist/types/index.d.ts",
|
|
22
22
|
"main": "./dist/cjs/index.js",
|
|
23
23
|
"exports": {
|
|
@@ -38,11 +38,11 @@
|
|
|
38
38
|
}
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@modern-js/runtime-utils": "npm:@bleedingdev/modern-js-runtime-utils@3.9.0-ultramodern.
|
|
42
|
-
"@modern-js/server-core": "npm:@bleedingdev/modern-js-server-core@3.9.0-ultramodern.
|
|
43
|
-
"@modern-js/server-utils": "npm:@bleedingdev/modern-js-server-utils@3.9.0-ultramodern.
|
|
44
|
-
"@modern-js/types": "npm:@bleedingdev/modern-js-types@3.9.0-ultramodern.
|
|
45
|
-
"@modern-js/utils": "npm:@bleedingdev/modern-js-utils@3.9.0-ultramodern.
|
|
41
|
+
"@modern-js/runtime-utils": "npm:@bleedingdev/modern-js-runtime-utils@3.9.0-ultramodern.14",
|
|
42
|
+
"@modern-js/server-core": "npm:@bleedingdev/modern-js-server-core@3.9.0-ultramodern.14",
|
|
43
|
+
"@modern-js/server-utils": "npm:@bleedingdev/modern-js-server-utils@3.9.0-ultramodern.14",
|
|
44
|
+
"@modern-js/types": "npm:@bleedingdev/modern-js-types@3.9.0-ultramodern.14",
|
|
45
|
+
"@modern-js/utils": "npm:@bleedingdev/modern-js-utils@3.9.0-ultramodern.14",
|
|
46
46
|
"@swc/helpers": "^0.5.23",
|
|
47
47
|
"connect-history-api-fallback": "^2.0.0",
|
|
48
48
|
"http-compression": "1.1.3",
|
|
@@ -51,11 +51,12 @@
|
|
|
51
51
|
"ws": "^8.21.3"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
|
-
"@modern-js/builder": "npm:@bleedingdev/modern-js-builder@3.9.0-ultramodern.
|
|
55
|
-
"@
|
|
54
|
+
"@modern-js/builder": "npm:@bleedingdev/modern-js-builder@3.9.0-ultramodern.14",
|
|
55
|
+
"@module-federation/runtime": "npm:@bleedingdev/mf-runtime@2.9.1",
|
|
56
|
+
"@rslib/core": "1.0.2",
|
|
56
57
|
"@scripts/rstest-config": "2.66.0",
|
|
57
58
|
"@types/connect-history-api-fallback": "^1.5.4",
|
|
58
|
-
"@types/node": "^26.
|
|
59
|
+
"@types/node": "^26.6.2",
|
|
59
60
|
"@types/ws": "^8.18.1",
|
|
60
61
|
"@typescript/native-preview": "7.0.0-dev.20260707.2",
|
|
61
62
|
"node-mocks-http": "^1.18.1",
|