qunitx-cli 0.23.2 → 0.23.3

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.
Files changed (2) hide show
  1. package/dist/cli.js +9 -6
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -374,7 +374,7 @@ var init_package = __esm({
374
374
  package_default = {
375
375
  name: "qunitx-cli",
376
376
  type: "module",
377
- version: "0.23.2",
377
+ version: "0.23.3",
378
378
  description: "Browser runner for QUnitx: run your qunitx tests in google-chrome",
379
379
  author: "Izel Nakri",
380
380
  license: "MIT",
@@ -4681,7 +4681,11 @@ __export(daemon_exports, {
4681
4681
  import { spawn as spawn3 } from "node:child_process";
4682
4682
  import fs16, { existsSync as existsSync3 } from "node:fs";
4683
4683
  import path13 from "node:path";
4684
- import { fileURLToPath as fileURLToPath2 } from "node:url";
4684
+ async function buildDaemonSpawn() {
4685
+ const sea = await import("node:sea").catch(() => null);
4686
+ if (sea?.isSea()) return { bin: process.execPath, args: ["daemon", "_serve"] };
4687
+ return { bin: process.execPath, args: [process.argv[1], "daemon", "_serve"] };
4688
+ }
4685
4689
  function runDaemonCommand() {
4686
4690
  const sub = process.argv[3];
4687
4691
  if (sub === "_serve") return runServeMode();
@@ -4719,7 +4723,8 @@ function waitForFile(filePath, timeoutMs) {
4719
4723
  async function spawnAndWaitForDaemon() {
4720
4724
  const parsed = parseDaemonIdleTimeout(process.env.QUNITX_DAEMON_IDLE_TIMEOUT);
4721
4725
  if (parsed.warning) process.stderr.write(parsed.warning + "\n");
4722
- spawn3(process.execPath, [CLI_ENTRY, "daemon", "_serve"], {
4726
+ const { bin, args } = await buildDaemonSpawn();
4727
+ spawn3(bin, args, {
4723
4728
  detached: true,
4724
4729
  stdio: "ignore",
4725
4730
  env: { ...process.env, QUNITX_DAEMON_CWD: process.cwd() }
@@ -4772,7 +4777,7 @@ async function statusDaemon() {
4772
4777
  );
4773
4778
  return 0;
4774
4779
  }
4775
- var SPAWN_TIMEOUT_MS, highlight2, color2, USAGE, __filename, CLI_ENTRY;
4780
+ var SPAWN_TIMEOUT_MS, highlight2, color2, USAGE;
4776
4781
  var init_daemon = __esm({
4777
4782
  "lib/commands/daemon/index.ts"() {
4778
4783
  init_color();
@@ -4798,8 +4803,6 @@ ${color2("QUNITX_DAEMON_LOG=<path>")} : redirect the daemon's stdout + stder
4798
4803
 
4799
4804
  ${highlight2("Tip:")} set ${color2("QUNITX_DAEMON=1")} to auto-spawn the daemon on the first qunitx run; ${color2("$ qunitx --help")} for top-level options.
4800
4805
  `;
4801
- __filename = fileURLToPath2(import.meta.url);
4802
- CLI_ENTRY = path13.resolve(path13.dirname(__filename), "..", "..", "..", "cli.ts");
4803
4806
  }
4804
4807
  });
4805
4808
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "qunitx-cli",
3
3
  "type": "module",
4
- "version": "0.23.2",
4
+ "version": "0.23.3",
5
5
  "description": "Browser runner for QUnitx: run your qunitx tests in google-chrome",
6
6
  "author": "Izel Nakri",
7
7
  "license": "MIT",