@dimina-kit/devtools 0.4.0 → 0.5.0
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 +51 -660
- package/dist/main/api.d.ts +2 -1
- package/dist/main/app/app.d.ts +41 -12
- package/dist/main/app/app.js +299 -514
- package/dist/main/app/bootstrap.d.ts +8 -5
- package/dist/main/app/bootstrap.js +15 -15
- package/dist/main/app/editor-view.d.ts +21 -0
- package/dist/main/app/editor-view.js +71 -0
- package/dist/main/app/global-mirrors.d.ts +23 -0
- package/dist/main/app/global-mirrors.js +37 -0
- package/dist/main/app/host-sidebar-default.d.ts +19 -0
- package/dist/main/app/host-sidebar-default.js +44 -0
- package/dist/main/app/lifecycle.d.ts +12 -1
- package/dist/main/app/lifecycle.js +27 -1
- package/dist/main/app/menu-setup.d.ts +13 -0
- package/dist/main/app/menu-setup.js +49 -0
- package/dist/main/app/native-overview.d.ts +1 -1
- package/dist/main/app/open-project-ipc.d.ts +13 -0
- package/dist/main/app/open-project-ipc.js +21 -0
- package/dist/main/app/project-list-surface.d.ts +31 -0
- package/dist/main/app/project-list-surface.js +20 -0
- package/dist/main/app/project-window.d.ts +36 -0
- package/dist/main/app/project-window.js +93 -0
- package/dist/main/app/servers.d.ts +17 -0
- package/dist/main/app/servers.js +60 -0
- package/dist/main/app/ui-extension-targets.d.ts +42 -0
- package/dist/main/app/ui-extension-targets.js +101 -0
- package/dist/main/app/window-close-reveal.harness.d.ts +34 -0
- package/dist/main/app/window-close-reveal.harness.js +65 -0
- package/dist/main/app/window-events.d.ts +15 -0
- package/dist/main/app/window-events.js +45 -0
- package/dist/main/app/window-runtime-services.d.ts +41 -0
- package/dist/main/app/window-runtime-services.js +197 -0
- package/dist/main/app/workbench-modules.d.ts +24 -0
- package/dist/main/app/workbench-modules.js +51 -0
- package/dist/main/app/workbench-window.d.ts +85 -0
- package/dist/main/app/workbench-window.js +310 -0
- package/dist/main/index.bundle.js +11712 -9986
- package/dist/main/index.js +49 -1
- package/dist/main/ipc/app-lifecycle.d.ts +1 -31
- package/dist/main/ipc/app-lifecycle.js +1 -53
- package/dist/main/ipc/app.d.ts +4 -1
- package/dist/main/ipc/app.js +4 -3
- package/dist/main/ipc/bridge-router.d.ts +19 -116
- package/dist/main/ipc/bridge-router.js +28 -2128
- package/dist/main/ipc/device-picker.d.ts +16 -0
- package/dist/main/ipc/device-picker.js +27 -0
- package/dist/main/ipc/index.d.ts +5 -0
- package/dist/main/ipc/index.js +5 -0
- package/dist/main/ipc/internal-devtools.d.ts +16 -0
- package/dist/main/ipc/internal-devtools.js +10 -0
- package/dist/main/ipc/page-scroll.d.ts +1 -13
- package/dist/main/ipc/page-scroll.js +1 -16
- package/dist/main/ipc/popover.d.ts +4 -1
- package/dist/main/ipc/popover.js +26 -19
- package/dist/main/ipc/project-create.d.ts +16 -0
- package/dist/main/ipc/project-create.js +27 -0
- package/dist/main/ipc/project-fs.d.ts +38 -3
- package/dist/main/ipc/project-fs.js +53 -22
- package/dist/main/ipc/projects.d.ts +3 -3
- package/dist/main/ipc/projects.js +47 -11
- package/dist/main/ipc/session-listener-bag.d.ts +1 -40
- package/dist/main/ipc/session-listener-bag.js +1 -39
- package/dist/main/ipc/session.d.ts +4 -1
- package/dist/main/ipc/session.js +26 -26
- package/dist/main/ipc/settings.d.ts +4 -1
- package/dist/main/ipc/settings.js +17 -19
- package/dist/main/ipc/simulator-module.d.ts +9 -3
- package/dist/main/ipc/simulator-module.js +13 -10
- package/dist/main/ipc/simulator.d.ts +4 -1
- package/dist/main/ipc/simulator.js +12 -18
- package/dist/main/ipc/tooltip.d.ts +14 -0
- package/dist/main/ipc/tooltip.js +29 -0
- package/dist/main/ipc/views.d.ts +19 -2
- package/dist/main/ipc/views.js +76 -8
- package/dist/main/runtime/devtools-backend-before-quit.harness.d.ts +43 -0
- package/dist/main/runtime/devtools-backend-before-quit.harness.js +87 -0
- package/dist/main/runtime/devtools-backend.js +60 -4
- package/dist/main/runtime/devtools-runtime-mock.harness.d.ts +21 -0
- package/dist/main/runtime/devtools-runtime-mock.harness.js +313 -0
- package/dist/main/runtime/miniapp-runtime.d.ts +91 -22
- package/dist/main/services/app-services.d.ts +62 -0
- package/dist/main/services/app-services.js +64 -0
- package/dist/main/services/automation/connection-target.d.ts +36 -0
- package/dist/main/services/automation/connection-target.js +29 -0
- package/dist/main/services/automation/console-bridge.d.ts +28 -0
- package/dist/main/services/automation/console-bridge.js +91 -0
- package/dist/main/services/automation/handlers/app.js +4 -4
- package/dist/main/services/automation/handlers/element.js +55 -21
- package/dist/main/services/automation/index.d.ts +12 -1
- package/dist/main/services/automation/index.js +54 -133
- package/dist/main/services/cdp-session/index.d.ts +87 -0
- package/dist/main/services/cdp-session/index.js +173 -0
- package/dist/main/services/compile-standby.js +4 -0
- package/dist/main/services/console-forward/cdp-inject.d.ts +18 -0
- package/dist/main/services/console-forward/cdp-inject.js +30 -0
- package/dist/main/services/console-forward/global-console-mirror.d.ts +33 -0
- package/dist/main/services/console-forward/global-console-mirror.js +71 -0
- package/dist/main/services/console-forward/global-diagnostics-mirror.d.ts +33 -0
- package/dist/main/services/console-forward/global-diagnostics-mirror.js +73 -0
- package/dist/main/services/console-forward/index.d.ts +1 -46
- package/dist/main/services/console-forward/index.js +1 -185
- package/dist/main/services/console-forward/internal-log.d.ts +2 -0
- package/dist/main/services/console-forward/internal-log.js +2 -0
- package/dist/main/services/console-forward/open-gated-relay.d.ts +67 -0
- package/dist/main/services/console-forward/open-gated-relay.js +55 -0
- package/dist/main/services/default-adapter.js +1 -1
- package/dist/main/services/diagnostics/index.d.ts +1 -48
- package/dist/main/services/diagnostics/index.js +1 -60
- package/dist/main/services/dimina-resource-server.d.ts +1 -6
- package/dist/main/services/dimina-resource-server.js +1 -98
- package/dist/main/services/elements-forward/index.d.ts +132 -15
- package/dist/main/services/elements-forward/index.js +155 -304
- package/dist/main/services/fs-bridge-protocol.d.ts +61 -0
- package/dist/main/services/fs-bridge-protocol.js +34 -0
- package/dist/main/services/fs-watch-sse.d.ts +40 -0
- package/dist/main/services/fs-watch-sse.js +113 -0
- package/dist/main/services/http-json.d.ts +9 -0
- package/dist/main/services/http-json.js +6 -0
- package/dist/main/services/layout/index.d.ts +11 -0
- package/dist/main/services/layout/index.js +23 -0
- package/dist/main/services/mcp/connection-owner.d.ts +38 -0
- package/dist/main/services/mcp/connection-owner.js +79 -0
- package/dist/main/services/mcp/index.d.ts +3 -1
- package/dist/main/services/mcp/index.js +4 -3
- package/dist/main/services/mcp/opened-project.d.ts +88 -0
- package/dist/main/services/mcp/opened-project.js +60 -0
- package/dist/main/services/mcp/server.d.ts +2 -1
- package/dist/main/services/mcp/server.js +29 -4
- package/dist/main/services/mcp/target-manager.d.ts +71 -23
- package/dist/main/services/mcp/target-manager.js +269 -138
- package/dist/main/services/mcp/target-selection.d.ts +47 -0
- package/dist/main/services/mcp/target-selection.js +71 -0
- package/dist/main/services/mcp/tools/context-tools.js +20 -5
- package/dist/main/services/mcp/tools/project-tools.d.ts +72 -0
- package/dist/main/services/mcp/tools/project-tools.js +133 -0
- package/dist/main/services/module.d.ts +13 -5
- package/dist/main/services/network-forward/body-cache.d.ts +72 -0
- package/dist/main/services/network-forward/body-cache.js +179 -0
- package/dist/main/services/network-forward/frontend-dispatch.d.ts +91 -0
- package/dist/main/services/network-forward/frontend-dispatch.js +148 -0
- package/dist/main/services/network-forward/global-body-gate.d.ts +46 -0
- package/dist/main/services/network-forward/global-body-gate.js +93 -0
- package/dist/main/services/network-forward/global-mirror-test-fixtures.d.ts +48 -0
- package/dist/main/services/network-forward/global-mirror-test-fixtures.js +96 -0
- package/dist/main/services/network-forward/http.d.ts +47 -0
- package/dist/main/services/network-forward/http.js +162 -0
- package/dist/main/services/network-forward/index.d.ts +135 -15
- package/dist/main/services/network-forward/index.js +854 -224
- package/dist/main/services/network-forward/request-ids.d.ts +5 -0
- package/dist/main/services/network-forward/request-ids.js +5 -0
- package/dist/main/services/network-forward/user-facing.d.ts +21 -0
- package/dist/main/services/network-forward/user-facing.js +50 -0
- package/dist/main/services/network-forward/websocket.d.ts +36 -0
- package/dist/main/services/network-forward/websocket.js +120 -0
- package/dist/main/services/notifications/renderer-notifier.d.ts +71 -9
- package/dist/main/services/notifications/renderer-notifier.js +45 -8
- package/dist/main/services/projects/create-project-service.js +19 -5
- package/dist/main/services/projects/local-provider.js +8 -4
- package/dist/main/services/projects/project-repository.d.ts +59 -7
- package/dist/main/services/projects/project-repository.js +285 -51
- package/dist/main/services/projects/types.d.ts +44 -34
- package/dist/main/services/render-inspect/index.d.ts +12 -2
- package/dist/main/services/render-inspect/index.js +21 -102
- package/dist/main/services/safe-area/index.d.ts +21 -6
- package/dist/main/services/safe-area/index.js +92 -46
- package/dist/main/services/service-host-pool/pool.d.ts +1 -196
- package/dist/main/services/service-host-pool/pool.js +1 -363
- package/dist/main/services/settings/index.d.ts +7 -1
- package/dist/main/services/settings/index.js +22 -2
- package/dist/main/services/simulator/custom-apis.d.ts +1 -42
- package/dist/main/services/simulator/custom-apis.js +1 -46
- package/dist/main/services/simulator/referer.d.ts +1 -9
- package/dist/main/services/simulator/referer.js +1 -19
- package/dist/main/services/simulator/ui-extensions.d.ts +21 -0
- package/dist/main/services/simulator/ui-extensions.js +176 -0
- package/dist/main/services/simulator-appdata/index.d.ts +6 -0
- package/dist/main/services/simulator-appdata/index.js +21 -2
- package/dist/main/services/simulator-current-page/index.d.ts +5 -3
- package/dist/main/services/simulator-current-page/index.js +8 -1
- package/dist/main/services/simulator-storage/index.d.ts +34 -5
- package/dist/main/services/simulator-storage/index.js +73 -71
- package/dist/main/services/simulator-storage/service-storage-ops.d.ts +1 -39
- package/dist/main/services/simulator-storage/service-storage-ops.js +1 -66
- package/dist/main/services/simulator-storage/window-scope.d.ts +20 -0
- package/dist/main/services/simulator-storage/window-scope.js +20 -0
- package/dist/main/services/simulator-temp-files/disk.d.ts +1 -54
- package/dist/main/services/simulator-temp-files/disk.js +1 -237
- package/dist/main/services/simulator-temp-files/fs-channels.d.ts +1 -68
- package/dist/main/services/simulator-temp-files/fs-channels.js +1 -107
- package/dist/main/services/simulator-temp-files/index.d.ts +1 -32
- package/dist/main/services/simulator-temp-files/index.js +1 -181
- package/dist/main/services/simulator-temp-files/request-handler.d.ts +1 -29
- package/dist/main/services/simulator-temp-files/request-handler.js +1 -177
- package/dist/main/services/simulator-temp-files/resolver.d.ts +1 -21
- package/dist/main/services/simulator-temp-files/resolver.js +1 -21
- package/dist/main/services/simulator-temp-files/store.d.ts +1 -13
- package/dist/main/services/simulator-temp-files/store.js +1 -23
- package/dist/main/services/update/github-release-checker.js +22 -3
- package/dist/main/services/update/update-manager.d.ts +21 -4
- package/dist/main/services/update/update-manager.js +55 -11
- package/dist/main/services/views/clear-console-filter.d.ts +44 -0
- package/dist/main/services/views/clear-console-filter.js +86 -0
- package/dist/main/services/views/console-filter-test-fixtures.d.ts +94 -0
- package/dist/main/services/views/console-filter-test-fixtures.js +82 -0
- package/dist/main/services/views/console-filter.d.ts +94 -0
- package/dist/main/services/views/console-filter.js +190 -0
- package/dist/main/services/views/devtools-tabs.d.ts +24 -4
- package/dist/main/services/views/devtools-tabs.js +40 -21
- package/dist/main/services/views/frontend-bootstrap-gate.d.ts +59 -0
- package/dist/main/services/views/frontend-bootstrap-gate.js +117 -0
- package/dist/main/services/views/host-dialog-port-channel.d.ts +18 -0
- package/dist/main/services/views/host-dialog-port-channel.js +15 -0
- package/dist/main/services/views/host-dialog-session-runtime.d.ts +10 -0
- package/dist/main/services/views/host-dialog-session-runtime.js +17 -0
- package/dist/main/services/views/host-dialog-view.d.ts +95 -0
- package/dist/main/services/views/host-dialog-view.js +147 -0
- package/dist/main/services/views/host-sidebar-port-channel.d.ts +18 -0
- package/dist/main/services/views/host-sidebar-port-channel.js +15 -0
- package/dist/main/services/views/host-sidebar-session-runtime.d.ts +10 -0
- package/dist/main/services/views/host-sidebar-session-runtime.js +17 -0
- package/dist/main/services/views/host-sidebar-view.d.ts +59 -0
- package/dist/main/services/views/host-sidebar-view.js +44 -0
- package/dist/main/services/views/host-slot-port-channel.d.ts +124 -0
- package/dist/main/services/views/host-slot-port-channel.js +289 -0
- package/dist/main/services/views/host-slot-session-runtime.d.ts +40 -0
- package/dist/main/services/views/host-slot-session-runtime.js +50 -0
- package/dist/main/services/views/host-slot-view.d.ts +109 -0
- package/dist/main/services/views/host-slot-view.js +147 -0
- package/dist/main/services/views/host-toolbar-port-channel.d.ts +6 -91
- package/dist/main/services/views/host-toolbar-port-channel.js +10 -243
- package/dist/main/services/views/host-toolbar-session-runtime.d.ts +5 -30
- package/dist/main/services/views/host-toolbar-session-runtime.js +9 -47
- package/dist/main/services/views/host-toolbar-view.d.ts +34 -7
- package/dist/main/services/views/host-toolbar-view.js +30 -237
- package/dist/main/services/views/managed-web-contents-view.d.ts +48 -0
- package/dist/main/services/views/managed-web-contents-view.js +143 -0
- package/dist/main/services/views/miniapp-partition.d.ts +1 -89
- package/dist/main/services/views/miniapp-partition.js +1 -158
- package/dist/main/services/views/native-simulator-devtools-host.js +206 -68
- package/dist/main/services/views/native-simulator-view.d.ts +6 -0
- package/dist/main/services/views/native-simulator-view.js +47 -40
- package/dist/main/services/views/native-view-tree.d.ts +25 -0
- package/dist/main/services/views/native-view-tree.js +69 -0
- package/dist/main/services/views/overlay-panels-view.d.ts +63 -4
- package/dist/main/services/views/overlay-panels-view.js +257 -108
- package/dist/main/services/views/placement-reconciler.d.ts +18 -18
- package/dist/main/services/views/placement-reconciler.js +91 -29
- package/dist/main/services/views/placement-test-driver.d.ts +27 -0
- package/dist/main/services/views/placement-test-driver.js +29 -0
- package/dist/main/services/views/refresh-styles.d.ts +10 -0
- package/dist/main/services/views/refresh-styles.js +57 -0
- package/dist/main/services/views/simulator-session-policy.d.ts +1 -27
- package/dist/main/services/views/simulator-session-policy.js +1 -98
- package/dist/main/services/views/view-manager-devtools-host-test-fixtures.d.ts +76 -0
- package/dist/main/services/views/view-manager-devtools-host-test-fixtures.js +184 -0
- package/dist/main/services/views/view-manager.d.ts +69 -88
- package/dist/main/services/views/view-manager.js +62 -7
- package/dist/main/services/views/workbench-view.d.ts +2 -0
- package/dist/main/services/views/workbench-view.js +104 -17
- package/dist/main/services/window-contexts/context-router.d.ts +36 -0
- package/dist/main/services/window-contexts/context-router.js +55 -0
- package/dist/main/services/workbench-coi-host.d.ts +52 -0
- package/dist/main/services/workbench-coi-host.js +227 -0
- package/dist/main/services/workbench-coi-server.d.ts +11 -0
- package/dist/main/services/workbench-coi-server.js +126 -126
- package/dist/main/services/workbench-coi-shutdown.d.ts +40 -0
- package/dist/main/services/workbench-coi-shutdown.js +69 -0
- package/dist/main/services/workbench-coi-static.d.ts +23 -0
- package/dist/main/services/workbench-coi-static.js +87 -0
- package/dist/main/services/workbench-context.d.ts +88 -8
- package/dist/main/services/workbench-context.js +54 -6
- package/dist/main/services/workspace/compile-log-buffer.d.ts +40 -0
- package/dist/main/services/workspace/compile-log-buffer.js +41 -0
- package/dist/main/services/workspace/compile-mode-adapter.d.ts +18 -0
- package/dist/main/services/workspace/compile-mode-adapter.js +57 -0
- package/dist/main/services/workspace/compile-mode-store.d.ts +25 -0
- package/dist/main/services/workspace/compile-mode-store.js +71 -0
- package/dist/main/services/workspace/open-project-guards.d.ts +16 -0
- package/dist/main/services/workspace/open-project-guards.js +42 -0
- package/dist/main/services/workspace/rebuild-status.d.ts +37 -0
- package/dist/main/services/workspace/rebuild-status.js +36 -0
- package/dist/main/services/workspace/session-status-store.d.ts +47 -0
- package/dist/main/services/workspace/session-status-store.js +73 -0
- package/dist/main/services/workspace/status-tap.d.ts +20 -0
- package/dist/main/services/workspace/status-tap.js +32 -0
- package/dist/main/services/workspace/workspace-compile-modes.d.ts +59 -0
- package/dist/main/services/workspace/workspace-compile-modes.js +93 -0
- package/dist/main/services/workspace/workspace-lifecycle-race.testutil.d.ts +22 -0
- package/dist/main/services/workspace/workspace-lifecycle-race.testutil.js +62 -0
- package/dist/main/services/workspace/workspace-referer.d.ts +17 -0
- package/dist/main/services/workspace/workspace-referer.js +26 -0
- package/dist/main/services/workspace/workspace-service.d.ts +7 -5
- package/dist/main/services/workspace/workspace-service.js +96 -135
- package/dist/main/services/workspace/workspace-thumbnails.d.ts +22 -0
- package/dist/main/services/workspace/workspace-thumbnails.js +67 -0
- package/dist/main/utils/ipc-context-source.d.ts +40 -0
- package/dist/main/utils/ipc-context-source.js +23 -0
- package/dist/main/utils/ipc-registry.d.ts +46 -21
- package/dist/main/utils/ipc-registry.js +166 -76
- package/dist/main/utils/paths.d.ts +18 -0
- package/dist/main/utils/paths.js +18 -0
- package/dist/main/utils/sender-policy.d.ts +10 -1
- package/dist/main/utils/sender-policy.js +42 -4
- package/dist/main/utils/theme.d.ts +18 -8
- package/dist/main/utils/theme.js +19 -9
- package/dist/main/windows/internal-devtools-window/index.d.ts +66 -0
- package/dist/main/windows/internal-devtools-window/index.js +160 -0
- package/dist/main/windows/main-window/create.d.ts +16 -0
- package/dist/main/windows/main-window/create.js +19 -11
- package/dist/main/windows/main-window/events.d.ts +1 -1
- package/dist/main/windows/main-window/events.js +26 -13
- package/dist/main/windows/main-window/index.d.ts +1 -1
- package/dist/main/windows/main-window/index.js +1 -1
- package/dist/main/windows/service-host-window/create.d.ts +1 -92
- package/dist/main/windows/service-host-window/create.js +1 -154
- package/dist/native-host/common/common.js +173 -53
- package/dist/native-host/container/pageFrame.css +1 -1
- package/dist/native-host/render/render.js +8278 -3659
- package/dist/native-host/service/service.js +2 -2
- package/dist/preload/index.d.ts +2 -0
- package/dist/preload/index.js +1 -0
- package/dist/preload/instrumentation/app-data.d.ts +2 -2
- package/dist/preload/instrumentation/app-data.js +1 -1
- package/dist/preload/instrumentation/wxml.js +1 -1
- package/dist/preload/runtime/bridge.d.ts +3 -3
- package/dist/preload/runtime/bridge.js +2 -2
- package/dist/preload/runtime/clipboard.d.ts +6 -0
- package/dist/preload/runtime/clipboard.js +12 -0
- package/dist/preload/runtime/host-dialog-advertiser.d.ts +22 -0
- package/dist/preload/runtime/host-dialog-advertiser.js +37 -0
- package/dist/preload/runtime/host-dialog-port.d.ts +44 -0
- package/dist/preload/runtime/host-dialog-port.js +53 -0
- package/dist/preload/runtime/host-dialog-runtime.d.ts +28 -0
- package/dist/preload/runtime/host-dialog-runtime.js +36 -0
- package/dist/preload/runtime/host-sidebar-advertiser.d.ts +19 -0
- package/dist/preload/runtime/host-sidebar-advertiser.js +35 -0
- package/dist/preload/runtime/host-sidebar-port.d.ts +44 -0
- package/dist/preload/runtime/host-sidebar-port.js +53 -0
- package/dist/preload/runtime/host-sidebar-runtime.d.ts +28 -0
- package/dist/preload/runtime/host-sidebar-runtime.js +36 -0
- package/dist/preload/runtime/host-slot-port-bridge.d.ts +18 -0
- package/dist/preload/runtime/host-slot-port-bridge.js +112 -0
- package/dist/preload/runtime/host-toolbar-advertiser.d.ts +5 -13
- package/dist/preload/runtime/host-toolbar-advertiser.js +18 -38
- package/dist/preload/runtime/host-toolbar-port.d.ts +9 -0
- package/dist/preload/runtime/host-toolbar-port.js +11 -95
- package/dist/preload/runtime/native-host.d.ts +14 -0
- package/dist/preload/runtime/native-host.js +5 -8
- package/dist/preload/runtime/node-bindings.d.ts +18 -0
- package/dist/preload/runtime/node-bindings.js +44 -0
- package/dist/preload/runtime/temp-files.js +9 -2
- package/dist/preload/runtime/wait-for-slot-root.d.ts +23 -0
- package/dist/preload/runtime/wait-for-slot-root.js +80 -0
- package/dist/preload/shared/api-compat.js +63 -41
- package/dist/preload/windows/host-dialog-runtime.cjs +360 -0
- package/dist/preload/windows/host-dialog-runtime.cjs.map +7 -0
- package/dist/preload/windows/host-dialog-runtime.d.ts +2 -0
- package/dist/preload/windows/host-dialog-runtime.js +13 -0
- package/dist/preload/windows/host-sidebar-runtime.cjs +361 -0
- package/dist/preload/windows/host-sidebar-runtime.cjs.map +7 -0
- package/dist/preload/windows/host-sidebar-runtime.d.ts +2 -0
- package/dist/preload/windows/host-sidebar-runtime.js +13 -0
- package/dist/preload/windows/host-toolbar-runtime.cjs +142 -52
- package/dist/preload/windows/host-toolbar-runtime.cjs.map +3 -3
- package/dist/preload/windows/main.cjs +4922 -1246
- package/dist/preload/windows/main.cjs.map +4 -4
- package/dist/preload/windows/main.css +428 -0
- package/dist/preload/windows/main.css.map +7 -0
- package/dist/preload/windows/simulator.cjs +376 -322
- package/dist/preload/windows/simulator.cjs.map +4 -4
- package/dist/preload/windows/simulator.js +376 -322
- package/dist/render-host/pageFrame.html +4 -4
- package/dist/render-host/preload.cjs +30 -0
- package/dist/render-host/render-inspect.js +184 -115
- package/dist/renderer/assets/button-CB2MWjHY.js +2 -0
- package/dist/renderer/assets/constants-CkoGPQTS.js +2 -0
- package/dist/renderer/assets/constants-zQZ2-y21.js +2 -0
- package/dist/renderer/assets/createLucideIcon-cZ9FlZZw.js +2 -0
- package/dist/renderer/assets/devicePicker-H2eIO4e1.js +2 -0
- package/dist/renderer/assets/dialog-pHzEA8Vx.js +46 -0
- package/dist/renderer/assets/dist-B5HADirS.js +2 -0
- package/dist/renderer/assets/dist-DIFlRMKe.js +2 -0
- package/dist/renderer/assets/hostSidebarDefault-DRWh6OCt.js +2 -0
- package/dist/renderer/assets/index-CEL_XFge.js +2 -0
- package/dist/renderer/assets/input-CAObw95L.js +2 -0
- package/dist/renderer/assets/ipc-channels-overlays-gIPUFnqc.js +2 -0
- package/dist/renderer/assets/jsx-runtime-DICEQH_0.css +1 -0
- package/dist/renderer/assets/jsx-runtime-DIw5wnYl.js +9 -0
- package/dist/renderer/assets/plus-BQ9u5EbL.js +2 -0
- package/dist/renderer/assets/popover-Cw7G2Ctp.js +2 -0
- package/dist/renderer/assets/presets-DMZOb9ay.js +2 -0
- package/dist/renderer/assets/project-api-YTOr_Yvo.js +2 -0
- package/dist/renderer/assets/projectCreateDialog-BmLqiYxn.js +2 -0
- package/dist/renderer/assets/search-BMvuYF48.js +2 -0
- package/dist/renderer/assets/select-nFP95TxM.js +2 -0
- package/dist/renderer/assets/settings-CnpVfSWt.js +2 -0
- package/dist/renderer/assets/settings-api-Ccsf-Nsj.js +2 -0
- package/dist/renderer/assets/settings-tab-bar-CAzrv32m.js +2 -0
- package/dist/renderer/assets/smartphone-Bb2GdIKy.js +2 -0
- package/dist/renderer/assets/tabs-CPKN3Mmq.js +2 -0
- package/dist/renderer/assets/tooltip-D6AxXRk5.js +2 -0
- package/dist/renderer/assets/types-Bh0hA7El.js +2 -0
- package/dist/renderer/assets/updateDialog-CwndJ0Bl.js +2 -0
- package/dist/renderer/assets/utils-sEB5OZEQ.js +2 -0
- package/dist/renderer/assets/view-api-B-2zPBR5.js +2 -0
- package/dist/renderer/assets/view-ids-BfaDVV5P.js +2 -0
- package/dist/renderer/assets/workbench-C0Jkdlps.js +5 -0
- package/dist/renderer/assets/workbenchSettings-YD0Ctbm_.js +8 -0
- package/dist/renderer/entries/device-picker/index.html +28 -0
- package/dist/renderer/entries/host-sidebar-default/index.html +22 -0
- package/dist/renderer/entries/main/index.html +16 -7
- package/dist/renderer/entries/popover/index.html +16 -6
- package/dist/renderer/entries/project-create-dialog/index.html +27 -0
- package/dist/renderer/entries/settings/index.html +10 -5
- package/dist/renderer/entries/tooltip/index.html +21 -0
- package/dist/renderer/entries/update-dialog/index.html +25 -0
- package/dist/renderer/entries/workbench/index.html +49 -0
- package/dist/renderer/entries/workbench-settings/index.html +12 -5
- package/dist/service-host/appdata-set-data.cjs +39 -0
- package/dist/service-host/host-env-update.cjs +23 -0
- package/dist/service-host/preload.cjs +54 -48
- package/dist/service-host/service-message-queue.cjs +71 -0
- package/dist/service-host/sync-impls/menu-button-geometry.js +16 -5
- package/dist/service-host/sync-impls/menu-button.js +5 -3
- package/dist/service-host/sync-impls/system-info.js +31 -9
- package/dist/shared/bridge-channels.d.ts +1 -416
- package/dist/shared/bridge-channels.js +1 -89
- package/dist/shared/compile-mode-state.d.ts +73 -0
- package/dist/shared/compile-mode-state.js +100 -0
- package/dist/shared/compile-modes.d.ts +152 -0
- package/dist/shared/compile-modes.js +237 -0
- package/dist/shared/constants.d.ts +22 -0
- package/dist/shared/constants.js +22 -0
- package/dist/shared/dmb-resource-url.d.ts +2 -0
- package/dist/shared/dmb-resource-url.js +2 -0
- package/dist/shared/ipc-channels-overlays.d.ts +162 -0
- package/dist/shared/ipc-channels-overlays.js +203 -0
- package/dist/shared/ipc-channels.d.ts +24 -154
- package/dist/shared/ipc-channels.js +48 -96
- package/dist/shared/ipc-schemas.d.ts +143 -54
- package/dist/shared/ipc-schemas.js +137 -45
- package/dist/shared/node-bindings.d.ts +2 -0
- package/dist/shared/node-bindings.js +2 -0
- package/dist/shared/project-window-types.d.ts +42 -0
- package/dist/shared/project-window-types.js +2 -0
- package/dist/shared/simulator-route.d.ts +8 -0
- package/dist/shared/simulator-route.js +15 -0
- package/dist/shared/simulator-ui.d.ts +61 -0
- package/dist/shared/simulator-ui.js +12 -0
- package/dist/shared/types.d.ts +126 -41
- package/dist/shared/view-ids.d.ts +10 -0
- package/dist/shared/view-ids.js +23 -0
- package/dist/simulator/assets/bridge-channels-B3JAmRfl.js +2 -0
- package/dist/simulator/assets/device-shell-ATEhHV2_.css +1 -0
- package/dist/simulator/assets/device-shell-DucLepkm.js +431 -0
- package/dist/simulator/assets/simulator-B4rbcOVt.js +10 -0
- package/dist/simulator/assets/simulator-mini-app-DFo7fhi5.js +2 -0
- package/dist/simulator/assets/simulator-ui-BupATgKo.css +1 -0
- package/dist/simulator/assets/simulator-ui-i3GCc7YJ.js +2 -0
- package/dist/simulator/simulator.html +4 -3
- package/dist/simulator/temp-files.d.ts +35 -0
- package/dist/simulator/temp-files.js +121 -0
- package/dist/simulator/types.d.ts +50 -0
- package/dist/simulator/types.js +2 -0
- package/dist/vscode-workbench/assets/__vite-browser-external-JIkWewFf.js +1 -0
- package/dist/vscode-workbench/assets/{dist-TpGpmMGi.js → dist-CXG-u1VB.js} +3 -3
- package/dist/vscode-workbench/assets/fs-core-worker-urls-DZ1nod84.js +1 -0
- package/dist/vscode-workbench/assets/fs-core.worker-Bnmpp6fo.js +1 -0
- package/dist/vscode-workbench/assets/fs-query.worker-cZ-7Fjch.js +2 -0
- package/dist/vscode-workbench/assets/{iconv-lite-umd-C9tiCAJa.js → iconv-lite-umd-Dxx9Qyb4.js} +1 -1
- package/dist/vscode-workbench/assets/{index-DJ1HyMZ7.js → index-6VJMsaWj.js} +475 -475
- package/dist/vscode-workbench/assets/{jschardet-DE1jV513.js → jschardet-Ba3D16vt.js} +1 -1
- package/dist/vscode-workbench/index.html +21 -1
- package/package.json +23 -13
- package/dist/main/services/views/destroy-child-view.d.ts +0 -9
- package/dist/main/services/views/destroy-child-view.js +0 -23
- package/dist/preload/instrumentation/wxml-extract.d.ts +0 -11
- package/dist/preload/instrumentation/wxml-extract.js +0 -382
- package/dist/preload/shared/sid-registry.d.ts +0 -11
- package/dist/preload/shared/sid-registry.js +0 -38
- package/dist/renderer/assets/constants-EAMiwL9_.js +0 -2
- package/dist/renderer/assets/index-BMqyDx71.js +0 -49
- package/dist/renderer/assets/input-CDAEwpBO.js +0 -2
- package/dist/renderer/assets/ipc-transport-B7eFOR68.css +0 -1
- package/dist/renderer/assets/ipc-transport-_G1k5V1p.js +0 -9
- package/dist/renderer/assets/popover-DEdjK14m.js +0 -2
- package/dist/renderer/assets/select-DpKPCh3y.js +0 -2
- package/dist/renderer/assets/settings-M5q2elUr.js +0 -2
- package/dist/renderer/assets/settings-api-CDlZoHiO.js +0 -2
- package/dist/renderer/assets/workbenchSettings-CT_H1WhV.js +0 -8
- package/dist/shared/appdata-accumulator.d.ts +0 -95
- package/dist/shared/appdata-accumulator.js +0 -218
- package/dist/shared/request-core.d.ts +0 -84
- package/dist/shared/request-core.js +0 -168
- package/dist/shared/simulator-api-metadata.d.ts +0 -26
- package/dist/shared/simulator-api-metadata.js +0 -59
- package/dist/shared/vpath.d.ts +0 -42
- package/dist/shared/vpath.js +0 -105
- package/dist/simulator/assets/bridge-channels-zhsumfky.js +0 -2
- package/dist/simulator/assets/device-shell-C-wcFq3Z.js +0 -2
- package/dist/simulator/assets/device-shell-CS1rqAQz.css +0 -1
- package/dist/simulator/assets/jsx-runtime-BDTY6fEq.js +0 -2
- package/dist/simulator/assets/simulator-DU3-fS3v.js +0 -10
- package/dist/simulator/assets/simulator-mini-app-DzfMfnVM.js +0 -2
- package/dist/simulator/device-shell/menu-button-geometry.js +0 -8
- package/dist/vscode-workbench/assets/__vite-browser-external-CXi6Kz9W.js +0 -1
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { WorkbenchModule } from '../services/module.js';
|
|
2
|
+
import type { ViewManager } from '../services/views/view-manager.js';
|
|
3
|
+
import type { RendererNotifier } from '../services/notifications/renderer-notifier.js';
|
|
4
|
+
import type { Disposable } from '@dimina-kit/electron-deck/main';
|
|
5
|
+
import { type SenderPolicy } from '../utils/ipc-registry.js';
|
|
6
|
+
import { type IpcInput } from '../utils/ipc-context-source.js';
|
|
7
|
+
/** Module-local narrow deps — deliberately NOT `Pick<WorkbenchContext, ...>`
|
|
8
|
+
* (the gate in eslint.config.* is shrink-only; see its message). */
|
|
9
|
+
export interface DevicePickerIpcDeps {
|
|
10
|
+
views: Pick<ViewManager, 'showDevicePicker' | 'hideDevicePicker'>;
|
|
11
|
+
notify: Pick<RendererNotifier, 'devicePickerSelected'>;
|
|
12
|
+
senderPolicy?: SenderPolicy;
|
|
13
|
+
}
|
|
14
|
+
export declare function registerDevicePickerIpc(input: IpcInput<DevicePickerIpcDeps>): Disposable;
|
|
15
|
+
export declare const devicePickerModule: WorkbenchModule;
|
|
16
|
+
//# sourceMappingURL=device-picker.d.ts.map
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { DevicePickerChannel } from '../../shared/ipc-channels-overlays.js';
|
|
2
|
+
import { DevicePickerDeviceSchema } from '../../shared/ipc-schemas.js';
|
|
3
|
+
import { validate } from '../utils/ipc-schema.js';
|
|
4
|
+
import { IpcRegistry } from '../utils/ipc-registry.js';
|
|
5
|
+
import { toIpcContextSource } from '../utils/ipc-context-source.js';
|
|
6
|
+
export function registerDevicePickerIpc(input) {
|
|
7
|
+
return new IpcRegistry(toIpcContextSource(input))
|
|
8
|
+
.onRouted(DevicePickerChannel.Show, (ctx, _event, ...args) => {
|
|
9
|
+
const [data] = validate(DevicePickerChannel.Show, DevicePickerDeviceSchema, args);
|
|
10
|
+
ctx.views.showDevicePicker(data);
|
|
11
|
+
})
|
|
12
|
+
.onRouted(DevicePickerChannel.Cancel, (ctx) => {
|
|
13
|
+
ctx.views.hideDevicePicker();
|
|
14
|
+
})
|
|
15
|
+
.onRouted(DevicePickerChannel.Select, (ctx, _event, ...args) => {
|
|
16
|
+
const [data] = validate(DevicePickerChannel.Select, DevicePickerDeviceSchema, args);
|
|
17
|
+
ctx.views.hideDevicePicker();
|
|
18
|
+
ctx.notify.devicePickerSelected(data);
|
|
19
|
+
});
|
|
20
|
+
// OverlayChannel.Ready is registered once, in tooltip.ts — every overlay
|
|
21
|
+
// renderer (this one included) funnels readiness through that single
|
|
22
|
+
// listener, so a second registration here would double-fire markOverlayReady.
|
|
23
|
+
}
|
|
24
|
+
export const devicePickerModule = {
|
|
25
|
+
setup: (ctx) => registerDevicePickerIpc(ctx),
|
|
26
|
+
};
|
|
27
|
+
//# sourceMappingURL=device-picker.js.map
|
package/dist/main/ipc/index.d.ts
CHANGED
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
export { registerAppIpc } from './app.js';
|
|
2
2
|
export { registerSimulatorIpc } from './simulator.js';
|
|
3
3
|
export { registerPopoverIpc, popoverModule } from './popover.js';
|
|
4
|
+
export { registerTooltipIpc, tooltipModule } from './tooltip.js';
|
|
5
|
+
export { registerProjectCreateIpc, projectCreateModule } from './project-create.js';
|
|
6
|
+
export { registerDevicePickerIpc, devicePickerModule } from './device-picker.js';
|
|
4
7
|
export { registerProjectsIpc, projectsModule } from './projects.js';
|
|
5
8
|
export { registerSessionIpc, sessionModule } from './session.js';
|
|
6
9
|
export { registerSettingsIpc, settingsModule } from './settings.js';
|
|
10
|
+
export { registerInternalDevtoolsIpc } from './internal-devtools.js';
|
|
11
|
+
export { registerViewsIpc } from './views.js';
|
|
7
12
|
export { simulatorModule } from './simulator-module.js';
|
|
8
13
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/main/ipc/index.js
CHANGED
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
export { registerAppIpc } from './app.js';
|
|
2
2
|
export { registerSimulatorIpc } from './simulator.js';
|
|
3
3
|
export { registerPopoverIpc, popoverModule } from './popover.js';
|
|
4
|
+
export { registerTooltipIpc, tooltipModule } from './tooltip.js';
|
|
5
|
+
export { registerProjectCreateIpc, projectCreateModule } from './project-create.js';
|
|
6
|
+
export { registerDevicePickerIpc, devicePickerModule } from './device-picker.js';
|
|
4
7
|
export { registerProjectsIpc, projectsModule } from './projects.js';
|
|
5
8
|
export { registerSessionIpc, sessionModule } from './session.js';
|
|
6
9
|
export { registerSettingsIpc, settingsModule } from './settings.js';
|
|
10
|
+
export { registerInternalDevtoolsIpc } from './internal-devtools.js';
|
|
11
|
+
export { registerViewsIpc } from './views.js';
|
|
7
12
|
export { simulatorModule } from './simulator-module.js';
|
|
8
13
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { Disposable } from '@dimina-kit/electron-deck/main';
|
|
2
|
+
import { type SenderPolicy } from '../utils/ipc-registry.js';
|
|
3
|
+
import { type IpcInput } from '../utils/ipc-context-source.js';
|
|
4
|
+
import type { InternalDevtoolsWindow } from '../windows/internal-devtools-window/index.js';
|
|
5
|
+
/**
|
|
6
|
+
* Standalone internal (app-wide) DevTools debug window. The simulator
|
|
7
|
+
* toolbar's "debug" button opens (or focuses) it via the window controller —
|
|
8
|
+
* a module-local narrow deps interface, not `WorkbenchContext`, per the
|
|
9
|
+
* shrink-only WorkbenchContext-import gate (see eslint.config.js).
|
|
10
|
+
*/
|
|
11
|
+
export interface InternalDevtoolsIpcDeps {
|
|
12
|
+
internalDevtoolsWindow?: InternalDevtoolsWindow;
|
|
13
|
+
senderPolicy: SenderPolicy;
|
|
14
|
+
}
|
|
15
|
+
export declare function registerInternalDevtoolsIpc(input: IpcInput<InternalDevtoolsIpcDeps>): Disposable;
|
|
16
|
+
//# sourceMappingURL=internal-devtools.d.ts.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { InternalDevtoolsChannel } from '../../shared/ipc-channels.js';
|
|
2
|
+
import { IpcRegistry } from '../utils/ipc-registry.js';
|
|
3
|
+
import { toIpcContextSource } from '../utils/ipc-context-source.js';
|
|
4
|
+
export function registerInternalDevtoolsIpc(input) {
|
|
5
|
+
return new IpcRegistry(toIpcContextSource(input))
|
|
6
|
+
.handleRouted(InternalDevtoolsChannel.Open, (ctx) => {
|
|
7
|
+
ctx.internalDevtoolsWindow?.open();
|
|
8
|
+
});
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=internal-devtools.js.map
|
|
@@ -1,14 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
* Build the script that `wx.pageScrollTo` runs inside the page's render guest.
|
|
3
|
-
*
|
|
4
|
-
* The mini-program page scrolls the whole render document (the native iOS impl
|
|
5
|
-
* scrolls the WKWebView's scrollView; Android scrolls the page view), so the
|
|
6
|
-
* simulator scrolls `window`. `duration` is best-effort: a positive duration
|
|
7
|
-
* maps to smooth scrolling (the browser owns the easing — the exact ms is not
|
|
8
|
-
* controllable), and `0` jumps instantly.
|
|
9
|
-
*/
|
|
10
|
-
export declare function buildPageScrollScript(params: {
|
|
11
|
-
scrollTop?: unknown;
|
|
12
|
-
duration?: unknown;
|
|
13
|
-
}): string;
|
|
1
|
+
export * from '@dimina-kit/electron-runtime/main/page-scroll';
|
|
14
2
|
//# sourceMappingURL=page-scroll.d.ts.map
|
|
@@ -1,17 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
* Build the script that `wx.pageScrollTo` runs inside the page's render guest.
|
|
3
|
-
*
|
|
4
|
-
* The mini-program page scrolls the whole render document (the native iOS impl
|
|
5
|
-
* scrolls the WKWebView's scrollView; Android scrolls the page view), so the
|
|
6
|
-
* simulator scrolls `window`. `duration` is best-effort: a positive duration
|
|
7
|
-
* maps to smooth scrolling (the browser owns the easing — the exact ms is not
|
|
8
|
-
* controllable), and `0` jumps instantly.
|
|
9
|
-
*/
|
|
10
|
-
export function buildPageScrollScript(params) {
|
|
11
|
-
const rawTop = Number(params.scrollTop);
|
|
12
|
-
const top = Number.isFinite(rawTop) ? rawTop : 0;
|
|
13
|
-
const duration = params.duration === undefined ? 300 : Number(params.duration);
|
|
14
|
-
const behavior = Number.isFinite(duration) && duration > 0 ? 'smooth' : 'auto';
|
|
15
|
-
return `window.scrollTo({ top: ${top}, left: 0, behavior: ${JSON.stringify(behavior)} })`;
|
|
16
|
-
}
|
|
1
|
+
export * from '@dimina-kit/electron-runtime/main/page-scroll';
|
|
17
2
|
//# sourceMappingURL=page-scroll.js.map
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import type { WorkbenchContext } from '../services/workbench-context.js';
|
|
2
2
|
import type { WorkbenchModule } from '../services/module.js';
|
|
3
3
|
import type { Disposable } from '@dimina-kit/electron-deck/main';
|
|
4
|
-
|
|
4
|
+
import { type IpcInput } from '../utils/ipc-context-source.js';
|
|
5
|
+
type PopoverIpcCtx = Pick<WorkbenchContext, 'views' | 'notify' | 'senderPolicy' | 'workspace'>;
|
|
6
|
+
export declare function registerPopoverIpc(input: IpcInput<PopoverIpcCtx>): Disposable;
|
|
5
7
|
export declare const popoverModule: WorkbenchModule;
|
|
8
|
+
export {};
|
|
6
9
|
//# sourceMappingURL=popover.d.ts.map
|
package/dist/main/ipc/popover.js
CHANGED
|
@@ -1,29 +1,36 @@
|
|
|
1
|
-
import { PopoverChannel } from '../../shared/ipc-channels.js';
|
|
2
|
-
import { PopoverShowSchema,
|
|
1
|
+
import { PopoverChannel } from '../../shared/ipc-channels-overlays.js';
|
|
2
|
+
import { PopoverShowSchema, PopoverApplySchema, } from '../../shared/ipc-schemas.js';
|
|
3
3
|
import { validate } from '../utils/ipc-schema.js';
|
|
4
4
|
import { IpcRegistry } from '../utils/ipc-registry.js';
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
import { toIpcContextSource } from '../utils/ipc-context-source.js';
|
|
6
|
+
export function registerPopoverIpc(input) {
|
|
7
|
+
return new IpcRegistry(toIpcContextSource(input))
|
|
8
|
+
.handleRouted(PopoverChannel.Show, (ctx, _event, ...args) => {
|
|
8
9
|
const [data] = validate(PopoverChannel.Show, PopoverShowSchema, args);
|
|
9
|
-
|
|
10
|
+
// A stale/misbehaving renderer may still send the old `modes` field —
|
|
11
|
+
// never trust it. The live state always comes from the currently open
|
|
12
|
+
// project's store, injected here.
|
|
13
|
+
const { modes: _modes, ...rest } = data;
|
|
14
|
+
const { state } = ctx.workspace.getCompileModeState();
|
|
15
|
+
ctx.views.showPopover({ ...rest, state });
|
|
10
16
|
})
|
|
11
|
-
.
|
|
17
|
+
.handleRouted(PopoverChannel.Hide, (ctx) => {
|
|
12
18
|
ctx.views.hidePopover();
|
|
13
19
|
})
|
|
14
|
-
.
|
|
15
|
-
const [
|
|
20
|
+
.handleRouted(PopoverChannel.Apply, async (ctx, _event, ...args) => {
|
|
21
|
+
const [payload] = validate(PopoverChannel.Apply, PopoverApplySchema, args);
|
|
22
|
+
// Hide BEFORE touching the store: a slow or failing apply must never
|
|
23
|
+
// leave a stale popover window on screen.
|
|
16
24
|
ctx.views.hidePopover();
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
ctx.notify.popoverUpdateLaunchConfigs(configs);
|
|
25
|
+
try {
|
|
26
|
+
return await ctx.workspace.applyCompileModeCommand(payload.command);
|
|
27
|
+
}
|
|
28
|
+
catch (err) {
|
|
29
|
+
ctx.notify.compileModesApplyFailed({
|
|
30
|
+
message: err instanceof Error ? err.message : String(err),
|
|
31
|
+
});
|
|
32
|
+
throw err;
|
|
33
|
+
}
|
|
27
34
|
});
|
|
28
35
|
}
|
|
29
36
|
export const popoverModule = {
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { WorkbenchModule } from '../services/module.js';
|
|
2
|
+
import type { ViewManager } from '../services/views/view-manager.js';
|
|
3
|
+
import type { RendererNotifier } from '../services/notifications/renderer-notifier.js';
|
|
4
|
+
import type { Disposable } from '@dimina-kit/electron-deck/main';
|
|
5
|
+
import { type SenderPolicy } from '../utils/ipc-registry.js';
|
|
6
|
+
import { type IpcInput } from '../utils/ipc-context-source.js';
|
|
7
|
+
/** Module-local narrow deps — deliberately NOT `Pick<WorkbenchContext, ...>`
|
|
8
|
+
* (the gate in eslint.config.* is shrink-only; see its message). */
|
|
9
|
+
export interface ProjectCreateIpcDeps {
|
|
10
|
+
views: Pick<ViewManager, 'showProjectCreateDialog' | 'hideProjectCreateDialog'>;
|
|
11
|
+
notify: Pick<RendererNotifier, 'projectCreateSubmitted'>;
|
|
12
|
+
senderPolicy?: SenderPolicy;
|
|
13
|
+
}
|
|
14
|
+
export declare function registerProjectCreateIpc(input: IpcInput<ProjectCreateIpcDeps>): Disposable;
|
|
15
|
+
export declare const projectCreateModule: WorkbenchModule;
|
|
16
|
+
//# sourceMappingURL=project-create.d.ts.map
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { ProjectCreateChannel } from '../../shared/ipc-channels-overlays.js';
|
|
2
|
+
import { ProjectCreateShowSchema, ProjectCreateSubmitSchema } from '../../shared/ipc-schemas.js';
|
|
3
|
+
import { validate } from '../utils/ipc-schema.js';
|
|
4
|
+
import { IpcRegistry } from '../utils/ipc-registry.js';
|
|
5
|
+
import { toIpcContextSource } from '../utils/ipc-context-source.js';
|
|
6
|
+
export function registerProjectCreateIpc(input) {
|
|
7
|
+
return new IpcRegistry(toIpcContextSource(input))
|
|
8
|
+
.onRouted(ProjectCreateChannel.Show, (ctx, _event, ...args) => {
|
|
9
|
+
const [data] = validate(ProjectCreateChannel.Show, ProjectCreateShowSchema, args);
|
|
10
|
+
ctx.views.showProjectCreateDialog(data);
|
|
11
|
+
})
|
|
12
|
+
.onRouted(ProjectCreateChannel.Cancel, (ctx) => {
|
|
13
|
+
ctx.views.hideProjectCreateDialog();
|
|
14
|
+
})
|
|
15
|
+
.onRouted(ProjectCreateChannel.Submit, (ctx, _event, ...args) => {
|
|
16
|
+
const [input] = validate(ProjectCreateChannel.Submit, ProjectCreateSubmitSchema, args);
|
|
17
|
+
ctx.views.hideProjectCreateDialog();
|
|
18
|
+
ctx.notify.projectCreateSubmitted(input);
|
|
19
|
+
});
|
|
20
|
+
// OverlayChannel.Ready is registered once, in tooltip.ts — every overlay
|
|
21
|
+
// renderer (this one included) funnels readiness through that single
|
|
22
|
+
// listener, so a second registration here would double-fire markOverlayReady.
|
|
23
|
+
}
|
|
24
|
+
export const projectCreateModule = {
|
|
25
|
+
setup: (ctx) => registerProjectCreateIpc(ctx),
|
|
26
|
+
};
|
|
27
|
+
//# sourceMappingURL=project-create.js.map
|
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
import type { WorkbenchContext } from '../services/workbench-context.js';
|
|
2
2
|
import type { Disposable } from '@dimina-kit/electron-deck/main';
|
|
3
|
+
import { type IpcInput } from '../utils/ipc-context-source.js';
|
|
4
|
+
/** Dependency/VCS/build directories invisible to every project-tree consumer:
|
|
5
|
+
* IPC `listFiles`, the `/__fs/readdir` bridge (so the workbench mirror and the
|
|
6
|
+
* WAL ledger seed never walk into them), and the `/__fs/watch` change stream.
|
|
7
|
+
* Derived from devkit's `WATCH_IGNORE_DIRS` (the shared never-source core:
|
|
8
|
+
* node_modules + VCS) so the `node_modules` omission that once wedged
|
|
9
|
+
* `watcher.close()` can never drift back on this side, PLUS the editor mirror's
|
|
10
|
+
* own build-output names (`dist`/`build`/tool caches) — which the devkit
|
|
11
|
+
* recompile watcher deliberately does NOT ignore, since app.json may declare
|
|
12
|
+
* pages under such paths. */
|
|
13
|
+
export declare const SKIP_DIRS: ReadonlySet<string>;
|
|
3
14
|
/**
|
|
4
15
|
* Synchronous, string-level guard: reject empty root (ENOACTIVE), NUL bytes
|
|
5
16
|
* and empty paths (EINVAL), and lexical `..` escapes (EACCES) by resolving
|
|
@@ -75,8 +86,31 @@ export declare function writeFile(root: string, p: string, content: string | Buf
|
|
|
75
86
|
* out-of-sandbox metadata. `rel` is a project-root-relative bridge path.
|
|
76
87
|
*/
|
|
77
88
|
export declare function statWithin(root: string, rel: string): Promise<import('node:fs').Stats>;
|
|
78
|
-
/**
|
|
79
|
-
|
|
89
|
+
/**
|
|
90
|
+
* One `readdirWithin` result entry. Directories carry no stat (the caller —
|
|
91
|
+
* the `/__fs/readdir` bridge handler — never needs it: a directory recurses
|
|
92
|
+
* instead of being compared). `size`/`mtimeMs` are omitted (not `null`) when
|
|
93
|
+
* the entry raced a concurrent delete between `readdir` and `stat` — the
|
|
94
|
+
* bridge wire format then drops them too, which the sync engine's watch
|
|
95
|
+
* expansion (@dimina-kit/fs-core/sync/watch-expander) treats as
|
|
96
|
+
* "always changed" rather than risking a false stat match.
|
|
97
|
+
*/
|
|
98
|
+
export interface ReaddirStatEntry {
|
|
99
|
+
name: string;
|
|
100
|
+
isDirectory: boolean;
|
|
101
|
+
size?: number;
|
|
102
|
+
mtimeMs?: number;
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Realpath-contained `fs.readdir` twin (see {@link statWithin}) that also
|
|
106
|
+
* `fs.stat`s every FILE entry (size + mtimeMs) — the disk-side half of the
|
|
107
|
+
* sync engine's stat-diffing (see @dimina-kit/fs-core/sync/watch-expander's module doc):
|
|
108
|
+
* a watch-reported directory is only worth a full content re-read when a
|
|
109
|
+
* file's stat inside it actually moved, and the `/__fs/readdir` bridge is
|
|
110
|
+
* the one HTTP round trip cheap enough to do that check on every watch
|
|
111
|
+
* event without itself re-reading file bytes.
|
|
112
|
+
*/
|
|
113
|
+
export declare function readdirWithin(root: string, rel: string): Promise<ReaddirStatEntry[]>;
|
|
80
114
|
/**
|
|
81
115
|
* Raw-byte read twin of {@link readFileBuffer} taking a project-root-relative
|
|
82
116
|
* bridge path (the COI `/__fs/read` bridge), with the same realpath +
|
|
@@ -115,7 +149,8 @@ declare function listFiles(root: string, rootArg: string): Promise<string[]>;
|
|
|
115
149
|
* Register the project-fs IPC channels. Call once during workbench setup;
|
|
116
150
|
* the returned Disposable removes every channel (park on `ctx.registry`).
|
|
117
151
|
*/
|
|
118
|
-
|
|
152
|
+
type ProjectFsIpcCtx = Pick<WorkbenchContext, 'workspace' | 'senderPolicy'>;
|
|
153
|
+
export declare function registerProjectFsIpc(input: IpcInput<ProjectFsIpcCtx>): Disposable;
|
|
119
154
|
/** Test seams — pure handlers, no Electron needed. */
|
|
120
155
|
export declare const __testing: {
|
|
121
156
|
readFile: typeof readFile;
|
|
@@ -45,13 +45,24 @@ import nodeFs from 'node:fs';
|
|
|
45
45
|
import path from 'node:path';
|
|
46
46
|
import { z } from 'zod';
|
|
47
47
|
import { IpcRegistry } from '../utils/ipc-registry.js';
|
|
48
|
+
import { toIpcContextSource } from '../utils/ipc-context-source.js';
|
|
48
49
|
import { validate } from '../utils/ipc-schema.js';
|
|
49
50
|
import { ProjectFsChannel } from '../../shared/ipc-channels.js';
|
|
51
|
+
import { WATCH_IGNORE_DIRS } from '@dimina-kit/devkit/watch-ignore';
|
|
50
52
|
/** Cap for `listFiles` — huge monorepos would otherwise stall the renderer. */
|
|
51
53
|
const LIST_FILE_LIMIT = 5000;
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
54
|
+
/** Dependency/VCS/build directories invisible to every project-tree consumer:
|
|
55
|
+
* IPC `listFiles`, the `/__fs/readdir` bridge (so the workbench mirror and the
|
|
56
|
+
* WAL ledger seed never walk into them), and the `/__fs/watch` change stream.
|
|
57
|
+
* Derived from devkit's `WATCH_IGNORE_DIRS` (the shared never-source core:
|
|
58
|
+
* node_modules + VCS) so the `node_modules` omission that once wedged
|
|
59
|
+
* `watcher.close()` can never drift back on this side, PLUS the editor mirror's
|
|
60
|
+
* own build-output names (`dist`/`build`/tool caches) — which the devkit
|
|
61
|
+
* recompile watcher deliberately does NOT ignore, since app.json may declare
|
|
62
|
+
* pages under such paths. */
|
|
63
|
+
export const SKIP_DIRS = new Set([
|
|
64
|
+
...WATCH_IGNORE_DIRS,
|
|
65
|
+
'dist', 'build', '.next', '.cache', '.turbo', '.parcel-cache', '.nuxt', '.output', '.vite',
|
|
55
66
|
]);
|
|
56
67
|
const PathArg = z.string().min(1);
|
|
57
68
|
const ReadFileSchema = z.tuple([PathArg]);
|
|
@@ -316,10 +327,31 @@ export async function statWithin(root, rel) {
|
|
|
316
327
|
const safe = await resolveWithinProjectRoot(joinRel(root, rel), root);
|
|
317
328
|
return fs.stat(safe);
|
|
318
329
|
}
|
|
319
|
-
/**
|
|
330
|
+
/**
|
|
331
|
+
* Realpath-contained `fs.readdir` twin (see {@link statWithin}) that also
|
|
332
|
+
* `fs.stat`s every FILE entry (size + mtimeMs) — the disk-side half of the
|
|
333
|
+
* sync engine's stat-diffing (see @dimina-kit/fs-core/sync/watch-expander's module doc):
|
|
334
|
+
* a watch-reported directory is only worth a full content re-read when a
|
|
335
|
+
* file's stat inside it actually moved, and the `/__fs/readdir` bridge is
|
|
336
|
+
* the one HTTP round trip cheap enough to do that check on every watch
|
|
337
|
+
* event without itself re-reading file bytes.
|
|
338
|
+
*/
|
|
320
339
|
export async function readdirWithin(root, rel) {
|
|
321
340
|
const safe = await resolveWithinProjectRoot(joinRel(root, rel), root);
|
|
322
|
-
|
|
341
|
+
const dirents = await fs.readdir(safe, { withFileTypes: true });
|
|
342
|
+
return Promise.all(dirents.map(async (d) => {
|
|
343
|
+
if (d.isDirectory())
|
|
344
|
+
return { name: d.name, isDirectory: true };
|
|
345
|
+
try {
|
|
346
|
+
const st = await fs.stat(path.join(safe, d.name));
|
|
347
|
+
return { name: d.name, isDirectory: false, size: st.size, mtimeMs: st.mtimeMs };
|
|
348
|
+
}
|
|
349
|
+
catch {
|
|
350
|
+
// Entry vanished (or became unreadable) between readdir and stat —
|
|
351
|
+
// report it stat-less; see this function's doc for why that is safe.
|
|
352
|
+
return { name: d.name, isDirectory: false };
|
|
353
|
+
}
|
|
354
|
+
}));
|
|
323
355
|
}
|
|
324
356
|
/**
|
|
325
357
|
* Raw-byte read twin of {@link readFileBuffer} taking a project-root-relative
|
|
@@ -521,44 +553,43 @@ async function listFiles(root, rootArg) {
|
|
|
521
553
|
}
|
|
522
554
|
return out;
|
|
523
555
|
}
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
const
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
.
|
|
533
|
-
.handle(ProjectFsChannel.ReadFile, (_event, ...args) => {
|
|
556
|
+
export function registerProjectFsIpc(input) {
|
|
557
|
+
// Roots are read per call from the CALLING window's workspace: each window
|
|
558
|
+
// has its own open project, so a captured root would sandbox one window's
|
|
559
|
+
// file access against another's project.
|
|
560
|
+
const getRoot = (ctx) => ctx.workspace.getProjectPath();
|
|
561
|
+
const getLastClosedRoot = (ctx) => ctx.workspace.getLastClosedProjectPath();
|
|
562
|
+
return new IpcRegistry(toIpcContextSource(input))
|
|
563
|
+
.handleRouted(ProjectFsChannel.GetRoot, (ctx) => getRoot(ctx))
|
|
564
|
+
.handleRouted(ProjectFsChannel.ReadFile, (ctx, _event, ...args) => {
|
|
534
565
|
const [p] = validate(ProjectFsChannel.ReadFile, ReadFileSchema, args);
|
|
535
566
|
// Reads stay scoped to the CURRENT root only — never widen the read
|
|
536
567
|
// surface to the last-closed project.
|
|
537
|
-
return readFile(getRoot(), p);
|
|
568
|
+
return readFile(getRoot(ctx), p);
|
|
538
569
|
})
|
|
539
|
-
.
|
|
570
|
+
.handleRouted(ProjectFsChannel.WriteFile, (ctx, _event, ...args) => {
|
|
540
571
|
const [p, content] = validate(ProjectFsChannel.WriteFile, WriteFileSchema, args);
|
|
541
572
|
// Accept a write under the current OR the just-closed project root (the
|
|
542
573
|
// latter rescues an in-flight teardown flush after `closeProject`). The
|
|
543
574
|
// selected root then runs the FULL sandbox (realpath containment +
|
|
544
575
|
// ancestor guard + O_NOFOLLOW) inside `writeFile`, so the boundary is
|
|
545
576
|
// never relaxed — only WHICH root is considered.
|
|
546
|
-
const root = pickWriteRoot(p, { current: getRoot(), lastClosed: getLastClosedRoot() });
|
|
577
|
+
const root = pickWriteRoot(p, { current: getRoot(ctx), lastClosed: getLastClosedRoot(ctx) });
|
|
547
578
|
return writeFile(root, p, content);
|
|
548
579
|
})
|
|
549
|
-
.
|
|
580
|
+
.handleSyncRouted(ProjectFsChannel.WriteFileSync, (ctx, _event, ...args) => {
|
|
550
581
|
// Synchronous twin of WriteFile for the editor's beforeunload flush. Same
|
|
551
582
|
// root selection + same sandbox (`writeFileSync` mirrors `writeFile`); the
|
|
552
583
|
// only difference is the blocking transport. Returns `{ ok: true }`; any
|
|
553
584
|
// throw is converted to `{ ok: false, code, message }` by `handleSync`.
|
|
554
585
|
const [p, content] = validate(ProjectFsChannel.WriteFileSync, WriteFileSchema, args);
|
|
555
|
-
const root = pickWriteRoot(p, { current: getRoot(), lastClosed: getLastClosedRoot() });
|
|
586
|
+
const root = pickWriteRoot(p, { current: getRoot(ctx), lastClosed: getLastClosedRoot(ctx) });
|
|
556
587
|
writeFileSync(root, p, content);
|
|
557
588
|
return { ok: true };
|
|
558
589
|
})
|
|
559
|
-
.
|
|
590
|
+
.handleRouted(ProjectFsChannel.ListFiles, (ctx, _event, ...args) => {
|
|
560
591
|
const [p] = validate(ProjectFsChannel.ListFiles, ListFilesSchema, args);
|
|
561
|
-
return listFiles(getRoot(), p);
|
|
592
|
+
return listFiles(getRoot(ctx), p);
|
|
562
593
|
});
|
|
563
594
|
}
|
|
564
595
|
/** Test seams — pure handlers, no Electron needed. */
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { WorkbenchContext } from '../services/workbench-context.js';
|
|
2
2
|
import type { WorkbenchModule } from '../services/module.js';
|
|
3
3
|
import type { Disposable } from '@dimina-kit/electron-deck/main';
|
|
4
|
-
|
|
5
|
-
export
|
|
4
|
+
import { type IpcInput } from '../utils/ipc-context-source.js';
|
|
5
|
+
export type ProjectsIpcCtx = Pick<WorkbenchContext, 'workspace' | 'windows' | 'senderPolicy' | 'projectsProvider' | 'projectTemplates' | 'customCreateProjectDialog' | 'customEditProjectDialog' | 'notify' | 'views'>;
|
|
6
|
+
export declare function registerProjectsIpc(input: IpcInput<ProjectsIpcCtx>): Disposable;
|
|
6
7
|
export declare const projectsModule: WorkbenchModule;
|
|
7
|
-
export {};
|
|
8
8
|
//# sourceMappingURL=projects.d.ts.map
|
|
@@ -1,25 +1,26 @@
|
|
|
1
1
|
import { app, dialog } from 'electron';
|
|
2
2
|
import path from 'path';
|
|
3
3
|
import { ProjectsChannel, DialogChannel } from '../../shared/ipc-channels.js';
|
|
4
|
-
import { ProjectsAddSchema, ProjectsRemoveSchema, } from '../../shared/ipc-schemas.js';
|
|
4
|
+
import { ProjectsAddSchema, ProjectsOpenEditDialogSchema, ProjectsRemoveSchema, ProjectsUpdateSchema, } from '../../shared/ipc-schemas.js';
|
|
5
5
|
import { validate } from '../utils/ipc-schema.js';
|
|
6
6
|
import { IpcRegistry } from '../utils/ipc-registry.js';
|
|
7
|
+
import { toIpcContextSource } from '../utils/ipc-context-source.js';
|
|
7
8
|
import { sanitizeTemplates } from '../services/projects/templates.js';
|
|
8
9
|
import { createProject } from '../services/projects/create-project-service.js';
|
|
9
10
|
import { loadWorkbenchSettings, saveWorkbenchSettings, } from '../services/settings/index.js';
|
|
10
|
-
export function registerProjectsIpc(
|
|
11
|
-
return new IpcRegistry(
|
|
12
|
-
.
|
|
11
|
+
export function registerProjectsIpc(input) {
|
|
12
|
+
return new IpcRegistry(toIpcContextSource(input))
|
|
13
|
+
.handleRouted(ProjectsChannel.List, (ctx) => {
|
|
13
14
|
return ctx.workspace.listProjects();
|
|
14
15
|
})
|
|
15
|
-
.
|
|
16
|
+
.handleRouted(DialogChannel.OpenDirectory, async (ctx) => {
|
|
16
17
|
const result = await dialog.showOpenDialog(ctx.windows.mainWindow, {
|
|
17
18
|
properties: ['openDirectory'],
|
|
18
19
|
title: '选择小程序项目目录',
|
|
19
20
|
});
|
|
20
21
|
return result.canceled ? null : result.filePaths[0];
|
|
21
22
|
})
|
|
22
|
-
.
|
|
23
|
+
.handleRouted(ProjectsChannel.Add, async (ctx, _event, ...args) => {
|
|
23
24
|
const [dirPath] = validate(ProjectsChannel.Add, ProjectsAddSchema, args);
|
|
24
25
|
const dirError = await ctx.workspace.validateProjectDir(dirPath);
|
|
25
26
|
if (dirError) {
|
|
@@ -43,20 +44,35 @@ export function registerProjectsIpc(ctx) {
|
|
|
43
44
|
buttons: ['确定'],
|
|
44
45
|
});
|
|
45
46
|
}
|
|
47
|
+
// Imported project's own detected type wins over whatever category the
|
|
48
|
+
// sidebar happened to be showing — the list would otherwise stay on
|
|
49
|
+
// the old category and hide the project that was just added. Drives
|
|
50
|
+
// both halves: the main-window list filter (existing notify channel,
|
|
51
|
+
// same one the sidebar's own click uses) and the sidebar rail's own
|
|
52
|
+
// highlight (a push down through its narrow bridge — the rail has no
|
|
53
|
+
// other way to learn about a selection that didn't originate from its
|
|
54
|
+
// own click).
|
|
55
|
+
const importedCategory = project.type ?? 'miniprogram';
|
|
56
|
+
ctx.notify.hostSidebarCategorySelected(importedCategory);
|
|
57
|
+
ctx.views.hostSidebar.send('project-category-forced', { category: importedCategory });
|
|
46
58
|
return project;
|
|
47
59
|
})
|
|
48
|
-
.
|
|
60
|
+
.handleRouted(ProjectsChannel.Remove, (ctx, _event, ...args) => {
|
|
49
61
|
const [dirPath] = validate(ProjectsChannel.Remove, ProjectsRemoveSchema, args);
|
|
50
62
|
return ctx.workspace.removeProject(dirPath);
|
|
63
|
+
})
|
|
64
|
+
.handleRouted(ProjectsChannel.Update, (ctx, _event, ...args) => {
|
|
65
|
+
const [dirPath, patch] = validate(ProjectsChannel.Update, ProjectsUpdateSchema, args);
|
|
66
|
+
return ctx.workspace.updateProject(dirPath, patch);
|
|
51
67
|
})
|
|
52
68
|
// ── template catalog + create flow ──
|
|
53
|
-
.
|
|
69
|
+
.handleRouted(ProjectsChannel.ListTemplates, (ctx) => {
|
|
54
70
|
// Sanitize at the IPC boundary: `generate` is a function and the
|
|
55
71
|
// structured-clone algorithm Electron uses for invoke would otherwise
|
|
56
72
|
// throw "could not be cloned" before the renderer ever sees it.
|
|
57
73
|
return sanitizeTemplates(ctx.projectTemplates ?? []);
|
|
58
74
|
})
|
|
59
|
-
.
|
|
75
|
+
.handleRouted(ProjectsChannel.OpenCreateDialog, async (ctx) => {
|
|
60
76
|
if (!ctx.customCreateProjectDialog)
|
|
61
77
|
return null;
|
|
62
78
|
const sanitized = sanitizeTemplates(ctx.projectTemplates ?? []);
|
|
@@ -65,7 +81,27 @@ export function registerProjectsIpc(ctx) {
|
|
|
65
81
|
templates: sanitized,
|
|
66
82
|
});
|
|
67
83
|
})
|
|
68
|
-
.
|
|
84
|
+
.handleRouted(ProjectsChannel.OpenEditDialog, async (ctx, _event, ...args) => {
|
|
85
|
+
if (!ctx.customEditProjectDialog)
|
|
86
|
+
return null;
|
|
87
|
+
const [dirPath] = validate(ProjectsChannel.OpenEditDialog, ProjectsOpenEditDialogSchema, args);
|
|
88
|
+
// Read from the workspace, not the renderer's args — the host sees
|
|
89
|
+
// devtools' own authoritative record, never a client-supplied one.
|
|
90
|
+
const project = (await ctx.workspace.listProjects()).find((p) => p.path === dirPath);
|
|
91
|
+
if (!project)
|
|
92
|
+
throw new Error(`No such project: ${dirPath}`);
|
|
93
|
+
const result = await ctx.customEditProjectDialog({
|
|
94
|
+
parentWindow: ctx.windows.mainWindow,
|
|
95
|
+
project,
|
|
96
|
+
});
|
|
97
|
+
// Wrapped in `{ result }` so `null` on the wire means ONLY "no hook
|
|
98
|
+
// configured" (renderer falls back to the built-in dialog). A hook that
|
|
99
|
+
// ran and was cancelled resolves `result: null`, which the renderer
|
|
100
|
+
// must treat as "do nothing" — otherwise a cancelled host dialog would
|
|
101
|
+
// fall through into the built-in one right behind it.
|
|
102
|
+
return { result };
|
|
103
|
+
})
|
|
104
|
+
.handleRouted(ProjectsChannel.Create, async (ctx, _event, ...args) => {
|
|
69
105
|
// We deliberately don't run this through zod yet — the input shape is
|
|
70
106
|
// wide (any template can stash arbitrary `extra` fields) and the
|
|
71
107
|
// service does its own per-field validation. Bound size to keep this
|
|
@@ -110,7 +146,7 @@ export function registerProjectsIpc(ctx) {
|
|
|
110
146
|
}
|
|
111
147
|
return project;
|
|
112
148
|
})
|
|
113
|
-
.
|
|
149
|
+
.handleRouted(ProjectsChannel.GetCreateDefaults, () => {
|
|
114
150
|
// Fallback chain: persisted last parent → user's Documents → home.
|
|
115
151
|
// Documents covers the common "我把项目都放在 Documents/ 下" case for
|
|
116
152
|
// first-time users on macOS; home is just a safe final fallback.
|
|
@@ -1,41 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
* Session-scoped listener bookkeeping. An app session hangs lifecycle hooks on
|
|
3
|
-
* emitters it does NOT own — the shared simulator WebContentsView, a pooled
|
|
4
|
-
* service-host window — and those emitters outlive the session (one simulator
|
|
5
|
-
* wc soft-reloads through many sessions). Every such hook is registered
|
|
6
|
-
* through this bag so the session's single teardown chokepoint can detach them
|
|
7
|
-
* all with one `dispose()`; a hook left behind survives as a dead listener on
|
|
8
|
-
* the shared emitter, growing by one per soft reload until Node's MaxListeners
|
|
9
|
-
* warning fires.
|
|
10
|
-
*/
|
|
11
|
-
type Listener = (...args: unknown[]) => void;
|
|
12
|
-
/**
|
|
13
|
-
* Structural surface of the Node/Electron emitters the bag manages.
|
|
14
|
-
* `removeListener(event, fn)` also detaches a `once(event, fn)` registration:
|
|
15
|
-
* Node's once wrapper keeps a `.listener` back-reference to `fn` and
|
|
16
|
-
* removeListener matches through it. `isDestroyed` covers Electron objects
|
|
17
|
-
* (WebContents / BrowserWindow) whose methods throw once destroyed.
|
|
18
|
-
*/
|
|
19
|
-
export interface BagEmitter {
|
|
20
|
-
on(event: string, listener: Listener): unknown;
|
|
21
|
-
once(event: string, listener: Listener): unknown;
|
|
22
|
-
removeListener(event: string, listener: Listener): unknown;
|
|
23
|
-
isDestroyed?(): boolean;
|
|
24
|
-
}
|
|
25
|
-
export interface SessionListenerBag {
|
|
26
|
-
/** Attach `fn` via `emitter.on` and track it for dispose. No-op after dispose. */
|
|
27
|
-
on(emitter: BagEmitter, event: string, fn: Listener): void;
|
|
28
|
-
/** Attach `fn` via `emitter.once` and track it for dispose. No-op after dispose. */
|
|
29
|
-
once(emitter: BagEmitter, event: string, fn: Listener): void;
|
|
30
|
-
/**
|
|
31
|
-
* Detach every tracked listener that may still be attached. Emitters that
|
|
32
|
-
* report `isDestroyed()` are skipped — their listeners died with them, and
|
|
33
|
-
* touching a destroyed Electron object throws. Removing a `once` that
|
|
34
|
-
* already fired is a no-op, so dispose is safe to call FROM one of the
|
|
35
|
-
* bag's own hooks (teardown triggered by the hook itself). Idempotent.
|
|
36
|
-
*/
|
|
37
|
-
dispose(): void;
|
|
38
|
-
}
|
|
39
|
-
export declare function createSessionListenerBag(): SessionListenerBag;
|
|
40
|
-
export {};
|
|
1
|
+
export * from '@dimina-kit/electron-runtime/main/session-listener-bag';
|
|
41
2
|
//# sourceMappingURL=session-listener-bag.d.ts.map
|