@dimina-kit/devtools 0.4.0-dev.20260616024534 → 0.4.0-dev.20260616085026

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.
@@ -885,15 +885,13 @@ function createMainWindow(opts) {
885
885
  }
886
886
  });
887
887
  mainWindow.once("ready-to-show", () => {
888
- if (process.env.NODE_ENV === "test") {
889
- mainWindow.showInactive();
890
- } else {
891
- if (opts.autoShow !== false) {
892
- mainWindow.show();
893
- }
894
- if (!app3.isPackaged && process.env.DIMINA_DEVTOOLS_MAIN_INSPECTOR === "1") {
895
- mainWindow.webContents.openDevTools({ mode: "detach" });
896
- }
888
+ const isTest = process.env.NODE_ENV === "test";
889
+ if (opts.autoShow !== false) {
890
+ if (isTest) mainWindow.showInactive();
891
+ else mainWindow.show();
892
+ }
893
+ if (!isTest && !app3.isPackaged && process.env.DIMINA_DEVTOOLS_MAIN_INSPECTOR === "1") {
894
+ mainWindow.webContents.openDevTools({ mode: "detach" });
897
895
  }
898
896
  });
899
897
  const rendererDir2 = path5.dirname(opts.indexHtml);
@@ -2950,7 +2948,9 @@ function createWorkspaceService(ctx) {
2950
2948
  try {
2951
2949
  await ctx.onBeforeOpenProject(projectPath);
2952
2950
  } catch (err) {
2953
- return { success: false, error: err instanceof Error ? err.message : String(err) };
2951
+ const error = err instanceof Error ? err.message : String(err);
2952
+ sendStatus("error", error);
2953
+ return { success: false, error };
2954
2954
  }
2955
2955
  }
2956
2956
  clearSimulatorServicewechatReferer();
@@ -9151,9 +9151,11 @@ function createDevtoolsBackend(config = {}) {
9151
9151
  // NOTE: `ownsWindows` is NOT structurally required — the framework's
9152
9152
  // `mainWindowWebPreferences()` + `onMainWindowCreated()` hooks can supply both,
9153
9153
  // and the project close→back lifecycle maps onto the Window facade's
9154
- // `onClose`/`newSession` (probe-validated). Retained for now; migrating to
9155
- // `runtime.windows.main` is the documented next step. (The `persist:simulator`
9156
- // partition is a fixed session used by child WCVs, not main-window state.)
9154
+ // `onClose`/`newSession` (probe-validated). It is RETAINED BY DECISION, not
9155
+ // inertia: migrating to `runtime.windows.main` buys no user value at high
9156
+ // regression cost (see docs/deck-adoption-decision.md, F1). (The
9157
+ // `persist:simulator` partition is a fixed session used by child WCVs, not
9158
+ // main-window state.)
9157
9159
  ownsWindows: true,
9158
9160
  // Pre-ready: app name / CDP port / CSP / privileged scheme — must run before
9159
9161
  // the framework awaits app.whenReady().
@@ -12,6 +12,11 @@ import type { WorkbenchAppConfig } from '../../shared/types.js';
12
12
  * backend is present), so `assemble` ignores the framework `runtime` and builds
13
13
  * the real devtools main window itself. Trust/frame unification and surfacing
14
14
  * the runtime facade are deferred (see framework-extraction-v2.md §7).
15
+ *
16
+ * NOT migrating onto deck's high-level host API (Window facade / runtime.view /
17
+ * DeckSession / grants) is a DELIBERATE, reviewed decision — not a backlog item.
18
+ * The ROI matrix (every candidate NO-GO) + revisit conditions live in
19
+ * docs/deck-adoption-decision.md. Read it before re-proposing such a migration.
15
20
  */
16
21
  export declare function createDevtoolsBackend(config?: WorkbenchAppConfig): RuntimeBackend;
17
22
  //# sourceMappingURL=devtools-backend.d.ts.map
@@ -12,6 +12,11 @@ import { registerAppLifecycle } from '../app/lifecycle.js';
12
12
  * backend is present), so `assemble` ignores the framework `runtime` and builds
13
13
  * the real devtools main window itself. Trust/frame unification and surfacing
14
14
  * the runtime facade are deferred (see framework-extraction-v2.md §7).
15
+ *
16
+ * NOT migrating onto deck's high-level host API (Window facade / runtime.view /
17
+ * DeckSession / grants) is a DELIBERATE, reviewed decision — not a backlog item.
18
+ * The ROI matrix (every candidate NO-GO) + revisit conditions live in
19
+ * docs/deck-adoption-decision.md. Read it before re-proposing such a migration.
15
20
  */
16
21
  export function createDevtoolsBackend(config = {}) {
17
22
  // Hoisted so `onShutdown` can reach the assembled context (assigned by `assemble`).
@@ -23,9 +28,11 @@ export function createDevtoolsBackend(config = {}) {
23
28
  // NOTE: `ownsWindows` is NOT structurally required — the framework's
24
29
  // `mainWindowWebPreferences()` + `onMainWindowCreated()` hooks can supply both,
25
30
  // and the project close→back lifecycle maps onto the Window facade's
26
- // `onClose`/`newSession` (probe-validated). Retained for now; migrating to
27
- // `runtime.windows.main` is the documented next step. (The `persist:simulator`
28
- // partition is a fixed session used by child WCVs, not main-window state.)
31
+ // `onClose`/`newSession` (probe-validated). It is RETAINED BY DECISION, not
32
+ // inertia: migrating to `runtime.windows.main` buys no user value at high
33
+ // regression cost (see docs/deck-adoption-decision.md, F1). (The
34
+ // `persist:simulator` partition is a fixed session used by child WCVs, not
35
+ // main-window state.)
29
36
  ownsWindows: true,
30
37
  // Pre-ready: app name / CDP port / CSP / privileged scheme — must run before
31
38
  // the framework awaits app.whenReady().
@@ -90,7 +90,15 @@ export function createWorkspaceService(ctx) {
90
90
  await ctx.onBeforeOpenProject(projectPath);
91
91
  }
92
92
  catch (err) {
93
- return { success: false, error: err instanceof Error ? err.message : String(err) };
93
+ // Surface the veto to the status bar symmetric with the
94
+ // validateProjectDir rejection below (which already emits an error
95
+ // status). The framework caught the error, so it owns the minimal
96
+ // user-visible feedback; a host gate must not have to thread
97
+ // `notify` through a singleton just to report why the open was
98
+ // denied. The host can still layer richer UX (e.g. a dialog).
99
+ const error = err instanceof Error ? err.message : String(err);
100
+ sendStatus('error', error);
101
+ return { success: false, error };
94
102
  }
95
103
  }
96
104
  clearSimulatorServicewechatReferer();
@@ -22,21 +22,24 @@ export function createMainWindow(opts) {
22
22
  },
23
23
  });
24
24
  mainWindow.once('ready-to-show', () => {
25
- if (process.env.NODE_ENV === 'test') {
26
- mainWindow.showInactive();
27
- }
28
- else {
29
- // A login-gating host opts out via `autoShow: false` and shows the
30
- // window itself once auth passes don't flash an un-authed window.
31
- if (opts.autoShow !== false) {
25
+ const isTest = process.env.NODE_ENV === 'test';
26
+ // Visibility is governed by `autoShow` in BOTH envs. A login-gating host
27
+ // opts out via `autoShow: false` and reveals the window itself once auth
28
+ // passes — don't flash an un-authed window. The env only chooses HOW to
29
+ // show: test uses showInactive() so e2e windows don't steal focus, prod
30
+ // uses show(). The framework must never force-show when the host opted
31
+ // out, in test env either (that would fight the host's own reveal handler).
32
+ if (opts.autoShow !== false) {
33
+ if (isTest)
34
+ mainWindow.showInactive();
35
+ else
32
36
  mainWindow.show();
33
- }
34
- // Don't auto-open a detached DevTools for the devtools UI shell itself —
35
- // it's noise for normal use (the mini-app's Console lives in the embedded
36
- // right-panel DevTools, not here). Opt in via env for debugging the shell.
37
- if (!app.isPackaged && process.env.DIMINA_DEVTOOLS_MAIN_INSPECTOR === '1') {
38
- mainWindow.webContents.openDevTools({ mode: 'detach' });
39
- }
37
+ }
38
+ // Don't auto-open a detached DevTools for the devtools UI shell itself —
39
+ // it's noise for normal use (the mini-app's Console lives in the embedded
40
+ // right-panel DevTools, not here). Opt in via env for debugging the shell.
41
+ if (!isTest && !app.isPackaged && process.env.DIMINA_DEVTOOLS_MAIN_INSPECTOR === '1') {
42
+ mainWindow.webContents.openDevTools({ mode: 'detach' });
40
43
  }
41
44
  });
42
45
  const rendererDir = path.dirname(opts.indexHtml);