@hachej/boring-ui-plugin-cli 0.1.34 → 0.1.35

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/bin.js CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  runBoringUiPluginCli
4
- } from "./chunk-HY4ZELTX.js";
4
+ } from "./chunk-GHTVKPQG.js";
5
5
  import "./chunk-6FD653KO.js";
6
6
 
7
7
  // src/bin.ts
@@ -606,6 +606,7 @@ function parseCreateArgs(positionals) {
606
606
  // src/server/testPlugin.ts
607
607
  var DEFAULT_TIMEOUT_MS = 1e4;
608
608
  var POLL_MS = 500;
609
+ var NO_BROWSER_GRACE_MS = 1500;
609
610
  function inferSelfTestUrl(explicitUrl, env = process.env) {
610
611
  const envUrl = env.BORING_UI_SELF_TEST_URL ?? env.BORING_UI_URL ?? env.BORING_WORKSPACE_URL;
611
612
  const portUrl = env.PORT ? `http://127.0.0.1:${env.PORT}` : void 0;
@@ -779,22 +780,25 @@ async function runPluginSelfTest(options) {
779
780
  let lastState = "missing";
780
781
  let lastStatus;
781
782
  let openErrors = [];
783
+ let openedAtLeastOnce = false;
782
784
  while (Date.now() - start <= timeoutMs) {
785
+ const now = Date.now();
786
+ if (!openedAtLeastOnce || now - lastOpenAt >= POLL_MS) {
787
+ openErrors = await openPanel({ baseUrl, headers, pluginId, panelId, panelInstanceId });
788
+ lastOpenAt = Date.now();
789
+ openedAtLeastOnce = openErrors.length === 0 || openedAtLeastOnce;
790
+ }
783
791
  const status = await pollPaneStatus({ baseUrl, headers, workspaceId, pluginId, panelId, panelInstanceId, minReportedAtMs: start });
784
792
  lastState = status.state;
785
793
  lastStatus = status.status;
786
- if (status.state === "no-browser-connected") {
787
- return buildResult({ pluginId, workspaceId, revision, reloadErrors, panelId, panelInstanceId, state: "no-browser-connected", status: lastStatus });
788
- }
789
794
  if (status.state === "ready" || status.state === "error") break;
790
- if (Date.now() - lastOpenAt >= POLL_MS) {
791
- openErrors = await openPanel({ baseUrl, headers, pluginId, panelId, panelInstanceId });
792
- lastOpenAt = Date.now();
795
+ if (status.state === "no-browser-connected" && openedAtLeastOnce && Date.now() - lastOpenAt >= NO_BROWSER_GRACE_MS) {
796
+ return buildResult({ pluginId, workspaceId, revision, reloadErrors, panelId, panelInstanceId, state: "no-browser-connected", status: lastStatus });
793
797
  }
794
798
  await new Promise((resolve5) => setTimeout(resolve5, POLL_MS));
795
799
  }
796
800
  if (openErrors.length > 0) reloadErrors.push(...openErrors);
797
- const finalState = lastState === "ready" || lastState === "error" ? lastState : "timeout";
801
+ const finalState = lastState === "ready" || lastState === "error" ? lastState : lastState === "no-browser-connected" && openedAtLeastOnce ? "no-browser-connected" : "timeout";
798
802
  return buildResult({ pluginId, workspaceId, revision, reloadErrors, panelId, panelInstanceId, state: finalState, status: lastStatus });
799
803
  }
800
804
  function buildResult(args) {
package/dist/index.js CHANGED
@@ -8,7 +8,7 @@ import {
8
8
  runPluginSelfTest,
9
9
  scaffoldPlugin,
10
10
  verifyPlugin
11
- } from "./chunk-HY4ZELTX.js";
11
+ } from "./chunk-GHTVKPQG.js";
12
12
  import {
13
13
  formatPluginSourceList,
14
14
  installPluginSource,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hachej/boring-ui-plugin-cli",
3
- "version": "0.1.34",
3
+ "version": "0.1.35",
4
4
  "description": "Slim boring-ui plugin authoring CLI for workspace runtimes.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -26,7 +26,7 @@
26
26
  "@types/node": "^22.15.3",
27
27
  "tsup": "^8.4.0",
28
28
  "typescript": "^5.8.3",
29
- "vitest": "^3.1.3"
29
+ "vitest": "^3.2.6"
30
30
  },
31
31
  "repository": {
32
32
  "type": "git",