@dimina-kit/devtools 0.4.0-dev.20260616102751 → 0.4.0-dev.20260618090552
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/README.md +25 -24
- package/dist/main/index.bundle.js +212 -12
- package/dist/main/ipc/bridge-router.js +44 -1
- package/dist/main/runtime/devtools-backend.d.ts +1 -1
- package/dist/main/runtime/devtools-backend.js +1 -1
- package/dist/main/runtime/miniapp-runtime.d.ts +2 -2
- package/dist/main/services/console-forward/index.js +8 -1
- package/dist/main/services/elements-forward/index.js +31 -7
- package/dist/main/services/layout/index.d.ts +12 -0
- package/dist/main/services/layout/index.js +14 -2
- package/dist/main/services/projects/types.d.ts +1 -1
- package/dist/main/services/projects/types.js +1 -1
- package/dist/main/services/service-console/console-api.d.ts +78 -0
- package/dist/main/services/service-console/console-api.js +104 -0
- package/dist/main/services/service-console/index.d.ts +47 -0
- package/dist/main/services/service-console/index.js +139 -0
- package/dist/main/services/update/update-manager.d.ts +1 -1
- package/dist/main/services/update/update-manager.js +1 -1
- package/dist/main/services/views/view-manager.d.ts +7 -0
- package/dist/main/services/views/view-manager.js +53 -0
- package/dist/main/services/workbench-context.d.ts +7 -6
- package/dist/renderer/assets/index-DmgWoK8N.js +50 -0
- package/dist/renderer/assets/{input-B8NDCYv3.js → input-DiCxYlqY.js} +2 -2
- package/dist/renderer/assets/{ipc-transport-DhrajiC5.js → ipc-transport-DSBmaWpJ.js} +1 -1
- package/dist/renderer/assets/ipc-transport-DZxf2YoM.css +1 -0
- package/dist/renderer/assets/{popover-DbZOg03s.js → popover-CyL_uffj.js} +2 -2
- package/dist/renderer/assets/{select-pW3Ysc9T.js → select-BSwvDMtA.js} +2 -2
- package/dist/renderer/assets/settings-Ch8XbFxf.js +2 -0
- package/dist/renderer/assets/{settings-api-BSKzKiWd.js → settings-api-e9ILe2JO.js} +2 -2
- package/dist/renderer/assets/{workbenchSettings-BGxjl25x.js → workbenchSettings-DZsHf1g_.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 +11 -5
- package/dist/renderer/entries/workbench-settings/index.html +4 -4
- package/dist/service-host/preload.cjs +13 -15
- package/dist/service-host/sourcemap-rewrite.cjs +21 -12
- package/package.json +4 -4
- package/dist/renderer/assets/index-Z4Rh52G8.js +0 -50
- package/dist/renderer/assets/ipc-transport-9agi76dX.css +0 -1
- package/dist/renderer/assets/settings-CZJOHt8b.js +0 -2
|
@@ -5,12 +5,18 @@
|
|
|
5
5
|
<!-- See main/index.html for CSP rationale. -->
|
|
6
6
|
<meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'; img-src 'self' data: blob: http: https:; font-src 'self' data:; media-src 'self' blob: http: https:; connect-src 'self' http: https: ws: wss:;" />
|
|
7
7
|
<title>Settings</title>
|
|
8
|
-
<
|
|
8
|
+
<style>
|
|
9
|
+
/* The view spans the full content area as a transparent backdrop (only the
|
|
10
|
+
panel is opaque) so a click outside the panel reaches the backdrop and
|
|
11
|
+
closes the overlay — mirrors the popover entry. */
|
|
12
|
+
html, body { margin: 0; padding: 0; width: 100%; height: 100%; overflow: hidden; background: transparent !important; }
|
|
13
|
+
</style>
|
|
14
|
+
<script type="module" crossorigin src="../../assets/settings-Ch8XbFxf.js"></script>
|
|
9
15
|
<link rel="modulepreload" crossorigin href="../../assets/chunk-DPI0Y_ll.js">
|
|
10
|
-
<link rel="modulepreload" crossorigin href="../../assets/ipc-transport-
|
|
11
|
-
<link rel="modulepreload" crossorigin href="../../assets/input-
|
|
12
|
-
<link rel="modulepreload" crossorigin href="../../assets/settings-api-
|
|
13
|
-
<link rel="stylesheet" crossorigin href="../../assets/ipc-transport-
|
|
16
|
+
<link rel="modulepreload" crossorigin href="../../assets/ipc-transport-DSBmaWpJ.js">
|
|
17
|
+
<link rel="modulepreload" crossorigin href="../../assets/input-DiCxYlqY.js">
|
|
18
|
+
<link rel="modulepreload" crossorigin href="../../assets/settings-api-e9ILe2JO.js">
|
|
19
|
+
<link rel="stylesheet" crossorigin href="../../assets/ipc-transport-DZxf2YoM.css">
|
|
14
20
|
</head>
|
|
15
21
|
<body>
|
|
16
22
|
<div id="root"></div>
|
|
@@ -6,12 +6,12 @@
|
|
|
6
6
|
<!-- See entries/main/index.html for CSP rationale. -->
|
|
7
7
|
<meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'; img-src 'self' data: blob: http: https:; font-src 'self' data:; media-src 'self' blob: http: https:; connect-src 'self' http: https: ws: wss:;" />
|
|
8
8
|
<title>开发工具设置</title>
|
|
9
|
-
<script type="module" crossorigin src="../../assets/workbenchSettings-
|
|
9
|
+
<script type="module" crossorigin src="../../assets/workbenchSettings-DZsHf1g_.js"></script>
|
|
10
10
|
<link rel="modulepreload" crossorigin href="../../assets/chunk-DPI0Y_ll.js">
|
|
11
|
-
<link rel="modulepreload" crossorigin href="../../assets/ipc-transport-
|
|
12
|
-
<link rel="modulepreload" crossorigin href="../../assets/settings-api-
|
|
11
|
+
<link rel="modulepreload" crossorigin href="../../assets/ipc-transport-DSBmaWpJ.js">
|
|
12
|
+
<link rel="modulepreload" crossorigin href="../../assets/settings-api-e9ILe2JO.js">
|
|
13
13
|
<link rel="modulepreload" crossorigin href="../../assets/constants-DI382mTP.js">
|
|
14
|
-
<link rel="stylesheet" crossorigin href="../../assets/ipc-transport-
|
|
14
|
+
<link rel="stylesheet" crossorigin href="../../assets/ipc-transport-DZxf2YoM.css">
|
|
15
15
|
</head>
|
|
16
16
|
<body>
|
|
17
17
|
<div id="root"></div>
|
|
@@ -192,14 +192,21 @@ ipcRenderer.on(CHANNELS.TO_SERVICE, (_event, payload) => {
|
|
|
192
192
|
deliver(payload && payload.msg)
|
|
193
193
|
})
|
|
194
194
|
|
|
195
|
-
// ──
|
|
195
|
+
// ── Uncaught error capture (native-host) ────────────────────────────────────
|
|
196
196
|
// Placed AFTER the no-bridgeId early-return (pool warming) and AFTER
|
|
197
197
|
// DiminaServiceBridge is defined, so it only runs for a real spawn and can use
|
|
198
|
-
// the bridge.
|
|
199
|
-
//
|
|
200
|
-
//
|
|
201
|
-
//
|
|
202
|
-
//
|
|
198
|
+
// the bridge.
|
|
199
|
+
//
|
|
200
|
+
// NOTE: `console.*` is deliberately NOT patched here. A wrapper adds a stack
|
|
201
|
+
// frame, so the embedded Chrome DevTools (attached natively to this service
|
|
202
|
+
// host) would attribute every log to the wrapper line instead of the
|
|
203
|
+
// developer's source. Service-layer console output is captured in main via CDP
|
|
204
|
+
// `Runtime.consoleAPICalled` (services/service-console) — no extra frame, native
|
|
205
|
+
// attribution + sourcemaps preserved. Only WINDOW error / unhandledrejection
|
|
206
|
+
// events are posted here: they carry no console call site to preserve and CDP's
|
|
207
|
+
// `consoleAPICalled` does not report them. Each is forwarded to main as a
|
|
208
|
+
// `consoleLog` container message (source:'service') → bridge-router →
|
|
209
|
+
// ctx.guestConsole → automation `App.logAdded`.
|
|
203
210
|
|
|
204
211
|
function safeSerializeArg(val) {
|
|
205
212
|
if (val === null || val === undefined) return val
|
|
@@ -230,15 +237,6 @@ function emitConsoleLog(level, args) {
|
|
|
230
237
|
} catch (_) { /* never let console capture break the guest */ }
|
|
231
238
|
}
|
|
232
239
|
|
|
233
|
-
;['log', 'warn', 'error', 'info', 'debug'].forEach((level) => {
|
|
234
|
-
const original = typeof console[level] === 'function' ? console[level].bind(console) : null
|
|
235
|
-
if (!original) return
|
|
236
|
-
console[level] = (...args) => {
|
|
237
|
-
original(...args)
|
|
238
|
-
emitConsoleLog(level, args)
|
|
239
|
-
}
|
|
240
|
-
})
|
|
241
|
-
|
|
242
240
|
globalThis.addEventListener('error', (event) => {
|
|
243
241
|
emitConsoleLog('error', [{
|
|
244
242
|
message: event.message,
|
|
@@ -5,18 +5,27 @@
|
|
|
5
5
|
* ABSOLUTE URL resolved against the script's own fetch URL.
|
|
6
6
|
*
|
|
7
7
|
* Why this exists (native-host console file links):
|
|
8
|
-
* The
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* (
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
8
|
+
* The compiled `logic.js` ships a RELATIVE `//# sourceMappingURL=logic.js.map`
|
|
9
|
+
* (compiler/core/logic-compiler.js). Whoever injects it must give DevTools a
|
|
10
|
+
* resolvable base for that relative map, or DevTools resolves it against the
|
|
11
|
+
* service-host DOCUMENT (`file://…/service-host/service.html`) and 404s —
|
|
12
|
+
* console file:line links then point at the compiled bundle, not the
|
|
13
|
+
* developer's original source. Rewriting the directive to an absolute
|
|
14
|
+
* dev-server URL restores sourcemapped console frames + Sources links.
|
|
15
|
+
*
|
|
16
|
+
* Consumer: the `importScripts` shim in preload.cjs below (this file is COPIED,
|
|
17
|
+
* not bundled, so a plain relative `require('./sourcemap-rewrite.cjs')` works).
|
|
18
|
+
* The main process needs the same rewrite in `bridge-router.injectLogicBundle`
|
|
19
|
+
* but keeps its OWN inlined copy there — the shipped main entry is the flat
|
|
20
|
+
* esbuild bundle and a runtime `require` of this relative path resolved wrong
|
|
21
|
+
* against the bundle location (crashed the packaged app). KEEP THE TWO IN SYNC.
|
|
22
|
+
*
|
|
23
|
+
* Legacy consumer (web-worker render only): the `importScripts` shim in
|
|
24
|
+
* preload.cjs (synchronous XHR + `(0, eval)(...)`). Under native-host the
|
|
25
|
+
* service host is a BrowserWindow, not a Web Worker (`isWebWorker` false), so
|
|
26
|
+
* that shim never runs — kept for the worker render path. A real
|
|
27
|
+
* `importScripts(url)` would base the relative map on the script URL itself,
|
|
28
|
+
* but `(0, eval)(...)` does not, hence the same rewrite applies there too.
|
|
20
29
|
*
|
|
21
30
|
* Contract:
|
|
22
31
|
* - Operates on the LAST `//# sourceMappingURL=` (or legacy `//@`) directive
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dimina-kit/devtools",
|
|
3
|
-
"version": "0.4.0-dev.
|
|
3
|
+
"version": "0.4.0-dev.20260618090552",
|
|
4
4
|
"description": "Dimina DevTools - modular developer tools for mini app debugging",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"dimina",
|
|
@@ -86,9 +86,9 @@
|
|
|
86
86
|
"monaco-editor": "^0.55.1",
|
|
87
87
|
"ws": "^8.20.0",
|
|
88
88
|
"zod": "^4.3.6",
|
|
89
|
-
"@dimina-kit/devkit": "0.1.2-dev.
|
|
90
|
-
"@dimina-kit/view-anchor": "0.1.0-dev.
|
|
91
|
-
"@dimina-kit/electron-deck": "0.1.0-dev.
|
|
89
|
+
"@dimina-kit/devkit": "0.1.2-dev.20260618090552",
|
|
90
|
+
"@dimina-kit/view-anchor": "0.1.0-dev.20260618090552",
|
|
91
|
+
"@dimina-kit/electron-deck": "0.1.0-dev.20260618090552"
|
|
92
92
|
},
|
|
93
93
|
"devDependencies": {
|
|
94
94
|
"@playwright/test": "^1.59.1",
|