@dimina-kit/devtools 0.4.0-dev.20260701083540 → 0.4.0-dev.20260702145840
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/main/app/app.js +11 -0
- package/dist/main/app/max-listeners-diagnostic.d.ts +32 -0
- package/dist/main/app/max-listeners-diagnostic.js +63 -0
- package/dist/main/index.bundle.js +1657 -1158
- package/dist/main/ipc/bridge-router.d.ts +33 -4
- package/dist/main/ipc/bridge-router.js +200 -51
- package/dist/main/ipc/session-listener-bag.d.ts +41 -0
- package/dist/main/ipc/session-listener-bag.js +40 -0
- package/dist/main/ipc/simulator.js +5 -5
- package/dist/main/ipc/views.js +8 -19
- package/dist/main/services/automation/wait-active-page.d.ts +4 -2
- package/dist/main/services/elements-forward/index.js +19 -0
- package/dist/main/services/network-forward/index.js +13 -0
- package/dist/main/services/render-inspect/index.d.ts +9 -0
- package/dist/main/services/render-inspect/index.js +13 -1
- package/dist/main/services/simulator-storage/index.d.ts +9 -0
- package/dist/main/services/simulator-storage/index.js +26 -1
- package/dist/main/services/simulator-wxml/index.js +117 -11
- package/dist/main/services/views/apply-view-ops.d.ts +11 -0
- package/dist/main/services/views/apply-view-ops.js +22 -0
- package/dist/main/services/views/destroy-child-view.d.ts +9 -0
- package/dist/main/services/views/destroy-child-view.js +23 -0
- package/dist/main/services/views/host-toolbar-view.d.ts +21 -0
- package/dist/main/services/views/host-toolbar-view.js +249 -0
- package/dist/main/services/views/inject-when-ready.d.ts +41 -0
- package/dist/main/services/views/inject-when-ready.js +62 -0
- package/dist/main/services/views/native-simulator-devtools-host.d.ts +26 -0
- package/dist/main/services/views/native-simulator-devtools-host.js +484 -0
- package/dist/main/services/views/native-simulator-view.d.ts +28 -0
- package/dist/main/services/views/native-simulator-view.js +428 -0
- package/dist/main/services/views/overlay-panels-view.d.ts +29 -0
- package/dist/main/services/views/overlay-panels-view.js +150 -0
- package/dist/main/services/views/placement-reconciler.d.ts +73 -0
- package/dist/main/services/views/placement-reconciler.js +120 -0
- package/dist/main/services/views/placement-test-driver.d.ts +25 -0
- package/dist/main/services/views/placement-test-driver.js +48 -0
- package/dist/main/services/views/resolve-project-editor-target.d.ts +13 -0
- package/dist/main/services/views/resolve-project-editor-target.js +33 -0
- package/dist/main/services/views/view-manager.d.ts +28 -70
- package/dist/main/services/views/view-manager.js +66 -1514
- package/dist/main/services/views/workbench-view.d.ts +15 -0
- package/dist/main/services/views/workbench-view.js +170 -0
- package/dist/main/services/workbench-context.d.ts +10 -0
- package/dist/preload/windows/host-toolbar-runtime.cjs +6 -13
- package/dist/preload/windows/host-toolbar-runtime.cjs.map +2 -2
- package/dist/preload/windows/main.cjs +10 -1
- package/dist/preload/windows/main.cjs.map +2 -2
- package/dist/preload/windows/simulator.cjs +6 -3
- package/dist/preload/windows/simulator.cjs.map +2 -2
- package/dist/preload/windows/simulator.js +6 -3
- package/dist/render-host/render-inspect.js +35 -1
- package/dist/renderer/assets/index-ChF9V4r-.js +49 -0
- package/dist/renderer/assets/{input-DR7bfyQE.js → input-Cjk0wSEh.js} +2 -2
- package/dist/renderer/assets/ipc-transport-D5dKIti1.css +1 -0
- package/dist/renderer/assets/{ipc-transport-3Arg8jPC.js → ipc-transport-OZS-KmOW.js} +2 -2
- package/dist/renderer/assets/{popover-CPZX3MrT.js → popover-CQVvOe90.js} +2 -2
- package/dist/renderer/assets/{select-BxyPlVyJ.js → select-BQDXi5ih.js} +2 -2
- package/dist/renderer/assets/{settings-api-CtPPJF-F.js → settings-api-B6x2mhaD.js} +2 -2
- package/dist/renderer/assets/{settings-CG_OR03F.js → settings-tP3Px2KR.js} +2 -2
- package/dist/renderer/assets/{workbenchSettings-ClqCBGOa.js → workbenchSettings-Bim9ol9R.js} +2 -2
- package/dist/renderer/entries/main/index.html +6 -6
- package/dist/renderer/entries/popover/index.html +5 -5
- package/dist/renderer/entries/settings/index.html +5 -5
- package/dist/renderer/entries/workbench-settings/index.html +4 -4
- package/dist/service-host/sync-api-patch.js +33 -3
- package/dist/shared/bridge-channels.d.ts +17 -0
- package/dist/shared/bridge-channels.js +9 -0
- package/dist/shared/ipc-channels.d.ts +29 -14
- package/dist/shared/ipc-channels.js +16 -17
- package/dist/shared/ipc-schemas.d.ts +25 -17
- package/dist/shared/ipc-schemas.js +38 -22
- package/dist/shared/view-ids.d.ts +19 -0
- package/dist/shared/view-ids.js +25 -0
- package/dist/simulator/assets/{bridge-channels-BUQ5AbvJ.js → bridge-channels-zhsumfky.js} +2 -2
- package/dist/simulator/assets/{device-shell-CT3LRnTB.js → device-shell-CUl0ILfn.js} +2 -2
- package/dist/simulator/assets/{simulator-BizhGGE3.js → simulator-Dz8iGcgy.js} +5 -5
- package/dist/simulator/assets/{simulator-mini-app-BfNuDF3R.js → simulator-mini-app-Bt639XL_.js} +2 -2
- package/dist/simulator/simulator.html +2 -1
- package/package.json +4 -4
- package/dist/renderer/assets/index-HE9Xr9bQ.js +0 -49
- package/dist/renderer/assets/ipc-transport-Dt0jR7Ir.css +0 -1
package/dist/main/app/app.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { setupCdpPort, registerDifileScheme, suppressInsecureCspWarnings } from './bootstrap.js';
|
|
2
|
+
import { installMaxListenersWarningDiagnostic } from './max-listeners-diagnostic.js';
|
|
2
3
|
import { registerProjectFsIpc } from '../ipc/project-fs.js';
|
|
3
4
|
import { app, BrowserWindow, nativeImage, session } from 'electron';
|
|
4
5
|
import fs from 'fs';
|
|
@@ -317,6 +318,11 @@ export function runDevtoolsBootstrap(config = {}) {
|
|
|
317
318
|
setupCdpPort();
|
|
318
319
|
// Dev-only: silence Electron Insecure-CSP warning; no-op when packaged.
|
|
319
320
|
suppressInsecureCspWarnings();
|
|
321
|
+
// Dev-only: decode any MaxListenersExceededWarning to the concrete wc that
|
|
322
|
+
// tripped it (id/type/url), so a stray listener accrual is pinned rather than
|
|
323
|
+
// guessed. Registered once, pre-ready; harmless if it never fires.
|
|
324
|
+
if (!app.isPackaged)
|
|
325
|
+
installMaxListenersWarningDiagnostic();
|
|
320
326
|
// Privileged scheme registration must run before app.whenReady (else throws).
|
|
321
327
|
registerDifileScheme();
|
|
322
328
|
// The embedded workbench editor (the sole devtools editor) needs
|
|
@@ -497,6 +503,11 @@ export async function createDevtoolsRuntime(config = {}) {
|
|
|
497
503
|
if (storage.storageApi) {
|
|
498
504
|
context.storageApi = storage.storageApi;
|
|
499
505
|
context.registry.add(() => { context.storageApi = undefined; });
|
|
506
|
+
// SYNC wx storage writes bypass main (they hit the service-host localStorage
|
|
507
|
+
// directly); the service-host posts `storageChanged` and bridge-router routes
|
|
508
|
+
// it here so the Storage panel stays live without a manual reload.
|
|
509
|
+
context.onServiceStorageChanged = storage.onSyncStorageChange;
|
|
510
|
+
context.registry.add(() => { context.onServiceStorageChanged = undefined; });
|
|
500
511
|
}
|
|
501
512
|
// Native-host WXML + AppData panels: main sources the data (WXML pulled
|
|
502
513
|
// from the active render guest; AppData tapped from the service→render
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Runtime diagnostic for `MaxListenersExceededWarning`.
|
|
3
|
+
*
|
|
4
|
+
* Node prints `MaxListenersExceededWarning: N <event> listeners added to
|
|
5
|
+
* [emitter]` when an EventEmitter crosses its (default 10) ceiling, but the
|
|
6
|
+
* message alone does not identify WHICH Electron WebContents tripped it. This
|
|
7
|
+
* hook decodes the warning's `emitter` (present on the warning object in current
|
|
8
|
+
* Node) into the wc's id / type / url so a stray listener accrual can be pinned
|
|
9
|
+
* to a concrete surface (DevTools host, service host, main window, …) instead of
|
|
10
|
+
* guessed at. Dev-only; a no-op counterpart is returned when disabled.
|
|
11
|
+
*/
|
|
12
|
+
export interface MaxListenersWarningReport {
|
|
13
|
+
event: string | undefined;
|
|
14
|
+
count: number | undefined;
|
|
15
|
+
wcId: number | undefined;
|
|
16
|
+
wcType: string | undefined;
|
|
17
|
+
url: string | undefined;
|
|
18
|
+
destroyed: boolean | undefined;
|
|
19
|
+
stack: string | undefined;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Decode a warning into a flat report, or `null` if it is not a
|
|
23
|
+
* `MaxListenersExceededWarning`. Pure — no logging, no process state.
|
|
24
|
+
*/
|
|
25
|
+
export declare function describeMaxListenersWarning(warning: Error): MaxListenersWarningReport | null;
|
|
26
|
+
/**
|
|
27
|
+
* Register a `process.on('warning')` listener that logs a decoded report for any
|
|
28
|
+
* `MaxListenersExceededWarning`. Returns a disposer that removes the listener.
|
|
29
|
+
* Other warning kinds pass through untouched.
|
|
30
|
+
*/
|
|
31
|
+
export declare function installMaxListenersWarningDiagnostic(log?: (report: MaxListenersWarningReport) => void): () => void;
|
|
32
|
+
//# sourceMappingURL=max-listeners-diagnostic.d.ts.map
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Runtime diagnostic for `MaxListenersExceededWarning`.
|
|
3
|
+
*
|
|
4
|
+
* Node prints `MaxListenersExceededWarning: N <event> listeners added to
|
|
5
|
+
* [emitter]` when an EventEmitter crosses its (default 10) ceiling, but the
|
|
6
|
+
* message alone does not identify WHICH Electron WebContents tripped it. This
|
|
7
|
+
* hook decodes the warning's `emitter` (present on the warning object in current
|
|
8
|
+
* Node) into the wc's id / type / url so a stray listener accrual can be pinned
|
|
9
|
+
* to a concrete surface (DevTools host, service host, main window, …) instead of
|
|
10
|
+
* guessed at. Dev-only; a no-op counterpart is returned when disabled.
|
|
11
|
+
*/
|
|
12
|
+
// Run a probe thunk, swallowing anything it throws. The method call lives INSIDE
|
|
13
|
+
// the thunk (not eagerly bound at the call site) so a malformed emitter whose
|
|
14
|
+
// `getType`/`getURL`/`isDestroyed` is a non-function value throws here and is
|
|
15
|
+
// caught, rather than blowing up while evaluating the argument.
|
|
16
|
+
function callSafe(fn) {
|
|
17
|
+
try {
|
|
18
|
+
return fn();
|
|
19
|
+
}
|
|
20
|
+
catch {
|
|
21
|
+
return undefined;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Decode a warning into a flat report, or `null` if it is not a
|
|
26
|
+
* `MaxListenersExceededWarning`. Pure — no logging, no process state.
|
|
27
|
+
*/
|
|
28
|
+
export function describeMaxListenersWarning(warning) {
|
|
29
|
+
if (warning.name !== 'MaxListenersExceededWarning')
|
|
30
|
+
return null;
|
|
31
|
+
const w = warning;
|
|
32
|
+
const emitter = (w.emitter ?? undefined);
|
|
33
|
+
return {
|
|
34
|
+
event: w.type,
|
|
35
|
+
count: w.count,
|
|
36
|
+
wcId: typeof emitter?.id === 'number' ? emitter.id : undefined,
|
|
37
|
+
wcType: callSafe(() => emitter?.getType?.()),
|
|
38
|
+
url: callSafe(() => emitter?.getURL?.()),
|
|
39
|
+
destroyed: callSafe(() => emitter?.isDestroyed?.()),
|
|
40
|
+
stack: warning.stack,
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Register a `process.on('warning')` listener that logs a decoded report for any
|
|
45
|
+
* `MaxListenersExceededWarning`. Returns a disposer that removes the listener.
|
|
46
|
+
* Other warning kinds pass through untouched.
|
|
47
|
+
*/
|
|
48
|
+
export function installMaxListenersWarningDiagnostic(
|
|
49
|
+
// Single-line JSON: the report must survive line-oriented stderr capture
|
|
50
|
+
// (the e2e MaxListeners gate collects matching LINES; a multi-line object
|
|
51
|
+
// print loses the identity fields).
|
|
52
|
+
log = (r) => console.warn('[max-listeners]', JSON.stringify(r))) {
|
|
53
|
+
const onWarning = (warning) => {
|
|
54
|
+
const report = describeMaxListenersWarning(warning);
|
|
55
|
+
if (report)
|
|
56
|
+
log(report);
|
|
57
|
+
};
|
|
58
|
+
process.on('warning', onWarning);
|
|
59
|
+
return () => {
|
|
60
|
+
process.removeListener('warning', onWarning);
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=max-listeners-diagnostic.js.map
|