@jamiexiongr/panda-hub 0.1.21 → 0.1.22

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.
@@ -15,7 +15,7 @@ import { fileURLToPath as fileURLToPath2 } from "url";
15
15
  // release/panda-hub/package.json
16
16
  var package_default = {
17
17
  name: "@jamiexiongr/panda-hub",
18
- version: "0.1.21",
18
+ version: "0.1.22",
19
19
  type: "module",
20
20
  private: false,
21
21
  description: "Panda hub runtime",
@@ -150,6 +150,15 @@ var waitForWindowsServiceState = async (input, desiredState, timeoutMs = WINDOWS
150
150
  }
151
151
  return latest;
152
152
  };
153
+ var waitForWindowsServicePresence = async (input, timeoutMs = WINDOWS_SERVICE_TIMEOUT_MS) => {
154
+ const startedAt = Date.now();
155
+ let latest = queryWindowsServiceStatus(input);
156
+ while (!latest.exists && Date.now() - startedAt < timeoutMs) {
157
+ await wait(750);
158
+ latest = queryWindowsServiceStatus(input);
159
+ }
160
+ return latest;
161
+ };
153
162
  var startWindowsService = async (input) => {
154
163
  ensureWindows();
155
164
  const current = queryWindowsServiceStatus(input);
@@ -275,7 +284,11 @@ var installOrUpdateWindowsService = async (definition, options) => {
275
284
  }
276
285
  const service = createNodeWindowsService(definition);
277
286
  await waitForNodeWindowsAction(service, "install");
278
- runSc(["config", quoteForSc(reference.controllerName), "start=", "auto"]);
287
+ const installed = await waitForWindowsServicePresence(definition);
288
+ if (!installed.exists) {
289
+ throw new Error(`Windows \u670D\u52A1 ${reference.displayName} \u6CE8\u518C\u540E\u4ECD\u4E0D\u53EF\u89C1\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002`);
290
+ }
291
+ runSc(["config", quoteForSc(installed.controllerName), "start=", "auto"]);
279
292
  let started = false;
280
293
  let startError = null;
281
294
  if (options?.start !== false) {
package/dist/cli.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  manageJamiexiongrHubService,
3
3
  startJamiexiongrHub
4
- } from "./chunk-YKNCRHVV.mjs";
4
+ } from "./chunk-VKOJD7PG.mjs";
5
5
  import {
6
6
  resolveTailscalePublicationMode
7
7
  } from "./chunk-SPTBBMUL.mjs";
package/dist/index.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  manageJamiexiongrHubService,
3
3
  startJamiexiongrHub
4
- } from "./chunk-YKNCRHVV.mjs";
4
+ } from "./chunk-VKOJD7PG.mjs";
5
5
  import "./chunk-SPTBBMUL.mjs";
6
6
  import "./chunk-AEQMWH7D.mjs";
7
7
  export {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jamiexiongr/panda-hub",
3
- "version": "0.1.21",
3
+ "version": "0.1.22",
4
4
  "type": "module",
5
5
  "private": false,
6
6
  "description": "Panda hub runtime",