@gadmin2n/schematics 0.0.123 → 0.0.125
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/lib/application/files/gadmin2-game-angle-demo/server/scripts/notify-dev-servers.js +1 -2
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/dev-shell-entry.html +28 -12
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/routes/audit/index.ts +0 -7
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/routes/audit/list.tsx +2 -0
- package/package.json +1 -1
package/dist/lib/application/files/gadmin2-game-angle-demo/server/scripts/notify-dev-servers.js
CHANGED
|
@@ -27,8 +27,7 @@ const shouldWaitNest = MODE === 'full' || MODE === 'server';
|
|
|
27
27
|
const shouldTouchWeb = MODE === 'full' || MODE === 'web';
|
|
28
28
|
|
|
29
29
|
const NEST_PORT = Number(process.env.NEST_PORT) || 8000;
|
|
30
|
-
const
|
|
31
|
-
const HEALTH_URL = `http://127.0.0.1:${NEST_PORT}${DEPLOY_NAME}/api/health/live`;
|
|
30
|
+
const HEALTH_URL = `http://127.0.0.1:${NEST_PORT}/api/health/live`;
|
|
32
31
|
const WEB_SENTINEL = path.resolve(process.cwd(), '..', 'web', '.vite-restart');
|
|
33
32
|
|
|
34
33
|
function log(msg) {
|
|
@@ -7,20 +7,19 @@
|
|
|
7
7
|
<script defer src="https://knot.woa.com/chat-sdk/latest/sdk.js"></script>
|
|
8
8
|
<!--
|
|
9
9
|
Block Vite full-reload on the dev-shell page.
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
两条路径都要挡:
|
|
11
|
+
1. WS message 层:Vite 通过 "full-reload" 广播刷新时走这里。
|
|
12
|
+
2. server.restart() 后 Vite client 在 ws.onopen 里直接调用 location.reload(),
|
|
13
|
+
不走 message,只能在 location.reload 层拦截。
|
|
14
|
+
Dev-shell 外壳几乎不改,牺牲它的 fast refresh 换取 Coding Agent 会话不被清。
|
|
15
|
+
iframe 里的 /app 有独立 window/location,不受影响。
|
|
15
16
|
-->
|
|
16
17
|
<script>
|
|
17
18
|
/*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
* Dev-shell doesn't need HMR; keeping the socket open avoids Vite errors,
|
|
23
|
-
* but we silently discard every incoming message.
|
|
19
|
+
* 1) 屏蔽同源 Vite HMR 的 message 与 close:
|
|
20
|
+
* - message: 挡住 full-reload 广播
|
|
21
|
+
* - close: 挡住 server.restart() 后 client 走的重连→reload 路径
|
|
22
|
+
* Knot SDK 等跨域 WS 完全放行。
|
|
24
23
|
*/
|
|
25
24
|
(function () {
|
|
26
25
|
var OrigWS = window.WebSocket;
|
|
@@ -30,9 +29,10 @@
|
|
|
30
29
|
if (new URL(url, location.href).host === location.host) {
|
|
31
30
|
var origAdd = ws.addEventListener.bind(ws);
|
|
32
31
|
ws.addEventListener = function (type, fn, opts) {
|
|
33
|
-
if (type !== 'message') origAdd(type, fn, opts);
|
|
32
|
+
if (type !== 'message' && type !== 'close') origAdd(type, fn, opts);
|
|
34
33
|
};
|
|
35
34
|
Object.defineProperty(ws, 'onmessage', { get: function () { return null; }, set: function () {} });
|
|
35
|
+
Object.defineProperty(ws, 'onclose', { get: function () { return null; }, set: function () {} });
|
|
36
36
|
}
|
|
37
37
|
} catch (_) {}
|
|
38
38
|
return ws;
|
|
@@ -40,6 +40,22 @@
|
|
|
40
40
|
PatchedWS.prototype = OrigWS.prototype;
|
|
41
41
|
window.WebSocket = PatchedWS;
|
|
42
42
|
})();
|
|
43
|
+
|
|
44
|
+
/*
|
|
45
|
+
* 2) 屏蔽 Vite client 在 ws.onopen 里同步调用的 location.reload()
|
|
46
|
+
* 只对外壳 window 生效;iframe 有自己的 location,不受影响。
|
|
47
|
+
*/
|
|
48
|
+
(function () {
|
|
49
|
+
try {
|
|
50
|
+
var proto = Object.getPrototypeOf(location);
|
|
51
|
+
Object.defineProperty(proto, 'reload', {
|
|
52
|
+
configurable: true,
|
|
53
|
+
value: function () {
|
|
54
|
+
console.warn('[dev-shell] location.reload() blocked');
|
|
55
|
+
},
|
|
56
|
+
});
|
|
57
|
+
} catch (_) {}
|
|
58
|
+
})();
|
|
43
59
|
</script>
|
|
44
60
|
</head>
|
|
45
61
|
<body>
|
|
@@ -1,8 +1 @@
|
|
|
1
1
|
export * from './list';
|
|
2
|
-
|
|
3
|
-
// Stub exports for generated/resources.tsx compatibility (gadmin2 generated imports)
|
|
4
|
-
const EmptyComponent = () => null;
|
|
5
|
-
export const AuditCreate = EmptyComponent;
|
|
6
|
-
export const AuditEdit = EmptyComponent;
|
|
7
|
-
export const AuditList = EmptyComponent;
|
|
8
|
-
export const AuditShow = EmptyComponent;
|