@qwik.dev/core 2.0.0-beta.11 → 2.0.0-beta.14

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 (79) hide show
  1. package/bindings/qwik.darwin-arm64.node +0 -0
  2. package/bindings/qwik.darwin-x64.node +0 -0
  3. package/bindings/qwik.linux-x64-gnu.node +0 -0
  4. package/bindings/qwik.win32-x64-msvc.node +0 -0
  5. package/bindings/qwik_wasm_bg.wasm +0 -0
  6. package/dist/backpatch/index.mjs +2 -2
  7. package/dist/backpatch/package.json +1 -1
  8. package/dist/backpatch-executor.debug.js +7 -2
  9. package/dist/backpatch-executor.js +1 -1
  10. package/dist/build/package.json +1 -1
  11. package/dist/{cli.cjs → cli.mjs} +444 -2624
  12. package/dist/core-internal.d.ts +219 -123
  13. package/dist/core.min.mjs +1 -1
  14. package/dist/core.mjs +9416 -8957
  15. package/dist/core.mjs.map +1 -1
  16. package/dist/core.prod.mjs +5225 -4890
  17. package/dist/loader/index.mjs +2 -2
  18. package/dist/loader/package.json +1 -1
  19. package/dist/optimizer.d.ts +3 -0
  20. package/dist/optimizer.mjs +1354 -1341
  21. package/dist/qwikloader.debug.js +14 -8
  22. package/dist/qwikloader.js +1 -1
  23. package/dist/server.d.ts +20 -12
  24. package/dist/server.mjs +466 -381
  25. package/dist/starters/adapters/aws-lambda/adapters/aws-lambda/{vite.config.mts → vite.config.ts} +1 -1
  26. package/dist/starters/adapters/aws-lambda/package.json +3 -2
  27. package/dist/starters/adapters/azure-swa/adapters/azure-swa/{vite.config.mts → vite.config.ts} +1 -1
  28. package/dist/starters/adapters/azure-swa/package.json +3 -2
  29. package/dist/starters/adapters/bun/adapters/bun/{vite.config.mts → vite.config.ts} +1 -1
  30. package/dist/starters/adapters/bun/package.json +3 -2
  31. package/dist/starters/adapters/cloud-run/adapters/cloud-run/{vite.config.mts → vite.config.ts} +1 -1
  32. package/dist/starters/adapters/cloud-run/package.json +3 -2
  33. package/dist/starters/adapters/cloudflare-pages/adapters/cloudflare-pages/{vite.config.mts → vite.config.ts} +1 -1
  34. package/dist/starters/adapters/cloudflare-pages/package.json +3 -2
  35. package/dist/starters/adapters/deno/adapters/deno/{vite.config.mts → vite.config.ts} +1 -1
  36. package/dist/starters/adapters/deno/package.json +3 -2
  37. package/dist/starters/adapters/express/adapters/express/{vite.config.mts → vite.config.ts} +1 -1
  38. package/dist/starters/adapters/express/package.json +3 -2
  39. package/dist/starters/adapters/fastify/adapters/fastify/{vite.config.mts → vite.config.ts} +1 -1
  40. package/dist/starters/adapters/fastify/package.json +3 -2
  41. package/dist/starters/adapters/firebase/adapters/firebase/{vite.config.mts → vite.config.ts} +1 -1
  42. package/dist/starters/adapters/firebase/package.json +3 -2
  43. package/dist/starters/adapters/netlify-edge/adapters/netlify-edge/{vite.config.mts → vite.config.ts} +1 -1
  44. package/dist/starters/adapters/netlify-edge/package.json +3 -2
  45. package/dist/starters/adapters/node-server/adapters/node-server/{vite.config.mts → vite.config.ts} +1 -1
  46. package/dist/starters/adapters/node-server/package.json +3 -2
  47. package/dist/starters/adapters/ssg/adapters/ssg/{vite.config.mts → vite.config.ts} +1 -1
  48. package/dist/starters/adapters/ssg/package.json +4 -3
  49. package/dist/starters/adapters/vercel-edge/README.md +2 -2
  50. package/dist/starters/adapters/vercel-edge/adapters/vercel-edge/{vite.config.mts → vite.config.ts} +1 -1
  51. package/dist/starters/adapters/vercel-edge/package.json +3 -2
  52. package/dist/starters/features/csr/package.json +1 -1
  53. package/dist/starters/features/storybook/.storybook/tsconfig.json +0 -1
  54. package/dist/starters/features/styled-vanilla-extract/package.json +2 -1
  55. package/dist/testing/index.d.ts +75 -27
  56. package/dist/testing/index.mjs +2809 -2178
  57. package/dist/testing/package.json +1 -1
  58. package/handlers.mjs +1 -1
  59. package/package.json +16 -50
  60. package/public.d.ts +1 -0
  61. package/{qwik-cli.cjs → qwik-cli.mjs} +1 -1
  62. package/dist/backpatch/index.cjs +0 -6
  63. package/dist/build/index.cjs +0 -35
  64. package/dist/build/index.cjs.map +0 -7
  65. package/dist/build/index.dev.cjs +0 -37
  66. package/dist/build/index.dev.cjs.map +0 -7
  67. package/dist/build/index.prod.cjs +0 -37
  68. package/dist/build/index.prod.cjs.map +0 -7
  69. package/dist/core.cjs +0 -12672
  70. package/dist/core.cjs.map +0 -1
  71. package/dist/core.prod.cjs +0 -6111
  72. package/dist/insights/index.qwik.cjs +0 -1
  73. package/dist/insights/vite/index.cjs +0 -1
  74. package/dist/loader/index.cjs +0 -4
  75. package/dist/optimizer.cjs +0 -212
  76. package/dist/preloader.cjs +0 -266
  77. package/dist/server.cjs +0 -3209
  78. package/dist/testing/index.cjs +0 -35696
  79. /package/dist/starters/features/csr/{vite.config.mts → vite.config.ts} +0 -0
@@ -1,17 +1,17 @@
1
1
  /**
2
2
  * @license
3
- * @qwik.dev/core/cli 2.0.0-beta.11-dev+d7daca3
3
+ * @qwik.dev/core/cli 2.0.0-beta.14-dev+1e7496d
4
4
  * Copyright QwikDev. All Rights Reserved.
5
5
  * Use of this source code is governed by an MIT-style license that can be
6
6
  * found in the LICENSE file at https://github.com/QwikDev/qwik/blob/main/LICENSE
7
7
  */
8
- "use strict";
9
8
  var __create = Object.create;
10
9
  var __defProp = Object.defineProperty;
11
10
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
12
11
  var __getOwnPropNames = Object.getOwnPropertyNames;
13
12
  var __getProtoOf = Object.getPrototypeOf;
14
13
  var __hasOwnProp = Object.prototype.hasOwnProperty;
14
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
15
15
  var __esm = (fn, res) => function __init() {
16
16
  return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
17
17
  };
@@ -38,11 +38,11 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
38
38
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
39
39
  mod
40
40
  ));
41
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
41
+ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
42
42
 
43
43
  // node_modules/.pnpm/sisteransi@1.0.5/node_modules/sisteransi/src/index.js
44
44
  var require_src = __commonJS({
45
- "node_modules/.pnpm/sisteransi@1.0.5/node_modules/sisteransi/src/index.js"(exports2, module2) {
45
+ "node_modules/.pnpm/sisteransi@1.0.5/node_modules/sisteransi/src/index.js"(exports, module) {
46
46
  "use strict";
47
47
  var ESC = "\x1B";
48
48
  var CSI = `${ESC}[`;
@@ -92,13 +92,13 @@ var require_src = __commonJS({
92
92
  return clear;
93
93
  }
94
94
  };
95
- module2.exports = { cursor, scroll, erase, beep };
95
+ module.exports = { cursor, scroll, erase, beep };
96
96
  }
97
97
  });
98
98
 
99
99
  // node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js
100
100
  var require_picocolors = __commonJS({
101
- "node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js"(exports2, module2) {
101
+ "node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js"(exports, module) {
102
102
  var p2 = process || {};
103
103
  var argv = p2.argv || [];
104
104
  var env = p2.env || {};
@@ -163,12 +163,16 @@ var require_picocolors = __commonJS({
163
163
  bgWhiteBright: f("\x1B[107m", "\x1B[49m")
164
164
  };
165
165
  };
166
- module2.exports = createColors();
167
- module2.exports.createColors = createColors;
166
+ module.exports = createColors();
167
+ module.exports.createColors = createColors;
168
168
  }
169
169
  });
170
170
 
171
171
  // node_modules/.pnpm/@clack+core@0.5.0/node_modules/@clack/core/dist/index.mjs
172
+ import { stdin as j, stdout as M } from "node:process";
173
+ import * as g from "node:readline";
174
+ import O from "node:readline";
175
+ import { Writable as X } from "node:stream";
172
176
  function DD({ onlyFirst: e2 = false } = {}) {
173
177
  const t = ["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))", "(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");
174
178
  return new RegExp(t, e2 ? void 0 : "g");
@@ -257,7 +261,7 @@ function m(e2, u2) {
257
261
  const t = e2;
258
262
  t.isTTY && t.setRawMode(u2);
259
263
  }
260
- function fD({ input: e2 = import_node_process.stdin, output: u2 = import_node_process.stdout, overwrite: t = true, hideCursor: F2 = true } = {}) {
264
+ function fD({ input: e2 = j, output: u2 = M, overwrite: t = true, hideCursor: F2 = true } = {}) {
261
265
  const s2 = g.createInterface({ input: e2, output: u2, prompt: "", tabSize: 1 });
262
266
  g.emitKeypressEvents(e2, s2), e2.isTTY && e2.setRawMode(true);
263
267
  const i = (D2, { name: C2, sequence: n }) => {
@@ -278,14 +282,10 @@ function fD({ input: e2 = import_node_process.stdin, output: u2 = import_node_pr
278
282
  e2.off("keypress", i), F2 && u2.write(import_sisteransi.cursor.show), e2.isTTY && !AD && e2.setRawMode(false), s2.terminal = false, s2.close();
279
283
  };
280
284
  }
281
- var import_sisteransi, import_node_process, g, import_node_readline, import_node_stream, import_picocolors, uD, W, tD, eD, FD, sD, w, N, I, R, r, iD, CD, ED, d, oD, y, V, nD, G, _, z, K, aD, k, hD, lD, xD, B, AD, S, gD, vD, h, x, dD, A, OD, PD, J, LD, RD;
285
+ var import_sisteransi, import_picocolors, uD, W, tD, eD, FD, sD, w, N, I, R, r, iD, CD, ED, d, oD, y, V, nD, G, _, z, K, aD, k, hD, lD, xD, B, AD, S, gD, vD, h, x, dD, A, OD, PD, J, LD, RD;
282
286
  var init_dist = __esm({
283
287
  "node_modules/.pnpm/@clack+core@0.5.0/node_modules/@clack/core/dist/index.mjs"() {
284
288
  import_sisteransi = __toESM(require_src(), 1);
285
- import_node_process = require("node:process");
286
- g = __toESM(require("node:readline"), 1);
287
- import_node_readline = __toESM(require("node:readline"), 1);
288
- import_node_stream = require("node:stream");
289
289
  import_picocolors = __toESM(require_picocolors(), 1);
290
290
  uD = DD();
291
291
  W = { exports: {} };
@@ -414,7 +414,7 @@ var init_dist = __esm({
414
414
  x = class {
415
415
  constructor(u2, t = true) {
416
416
  h(this, "input"), h(this, "output"), h(this, "_abortSignal"), h(this, "rl"), h(this, "opts"), h(this, "_render"), h(this, "_track", false), h(this, "_prevFrame", ""), h(this, "_subscribers", /* @__PURE__ */ new Map()), h(this, "_cursor", 0), h(this, "state", "initial"), h(this, "error", ""), h(this, "value");
417
- const { input: F2 = import_node_process.stdin, output: s2 = import_node_process.stdout, render: i, signal: D2, ...C2 } = u2;
417
+ const { input: F2 = j, output: s2 = M, render: i, signal: D2, ...C2 } = u2;
418
418
  this.opts = C2, this.onKeypress = this.onKeypress.bind(this), this.close = this.close.bind(this), this.render = this.render.bind(this), this._render = i.bind(this), this._track = t, this._abortSignal = D2, this.input = F2, this.output = s2;
419
419
  }
420
420
  unsubscribe() {
@@ -443,11 +443,10 @@ var init_dist = __esm({
443
443
  this.state = "cancel", this.close();
444
444
  }, { once: true });
445
445
  }
446
- const F2 = new import_node_stream.Writable();
446
+ const F2 = new X();
447
447
  F2._write = (s2, i, D2) => {
448
- var _a, _b;
449
- this._track && (this.value = (_a = this.rl) == null ? void 0 : _a.line.replace(/\t/g, ""), this._cursor = ((_b = this.rl) == null ? void 0 : _b.cursor) ?? 0, this.emit("value", this.value)), D2();
450
- }, this.input.pipe(F2), this.rl = import_node_readline.default.createInterface({ input: this.input, output: F2, tabSize: 2, prompt: "", escapeCodeTimeout: 50, terminal: true }), import_node_readline.default.emitKeypressEvents(this.input, this.rl), this.rl.prompt(), this.opts.initialValue !== void 0 && this._track && this.rl.write(this.opts.initialValue), this.input.on("keypress", this.onKeypress), m(this.input, true), this.output.on("resize", this.render), this.render(), this.once("submit", () => {
448
+ this._track && (this.value = this.rl?.line.replace(/\t/g, ""), this._cursor = this.rl?.cursor ?? 0, this.emit("value", this.value)), D2();
449
+ }, this.input.pipe(F2), this.rl = O.createInterface({ input: this.input, output: F2, tabSize: 2, prompt: "", escapeCodeTimeout: 50, terminal: true }), O.emitKeypressEvents(this.input, this.rl), this.rl.prompt(), this.opts.initialValue !== void 0 && this._track && this.rl.write(this.opts.initialValue), this.input.on("keypress", this.onKeypress), m(this.input, true), this.output.on("resize", this.render), this.render(), this.once("submit", () => {
451
450
  this.output.write(import_sisteransi.cursor.show), this.output.off("resize", this.render), m(this.input, false), u2(this.value);
452
451
  }), this.once("cancel", () => {
453
452
  this.output.write(import_sisteransi.cursor.show), this.output.off("resize", this.render), m(this.input, false), u2(S);
@@ -455,20 +454,18 @@ var init_dist = __esm({
455
454
  });
456
455
  }
457
456
  onKeypress(u2, t) {
458
- var _a, _b;
459
- if (this.state === "error" && (this.state = "active"), (t == null ? void 0 : t.name) && (!this._track && B.aliases.has(t.name) && this.emit("cursor", B.aliases.get(t.name)), B.actions.has(t.name) && this.emit("cursor", t.name)), u2 && (u2.toLowerCase() === "y" || u2.toLowerCase() === "n") && this.emit("confirm", u2.toLowerCase() === "y"), u2 === " " && this.opts.placeholder && (this.value || ((_a = this.rl) == null ? void 0 : _a.write(this.opts.placeholder), this.emit("value", this.opts.placeholder))), u2 && this.emit("key", u2.toLowerCase()), (t == null ? void 0 : t.name) === "return") {
457
+ if (this.state === "error" && (this.state = "active"), t?.name && (!this._track && B.aliases.has(t.name) && this.emit("cursor", B.aliases.get(t.name)), B.actions.has(t.name) && this.emit("cursor", t.name)), u2 && (u2.toLowerCase() === "y" || u2.toLowerCase() === "n") && this.emit("confirm", u2.toLowerCase() === "y"), u2 === " " && this.opts.placeholder && (this.value || (this.rl?.write(this.opts.placeholder), this.emit("value", this.opts.placeholder))), u2 && this.emit("key", u2.toLowerCase()), t?.name === "return") {
460
458
  if (this.opts.validate) {
461
459
  const F2 = this.opts.validate(this.value);
462
- F2 && (this.error = F2 instanceof Error ? F2.message : F2, this.state = "error", (_b = this.rl) == null ? void 0 : _b.write(this.value));
460
+ F2 && (this.error = F2 instanceof Error ? F2.message : F2, this.state = "error", this.rl?.write(this.value));
463
461
  }
464
462
  this.state !== "error" && (this.state = "submit");
465
463
  }
466
- $2([u2, t == null ? void 0 : t.name, t == null ? void 0 : t.sequence], "cancel") && (this.state = "cancel"), (this.state === "submit" || this.state === "cancel") && this.emit("finalize"), this.render(), (this.state === "submit" || this.state === "cancel") && this.close();
464
+ $2([u2, t?.name, t?.sequence], "cancel") && (this.state = "cancel"), (this.state === "submit" || this.state === "cancel") && this.emit("finalize"), this.render(), (this.state === "submit" || this.state === "cancel") && this.close();
467
465
  }
468
466
  close() {
469
- var _a;
470
467
  this.input.unpipe(), this.input.removeListener("keypress", this.onKeypress), this.output.write(`
471
- `), m(this.input, false), (_a = this.rl) == null ? void 0 : _a.close(), this.rl = void 0, this.emit(`${this.state}`, this.value), this.unsubscribe();
468
+ `), m(this.input, false), this.rl?.close(), this.rl = void 0, this.emit(`${this.state}`, this.value), this.unsubscribe();
472
469
  }
473
470
  restoreCursor() {
474
471
  const u2 = Y(this._prevFrame, process.stdout.columns, { hard: true }).split(`
@@ -481,7 +478,7 @@ var init_dist = __esm({
481
478
  if (this.state === "initial") this.output.write(import_sisteransi.cursor.hide);
482
479
  else {
483
480
  const t = BD(this._prevFrame, u2);
484
- if (this.restoreCursor(), t && (t == null ? void 0 : t.length) === 1) {
481
+ if (this.restoreCursor(), t && t?.length === 1) {
485
482
  const F2 = t[0];
486
483
  this.output.write(import_sisteransi.cursor.move(0, F2)), this.output.write(import_sisteransi.erase.lines(1));
487
484
  const s2 = u2.split(`
@@ -489,7 +486,7 @@ var init_dist = __esm({
489
486
  this.output.write(s2[F2]), this._prevFrame = u2, this.output.write(import_sisteransi.cursor.move(0, s2.length - F2 - 1));
490
487
  return;
491
488
  }
492
- if (t && (t == null ? void 0 : t.length) > 1) {
489
+ if (t && t?.length > 1) {
493
490
  const F2 = t[0];
494
491
  this.output.write(import_sisteransi.cursor.move(0, F2)), this.output.write(import_sisteransi.erase.down());
495
492
  const s2 = u2.split(`
@@ -568,15 +565,15 @@ var init_dist = __esm({
568
565
  });
569
566
 
570
567
  // node_modules/.pnpm/@clack+prompts@0.11.0/node_modules/@clack/prompts/dist/index.mjs
568
+ import y2 from "node:process";
571
569
  function ce() {
572
- return import_node_process2.default.platform !== "win32" ? import_node_process2.default.env.TERM !== "linux" : !!import_node_process2.default.env.CI || !!import_node_process2.default.env.WT_SESSION || !!import_node_process2.default.env.TERMINUS_SUBLIME || import_node_process2.default.env.ConEmuTask === "{cmd::Cmder}" || import_node_process2.default.env.TERM_PROGRAM === "Terminus-Sublime" || import_node_process2.default.env.TERM_PROGRAM === "vscode" || import_node_process2.default.env.TERM === "xterm-256color" || import_node_process2.default.env.TERM === "alacritty" || import_node_process2.default.env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
570
+ return y2.platform !== "win32" ? y2.env.TERM !== "linux" : !!y2.env.CI || !!y2.env.WT_SESSION || !!y2.env.TERMINUS_SUBLIME || y2.env.ConEmuTask === "{cmd::Cmder}" || y2.env.TERM_PROGRAM === "Terminus-Sublime" || y2.env.TERM_PROGRAM === "vscode" || y2.env.TERM === "xterm-256color" || y2.env.TERM === "alacritty" || y2.env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
573
571
  }
574
- var import_node_process2, import_picocolors2, import_sisteransi2, V2, u, le, L2, W2, C, ue, o, d2, k2, P2, A2, T, F, $e, _2, me, de, pe, q, D, U, K2, b2, G2, he, ye, ve, Ie, Se, M2, J2, Y2;
572
+ var import_picocolors2, import_sisteransi2, V2, u, le, L2, W2, C, ue, o, d2, k2, P2, A2, T, F, $e, _2, me, de, pe, q, D, U, K2, b2, G2, he, ye, ve, Ie, Se, M2, J2, Y2;
575
573
  var init_dist2 = __esm({
576
574
  "node_modules/.pnpm/@clack+prompts@0.11.0/node_modules/@clack/prompts/dist/index.mjs"() {
577
575
  init_dist();
578
576
  init_dist();
579
- import_node_process2 = __toESM(require("node:process"), 1);
580
577
  import_picocolors2 = __toESM(require_picocolors(), 1);
581
578
  import_sisteransi2 = __toESM(require_src(), 1);
582
579
  V2 = ce();
@@ -619,14 +616,13 @@ var init_dist2 = __esm({
619
616
  const { cursor: n, options: r2, style: i } = t, s2 = t.maxItems ?? Number.POSITIVE_INFINITY, c = Math.max(process.stdout.rows - 4, 0), a = Math.min(c, Math.max(s2, 5));
620
617
  let l2 = 0;
621
618
  n >= l2 + a - 3 ? l2 = Math.max(Math.min(n - a + 3, r2.length - a), 0) : n < l2 + 2 && (l2 = Math.max(n - 2, 0));
622
- const $4 = a < r2.length && l2 > 0, g2 = a < r2.length && l2 + a < r2.length;
619
+ const $3 = a < r2.length && l2 > 0, g2 = a < r2.length && l2 + a < r2.length;
623
620
  return r2.slice(l2, l2 + a).map((p2, v2, f) => {
624
- const j2 = v2 === 0 && $4, E = v2 === f.length - 1 && g2;
621
+ const j2 = v2 === 0 && $3, E = v2 === f.length - 1 && g2;
625
622
  return j2 || E ? import_picocolors2.default.dim("...") : i(p2, v2 + l2 === n);
626
623
  });
627
624
  };
628
625
  he = (t) => new RD({ validate: t.validate, placeholder: t.placeholder, defaultValue: t.defaultValue, initialValue: t.initialValue, render() {
629
- var _a;
630
626
  const n = `${import_picocolors2.default.gray(o)}
631
627
  ${b2(this.state)} ${t.message}
632
628
  `, r2 = t.placeholder ? import_picocolors2.default.inverse(t.placeholder[0]) + import_picocolors2.default.dim(t.placeholder.slice(1)) : import_picocolors2.default.inverse(import_picocolors2.default.hidden("_")), i = this.value ? this.valueWithCursor : r2;
@@ -639,7 +635,7 @@ ${import_picocolors2.default.yellow(d2)} ${import_picocolors2.default.yellow(th
639
635
  case "submit":
640
636
  return `${n}${import_picocolors2.default.gray(o)} ${import_picocolors2.default.dim(this.value || t.placeholder)}`;
641
637
  case "cancel":
642
- return `${n}${import_picocolors2.default.gray(o)} ${import_picocolors2.default.strikethrough(import_picocolors2.default.dim(this.value ?? ""))}${((_a = this.value) == null ? void 0 : _a.trim()) ? `
638
+ return `${n}${import_picocolors2.default.gray(o)} ${import_picocolors2.default.strikethrough(import_picocolors2.default.dim(this.value ?? ""))}${this.value?.trim() ? `
643
639
  ${import_picocolors2.default.gray(o)}` : ""}`;
644
640
  default:
645
641
  return `${n}${import_picocolors2.default.cyan(o)} ${i}
@@ -734,7 +730,7 @@ ${import_picocolors2.default.gray(d2)} ${t}
734
730
  J2 = `${import_picocolors2.default.gray(o)} `;
735
731
  Y2 = ({ indicator: t = "dots" } = {}) => {
736
732
  const n = V2 ? ["\u25D2", "\u25D0", "\u25D3", "\u25D1"] : ["\u2022", "o", "O", "0"], r2 = V2 ? 80 : 120, i = process.env.CI === "true";
737
- let s2, c, a = false, l2 = "", $4, g2 = performance.now();
733
+ let s2, c, a = false, l2 = "", $3, g2 = performance.now();
738
734
  const p2 = (m2) => {
739
735
  const h2 = m2 > 1 ? "Something went wrong" : "Canceled";
740
736
  a && N2(h2, m2);
@@ -743,10 +739,10 @@ ${import_picocolors2.default.gray(d2)} ${t}
743
739
  }, E = () => {
744
740
  process.removeListener("uncaughtExceptionMonitor", v2), process.removeListener("unhandledRejection", v2), process.removeListener("SIGINT", f), process.removeListener("SIGTERM", f), process.removeListener("exit", p2);
745
741
  }, B2 = () => {
746
- if ($4 === void 0) return;
742
+ if ($3 === void 0) return;
747
743
  i && process.stdout.write(`
748
744
  `);
749
- const m2 = $4.split(`
745
+ const m2 = $3.split(`
750
746
  `);
751
747
  process.stdout.write(import_sisteransi2.cursor.move(-999, m2.length - 1)), process.stdout.write(import_sisteransi2.erase.down(m2.length));
752
748
  }, R2 = (m2) => m2.replace(/\.+$/, ""), O2 = (m2) => {
@@ -757,8 +753,8 @@ ${import_picocolors2.default.gray(d2)} ${t}
757
753
  `);
758
754
  let h2 = 0, w2 = 0;
759
755
  j2(), c = setInterval(() => {
760
- if (i && l2 === $4) return;
761
- B2(), $4 = l2;
756
+ if (i && l2 === $3) return;
757
+ B2(), $3 = l2;
762
758
  const I2 = import_picocolors2.default.magenta(n[h2]);
763
759
  if (i) process.stdout.write(`${I2} ${l2}...`);
764
760
  else if (t === "timer") process.stdout.write(`${I2} ${l2} ${O2(g2)}`);
@@ -784,9 +780,9 @@ ${import_picocolors2.default.gray(d2)} ${t}
784
780
 
785
781
  // node_modules/.pnpm/which-pm-runs@1.1.0/node_modules/which-pm-runs/index.js
786
782
  var require_which_pm_runs = __commonJS({
787
- "node_modules/.pnpm/which-pm-runs@1.1.0/node_modules/which-pm-runs/index.js"(exports2, module2) {
783
+ "node_modules/.pnpm/which-pm-runs@1.1.0/node_modules/which-pm-runs/index.js"(exports, module) {
788
784
  "use strict";
789
- module2.exports = function() {
785
+ module.exports = function() {
790
786
  if (!process.env.npm_config_user_agent) {
791
787
  return void 0;
792
788
  }
@@ -804,512 +800,15 @@ var require_which_pm_runs = __commonJS({
804
800
  }
805
801
  });
806
802
 
807
- // node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/windows.js
808
- var require_windows = __commonJS({
809
- "node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/windows.js"(exports2, module2) {
810
- module2.exports = isexe;
811
- isexe.sync = sync;
812
- var fs9 = require("fs");
813
- function checkPathExt(path4, options) {
814
- var pathext = options.pathExt !== void 0 ? options.pathExt : process.env.PATHEXT;
815
- if (!pathext) {
816
- return true;
817
- }
818
- pathext = pathext.split(";");
819
- if (pathext.indexOf("") !== -1) {
820
- return true;
821
- }
822
- for (var i = 0; i < pathext.length; i++) {
823
- var p2 = pathext[i].toLowerCase();
824
- if (p2 && path4.substr(-p2.length).toLowerCase() === p2) {
825
- return true;
826
- }
827
- }
828
- return false;
829
- }
830
- function checkStat(stat, path4, options) {
831
- if (!stat.isSymbolicLink() && !stat.isFile()) {
832
- return false;
833
- }
834
- return checkPathExt(path4, options);
835
- }
836
- function isexe(path4, options, cb) {
837
- fs9.stat(path4, function(er, stat) {
838
- cb(er, er ? false : checkStat(stat, path4, options));
839
- });
840
- }
841
- function sync(path4, options) {
842
- return checkStat(fs9.statSync(path4), path4, options);
843
- }
844
- }
845
- });
846
-
847
- // node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/mode.js
848
- var require_mode = __commonJS({
849
- "node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/mode.js"(exports2, module2) {
850
- module2.exports = isexe;
851
- isexe.sync = sync;
852
- var fs9 = require("fs");
853
- function isexe(path4, options, cb) {
854
- fs9.stat(path4, function(er, stat) {
855
- cb(er, er ? false : checkStat(stat, options));
856
- });
857
- }
858
- function sync(path4, options) {
859
- return checkStat(fs9.statSync(path4), options);
860
- }
861
- function checkStat(stat, options) {
862
- return stat.isFile() && checkMode(stat, options);
863
- }
864
- function checkMode(stat, options) {
865
- var mod = stat.mode;
866
- var uid = stat.uid;
867
- var gid = stat.gid;
868
- var myUid = options.uid !== void 0 ? options.uid : process.getuid && process.getuid();
869
- var myGid = options.gid !== void 0 ? options.gid : process.getgid && process.getgid();
870
- var u2 = parseInt("100", 8);
871
- var g2 = parseInt("010", 8);
872
- var o2 = parseInt("001", 8);
873
- var ug = u2 | g2;
874
- var ret = mod & o2 || mod & g2 && gid === myGid || mod & u2 && uid === myUid || mod & ug && myUid === 0;
875
- return ret;
876
- }
877
- }
878
- });
879
-
880
- // node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/index.js
881
- var require_isexe = __commonJS({
882
- "node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/index.js"(exports2, module2) {
883
- var fs9 = require("fs");
884
- var core;
885
- if (process.platform === "win32" || global.TESTING_WINDOWS) {
886
- core = require_windows();
887
- } else {
888
- core = require_mode();
889
- }
890
- module2.exports = isexe;
891
- isexe.sync = sync;
892
- function isexe(path4, options, cb) {
893
- if (typeof options === "function") {
894
- cb = options;
895
- options = {};
896
- }
897
- if (!cb) {
898
- if (typeof Promise !== "function") {
899
- throw new TypeError("callback not provided");
900
- }
901
- return new Promise(function(resolve2, reject) {
902
- isexe(path4, options || {}, function(er, is) {
903
- if (er) {
904
- reject(er);
905
- } else {
906
- resolve2(is);
907
- }
908
- });
909
- });
910
- }
911
- core(path4, options || {}, function(er, is) {
912
- if (er) {
913
- if (er.code === "EACCES" || options && options.ignoreErrors) {
914
- er = null;
915
- is = false;
916
- }
917
- }
918
- cb(er, is);
919
- });
920
- }
921
- function sync(path4, options) {
922
- try {
923
- return core.sync(path4, options || {});
924
- } catch (er) {
925
- if (options && options.ignoreErrors || er.code === "EACCES") {
926
- return false;
927
- } else {
928
- throw er;
929
- }
930
- }
931
- }
932
- }
933
- });
934
-
935
- // node_modules/.pnpm/which@2.0.2/node_modules/which/which.js
936
- var require_which = __commonJS({
937
- "node_modules/.pnpm/which@2.0.2/node_modules/which/which.js"(exports2, module2) {
938
- var isWindows = process.platform === "win32" || process.env.OSTYPE === "cygwin" || process.env.OSTYPE === "msys";
939
- var path4 = require("path");
940
- var COLON = isWindows ? ";" : ":";
941
- var isexe = require_isexe();
942
- var getNotFoundError = (cmd) => Object.assign(new Error(`not found: ${cmd}`), { code: "ENOENT" });
943
- var getPathInfo = (cmd, opt) => {
944
- const colon = opt.colon || COLON;
945
- const pathEnv = cmd.match(/\//) || isWindows && cmd.match(/\\/) ? [""] : [
946
- // windows always checks the cwd first
947
- ...isWindows ? [process.cwd()] : [],
948
- ...(opt.path || process.env.PATH || /* istanbul ignore next: very unusual */
949
- "").split(colon)
950
- ];
951
- const pathExtExe = isWindows ? opt.pathExt || process.env.PATHEXT || ".EXE;.CMD;.BAT;.COM" : "";
952
- const pathExt = isWindows ? pathExtExe.split(colon) : [""];
953
- if (isWindows) {
954
- if (cmd.indexOf(".") !== -1 && pathExt[0] !== "")
955
- pathExt.unshift("");
956
- }
957
- return {
958
- pathEnv,
959
- pathExt,
960
- pathExtExe
961
- };
962
- };
963
- var which = (cmd, opt, cb) => {
964
- if (typeof opt === "function") {
965
- cb = opt;
966
- opt = {};
967
- }
968
- if (!opt)
969
- opt = {};
970
- const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt);
971
- const found = [];
972
- const step = (i) => new Promise((resolve2, reject) => {
973
- if (i === pathEnv.length)
974
- return opt.all && found.length ? resolve2(found) : reject(getNotFoundError(cmd));
975
- const ppRaw = pathEnv[i];
976
- const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
977
- const pCmd = path4.join(pathPart, cmd);
978
- const p2 = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
979
- resolve2(subStep(p2, i, 0));
980
- });
981
- const subStep = (p2, i, ii) => new Promise((resolve2, reject) => {
982
- if (ii === pathExt.length)
983
- return resolve2(step(i + 1));
984
- const ext = pathExt[ii];
985
- isexe(p2 + ext, { pathExt: pathExtExe }, (er, is) => {
986
- if (!er && is) {
987
- if (opt.all)
988
- found.push(p2 + ext);
989
- else
990
- return resolve2(p2 + ext);
991
- }
992
- return resolve2(subStep(p2, i, ii + 1));
993
- });
994
- });
995
- return cb ? step(0).then((res) => cb(null, res), cb) : step(0);
996
- };
997
- var whichSync = (cmd, opt) => {
998
- opt = opt || {};
999
- const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt);
1000
- const found = [];
1001
- for (let i = 0; i < pathEnv.length; i++) {
1002
- const ppRaw = pathEnv[i];
1003
- const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
1004
- const pCmd = path4.join(pathPart, cmd);
1005
- const p2 = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
1006
- for (let j2 = 0; j2 < pathExt.length; j2++) {
1007
- const cur = p2 + pathExt[j2];
1008
- try {
1009
- const is = isexe.sync(cur, { pathExt: pathExtExe });
1010
- if (is) {
1011
- if (opt.all)
1012
- found.push(cur);
1013
- else
1014
- return cur;
1015
- }
1016
- } catch (ex) {
1017
- }
1018
- }
1019
- }
1020
- if (opt.all && found.length)
1021
- return found;
1022
- if (opt.nothrow)
1023
- return null;
1024
- throw getNotFoundError(cmd);
1025
- };
1026
- module2.exports = which;
1027
- which.sync = whichSync;
1028
- }
1029
- });
1030
-
1031
- // node_modules/.pnpm/path-key@3.1.1/node_modules/path-key/index.js
1032
- var require_path_key = __commonJS({
1033
- "node_modules/.pnpm/path-key@3.1.1/node_modules/path-key/index.js"(exports2, module2) {
1034
- "use strict";
1035
- var pathKey2 = (options = {}) => {
1036
- const environment = options.env || process.env;
1037
- const platform = options.platform || process.platform;
1038
- if (platform !== "win32") {
1039
- return "PATH";
1040
- }
1041
- return Object.keys(environment).reverse().find((key) => key.toUpperCase() === "PATH") || "Path";
1042
- };
1043
- module2.exports = pathKey2;
1044
- module2.exports.default = pathKey2;
1045
- }
1046
- });
1047
-
1048
- // node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/resolveCommand.js
1049
- var require_resolveCommand = __commonJS({
1050
- "node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/resolveCommand.js"(exports2, module2) {
1051
- "use strict";
1052
- var path4 = require("path");
1053
- var which = require_which();
1054
- var getPathKey = require_path_key();
1055
- function resolveCommandAttempt(parsed, withoutPathExt) {
1056
- const env = parsed.options.env || process.env;
1057
- const cwd = process.cwd();
1058
- const hasCustomCwd = parsed.options.cwd != null;
1059
- const shouldSwitchCwd = hasCustomCwd && process.chdir !== void 0 && !process.chdir.disabled;
1060
- if (shouldSwitchCwd) {
1061
- try {
1062
- process.chdir(parsed.options.cwd);
1063
- } catch (err) {
1064
- }
1065
- }
1066
- let resolved;
1067
- try {
1068
- resolved = which.sync(parsed.command, {
1069
- path: env[getPathKey({ env })],
1070
- pathExt: withoutPathExt ? path4.delimiter : void 0
1071
- });
1072
- } catch (e2) {
1073
- } finally {
1074
- if (shouldSwitchCwd) {
1075
- process.chdir(cwd);
1076
- }
1077
- }
1078
- if (resolved) {
1079
- resolved = path4.resolve(hasCustomCwd ? parsed.options.cwd : "", resolved);
1080
- }
1081
- return resolved;
1082
- }
1083
- function resolveCommand(parsed) {
1084
- return resolveCommandAttempt(parsed) || resolveCommandAttempt(parsed, true);
1085
- }
1086
- module2.exports = resolveCommand;
1087
- }
1088
- });
1089
-
1090
- // node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/escape.js
1091
- var require_escape = __commonJS({
1092
- "node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/escape.js"(exports2, module2) {
1093
- "use strict";
1094
- var metaCharsRegExp = /([()\][%!^"`<>&|;, *?])/g;
1095
- function escapeCommand(arg) {
1096
- arg = arg.replace(metaCharsRegExp, "^$1");
1097
- return arg;
1098
- }
1099
- function escapeArgument(arg, doubleEscapeMetaChars) {
1100
- arg = `${arg}`;
1101
- arg = arg.replace(/(?=(\\+?)?)\1"/g, '$1$1\\"');
1102
- arg = arg.replace(/(?=(\\+?)?)\1$/, "$1$1");
1103
- arg = `"${arg}"`;
1104
- arg = arg.replace(metaCharsRegExp, "^$1");
1105
- if (doubleEscapeMetaChars) {
1106
- arg = arg.replace(metaCharsRegExp, "^$1");
1107
- }
1108
- return arg;
1109
- }
1110
- module2.exports.command = escapeCommand;
1111
- module2.exports.argument = escapeArgument;
1112
- }
1113
- });
1114
-
1115
- // node_modules/.pnpm/shebang-regex@3.0.0/node_modules/shebang-regex/index.js
1116
- var require_shebang_regex = __commonJS({
1117
- "node_modules/.pnpm/shebang-regex@3.0.0/node_modules/shebang-regex/index.js"(exports2, module2) {
1118
- "use strict";
1119
- module2.exports = /^#!(.*)/;
1120
- }
1121
- });
1122
-
1123
- // node_modules/.pnpm/shebang-command@2.0.0/node_modules/shebang-command/index.js
1124
- var require_shebang_command = __commonJS({
1125
- "node_modules/.pnpm/shebang-command@2.0.0/node_modules/shebang-command/index.js"(exports2, module2) {
1126
- "use strict";
1127
- var shebangRegex = require_shebang_regex();
1128
- module2.exports = (string = "") => {
1129
- const match = string.match(shebangRegex);
1130
- if (!match) {
1131
- return null;
1132
- }
1133
- const [path4, argument] = match[0].replace(/#! ?/, "").split(" ");
1134
- const binary = path4.split("/").pop();
1135
- if (binary === "env") {
1136
- return argument;
1137
- }
1138
- return argument ? `${binary} ${argument}` : binary;
1139
- };
1140
- }
1141
- });
1142
-
1143
- // node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/readShebang.js
1144
- var require_readShebang = __commonJS({
1145
- "node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/readShebang.js"(exports2, module2) {
1146
- "use strict";
1147
- var fs9 = require("fs");
1148
- var shebangCommand = require_shebang_command();
1149
- function readShebang(command) {
1150
- const size = 150;
1151
- const buffer = Buffer.alloc(size);
1152
- let fd;
1153
- try {
1154
- fd = fs9.openSync(command, "r");
1155
- fs9.readSync(fd, buffer, 0, size, 0);
1156
- fs9.closeSync(fd);
1157
- } catch (e2) {
1158
- }
1159
- return shebangCommand(buffer.toString());
1160
- }
1161
- module2.exports = readShebang;
1162
- }
1163
- });
1164
-
1165
- // node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/parse.js
1166
- var require_parse = __commonJS({
1167
- "node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/parse.js"(exports2, module2) {
1168
- "use strict";
1169
- var path4 = require("path");
1170
- var resolveCommand = require_resolveCommand();
1171
- var escape = require_escape();
1172
- var readShebang = require_readShebang();
1173
- var isWin = process.platform === "win32";
1174
- var isExecutableRegExp = /\.(?:com|exe)$/i;
1175
- var isCmdShimRegExp = /node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;
1176
- function detectShebang(parsed) {
1177
- parsed.file = resolveCommand(parsed);
1178
- const shebang = parsed.file && readShebang(parsed.file);
1179
- if (shebang) {
1180
- parsed.args.unshift(parsed.file);
1181
- parsed.command = shebang;
1182
- return resolveCommand(parsed);
1183
- }
1184
- return parsed.file;
1185
- }
1186
- function parseNonShell(parsed) {
1187
- if (!isWin) {
1188
- return parsed;
1189
- }
1190
- const commandFile = detectShebang(parsed);
1191
- const needsShell = !isExecutableRegExp.test(commandFile);
1192
- if (parsed.options.forceShell || needsShell) {
1193
- const needsDoubleEscapeMetaChars = isCmdShimRegExp.test(commandFile);
1194
- parsed.command = path4.normalize(parsed.command);
1195
- parsed.command = escape.command(parsed.command);
1196
- parsed.args = parsed.args.map((arg) => escape.argument(arg, needsDoubleEscapeMetaChars));
1197
- const shellCommand = [parsed.command].concat(parsed.args).join(" ");
1198
- parsed.args = ["/d", "/s", "/c", `"${shellCommand}"`];
1199
- parsed.command = process.env.comspec || "cmd.exe";
1200
- parsed.options.windowsVerbatimArguments = true;
1201
- }
1202
- return parsed;
1203
- }
1204
- function parse(command, args, options) {
1205
- if (args && !Array.isArray(args)) {
1206
- options = args;
1207
- args = null;
1208
- }
1209
- args = args ? args.slice(0) : [];
1210
- options = Object.assign({}, options);
1211
- const parsed = {
1212
- command,
1213
- args,
1214
- options,
1215
- file: void 0,
1216
- original: {
1217
- command,
1218
- args
1219
- }
1220
- };
1221
- return options.shell ? parsed : parseNonShell(parsed);
1222
- }
1223
- module2.exports = parse;
1224
- }
1225
- });
1226
-
1227
- // node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/enoent.js
1228
- var require_enoent = __commonJS({
1229
- "node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/enoent.js"(exports2, module2) {
1230
- "use strict";
1231
- var isWin = process.platform === "win32";
1232
- function notFoundError(original, syscall) {
1233
- return Object.assign(new Error(`${syscall} ${original.command} ENOENT`), {
1234
- code: "ENOENT",
1235
- errno: "ENOENT",
1236
- syscall: `${syscall} ${original.command}`,
1237
- path: original.command,
1238
- spawnargs: original.args
1239
- });
1240
- }
1241
- function hookChildProcess(cp, parsed) {
1242
- if (!isWin) {
1243
- return;
1244
- }
1245
- const originalEmit = cp.emit;
1246
- cp.emit = function(name, arg1) {
1247
- if (name === "exit") {
1248
- const err = verifyENOENT(arg1, parsed);
1249
- if (err) {
1250
- return originalEmit.call(cp, "error", err);
1251
- }
1252
- }
1253
- return originalEmit.apply(cp, arguments);
1254
- };
1255
- }
1256
- function verifyENOENT(status, parsed) {
1257
- if (isWin && status === 1 && !parsed.file) {
1258
- return notFoundError(parsed.original, "spawn");
1259
- }
1260
- return null;
1261
- }
1262
- function verifyENOENTSync(status, parsed) {
1263
- if (isWin && status === 1 && !parsed.file) {
1264
- return notFoundError(parsed.original, "spawnSync");
1265
- }
1266
- return null;
1267
- }
1268
- module2.exports = {
1269
- hookChildProcess,
1270
- verifyENOENT,
1271
- verifyENOENTSync,
1272
- notFoundError
1273
- };
1274
- }
1275
- });
1276
-
1277
- // node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/index.js
1278
- var require_cross_spawn = __commonJS({
1279
- "node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/index.js"(exports2, module2) {
1280
- "use strict";
1281
- var cp = require("child_process");
1282
- var parse = require_parse();
1283
- var enoent = require_enoent();
1284
- function spawn2(command, args, options) {
1285
- const parsed = parse(command, args, options);
1286
- const spawned = cp.spawn(parsed.command, parsed.args, parsed.options);
1287
- enoent.hookChildProcess(spawned, parsed);
1288
- return spawned;
1289
- }
1290
- function spawnSync(command, args, options) {
1291
- const parsed = parse(command, args, options);
1292
- const result = cp.spawnSync(parsed.command, parsed.args, parsed.options);
1293
- result.error = result.error || enoent.verifyENOENTSync(result.status, parsed);
1294
- return result;
1295
- }
1296
- module2.exports = spawn2;
1297
- module2.exports.spawn = spawn2;
1298
- module2.exports.sync = spawnSync;
1299
- module2.exports._parse = parse;
1300
- module2.exports._enoent = enoent;
1301
- }
1302
- });
1303
-
1304
- // node_modules/.pnpm/@croct+json5-parser@0.2.0/node_modules/@croct/json5-parser/identifier.js
803
+ // node_modules/.pnpm/@croct+json5-parser@0.2.1/node_modules/@croct/json5-parser/identifier.js
1305
804
  var require_identifier = __commonJS({
1306
- "node_modules/.pnpm/@croct+json5-parser@0.2.0/node_modules/@croct/json5-parser/identifier.js"(exports2) {
805
+ "node_modules/.pnpm/@croct+json5-parser@0.2.1/node_modules/@croct/json5-parser/identifier.js"(exports) {
1307
806
  "use strict";
1308
- Object.defineProperty(exports2, "__esModule", { value: true });
1309
- exports2.identifierRegex = exports2.reservedIdentifiers = void 0;
1310
- exports2.isReserved = isReserved;
1311
- exports2.isIdentifier = isIdentifier;
1312
- exports2.reservedIdentifiers = [
807
+ Object.defineProperty(exports, "__esModule", { value: true });
808
+ exports.identifierRegex = exports.reservedIdentifiers = void 0;
809
+ exports.isReserved = isReserved;
810
+ exports.isIdentifier = isIdentifier;
811
+ exports.reservedIdentifiers = [
1313
812
  // Keywords
1314
813
  "await",
1315
814
  "break",
@@ -1357,10 +856,10 @@ var require_identifier = __commonJS({
1357
856
  "protected",
1358
857
  "public"
1359
858
  ];
1360
- exports2.identifierRegex = /[$_\p{ID_Start}][$_\u200C\u200D\p{ID_Continue}]*/u;
1361
- var exactRegex = new RegExp(`^${exports2.identifierRegex.source}$`, exports2.identifierRegex.flags);
859
+ exports.identifierRegex = /[$_\p{ID_Start}][$_\u200C\u200D\p{ID_Continue}]*/u;
860
+ var exactRegex = new RegExp(`^${exports.identifierRegex.source}$`, exports.identifierRegex.flags);
1362
861
  function isReserved(value) {
1363
- return exports2.reservedIdentifiers.includes(value);
862
+ return exports.reservedIdentifiers.includes(value);
1364
863
  }
1365
864
  function isIdentifier(value) {
1366
865
  return exactRegex.test(value) && !isReserved(value);
@@ -1368,12 +867,12 @@ var require_identifier = __commonJS({
1368
867
  }
1369
868
  });
1370
869
 
1371
- // node_modules/.pnpm/@croct+json5-parser@0.2.0/node_modules/@croct/json5-parser/token.js
870
+ // node_modules/.pnpm/@croct+json5-parser@0.2.1/node_modules/@croct/json5-parser/token.js
1372
871
  var require_token = __commonJS({
1373
- "node_modules/.pnpm/@croct+json5-parser@0.2.0/node_modules/@croct/json5-parser/token.js"(exports2) {
872
+ "node_modules/.pnpm/@croct+json5-parser@0.2.1/node_modules/@croct/json5-parser/token.js"(exports) {
1374
873
  "use strict";
1375
- Object.defineProperty(exports2, "__esModule", { value: true });
1376
- exports2.JsonToken = exports2.JsonTokenType = void 0;
874
+ Object.defineProperty(exports, "__esModule", { value: true });
875
+ exports.JsonToken = exports.JsonTokenType = void 0;
1377
876
  var JsonTokenType;
1378
877
  (function(JsonTokenType2) {
1379
878
  JsonTokenType2["IDENTIFIER"] = "IDENTIFIER";
@@ -1392,30 +891,30 @@ var require_token = __commonJS({
1392
891
  JsonTokenType2["WHITESPACE"] = "WHITESPACE";
1393
892
  JsonTokenType2["NEWLINE"] = "NEWLINE";
1394
893
  JsonTokenType2["EOF"] = "EOF";
1395
- })(JsonTokenType || (exports2.JsonTokenType = JsonTokenType = {}));
894
+ })(JsonTokenType || (exports.JsonTokenType = JsonTokenType = {}));
1396
895
  var JsonToken;
1397
896
  (function(JsonToken2) {
1398
897
  function isType(token, type) {
1399
898
  return token.type === type;
1400
899
  }
1401
900
  JsonToken2.isType = isType;
1402
- })(JsonToken || (exports2.JsonToken = JsonToken = {}));
901
+ })(JsonToken || (exports.JsonToken = JsonToken = {}));
1403
902
  }
1404
903
  });
1405
904
 
1406
- // node_modules/.pnpm/@croct+json5-parser@0.2.0/node_modules/@croct/json5-parser/error.js
905
+ // node_modules/.pnpm/@croct+json5-parser@0.2.1/node_modules/@croct/json5-parser/error.js
1407
906
  var require_error = __commonJS({
1408
- "node_modules/.pnpm/@croct+json5-parser@0.2.0/node_modules/@croct/json5-parser/error.js"(exports2) {
907
+ "node_modules/.pnpm/@croct+json5-parser@0.2.1/node_modules/@croct/json5-parser/error.js"(exports) {
1409
908
  "use strict";
1410
- Object.defineProperty(exports2, "__esModule", { value: true });
1411
- exports2.JsonParseError = exports2.JsonError = void 0;
909
+ Object.defineProperty(exports, "__esModule", { value: true });
910
+ exports.JsonParseError = exports.JsonError = void 0;
1412
911
  var JsonError = class extends Error {
1413
912
  constructor(message) {
1414
913
  super(message);
1415
914
  Object.setPrototypeOf(this, new.target.prototype);
1416
915
  }
1417
916
  };
1418
- exports2.JsonError = JsonError;
917
+ exports.JsonError = JsonError;
1419
918
  var JsonParseError = class extends JsonError {
1420
919
  constructor(message, location) {
1421
920
  super(message);
@@ -1423,16 +922,16 @@ var require_error = __commonJS({
1423
922
  Object.setPrototypeOf(this, new.target.prototype);
1424
923
  }
1425
924
  };
1426
- exports2.JsonParseError = JsonParseError;
925
+ exports.JsonParseError = JsonParseError;
1427
926
  }
1428
927
  });
1429
928
 
1430
- // node_modules/.pnpm/@croct+json5-parser@0.2.0/node_modules/@croct/json5-parser/lexer.js
929
+ // node_modules/.pnpm/@croct+json5-parser@0.2.1/node_modules/@croct/json5-parser/lexer.js
1431
930
  var require_lexer = __commonJS({
1432
- "node_modules/.pnpm/@croct+json5-parser@0.2.0/node_modules/@croct/json5-parser/lexer.js"(exports2) {
931
+ "node_modules/.pnpm/@croct+json5-parser@0.2.1/node_modules/@croct/json5-parser/lexer.js"(exports) {
1433
932
  "use strict";
1434
- Object.defineProperty(exports2, "__esModule", { value: true });
1435
- exports2.JsonLexer = void 0;
933
+ Object.defineProperty(exports, "__esModule", { value: true });
934
+ exports.JsonLexer = void 0;
1436
935
  var token_1 = require_token();
1437
936
  var identifier_1 = require_identifier();
1438
937
  var error_1 = require_error();
@@ -1445,8 +944,7 @@ var require_lexer = __commonJS({
1445
944
  return [...new _JsonLexer(source)];
1446
945
  }
1447
946
  isEof() {
1448
- var _a;
1449
- return ((_a = this.current) == null ? void 0 : _a.type) === token_1.JsonTokenType.EOF;
947
+ return this.current?.type === token_1.JsonTokenType.EOF;
1450
948
  }
1451
949
  [Symbol.iterator]() {
1452
950
  return {
@@ -1509,7 +1007,6 @@ var require_lexer = __commonJS({
1509
1007
  return this.current;
1510
1008
  }
1511
1009
  match() {
1512
- var _a, _b, _c;
1513
1010
  for (const { type, pattern } of _JsonLexer.PATTERNS) {
1514
1011
  if (typeof pattern === "string") {
1515
1012
  if (this.remaining.startsWith(pattern)) {
@@ -1523,9 +1020,9 @@ var require_lexer = __commonJS({
1523
1020
  }
1524
1021
  }
1525
1022
  const start = {
1526
- index: ((_a = this.current) == null ? void 0 : _a.location.end.index) ?? 0,
1527
- line: ((_b = this.current) == null ? void 0 : _b.location.end.line) ?? 1,
1528
- column: ((_c = this.current) == null ? void 0 : _c.location.end.column) ?? 1
1023
+ index: this.current?.location.end.index ?? 0,
1024
+ line: this.current?.location.end.line ?? 1,
1025
+ column: this.current?.location.end.column ?? 1
1529
1026
  };
1530
1027
  const end = {
1531
1028
  index: start.index + 1,
@@ -1539,11 +1036,10 @@ var require_lexer = __commonJS({
1539
1036
  });
1540
1037
  }
1541
1038
  createToken(type, value) {
1542
- var _a, _b, _c;
1543
1039
  const start = {
1544
- index: ((_a = this.current) == null ? void 0 : _a.location.end.index) ?? 0,
1545
- line: ((_b = this.current) == null ? void 0 : _b.location.end.line) ?? 1,
1546
- column: ((_c = this.current) == null ? void 0 : _c.location.end.column) ?? 1
1040
+ index: this.current?.location.end.index ?? 0,
1041
+ line: this.current?.location.end.line ?? 1,
1042
+ column: this.current?.location.end.column ?? 1
1547
1043
  };
1548
1044
  const end = {
1549
1045
  index: start.index,
@@ -1572,7 +1068,7 @@ var require_lexer = __commonJS({
1572
1068
  return types.length === 0 || types.includes(token.type);
1573
1069
  }
1574
1070
  };
1575
- exports2.JsonLexer = JsonLexer;
1071
+ exports.JsonLexer = JsonLexer;
1576
1072
  JsonLexer.PATTERNS = [
1577
1073
  {
1578
1074
  type: token_1.JsonTokenType.BRACE_LEFT,
@@ -1642,12 +1138,12 @@ var require_lexer = __commonJS({
1642
1138
  }
1643
1139
  });
1644
1140
 
1645
- // node_modules/.pnpm/@croct+json5-parser@0.2.0/node_modules/@croct/json5-parser/location.js
1141
+ // node_modules/.pnpm/@croct+json5-parser@0.2.1/node_modules/@croct/json5-parser/location.js
1646
1142
  var require_location = __commonJS({
1647
- "node_modules/.pnpm/@croct+json5-parser@0.2.0/node_modules/@croct/json5-parser/location.js"(exports2) {
1143
+ "node_modules/.pnpm/@croct+json5-parser@0.2.1/node_modules/@croct/json5-parser/location.js"(exports) {
1648
1144
  "use strict";
1649
- Object.defineProperty(exports2, "__esModule", { value: true });
1650
- exports2.SourceLocation = exports2.SourcePosition = void 0;
1145
+ Object.defineProperty(exports, "__esModule", { value: true });
1146
+ exports.SourceLocation = exports.SourcePosition = void 0;
1651
1147
  var SourcePosition;
1652
1148
  (function(SourcePosition2) {
1653
1149
  function unknown() {
@@ -1658,7 +1154,7 @@ var require_location = __commonJS({
1658
1154
  };
1659
1155
  }
1660
1156
  SourcePosition2.unknown = unknown;
1661
- })(SourcePosition || (exports2.SourcePosition = SourcePosition = {}));
1157
+ })(SourcePosition || (exports.SourcePosition = SourcePosition = {}));
1662
1158
  var SourceLocation;
1663
1159
  (function(SourceLocation2) {
1664
1160
  function unknown() {
@@ -1668,16 +1164,16 @@ var require_location = __commonJS({
1668
1164
  };
1669
1165
  }
1670
1166
  SourceLocation2.unknown = unknown;
1671
- })(SourceLocation || (exports2.SourceLocation = SourceLocation = {}));
1167
+ })(SourceLocation || (exports.SourceLocation = SourceLocation = {}));
1672
1168
  }
1673
1169
  });
1674
1170
 
1675
- // node_modules/.pnpm/@croct+json5-parser@0.2.0/node_modules/@croct/json5-parser/node/node.js
1171
+ // node_modules/.pnpm/@croct+json5-parser@0.2.1/node_modules/@croct/json5-parser/node/node.js
1676
1172
  var require_node = __commonJS({
1677
- "node_modules/.pnpm/@croct+json5-parser@0.2.0/node_modules/@croct/json5-parser/node/node.js"(exports2) {
1173
+ "node_modules/.pnpm/@croct+json5-parser@0.2.1/node_modules/@croct/json5-parser/node/node.js"(exports) {
1678
1174
  "use strict";
1679
- Object.defineProperty(exports2, "__esModule", { value: true });
1680
- exports2.JsonNode = void 0;
1175
+ Object.defineProperty(exports, "__esModule", { value: true });
1176
+ exports.JsonNode = void 0;
1681
1177
  var location_1 = require_location();
1682
1178
  var JsonNode = class {
1683
1179
  constructor(definition) {
@@ -1690,16 +1186,16 @@ var require_node = __commonJS({
1690
1186
  return this.location.start.index === other.location.start.index && this.location.start.line === other.location.start.line && this.location.start.column === other.location.start.column && this.location.end.index === other.location.end.index && this.location.end.line === other.location.end.line && this.location.end.column === other.location.end.column;
1691
1187
  }
1692
1188
  };
1693
- exports2.JsonNode = JsonNode;
1189
+ exports.JsonNode = JsonNode;
1694
1190
  }
1695
1191
  });
1696
1192
 
1697
- // node_modules/.pnpm/@croct+json5-parser@0.2.0/node_modules/@croct/json5-parser/node/compositeNode.js
1193
+ // node_modules/.pnpm/@croct+json5-parser@0.2.1/node_modules/@croct/json5-parser/node/compositeNode.js
1698
1194
  var require_compositeNode = __commonJS({
1699
- "node_modules/.pnpm/@croct+json5-parser@0.2.0/node_modules/@croct/json5-parser/node/compositeNode.js"(exports2) {
1195
+ "node_modules/.pnpm/@croct+json5-parser@0.2.1/node_modules/@croct/json5-parser/node/compositeNode.js"(exports) {
1700
1196
  "use strict";
1701
- Object.defineProperty(exports2, "__esModule", { value: true });
1702
- exports2.JsonCompositeNode = void 0;
1197
+ Object.defineProperty(exports, "__esModule", { value: true });
1198
+ exports.JsonCompositeNode = void 0;
1703
1199
  var node_1 = require_node();
1704
1200
  var JsonCompositeNode = class _JsonCompositeNode extends node_1.JsonNode {
1705
1201
  constructor(definition) {
@@ -1722,16 +1218,16 @@ var require_compositeNode = __commonJS({
1722
1218
  return [node];
1723
1219
  }
1724
1220
  };
1725
- exports2.JsonCompositeNode = JsonCompositeNode;
1221
+ exports.JsonCompositeNode = JsonCompositeNode;
1726
1222
  }
1727
1223
  });
1728
1224
 
1729
- // node_modules/.pnpm/@croct+json5-parser@0.2.0/node_modules/@croct/json5-parser/node/valueNode.js
1225
+ // node_modules/.pnpm/@croct+json5-parser@0.2.1/node_modules/@croct/json5-parser/node/valueNode.js
1730
1226
  var require_valueNode = __commonJS({
1731
- "node_modules/.pnpm/@croct+json5-parser@0.2.0/node_modules/@croct/json5-parser/node/valueNode.js"(exports2) {
1227
+ "node_modules/.pnpm/@croct+json5-parser@0.2.1/node_modules/@croct/json5-parser/node/valueNode.js"(exports) {
1732
1228
  "use strict";
1733
- Object.defineProperty(exports2, "__esModule", { value: true });
1734
- exports2.JsonValueNode = void 0;
1229
+ Object.defineProperty(exports, "__esModule", { value: true });
1230
+ exports.JsonValueNode = void 0;
1735
1231
  var compositeNode_1 = require_compositeNode();
1736
1232
  var error_1 = require_error();
1737
1233
  var JsonValueNode = class extends compositeNode_1.JsonCompositeNode {
@@ -1742,16 +1238,16 @@ var require_valueNode = __commonJS({
1742
1238
  return this;
1743
1239
  }
1744
1240
  };
1745
- exports2.JsonValueNode = JsonValueNode;
1241
+ exports.JsonValueNode = JsonValueNode;
1746
1242
  }
1747
1243
  });
1748
1244
 
1749
- // node_modules/.pnpm/@croct+json5-parser@0.2.0/node_modules/@croct/json5-parser/node/tokenNode.js
1245
+ // node_modules/.pnpm/@croct+json5-parser@0.2.1/node_modules/@croct/json5-parser/node/tokenNode.js
1750
1246
  var require_tokenNode = __commonJS({
1751
- "node_modules/.pnpm/@croct+json5-parser@0.2.0/node_modules/@croct/json5-parser/node/tokenNode.js"(exports2) {
1247
+ "node_modules/.pnpm/@croct+json5-parser@0.2.1/node_modules/@croct/json5-parser/node/tokenNode.js"(exports) {
1752
1248
  "use strict";
1753
- Object.defineProperty(exports2, "__esModule", { value: true });
1754
- exports2.JsonTokenNode = void 0;
1249
+ Object.defineProperty(exports, "__esModule", { value: true });
1250
+ exports.JsonTokenNode = void 0;
1755
1251
  var token_1 = require_token();
1756
1252
  var node_1 = require_node();
1757
1253
  var JsonTokenNode = class _JsonTokenNode extends node_1.JsonNode {
@@ -1777,16 +1273,16 @@ var require_tokenNode = __commonJS({
1777
1273
  return this.value;
1778
1274
  }
1779
1275
  };
1780
- exports2.JsonTokenNode = JsonTokenNode;
1276
+ exports.JsonTokenNode = JsonTokenNode;
1781
1277
  }
1782
1278
  });
1783
1279
 
1784
- // node_modules/.pnpm/@croct+json5-parser@0.2.0/node_modules/@croct/json5-parser/manipulator.js
1280
+ // node_modules/.pnpm/@croct+json5-parser@0.2.1/node_modules/@croct/json5-parser/manipulator.js
1785
1281
  var require_manipulator = __commonJS({
1786
- "node_modules/.pnpm/@croct+json5-parser@0.2.0/node_modules/@croct/json5-parser/manipulator.js"(exports2) {
1282
+ "node_modules/.pnpm/@croct+json5-parser@0.2.1/node_modules/@croct/json5-parser/manipulator.js"(exports) {
1787
1283
  "use strict";
1788
- Object.defineProperty(exports2, "__esModule", { value: true });
1789
- exports2.NodeManipulator = exports2.NodeMatcher = void 0;
1284
+ Object.defineProperty(exports, "__esModule", { value: true });
1285
+ exports.NodeManipulator = exports.NodeMatcher = void 0;
1790
1286
  var token_1 = require_token();
1791
1287
  var node_1 = require_node2();
1792
1288
  var NodeMatcher;
@@ -1809,7 +1305,7 @@ var require_manipulator = __commonJS({
1809
1305
  token_1.JsonTokenType.BRACKET_LEFT,
1810
1306
  token_1.JsonTokenType.BRACKET_RIGHT
1811
1307
  ].includes(node.type);
1812
- })(NodeMatcher || (exports2.NodeMatcher = NodeMatcher = {}));
1308
+ })(NodeMatcher || (exports.NodeMatcher = NodeMatcher = {}));
1813
1309
  var NodeManipulator = class _NodeManipulator {
1814
1310
  constructor(list) {
1815
1311
  this.index = 0;
@@ -1961,7 +1457,7 @@ var require_manipulator = __commonJS({
1961
1457
  return this;
1962
1458
  }
1963
1459
  findMatch(nodes) {
1964
- return this.findNext((current) => nodes.some((node) => current == null ? void 0 : current.isEquivalent(node)), NodeMatcher.INSIGNIFICANT);
1460
+ return this.findNext((current) => nodes.some((node) => current?.isEquivalent(node)), NodeMatcher.INSIGNIFICANT);
1965
1461
  }
1966
1462
  fixSpacing(startIndex) {
1967
1463
  const currentToken = this.done() ? null : this.current;
@@ -2016,16 +1512,16 @@ var require_manipulator = __commonJS({
2016
1512
  return previousNode.constructor === currentNode.constructor;
2017
1513
  }
2018
1514
  };
2019
- exports2.NodeManipulator = NodeManipulator;
1515
+ exports.NodeManipulator = NodeManipulator;
2020
1516
  }
2021
1517
  });
2022
1518
 
2023
- // node_modules/.pnpm/@croct+json5-parser@0.2.0/node_modules/@croct/json5-parser/node/factory.js
1519
+ // node_modules/.pnpm/@croct+json5-parser@0.2.1/node_modules/@croct/json5-parser/node/factory.js
2024
1520
  var require_factory = __commonJS({
2025
- "node_modules/.pnpm/@croct+json5-parser@0.2.0/node_modules/@croct/json5-parser/node/factory.js"(exports2) {
1521
+ "node_modules/.pnpm/@croct+json5-parser@0.2.1/node_modules/@croct/json5-parser/node/factory.js"(exports) {
2026
1522
  "use strict";
2027
- Object.defineProperty(exports2, "__esModule", { value: true });
2028
- exports2.JsonValueFactory = void 0;
1523
+ Object.defineProperty(exports, "__esModule", { value: true });
1524
+ exports.JsonValueFactory = void 0;
2029
1525
  var valueNode_1 = require_valueNode();
2030
1526
  var JsonValueFactory;
2031
1527
  (function(JsonValueFactory2) {
@@ -2047,16 +1543,16 @@ var require_factory = __commonJS({
2047
1543
  return factories.primitive(value);
2048
1544
  }
2049
1545
  JsonValueFactory2.create = create;
2050
- })(JsonValueFactory || (exports2.JsonValueFactory = JsonValueFactory = {}));
1546
+ })(JsonValueFactory || (exports.JsonValueFactory = JsonValueFactory = {}));
2051
1547
  }
2052
1548
  });
2053
1549
 
2054
- // node_modules/.pnpm/@croct+json5-parser@0.2.0/node_modules/@croct/json5-parser/node/identifierNode.js
1550
+ // node_modules/.pnpm/@croct+json5-parser@0.2.1/node_modules/@croct/json5-parser/node/identifierNode.js
2055
1551
  var require_identifierNode = __commonJS({
2056
- "node_modules/.pnpm/@croct+json5-parser@0.2.0/node_modules/@croct/json5-parser/node/identifierNode.js"(exports2) {
1552
+ "node_modules/.pnpm/@croct+json5-parser@0.2.1/node_modules/@croct/json5-parser/node/identifierNode.js"(exports) {
2057
1553
  "use strict";
2058
- Object.defineProperty(exports2, "__esModule", { value: true });
2059
- exports2.JsonIdentifierNode = void 0;
1554
+ Object.defineProperty(exports, "__esModule", { value: true });
1555
+ exports.JsonIdentifierNode = void 0;
2060
1556
  var valueNode_1 = require_valueNode();
2061
1557
  var manipulator_1 = require_manipulator();
2062
1558
  var tokenNode_1 = require_tokenNode();
@@ -2108,16 +1604,16 @@ var require_identifierNode = __commonJS({
2108
1604
  return this.token.value;
2109
1605
  }
2110
1606
  };
2111
- exports2.JsonIdentifierNode = JsonIdentifierNode;
1607
+ exports.JsonIdentifierNode = JsonIdentifierNode;
2112
1608
  }
2113
1609
  });
2114
1610
 
2115
- // node_modules/.pnpm/@croct+json5-parser@0.2.0/node_modules/@croct/json5-parser/node/primitiveNode.js
1611
+ // node_modules/.pnpm/@croct+json5-parser@0.2.1/node_modules/@croct/json5-parser/node/primitiveNode.js
2116
1612
  var require_primitiveNode = __commonJS({
2117
- "node_modules/.pnpm/@croct+json5-parser@0.2.0/node_modules/@croct/json5-parser/node/primitiveNode.js"(exports2) {
1613
+ "node_modules/.pnpm/@croct+json5-parser@0.2.1/node_modules/@croct/json5-parser/node/primitiveNode.js"(exports) {
2118
1614
  "use strict";
2119
- Object.defineProperty(exports2, "__esModule", { value: true });
2120
- exports2.JsonPrimitiveNode = void 0;
1615
+ Object.defineProperty(exports, "__esModule", { value: true });
1616
+ exports.JsonPrimitiveNode = void 0;
2121
1617
  var valueNode_1 = require_valueNode();
2122
1618
  var manipulator_1 = require_manipulator();
2123
1619
  var tokenNode_1 = require_tokenNode();
@@ -2152,11 +1648,10 @@ var require_primitiveNode = __commonJS({
2152
1648
  this.children.length = 0;
2153
1649
  }
2154
1650
  rebuild(formatting) {
2155
- var _a;
2156
1651
  const manipulator = new manipulator_1.NodeManipulator(this.children);
2157
1652
  let token = this.token;
2158
1653
  if (token.isType(token_1.JsonTokenType.STRING) && manipulator.done()) {
2159
- const quotes = (_a = formatting == null ? void 0 : formatting.string) == null ? void 0 : _a.quote;
1654
+ const quotes = formatting?.string?.quote;
2160
1655
  if (quotes === "single") {
2161
1656
  let value = JSON.stringify(this.value).slice(1, -1).replace(/((?:^|[^\\])(?:\\\\)*)\\"/g, (_3, preceding) => `${preceding}"`).replace(/'/g, "\\'");
2162
1657
  value = `'${value}'`;
@@ -2185,7 +1680,7 @@ var require_primitiveNode = __commonJS({
2185
1680
  return this.value;
2186
1681
  }
2187
1682
  };
2188
- exports2.JsonPrimitiveNode = JsonPrimitiveNode;
1683
+ exports.JsonPrimitiveNode = JsonPrimitiveNode;
2189
1684
  var tokenTypes = {
2190
1685
  string: token_1.JsonTokenType.STRING,
2191
1686
  number: token_1.JsonTokenType.NUMBER,
@@ -2202,12 +1697,12 @@ var require_primitiveNode = __commonJS({
2202
1697
  }
2203
1698
  });
2204
1699
 
2205
- // node_modules/.pnpm/@croct+json5-parser@0.2.0/node_modules/@croct/json5-parser/node/propertyNode.js
1700
+ // node_modules/.pnpm/@croct+json5-parser@0.2.1/node_modules/@croct/json5-parser/node/propertyNode.js
2206
1701
  var require_propertyNode = __commonJS({
2207
- "node_modules/.pnpm/@croct+json5-parser@0.2.0/node_modules/@croct/json5-parser/node/propertyNode.js"(exports2) {
1702
+ "node_modules/.pnpm/@croct+json5-parser@0.2.1/node_modules/@croct/json5-parser/node/propertyNode.js"(exports) {
2208
1703
  "use strict";
2209
- Object.defineProperty(exports2, "__esModule", { value: true });
2210
- exports2.JsonPropertyNode = void 0;
1704
+ Object.defineProperty(exports, "__esModule", { value: true });
1705
+ exports.JsonPropertyNode = void 0;
2211
1706
  var tokenNode_1 = require_tokenNode();
2212
1707
  var token_1 = require_token();
2213
1708
  var compositeNode_1 = require_compositeNode();
@@ -2231,10 +1726,9 @@ var require_propertyNode = __commonJS({
2231
1726
  this.value = factory_1.JsonValueFactory.create(value);
2232
1727
  }
2233
1728
  rebuild(formatting) {
2234
- var _a, _b, _c;
2235
1729
  this.value.rebuild(formatting);
2236
- const quote = (_a = formatting == null ? void 0 : formatting.property) == null ? void 0 : _a.quote;
2237
- const spaced = ((_b = formatting == null ? void 0 : formatting.object) == null ? void 0 : _b.colonSpacing) ?? false;
1730
+ const quote = formatting?.property?.quote;
1731
+ const spaced = formatting?.object?.colonSpacing ?? false;
2238
1732
  const manipulator = new manipulator_1.NodeManipulator(this.children);
2239
1733
  let { key } = this;
2240
1734
  if (manipulator.matches(this.key)) {
@@ -2244,7 +1738,7 @@ var require_propertyNode = __commonJS({
2244
1738
  key.rebuild({
2245
1739
  ...formatting,
2246
1740
  string: {
2247
- quote: quote === "single" || quote === "double" ? quote : (_c = formatting == null ? void 0 : formatting.string) == null ? void 0 : _c.quote
1741
+ quote: quote === "single" || quote === "double" ? quote : formatting?.string?.quote
2248
1742
  }
2249
1743
  });
2250
1744
  }
@@ -2262,8 +1756,7 @@ var require_propertyNode = __commonJS({
2262
1756
  manipulator.node(this.value).end();
2263
1757
  }
2264
1758
  formatKey(formatting) {
2265
- var _a;
2266
- if (this.key instanceof primitiveNode_1.JsonPrimitiveNode && ((_a = formatting == null ? void 0 : formatting.property) == null ? void 0 : _a.unquoted) === true && (0, identifier_1.isIdentifier)(this.key.value)) {
1759
+ if (this.key instanceof primitiveNode_1.JsonPrimitiveNode && formatting?.property?.unquoted === true && (0, identifier_1.isIdentifier)(this.key.value)) {
2267
1760
  return identifierNode_1.JsonIdentifierNode.of(this.key.value);
2268
1761
  }
2269
1762
  return this.key;
@@ -2293,16 +1786,16 @@ var require_propertyNode = __commonJS({
2293
1786
  return this.key.isEquivalent(other.key) && this.value.isEquivalent(other.value);
2294
1787
  }
2295
1788
  };
2296
- exports2.JsonPropertyNode = JsonPropertyNode;
1789
+ exports.JsonPropertyNode = JsonPropertyNode;
2297
1790
  }
2298
1791
  });
2299
1792
 
2300
- // node_modules/.pnpm/@croct+json5-parser@0.2.0/node_modules/@croct/json5-parser/node/structureNode.js
1793
+ // node_modules/.pnpm/@croct+json5-parser@0.2.1/node_modules/@croct/json5-parser/node/structureNode.js
2301
1794
  var require_structureNode = __commonJS({
2302
- "node_modules/.pnpm/@croct+json5-parser@0.2.0/node_modules/@croct/json5-parser/node/structureNode.js"(exports2) {
1795
+ "node_modules/.pnpm/@croct+json5-parser@0.2.1/node_modules/@croct/json5-parser/node/structureNode.js"(exports) {
2303
1796
  "use strict";
2304
- Object.defineProperty(exports2, "__esModule", { value: true });
2305
- exports2.JsonStructureNode = exports2.StructureDelimiter = void 0;
1797
+ Object.defineProperty(exports, "__esModule", { value: true });
1798
+ exports.JsonStructureNode = exports.StructureDelimiter = void 0;
2306
1799
  var valueNode_1 = require_valueNode();
2307
1800
  var token_1 = require_token();
2308
1801
  var tokenNode_1 = require_tokenNode();
@@ -2318,7 +1811,7 @@ var require_structureNode = __commonJS({
2318
1811
  (function(StructureDelimiter2) {
2319
1812
  StructureDelimiter2["OBJECT"] = "object";
2320
1813
  StructureDelimiter2["ARRAY"] = "array";
2321
- })(StructureDelimiter || (exports2.StructureDelimiter = StructureDelimiter = {}));
1814
+ })(StructureDelimiter || (exports.StructureDelimiter = StructureDelimiter = {}));
2322
1815
  (function(StructureDelimiter2) {
2323
1816
  const definitions = {
2324
1817
  [StructureDelimiter2.OBJECT]: {
@@ -2358,7 +1851,7 @@ var require_structureNode = __commonJS({
2358
1851
  return new tokenNode_1.JsonTokenNode(definitions[delimiter].end);
2359
1852
  }
2360
1853
  StructureDelimiter2.getEndToken = getEndToken;
2361
- })(StructureDelimiter || (exports2.StructureDelimiter = StructureDelimiter = {}));
1854
+ })(StructureDelimiter || (exports.StructureDelimiter = StructureDelimiter = {}));
2362
1855
  var JsonStructureNode = class _JsonStructureNode extends valueNode_1.JsonValueNode {
2363
1856
  reset() {
2364
1857
  for (const item of this.getList()) {
@@ -2700,16 +2193,16 @@ var require_structureNode = __commonJS({
2700
2193
  );
2701
2194
  }
2702
2195
  };
2703
- exports2.JsonStructureNode = JsonStructureNode;
2196
+ exports.JsonStructureNode = JsonStructureNode;
2704
2197
  }
2705
2198
  });
2706
2199
 
2707
- // node_modules/.pnpm/@croct+json5-parser@0.2.0/node_modules/@croct/json5-parser/node/arrayNode.js
2200
+ // node_modules/.pnpm/@croct+json5-parser@0.2.1/node_modules/@croct/json5-parser/node/arrayNode.js
2708
2201
  var require_arrayNode = __commonJS({
2709
- "node_modules/.pnpm/@croct+json5-parser@0.2.0/node_modules/@croct/json5-parser/node/arrayNode.js"(exports2) {
2202
+ "node_modules/.pnpm/@croct+json5-parser@0.2.1/node_modules/@croct/json5-parser/node/arrayNode.js"(exports) {
2710
2203
  "use strict";
2711
- Object.defineProperty(exports2, "__esModule", { value: true });
2712
- exports2.JsonArrayNode = void 0;
2204
+ Object.defineProperty(exports, "__esModule", { value: true });
2205
+ exports.JsonArrayNode = void 0;
2713
2206
  var structureNode_1 = require_structureNode();
2714
2207
  var factory_1 = require_factory();
2715
2208
  var error_1 = require_error();
@@ -2808,19 +2301,19 @@ var require_arrayNode = __commonJS({
2808
2301
  return this.elements.map((element) => element.toJSON());
2809
2302
  }
2810
2303
  };
2811
- exports2.JsonArrayNode = JsonArrayNode;
2304
+ exports.JsonArrayNode = JsonArrayNode;
2812
2305
  factory_1.JsonValueFactory.register("array", (elements) => new JsonArrayNode({
2813
2306
  elements: elements.map(factory_1.JsonValueFactory.create)
2814
2307
  }));
2815
2308
  }
2816
2309
  });
2817
2310
 
2818
- // node_modules/.pnpm/@croct+json5-parser@0.2.0/node_modules/@croct/json5-parser/node/objectNode.js
2311
+ // node_modules/.pnpm/@croct+json5-parser@0.2.1/node_modules/@croct/json5-parser/node/objectNode.js
2819
2312
  var require_objectNode = __commonJS({
2820
- "node_modules/.pnpm/@croct+json5-parser@0.2.0/node_modules/@croct/json5-parser/node/objectNode.js"(exports2) {
2313
+ "node_modules/.pnpm/@croct+json5-parser@0.2.1/node_modules/@croct/json5-parser/node/objectNode.js"(exports) {
2821
2314
  "use strict";
2822
- Object.defineProperty(exports2, "__esModule", { value: true });
2823
- exports2.JsonObjectNode = void 0;
2315
+ Object.defineProperty(exports, "__esModule", { value: true });
2316
+ exports.JsonObjectNode = void 0;
2824
2317
  var valueNode_1 = require_valueNode();
2825
2318
  var structureNode_1 = require_structureNode();
2826
2319
  var propertyNode_1 = require_propertyNode();
@@ -2856,13 +2349,17 @@ var require_objectNode = __commonJS({
2856
2349
  this.children.splice(0, this.children.length, ...source.children.map((child) => child.clone()));
2857
2350
  return;
2858
2351
  }
2352
+ if (this.children.length === 0) {
2353
+ this.rebuild({ ...source.detectFormatting(), indentationLevel: 0 });
2354
+ }
2859
2355
  for (const property of source.propertyNodes) {
2860
2356
  const key = property.key.toJSON();
2861
2357
  const sourceRange = source.findPropertyRange(key);
2862
- let sourceChildren = [property];
2863
- if (sourceRange !== null) {
2864
- sourceChildren = source.children.slice(sourceRange[0], sourceRange[1] + 1);
2358
+ if (sourceRange === null) {
2359
+ this.set(property.key, property.value.clone());
2360
+ continue;
2865
2361
  }
2362
+ let sourceChildren = source.children.slice(sourceRange[0], sourceRange[1] + 1);
2866
2363
  const newProperty = property.clone();
2867
2364
  sourceChildren = sourceChildren.map((node) => node === property ? newProperty : node.clone());
2868
2365
  const range = this.findPropertyRange(key);
@@ -3014,7 +2511,8 @@ var require_objectNode = __commonJS({
3014
2511
  return [...this.propertyNodes];
3015
2512
  }
3016
2513
  set(name, value) {
3017
- const index = this.propertyNodes.findIndex((current) => current.key.toJSON() === name);
2514
+ const normalizedName = typeof name === "string" ? name : name.toJSON();
2515
+ const index = this.propertyNodes.findIndex((current) => current.key.toJSON() === normalizedName);
3018
2516
  if (index >= 0) {
3019
2517
  this.propertyNodes[index].set(value);
3020
2518
  return;
@@ -3063,10 +2561,7 @@ var require_objectNode = __commonJS({
3063
2561
  return false;
3064
2562
  }
3065
2563
  const entries = Object.fromEntries(other.properties.map((property) => [property.key.toJSON(), property]));
3066
- return this.properties.every((property) => {
3067
- var _a;
3068
- return ((_a = entries[property.key.toJSON()]) == null ? void 0 : _a.isEquivalent(property)) === true;
3069
- });
2564
+ return this.properties.every((property) => entries[property.key.toJSON()]?.isEquivalent(property) === true);
3070
2565
  }
3071
2566
  toJSON() {
3072
2567
  return Object.fromEntries(this.properties.map((property) => [
@@ -3075,7 +2570,7 @@ var require_objectNode = __commonJS({
3075
2570
  ]));
3076
2571
  }
3077
2572
  };
3078
- exports2.JsonObjectNode = JsonObjectNode2;
2573
+ exports.JsonObjectNode = JsonObjectNode2;
3079
2574
  factory_1.JsonValueFactory.register("object", (object) => new JsonObjectNode2({
3080
2575
  properties: Object.entries(object).flatMap(([propertyName, propertyValue]) => propertyValue === void 0 ? [] : [
3081
2576
  new propertyNode_1.JsonPropertyNode({
@@ -3087,11 +2582,11 @@ var require_objectNode = __commonJS({
3087
2582
  }
3088
2583
  });
3089
2584
 
3090
- // node_modules/.pnpm/@croct+json5-parser@0.2.0/node_modules/@croct/json5-parser/node/index.js
2585
+ // node_modules/.pnpm/@croct+json5-parser@0.2.1/node_modules/@croct/json5-parser/node/index.js
3091
2586
  var require_node2 = __commonJS({
3092
- "node_modules/.pnpm/@croct+json5-parser@0.2.0/node_modules/@croct/json5-parser/node/index.js"(exports2) {
2587
+ "node_modules/.pnpm/@croct+json5-parser@0.2.1/node_modules/@croct/json5-parser/node/index.js"(exports) {
3093
2588
  "use strict";
3094
- var __createBinding = exports2 && exports2.__createBinding || (Object.create ? (function(o2, m2, k3, k22) {
2589
+ var __createBinding = exports && exports.__createBinding || (Object.create ? (function(o2, m2, k3, k22) {
3095
2590
  if (k22 === void 0) k22 = k3;
3096
2591
  var desc = Object.getOwnPropertyDescriptor(m2, k3);
3097
2592
  if (!desc || ("get" in desc ? !m2.__esModule : desc.writable || desc.configurable)) {
@@ -3104,30 +2599,30 @@ var require_node2 = __commonJS({
3104
2599
  if (k22 === void 0) k22 = k3;
3105
2600
  o2[k22] = m2[k3];
3106
2601
  }));
3107
- var __exportStar = exports2 && exports2.__exportStar || function(m2, exports3) {
3108
- for (var p2 in m2) if (p2 !== "default" && !Object.prototype.hasOwnProperty.call(exports3, p2)) __createBinding(exports3, m2, p2);
2602
+ var __exportStar = exports && exports.__exportStar || function(m2, exports2) {
2603
+ for (var p2 in m2) if (p2 !== "default" && !Object.prototype.hasOwnProperty.call(exports2, p2)) __createBinding(exports2, m2, p2);
3109
2604
  };
3110
- Object.defineProperty(exports2, "__esModule", { value: true });
3111
- __exportStar(require_structureNode(), exports2);
3112
- __exportStar(require_arrayNode(), exports2);
3113
- __exportStar(require_compositeNode(), exports2);
3114
- __exportStar(require_identifierNode(), exports2);
3115
- __exportStar(require_node(), exports2);
3116
- __exportStar(require_objectNode(), exports2);
3117
- __exportStar(require_primitiveNode(), exports2);
3118
- __exportStar(require_propertyNode(), exports2);
3119
- __exportStar(require_tokenNode(), exports2);
3120
- __exportStar(require_valueNode(), exports2);
3121
- __exportStar(require_factory(), exports2);
2605
+ Object.defineProperty(exports, "__esModule", { value: true });
2606
+ __exportStar(require_structureNode(), exports);
2607
+ __exportStar(require_arrayNode(), exports);
2608
+ __exportStar(require_compositeNode(), exports);
2609
+ __exportStar(require_identifierNode(), exports);
2610
+ __exportStar(require_node(), exports);
2611
+ __exportStar(require_objectNode(), exports);
2612
+ __exportStar(require_primitiveNode(), exports);
2613
+ __exportStar(require_propertyNode(), exports);
2614
+ __exportStar(require_tokenNode(), exports);
2615
+ __exportStar(require_valueNode(), exports);
2616
+ __exportStar(require_factory(), exports);
3122
2617
  }
3123
2618
  });
3124
2619
 
3125
- // node_modules/.pnpm/@croct+json5-parser@0.2.0/node_modules/@croct/json5-parser/parser.js
2620
+ // node_modules/.pnpm/@croct+json5-parser@0.2.1/node_modules/@croct/json5-parser/parser.js
3126
2621
  var require_parser = __commonJS({
3127
- "node_modules/.pnpm/@croct+json5-parser@0.2.0/node_modules/@croct/json5-parser/parser.js"(exports2) {
2622
+ "node_modules/.pnpm/@croct+json5-parser@0.2.1/node_modules/@croct/json5-parser/parser.js"(exports) {
3128
2623
  "use strict";
3129
- Object.defineProperty(exports2, "__esModule", { value: true });
3130
- exports2.JsonParser = void 0;
2624
+ Object.defineProperty(exports, "__esModule", { value: true });
2625
+ exports.JsonParser = void 0;
3131
2626
  var lexer_1 = require_lexer();
3132
2627
  var token_1 = require_token();
3133
2628
  var node_1 = require_node2();
@@ -3353,23 +2848,23 @@ var require_parser = __commonJS({
3353
2848
  });
3354
2849
  }
3355
2850
  };
3356
- exports2.JsonParser = JsonParser2;
2851
+ exports.JsonParser = JsonParser2;
3357
2852
  }
3358
2853
  });
3359
2854
 
3360
- // node_modules/.pnpm/@croct+json5-parser@0.2.0/node_modules/@croct/json5-parser/formatting.js
2855
+ // node_modules/.pnpm/@croct+json5-parser@0.2.1/node_modules/@croct/json5-parser/formatting.js
3361
2856
  var require_formatting = __commonJS({
3362
- "node_modules/.pnpm/@croct+json5-parser@0.2.0/node_modules/@croct/json5-parser/formatting.js"(exports2) {
2857
+ "node_modules/.pnpm/@croct+json5-parser@0.2.1/node_modules/@croct/json5-parser/formatting.js"(exports) {
3363
2858
  "use strict";
3364
- Object.defineProperty(exports2, "__esModule", { value: true });
2859
+ Object.defineProperty(exports, "__esModule", { value: true });
3365
2860
  }
3366
2861
  });
3367
2862
 
3368
- // node_modules/.pnpm/@croct+json5-parser@0.2.0/node_modules/@croct/json5-parser/index.js
2863
+ // node_modules/.pnpm/@croct+json5-parser@0.2.1/node_modules/@croct/json5-parser/index.js
3369
2864
  var require_json5_parser = __commonJS({
3370
- "node_modules/.pnpm/@croct+json5-parser@0.2.0/node_modules/@croct/json5-parser/index.js"(exports2) {
2865
+ "node_modules/.pnpm/@croct+json5-parser@0.2.1/node_modules/@croct/json5-parser/index.js"(exports) {
3371
2866
  "use strict";
3372
- var __createBinding = exports2 && exports2.__createBinding || (Object.create ? (function(o2, m2, k3, k22) {
2867
+ var __createBinding = exports && exports.__createBinding || (Object.create ? (function(o2, m2, k3, k22) {
3373
2868
  if (k22 === void 0) k22 = k3;
3374
2869
  var desc = Object.getOwnPropertyDescriptor(m2, k3);
3375
2870
  if (!desc || ("get" in desc ? !m2.__esModule : desc.writable || desc.configurable)) {
@@ -3382,92 +2877,51 @@ var require_json5_parser = __commonJS({
3382
2877
  if (k22 === void 0) k22 = k3;
3383
2878
  o2[k22] = m2[k3];
3384
2879
  }));
3385
- var __exportStar = exports2 && exports2.__exportStar || function(m2, exports3) {
3386
- for (var p2 in m2) if (p2 !== "default" && !Object.prototype.hasOwnProperty.call(exports3, p2)) __createBinding(exports3, m2, p2);
3387
- };
3388
- Object.defineProperty(exports2, "__esModule", { value: true });
3389
- __exportStar(require_identifier(), exports2);
3390
- __exportStar(require_lexer(), exports2);
3391
- __exportStar(require_location(), exports2);
3392
- __exportStar(require_parser(), exports2);
3393
- __exportStar(require_token(), exports2);
3394
- __exportStar(require_formatting(), exports2);
3395
- __exportStar(require_node2(), exports2);
3396
- __exportStar(require_error(), exports2);
3397
- }
3398
- });
3399
-
3400
- // node_modules/.pnpm/merge-stream@2.0.0/node_modules/merge-stream/index.js
3401
- var require_merge_stream = __commonJS({
3402
- "node_modules/.pnpm/merge-stream@2.0.0/node_modules/merge-stream/index.js"(exports2, module2) {
3403
- "use strict";
3404
- var { PassThrough } = require("stream");
3405
- module2.exports = function() {
3406
- var sources = [];
3407
- var output = new PassThrough({ objectMode: true });
3408
- output.setMaxListeners(0);
3409
- output.add = add;
3410
- output.isEmpty = isEmpty;
3411
- output.on("unpipe", remove);
3412
- Array.prototype.slice.call(arguments).forEach(add);
3413
- return output;
3414
- function add(source) {
3415
- if (Array.isArray(source)) {
3416
- source.forEach(add);
3417
- return this;
3418
- }
3419
- sources.push(source);
3420
- source.once("end", remove.bind(null, source));
3421
- source.once("error", output.emit.bind(output, "error"));
3422
- source.pipe(output, { end: false });
3423
- return this;
3424
- }
3425
- function isEmpty() {
3426
- return sources.length == 0;
3427
- }
3428
- function remove(source) {
3429
- sources = sources.filter(function(it) {
3430
- return it !== source;
3431
- });
3432
- if (!sources.length && output.readable) {
3433
- output.end();
3434
- }
3435
- }
2880
+ var __exportStar = exports && exports.__exportStar || function(m2, exports2) {
2881
+ for (var p2 in m2) if (p2 !== "default" && !Object.prototype.hasOwnProperty.call(exports2, p2)) __createBinding(exports2, m2, p2);
3436
2882
  };
2883
+ Object.defineProperty(exports, "__esModule", { value: true });
2884
+ __exportStar(require_identifier(), exports);
2885
+ __exportStar(require_lexer(), exports);
2886
+ __exportStar(require_location(), exports);
2887
+ __exportStar(require_parser(), exports);
2888
+ __exportStar(require_token(), exports);
2889
+ __exportStar(require_formatting(), exports);
2890
+ __exportStar(require_node2(), exports);
2891
+ __exportStar(require_error(), exports);
3437
2892
  }
3438
2893
  });
3439
2894
 
3440
2895
  // packages/qwik/src/cli/migrate-v2/tools/visit-not-ignored-files.ts
2896
+ import { existsSync as existsSync2, lstatSync, readFileSync as readFileSync2, readdirSync } from "fs";
2897
+ import ignore from "ignore";
2898
+ import { join as join8, relative as relative2 } from "path";
3441
2899
  function visitNotIgnoredFiles(dirPath, visitor) {
3442
2900
  let ig;
3443
- if ((0, import_fs2.existsSync)(".gitignore")) {
3444
- ig = (0, import_ignore.default)();
2901
+ if (existsSync2(".gitignore")) {
2902
+ ig = ignore();
3445
2903
  ig.add(".git");
3446
- ig.add((0, import_fs2.readFileSync)(".gitignore", "utf-8"));
2904
+ ig.add(readFileSync2(".gitignore", "utf-8"));
3447
2905
  }
3448
- dirPath = (0, import_path4.relative)(process.cwd(), dirPath);
3449
- if (dirPath !== "" && (ig == null ? void 0 : ig.ignores(dirPath))) {
2906
+ dirPath = relative2(process.cwd(), dirPath);
2907
+ if (dirPath !== "" && ig?.ignores(dirPath)) {
3450
2908
  return;
3451
2909
  }
3452
- for (const child of (0, import_fs2.readdirSync)((0, import_path4.join)(process.cwd(), dirPath))) {
3453
- const fullPath = (0, import_path4.join)(dirPath, child);
3454
- if (ig == null ? void 0 : ig.ignores(fullPath)) {
2910
+ for (const child of readdirSync(join8(process.cwd(), dirPath))) {
2911
+ const fullPath = join8(dirPath, child);
2912
+ if (ig?.ignores(fullPath)) {
3455
2913
  continue;
3456
2914
  }
3457
- if ((0, import_fs2.lstatSync)(fullPath).isFile()) {
2915
+ if (lstatSync(fullPath).isFile()) {
3458
2916
  visitor(fullPath);
3459
2917
  } else {
3460
2918
  visitNotIgnoredFiles(fullPath, visitor);
3461
2919
  }
3462
2920
  }
3463
2921
  }
3464
- var import_fs2, import_ignore, import_path4;
3465
2922
  var init_visit_not_ignored_files = __esm({
3466
2923
  "packages/qwik/src/cli/migrate-v2/tools/visit-not-ignored-files.ts"() {
3467
2924
  "use strict";
3468
- import_fs2 = require("fs");
3469
- import_ignore = __toESM(require("ignore"), 1);
3470
- import_path4 = require("path");
3471
2925
  }
3472
2926
  });
3473
2927
 
@@ -3476,13 +2930,14 @@ var rename_import_exports = {};
3476
2930
  __export(rename_import_exports, {
3477
2931
  replaceImportInFiles: () => replaceImportInFiles
3478
2932
  });
2933
+ import { Project, ts } from "ts-morph";
3479
2934
  function replaceImportInFiles(changes, library) {
3480
- const project = new import_ts_morph.Project();
3481
- visitNotIgnoredFiles(".", (path4) => {
3482
- if (!path4.endsWith(".ts") && !path4.endsWith(".tsx")) {
2935
+ const project = new Project();
2936
+ visitNotIgnoredFiles(".", (path2) => {
2937
+ if (!path2.endsWith(".ts") && !path2.endsWith(".tsx")) {
3483
2938
  return;
3484
2939
  }
3485
- project.addSourceFileAtPath(path4);
2940
+ project.addSourceFileAtPath(path2);
3486
2941
  });
3487
2942
  project.getSourceFiles().forEach((sourceFile) => {
3488
2943
  let hasChanges = false;
@@ -3498,7 +2953,7 @@ function replaceImportInFiles(changes, library) {
3498
2953
  }
3499
2954
  }
3500
2955
  });
3501
- sourceFile.getDescendantsOfKind(import_ts_morph.ts.SyntaxKind.Identifier).forEach((identifier) => {
2956
+ sourceFile.getDescendantsOfKind(ts.SyntaxKind.Identifier).forEach((identifier) => {
3502
2957
  for (const [oldImport, newImport] of changes) {
3503
2958
  if (identifier.getText() === oldImport) {
3504
2959
  identifier.replaceWithText(newImport);
@@ -3512,24 +2967,14 @@ function replaceImportInFiles(changes, library) {
3512
2967
  }
3513
2968
  });
3514
2969
  }
3515
- var import_ts_morph;
3516
2970
  var init_rename_import = __esm({
3517
2971
  "packages/qwik/src/cli/migrate-v2/rename-import.ts"() {
3518
2972
  "use strict";
3519
- import_ts_morph = require("ts-morph");
3520
2973
  init_visit_not_ignored_files();
3521
2974
  init_dist2();
3522
2975
  }
3523
2976
  });
3524
2977
 
3525
- // packages/qwik/src/cli/index.ts
3526
- var index_exports = {};
3527
- __export(index_exports, {
3528
- runCli: () => runCli,
3529
- updateApp: () => updateApp
3530
- });
3531
- module.exports = __toCommonJS(index_exports);
3532
-
3533
2978
  // node_modules/.pnpm/kleur@4.1.5/node_modules/kleur/colors.mjs
3534
2979
  var FORCE_COLOR;
3535
2980
  var NODE_DISABLE_COLORS;
@@ -3579,15 +3024,15 @@ var bgCyan = init(46, 49);
3579
3024
  var bgWhite = init(47, 49);
3580
3025
 
3581
3026
  // packages/qwik/src/cli/utils/app-command.ts
3582
- var import_node_fs = require("node:fs");
3583
- var import_node_path = require("node:path");
3027
+ import { existsSync, readFileSync } from "node:fs";
3028
+ import { dirname, join, resolve } from "node:path";
3584
3029
  var AppCommand = class {
3585
- args;
3586
- task;
3587
- cwd;
3588
- _rootDir;
3589
- _rootPkgJson;
3590
3030
  constructor(opts) {
3031
+ __publicField(this, "args");
3032
+ __publicField(this, "task");
3033
+ __publicField(this, "cwd");
3034
+ __publicField(this, "_rootDir");
3035
+ __publicField(this, "_rootPkgJson");
3591
3036
  this._rootDir = opts.rootDir;
3592
3037
  this.cwd = opts.cwd;
3593
3038
  this.args = opts.args.slice();
@@ -3595,18 +3040,18 @@ var AppCommand = class {
3595
3040
  }
3596
3041
  get rootDir() {
3597
3042
  if (!this._rootDir) {
3598
- const fsRoot = (0, import_node_path.resolve)("/");
3043
+ const fsRoot = resolve("/");
3599
3044
  let testDir = process.cwd();
3600
3045
  for (let i = 0; i < 20; i++) {
3601
- const pkgPath = (0, import_node_path.join)(testDir, "package.json");
3602
- if ((0, import_node_fs.existsSync)(pkgPath)) {
3046
+ const pkgPath = join(testDir, "package.json");
3047
+ if (existsSync(pkgPath)) {
3603
3048
  this._rootDir = testDir;
3604
3049
  break;
3605
3050
  }
3606
3051
  if (testDir === fsRoot) {
3607
3052
  break;
3608
3053
  }
3609
- testDir = (0, import_node_path.dirname)(testDir);
3054
+ testDir = dirname(testDir);
3610
3055
  }
3611
3056
  if (!this._rootDir) {
3612
3057
  throw new Error(`Unable to find Qwik app package.json`);
@@ -3619,8 +3064,8 @@ var AppCommand = class {
3619
3064
  }
3620
3065
  get packageJson() {
3621
3066
  if (!this._rootPkgJson) {
3622
- const pkgJsonPath = (0, import_node_path.join)(this.rootDir, "package.json");
3623
- this._rootPkgJson = JSON.parse((0, import_node_fs.readFileSync)(pkgJsonPath, "utf-8"));
3067
+ const pkgJsonPath = join(this.rootDir, "package.json");
3068
+ this._rootPkgJson = JSON.parse(readFileSync(pkgJsonPath, "utf-8"));
3624
3069
  }
3625
3070
  return this._rootPkgJson;
3626
3071
  }
@@ -3642,63 +3087,50 @@ var AppCommand = class {
3642
3087
  init_dist2();
3643
3088
 
3644
3089
  // packages/qwik/src/cli/utils/integrations.ts
3645
- var import_node_fs3 = __toESM(require("node:fs"), 1);
3646
- var import_node_path3 = require("node:path");
3090
+ import fs2 from "node:fs";
3091
+ import { join as join3, dirname as dirname2 } from "node:path";
3092
+ import { fileURLToPath } from "node:url";
3647
3093
 
3648
3094
  // packages/qwik/src/cli/utils/utils.ts
3649
3095
  init_dist2();
3650
3096
  var import_which_pm_runs = __toESM(require_which_pm_runs(), 1);
3651
- var import_node_fs2 = __toESM(require("node:fs"), 1);
3652
- var import_node_path2 = require("node:path");
3653
- var import_cross_spawn = __toESM(require_cross_spawn(), 1);
3097
+ import fs from "node:fs";
3098
+ import { join as join2 } from "node:path";
3099
+ import { execa } from "execa";
3654
3100
  function runCommand(cmd, args, cwd) {
3655
- let child;
3656
- const install = new Promise((resolve2) => {
3657
- try {
3658
- child = (0, import_cross_spawn.default)(cmd, args, {
3659
- cwd,
3660
- stdio: "ignore"
3661
- });
3662
- child.on("error", (e2) => {
3663
- if (e2) {
3664
- if (e2.message) {
3665
- M2.error(red(String(e2.message)) + `
3101
+ const child = execa(cmd, args, {
3102
+ cwd,
3103
+ stdio: "ignore"
3104
+ });
3105
+ const install = child.then(() => {
3106
+ return true;
3107
+ }).catch((e2) => {
3108
+ if (e2) {
3109
+ if (e2.message) {
3110
+ M2.error(red(String(e2.message)) + `
3666
3111
 
3667
3112
  `);
3668
- } else {
3669
- M2.error(red(String(e2)) + `
3113
+ } else {
3114
+ M2.error(red(String(e2)) + `
3670
3115
 
3671
3116
  `);
3672
- }
3673
- }
3674
- resolve2(false);
3675
- });
3676
- child.on("close", (code) => {
3677
- if (code === 0) {
3678
- resolve2(true);
3679
- } else {
3680
- resolve2(false);
3681
- }
3682
- });
3683
- } catch (e2) {
3684
- resolve2(false);
3117
+ }
3685
3118
  }
3119
+ return false;
3686
3120
  });
3687
3121
  const abort = async () => {
3688
- if (child) {
3689
- child.kill("SIGINT");
3690
- }
3122
+ child.kill("SIGINT");
3691
3123
  };
3692
3124
  return { abort, install };
3693
3125
  }
3694
3126
  async function readPackageJson(dir) {
3695
- const path4 = (0, import_node_path2.join)(dir, "package.json");
3696
- const pkgJson = JSON.parse(await import_node_fs2.default.promises.readFile(path4, "utf-8"));
3127
+ const path2 = join2(dir, "package.json");
3128
+ const pkgJson = JSON.parse(await fs.promises.readFile(path2, "utf-8"));
3697
3129
  return pkgJson;
3698
3130
  }
3699
3131
  async function writePackageJson(dir, pkgJson) {
3700
- const path4 = (0, import_node_path2.join)(dir, "package.json");
3701
- await import_node_fs2.default.promises.writeFile(path4, JSON.stringify(pkgJson, null, 2) + "\n");
3132
+ const path2 = join2(dir, "package.json");
3133
+ await fs.promises.writeFile(path2, JSON.stringify(pkgJson, null, 2) + "\n");
3702
3134
  }
3703
3135
  function dashToTitleCase(str) {
3704
3136
  return str.toLocaleLowerCase().split("-").map((segment) => segment.charAt(0).toUpperCase() + segment.slice(1)).join(" ");
@@ -3710,8 +3142,7 @@ function limitLength(hint, maxLength = 50) {
3710
3142
  return hint;
3711
3143
  }
3712
3144
  function getPackageManager() {
3713
- var _a;
3714
- return ((_a = (0, import_which_pm_runs.default)()) == null ? void 0 : _a.name) || "pnpm";
3145
+ return (0, import_which_pm_runs.default)()?.name || "pnpm";
3715
3146
  }
3716
3147
  function pmRunCmd() {
3717
3148
  const pm = getPackageManager();
@@ -3752,13 +3183,13 @@ function printHeader() {
3752
3183
  async function getFilesDeep(root) {
3753
3184
  const files = [];
3754
3185
  async function getFiles(directory) {
3755
- if (!import_node_fs2.default.existsSync(directory)) {
3186
+ if (!fs.existsSync(directory)) {
3756
3187
  return;
3757
3188
  }
3758
- const filesInDirectory = await import_node_fs2.default.promises.readdir(directory);
3189
+ const filesInDirectory = await fs.promises.readdir(directory);
3759
3190
  for (const file of filesInDirectory) {
3760
- const absolute = (0, import_node_path2.join)(directory, file);
3761
- if (import_node_fs2.default.statSync(absolute).isDirectory()) {
3191
+ const absolute = join2(directory, file);
3192
+ if (fs.statSync(absolute).isDirectory()) {
3762
3193
  await getFiles(absolute);
3763
3194
  } else {
3764
3195
  files.push(absolute);
@@ -3818,6 +3249,7 @@ ${gray(S_CONNECT_LEFT + S_BAR_H.repeat(len + 2) + S_CORNER_BOTTOM_RIGHT)}
3818
3249
  };
3819
3250
 
3820
3251
  // packages/qwik/src/cli/utils/integrations.ts
3252
+ var __dirname = dirname2(fileURLToPath(import.meta.url));
3821
3253
  var integrations = null;
3822
3254
  async function sortIntegrationsAndReturnAsClackOptions(integrations2, { maxHintLength = 50, showHint = true } = {}) {
3823
3255
  return integrations2.sort((a, b3) => {
@@ -3838,30 +3270,29 @@ async function loadIntegrations() {
3838
3270
  if (!integrations) {
3839
3271
  const loadingIntegrations = [];
3840
3272
  const integrationTypes = ["app", "feature", "adapter"];
3841
- const integrationsDir = (0, import_node_path3.join)(__dirname, "starters");
3842
- const integrationsDirNames = await import_node_fs3.default.promises.readdir(integrationsDir);
3273
+ const integrationsDir = join3(__dirname, "starters");
3274
+ const integrationsDirNames = await fs2.promises.readdir(integrationsDir);
3843
3275
  await Promise.all(
3844
3276
  integrationsDirNames.map(async (integrationsDirName) => {
3845
3277
  const integrationType = integrationsDirName.slice(0, integrationsDirName.length - 1);
3846
3278
  if (integrationTypes.includes(integrationType)) {
3847
- const dir = (0, import_node_path3.join)(integrationsDir, integrationsDirName);
3848
- const dirItems = await import_node_fs3.default.promises.readdir(dir);
3279
+ const dir = join3(integrationsDir, integrationsDirName);
3280
+ const dirItems = await fs2.promises.readdir(dir);
3849
3281
  await Promise.all(
3850
3282
  dirItems.map(async (dirItem) => {
3851
- var _a, _b, _c, _d;
3852
- const dirPath = (0, import_node_path3.join)(dir, dirItem);
3853
- const stat = await import_node_fs3.default.promises.stat(dirPath);
3283
+ const dirPath = join3(dir, dirItem);
3284
+ const stat = await fs2.promises.stat(dirPath);
3854
3285
  if (stat.isDirectory()) {
3855
3286
  const pkgJson = await readPackageJson(dirPath);
3856
3287
  const integration = {
3857
3288
  id: dirItem,
3858
- name: ((_a = pkgJson.__qwik__) == null ? void 0 : _a.displayName) ?? dashToTitleCase(dirItem),
3289
+ name: pkgJson.__qwik__?.displayName ?? dashToTitleCase(dirItem),
3859
3290
  type: integrationType,
3860
3291
  dir: dirPath,
3861
3292
  pkgJson,
3862
- docs: ((_b = pkgJson.__qwik__) == null ? void 0 : _b.docs) ?? [],
3863
- priority: ((_c = pkgJson == null ? void 0 : pkgJson.__qwik__) == null ? void 0 : _c.priority) ?? 0,
3864
- alwaysInRoot: ((_d = pkgJson.__qwik__) == null ? void 0 : _d.alwaysInRoot) ?? []
3293
+ docs: pkgJson.__qwik__?.docs ?? [],
3294
+ priority: pkgJson?.__qwik__?.priority ?? 0,
3295
+ alwaysInRoot: pkgJson.__qwik__?.alwaysInRoot ?? []
3865
3296
  };
3866
3297
  loadingIntegrations.push(integration);
3867
3298
  }
@@ -3885,7 +3316,7 @@ async function loadIntegrations() {
3885
3316
  }
3886
3317
 
3887
3318
  // packages/qwik/src/cli/add/run-add-interactive.ts
3888
- var import_node_path6 = require("node:path");
3319
+ import { relative } from "node:path";
3889
3320
 
3890
3321
  // packages/qwik/src/cli/utils/install-deps.ts
3891
3322
  init_dist2();
@@ -3910,22 +3341,22 @@ function logNextStep(nextSteps, packageManager) {
3910
3341
 
3911
3342
  // packages/qwik/src/cli/add/update-app.ts
3912
3343
  init_dist2();
3913
- var import_node_fs5 = __toESM(require("node:fs"), 1);
3914
- var import_node_path5 = require("node:path");
3344
+ import fs5 from "node:fs";
3345
+ import { dirname as dirname3 } from "node:path";
3915
3346
 
3916
3347
  // packages/qwik/src/cli/add/update-files.ts
3917
3348
  var import_json5_parser = __toESM(require_json5_parser(), 1);
3918
- var import_node_fs4 = __toESM(require("node:fs"), 1);
3919
- var import_node_path4 = require("node:path");
3349
+ import fs3 from "node:fs";
3350
+ import { extname, join as join4 } from "node:path";
3920
3351
  async function mergeIntegrationDir(fileUpdates, opts, srcDir, destDir, alwaysInRoot) {
3921
- const items = await import_node_fs4.default.promises.readdir(srcDir);
3352
+ const items = await fs3.promises.readdir(srcDir);
3922
3353
  await Promise.all(
3923
3354
  items.map(async (itemName) => {
3924
3355
  const destName = itemName === "gitignore" ? ".gitignore" : itemName;
3925
- const ext = (0, import_node_path4.extname)(destName);
3926
- const srcChildPath = (0, import_node_path4.join)(srcDir, itemName);
3927
- const destRootPath = (0, import_node_path4.join)(destDir, destName);
3928
- const s2 = await import_node_fs4.default.promises.stat(srcChildPath);
3356
+ const ext = extname(destName);
3357
+ const srcChildPath = join4(srcDir, itemName);
3358
+ const destRootPath = join4(destDir, destName);
3359
+ const s2 = await fs3.promises.stat(srcChildPath);
3929
3360
  if (s2.isDirectory()) {
3930
3361
  await mergeIntegrationDir(fileUpdates, opts, srcChildPath, destRootPath, alwaysInRoot);
3931
3362
  } else if (s2.isFile()) {
@@ -3940,16 +3371,16 @@ async function mergeIntegrationDir(fileUpdates, opts, srcDir, destDir, alwaysInR
3940
3371
  await mergeIgnoresFile(fileUpdates, srcChildPath, destRootPath);
3941
3372
  } else if (ext === ".css") {
3942
3373
  await mergeCss(fileUpdates, srcChildPath, finalDestPath, opts);
3943
- } else if (import_node_fs4.default.existsSync(finalDestPath)) {
3374
+ } else if (fs3.existsSync(finalDestPath)) {
3944
3375
  fileUpdates.files.push({
3945
3376
  path: finalDestPath,
3946
- content: await import_node_fs4.default.promises.readFile(srcChildPath),
3377
+ content: await fs3.promises.readFile(srcChildPath),
3947
3378
  type: "overwrite"
3948
3379
  });
3949
3380
  } else {
3950
3381
  fileUpdates.files.push({
3951
3382
  path: finalDestPath,
3952
- content: await import_node_fs4.default.promises.readFile(srcChildPath),
3383
+ content: await fs3.promises.readFile(srcChildPath),
3953
3384
  type: "create"
3954
3385
  });
3955
3386
  }
@@ -3961,21 +3392,20 @@ function getFinalDestPath(opts, destRootPath, destDir, destName, alwaysInRoot) {
3961
3392
  const projectDir = opts.projectDir ? opts.projectDir : "";
3962
3393
  const rootDirEndIndex = destDir.indexOf(opts.rootDir) + opts.rootDir.length;
3963
3394
  const destWithoutRoot = destDir.slice(rootDirEndIndex);
3964
- const destChildPath = (0, import_node_path4.join)(opts.rootDir, projectDir, destWithoutRoot, destName);
3395
+ const destChildPath = join4(opts.rootDir, projectDir, destWithoutRoot, destName);
3965
3396
  const finalDestPath = alwaysInRoot && alwaysInRoot.some((rootItem) => destName.includes(rootItem) || destDir.includes(rootItem)) ? destRootPath : destChildPath;
3966
3397
  return finalDestPath;
3967
3398
  }
3968
3399
  async function mergePackageJsons(fileUpdates, srcPath, destPath) {
3969
- var _a;
3970
- const srcContent = await import_node_fs4.default.promises.readFile(srcPath, "utf-8");
3400
+ const srcContent = await fs3.promises.readFile(srcPath, "utf-8");
3971
3401
  try {
3972
3402
  const srcPkgJson = JSON.parse(srcContent);
3973
3403
  const props = ["scripts", "dependencies", "devDependencies"];
3974
- const destPkgJson = JSON.parse(await import_node_fs4.default.promises.readFile(destPath, "utf-8"));
3404
+ const destPkgJson = JSON.parse(await fs3.promises.readFile(destPath, "utf-8"));
3975
3405
  props.forEach((prop) => {
3976
3406
  mergePackageJsonSort(srcPkgJson, destPkgJson, prop);
3977
3407
  });
3978
- if ((_a = destPkgJson.scripts) == null ? void 0 : _a.qwik) {
3408
+ if (destPkgJson.scripts?.qwik) {
3979
3409
  const qwikVal = destPkgJson.scripts.qwik;
3980
3410
  delete destPkgJson.scripts.qwik;
3981
3411
  destPkgJson.scripts.qwik = qwikVal;
@@ -3994,11 +3424,11 @@ async function mergePackageJsons(fileUpdates, srcPath, destPath) {
3994
3424
  }
3995
3425
  }
3996
3426
  async function mergeVSCodeSettings(fileUpdates, srcPath, destPath) {
3997
- const srcContent = await import_node_fs4.default.promises.readFile(srcPath, "utf-8");
3427
+ const srcContent = await fs3.promises.readFile(srcPath, "utf-8");
3998
3428
  try {
3999
3429
  const srcPkgJson = import_json5_parser.JsonParser.parse(srcContent, import_json5_parser.JsonObjectNode);
4000
3430
  const destPkgJson = import_json5_parser.JsonParser.parse(
4001
- await import_node_fs4.default.promises.readFile(destPath, "utf-8"),
3431
+ await fs3.promises.readFile(destPath, "utf-8"),
4002
3432
  import_json5_parser.JsonObjectNode
4003
3433
  );
4004
3434
  destPkgJson.merge(srcPkgJson);
@@ -4031,11 +3461,11 @@ function mergePackageJsonSort(src, dest, prop) {
4031
3461
  }
4032
3462
  }
4033
3463
  async function mergeReadmes(fileUpdates, srcPath, destPath) {
4034
- const srcContent = await import_node_fs4.default.promises.readFile(srcPath, "utf-8");
3464
+ const srcContent = await fs3.promises.readFile(srcPath, "utf-8");
4035
3465
  let type;
4036
3466
  let destContent = "";
4037
3467
  try {
4038
- destContent = await import_node_fs4.default.promises.readFile(destPath, "utf-8");
3468
+ destContent = await fs3.promises.readFile(destPath, "utf-8");
4039
3469
  destContent = destContent.trim() + "\n\n" + srcContent;
4040
3470
  type = "modify";
4041
3471
  } catch (e2) {
@@ -4053,9 +3483,9 @@ async function mergeReadmes(fileUpdates, srcPath, destPath) {
4053
3483
  });
4054
3484
  }
4055
3485
  async function mergeIgnoresFile(fileUpdates, srcPath, destPath) {
4056
- const srcContent = await import_node_fs4.default.promises.readFile(srcPath, "utf-8");
3486
+ const srcContent = await fs3.promises.readFile(srcPath, "utf-8");
4057
3487
  try {
4058
- const destContent = await import_node_fs4.default.promises.readFile(destPath, "utf-8");
3488
+ const destContent = await fs3.promises.readFile(destPath, "utf-8");
4059
3489
  const srcLines = srcContent.trim().split(/\r?\n/);
4060
3490
  const destLines = destContent.trim().split(/\r?\n/);
4061
3491
  for (const srcLine of srcLines) {
@@ -4080,9 +3510,9 @@ async function mergeIgnoresFile(fileUpdates, srcPath, destPath) {
4080
3510
  }
4081
3511
  }
4082
3512
  async function mergeCss(fileUpdates, srcPath, destPath, opts) {
4083
- const srcContent = await import_node_fs4.default.promises.readFile(srcPath, "utf-8");
3513
+ const srcContent = await fs3.promises.readFile(srcPath, "utf-8");
4084
3514
  try {
4085
- const destContent = await import_node_fs4.default.promises.readFile(destPath, "utf-8");
3515
+ const destContent = await fs3.promises.readFile(destPath, "utf-8");
4086
3516
  const mergedContent = srcContent.trim() + "\n\n" + destContent.trim() + "\n";
4087
3517
  const isAddingLibrary = opts.installDeps === true;
4088
3518
  fileUpdates.files.push({
@@ -4100,12 +3530,12 @@ async function mergeCss(fileUpdates, srcPath, destPath, opts) {
4100
3530
  }
4101
3531
 
4102
3532
  // packages/qwik/src/cli/add/update-vite-config.ts
4103
- var import_fs = __toESM(require("fs"), 1);
4104
- var import_path = require("path");
3533
+ import fs4 from "fs";
3534
+ import { join as join5 } from "path";
4105
3535
 
4106
3536
  // packages/qwik/src/cli/code-mod/code-mod.ts
4107
3537
  function updateViteConfig(ts2, sourceText, updates) {
4108
- if (!(updates == null ? void 0 : updates.imports) && !(updates == null ? void 0 : updates.qwikViteConfig) && !(updates == null ? void 0 : updates.viteConfig) && !(updates == null ? void 0 : updates.vitePlugins) && !(updates == null ? void 0 : updates.vitePluginsPrepend)) {
3538
+ if (!updates?.imports && !updates?.qwikViteConfig && !updates?.viteConfig && !updates?.vitePlugins && !updates?.vitePluginsPrepend) {
4109
3539
  return null;
4110
3540
  }
4111
3541
  sourceText = transformSource(ts2, sourceText, () => (tsSourceFile) => {
@@ -4381,12 +3811,11 @@ function updatePlugins(ts2, obj, updates) {
4381
3811
  return ts2.factory.updateObjectLiteralExpression(obj, properties);
4382
3812
  }
4383
3813
  function updatePluginsArray(ts2, arr, updates) {
4384
- var _a, _b;
4385
3814
  const elms = [...arr.elements];
4386
3815
  if (updates.vitePlugins) {
4387
3816
  for (const vitePlugin of updates.vitePlugins) {
4388
3817
  const pluginExp = createPluginCall(ts2, vitePlugin);
4389
- const pluginName = (_a = pluginExp == null ? void 0 : pluginExp.expression) == null ? void 0 : _a.escapedText;
3818
+ const pluginName = pluginExp?.expression?.escapedText;
4390
3819
  const alreadyDefined = elms.some(
4391
3820
  (el) => ts2.isCallExpression(el) && ts2.isIdentifier(el.expression) && el.expression.escapedText === pluginName
4392
3821
  );
@@ -4398,7 +3827,7 @@ function updatePluginsArray(ts2, arr, updates) {
4398
3827
  if (updates.vitePluginsPrepend) {
4399
3828
  for (const vitePlugin of updates.vitePluginsPrepend) {
4400
3829
  const pluginExp = createPluginCall(ts2, vitePlugin);
4401
- const pluginName = (_b = pluginExp == null ? void 0 : pluginExp.expression) == null ? void 0 : _b.escapedText;
3830
+ const pluginName = pluginExp?.expression?.escapedText;
4402
3831
  const alreadyDefined = elms.some(
4403
3832
  (el) => ts2.isCallExpression(el) && ts2.isIdentifier(el.expression) && el.expression.escapedText === pluginName
4404
3833
  );
@@ -4481,18 +3910,17 @@ function transformSource(ts2, sourceText, transformer) {
4481
3910
 
4482
3911
  // packages/qwik/src/cli/add/update-vite-config.ts
4483
3912
  async function updateViteConfigs(fileUpdates, integration, rootDir) {
4484
- var _a;
4485
3913
  try {
4486
- const viteConfig = (_a = integration.pkgJson.__qwik__) == null ? void 0 : _a.viteConfig;
3914
+ const viteConfig = integration.pkgJson.__qwik__?.viteConfig;
4487
3915
  if (viteConfig) {
4488
- let viteConfigPath = (0, import_path.join)(rootDir, "vite.config.ts");
4489
- if (!import_fs.default.existsSync(viteConfigPath)) {
4490
- viteConfigPath = (0, import_path.join)(rootDir, "vite.config.mts");
3916
+ let viteConfigPath = join5(rootDir, "vite.config.ts");
3917
+ if (!fs4.existsSync(viteConfigPath)) {
3918
+ viteConfigPath = join5(rootDir, "vite.config.ts");
4491
3919
  }
4492
- if (!import_fs.default.existsSync(viteConfigPath)) {
4493
- throw new Error(`Could not find vite.config.ts or vite.config.mts in ${rootDir}`);
3920
+ if (!fs4.existsSync(viteConfigPath)) {
3921
+ throw new Error(`Could not find vite.config.ts or vite.config.ts in ${rootDir}`);
4494
3922
  }
4495
- const destContent = await import_fs.default.promises.readFile(viteConfigPath, "utf-8");
3923
+ const destContent = await fs4.promises.readFile(viteConfigPath, "utf-8");
4496
3924
  const ts2 = (await import("typescript")).default;
4497
3925
  let updatedContent = updateViteConfig(ts2, destContent, viteConfig);
4498
3926
  if (updatedContent) {
@@ -4559,16 +3987,16 @@ async function updateApp(pkgManager, opts) {
4559
3987
  }
4560
3988
  let passed = true;
4561
3989
  try {
4562
- const dirs = new Set(fileUpdates.files.map((f) => (0, import_node_path5.dirname)(f.path)));
3990
+ const dirs = new Set(fileUpdates.files.map((f) => dirname3(f.path)));
4563
3991
  for (const dir of Array.from(dirs)) {
4564
3992
  try {
4565
- import_node_fs5.default.mkdirSync(dir, { recursive: true });
3993
+ fs5.mkdirSync(dir, { recursive: true });
4566
3994
  } catch (e2) {
4567
3995
  }
4568
3996
  }
4569
3997
  const fsWrites = Promise.all(
4570
3998
  fileUpdates.files.map(async (f) => {
4571
- await import_node_fs5.default.promises.writeFile(f.path, f.content);
3999
+ await fs5.promises.writeFile(f.path, f.content);
4572
4000
  })
4573
4001
  );
4574
4002
  if (opts.installDeps && Object.keys(fileUpdates.installedDeps).length > 0) {
@@ -4602,7 +4030,6 @@ async function updateApp(pkgManager, opts) {
4602
4030
 
4603
4031
  // packages/qwik/src/cli/add/run-add-interactive.ts
4604
4032
  async function runAddInteractive(app, id) {
4605
- var _a;
4606
4033
  const pkgManager = getPackageManager();
4607
4034
  const integrations2 = await loadIntegrations();
4608
4035
  let integration;
@@ -4652,7 +4079,7 @@ async function runAddInteractive(app, id) {
4652
4079
  await logUpdateAppResult(pkgManager, result);
4653
4080
  }
4654
4081
  await result.commit(true);
4655
- const postInstall = (_a = result.integration.pkgJson.__qwik__) == null ? void 0 : _a.postInstall;
4082
+ const postInstall = result.integration.pkgJson.__qwik__?.postInstall;
4656
4083
  if (postInstall) {
4657
4084
  const s2 = Y2();
4658
4085
  s2.start(`Running post install script: ${postInstall}`);
@@ -4677,7 +4104,7 @@ async function logUpdateAppResult(pkgManager, result) {
4677
4104
  M2.message(
4678
4105
  [
4679
4106
  `\u{1F42C} ${cyan("Modify")}`,
4680
- ...modifyFiles.map((f) => ` - ${(0, import_node_path6.relative)(process.cwd(), f.path)}`)
4107
+ ...modifyFiles.map((f) => ` - ${relative(process.cwd(), f.path)}`)
4681
4108
  ].join("\n")
4682
4109
  );
4683
4110
  }
@@ -4685,7 +4112,7 @@ async function logUpdateAppResult(pkgManager, result) {
4685
4112
  M2.message(
4686
4113
  [
4687
4114
  `\u{1F31F} ${cyan(`Create`)}`,
4688
- ...createFiles.map((f) => ` - ${(0, import_node_path6.relative)(process.cwd(), f.path)}`)
4115
+ ...createFiles.map((f) => ` - ${relative(process.cwd(), f.path)}`)
4689
4116
  ].join("\n")
4690
4117
  );
4691
4118
  }
@@ -4693,7 +4120,7 @@ async function logUpdateAppResult(pkgManager, result) {
4693
4120
  M2.message(
4694
4121
  [
4695
4122
  `\u{1F433} ${cyan(`Overwrite`)}`,
4696
- ...overwriteFiles.map((f) => ` - ${(0, import_node_path6.relative)(process.cwd(), f.path)}`)
4123
+ ...overwriteFiles.map((f) => ` - ${relative(process.cwd(), f.path)}`)
4697
4124
  ].join("\n")
4698
4125
  );
4699
4126
  }
@@ -4728,13 +4155,12 @@ async function logUpdateAppResult(pkgManager, result) {
4728
4155
  }
4729
4156
  }
4730
4157
  function logUpdateAppCommitResult(result, pkgManager) {
4731
- var _a;
4732
4158
  if (result.updates.installedScripts.length > 0) {
4733
4159
  const prefix = pkgManager === "npm" || pkgManager === "bun" ? `${pkgManager} run` : pkgManager;
4734
4160
  const message = result.updates.installedScripts.map((script) => `- ${prefix} ${blue(script)}`).join("\n");
4735
4161
  note(message, "New scripts added");
4736
4162
  }
4737
- const nextSteps = (_a = result.integration.pkgJson.__qwik__) == null ? void 0 : _a.nextSteps;
4163
+ const nextSteps = result.integration.pkgJson.__qwik__?.nextSteps;
4738
4164
  if (nextSteps) {
4739
4165
  const noteMessage = `\u{1F7E3} ${bgMagenta(` ${nextSteps.title ?? "Action Required!"} `)}`;
4740
4166
  note(logNextStep(nextSteps, pkgManager), noteMessage);
@@ -4794,22 +4220,24 @@ async function runAddCommand(app) {
4794
4220
  }
4795
4221
 
4796
4222
  // packages/qwik/src/cli/new/run-new-command.ts
4797
- var import_node_fs7 = __toESM(require("node:fs"), 1);
4798
- var import_path2 = require("path");
4799
4223
  init_dist2();
4224
+ import fs7 from "node:fs";
4225
+ import { join as join7 } from "path";
4800
4226
 
4801
4227
  // packages/qwik/src/cli/utils/templates.ts
4802
- var import_node_fs6 = __toESM(require("node:fs"), 1);
4803
- var import_node_path7 = require("node:path");
4228
+ import fs6 from "node:fs";
4229
+ import { join as join6, sep, dirname as dirname4 } from "node:path";
4230
+ import { fileURLToPath as fileURLToPath2 } from "node:url";
4231
+ var __dirname2 = dirname4(fileURLToPath2(import.meta.url));
4804
4232
  var templates = null;
4805
4233
  async function loadTemplates() {
4806
4234
  if (!templates) {
4807
4235
  const allTemplates = [];
4808
- const templatesDir = (0, import_node_path7.join)(__dirname, "templates");
4809
- const templatesDirNames = await import_node_fs6.default.promises.readdir(templatesDir);
4236
+ const templatesDir = join6(__dirname2, "templates");
4237
+ const templatesDirNames = await fs6.promises.readdir(templatesDir);
4810
4238
  await Promise.all(
4811
4239
  templatesDirNames.map(async (templatesDirName) => {
4812
- const dir = (0, import_node_path7.join)(templatesDir, templatesDirName);
4240
+ const dir = join6(templatesDir, templatesDirName);
4813
4241
  const files = await readTemplates(dir);
4814
4242
  const template = { id: templatesDirName, ...files };
4815
4243
  allTemplates.push(template);
@@ -4828,10 +4256,10 @@ async function loadTemplates() {
4828
4256
  return templates;
4829
4257
  }
4830
4258
  async function readTemplates(rootDir) {
4831
- const componentDir = (0, import_node_path7.join)(rootDir, "component");
4832
- const routeDir = (0, import_node_path7.join)(rootDir, "route");
4833
- const markdownDir = (0, import_node_path7.join)(rootDir, "markdown");
4834
- const mdxDir = (0, import_node_path7.join)(rootDir, "mdx");
4259
+ const componentDir = join6(rootDir, "component");
4260
+ const routeDir = join6(rootDir, "route");
4261
+ const markdownDir = join6(rootDir, "markdown");
4262
+ const mdxDir = join6(rootDir, "mdx");
4835
4263
  const component = await getFilesDeep(componentDir);
4836
4264
  const route = await getFilesDeep(routeDir);
4837
4265
  const markdown = await getFilesDeep(markdownDir);
@@ -4843,10 +4271,10 @@ async function readTemplates(rootDir) {
4843
4271
  mdx: mdx.map((m2) => parseTemplatePath(m2, "mdx"))
4844
4272
  };
4845
4273
  }
4846
- function parseTemplatePath(path4, type) {
4847
- const parts = path4.split(import_node_path7.sep + type + import_node_path7.sep);
4274
+ function parseTemplatePath(path2, type) {
4275
+ const parts = path2.split(sep + type + sep);
4848
4276
  return {
4849
- absolute: path4,
4277
+ absolute: path2,
4850
4278
  relative: parts[1]
4851
4279
  };
4852
4280
  }
@@ -4953,9 +4381,9 @@ async function runNewCommand(app) {
4953
4381
  template = templates2[0][typeArg][0];
4954
4382
  }
4955
4383
  if (typeArg === "route" || typeArg === "markdown" || typeArg === "mdx") {
4956
- outDir = (0, import_path2.join)(app.rootDir, "src", `routes`, nameArg);
4384
+ outDir = join7(app.rootDir, "src", `routes`, nameArg);
4957
4385
  } else {
4958
- outDir = (0, import_path2.join)(app.rootDir, "src", `components`, nameArg);
4386
+ outDir = join7(app.rootDir, "src", `components`, nameArg);
4959
4387
  }
4960
4388
  const fileOutput = await writeToFile(name, slug, template, outDir);
4961
4389
  M2.success(`${green(`${toPascal([typeArg])} "${slug}" created!`)}`);
@@ -5042,22 +4470,22 @@ async function selectTemplate(typeArg) {
5042
4470
  return templateAnswer;
5043
4471
  }
5044
4472
  async function writeToFile(name, slug, template, outDir) {
5045
- const outFile = (0, import_path2.join)(outDir, template.relative);
4473
+ const outFile = join7(outDir, template.relative);
5046
4474
  const fileOutput = inject(outFile, [
5047
4475
  [SLUG_KEY, slug],
5048
4476
  [".template", ""]
5049
4477
  ]);
5050
- if (import_node_fs7.default.existsSync(fileOutput)) {
4478
+ if (fs7.existsSync(fileOutput)) {
5051
4479
  const filename = fileOutput.split("/").pop();
5052
4480
  throw new Error(`"${filename}" already exists in "${outDir}"`);
5053
4481
  }
5054
- const text = await import_node_fs7.default.promises.readFile(template.absolute, { encoding: "utf-8" });
4482
+ const text = await fs7.promises.readFile(template.absolute, { encoding: "utf-8" });
5055
4483
  const templateOut = inject(text, [
5056
4484
  [SLUG_KEY, slug],
5057
4485
  [NAME_KEY, name]
5058
4486
  ]);
5059
- await import_node_fs7.default.promises.mkdir(outDir, { recursive: true });
5060
- await import_node_fs7.default.promises.writeFile(fileOutput, templateOut, { encoding: "utf-8" });
4487
+ await fs7.promises.mkdir(outDir, { recursive: true });
4488
+ await fs7.promises.writeFile(fileOutput, templateOut, { encoding: "utf-8" });
5061
4489
  return fileOutput;
5062
4490
  }
5063
4491
  function inject(raw, vars) {
@@ -5160,1681 +4588,77 @@ async function runJokeCommand() {
5160
4588
  ${punchline.trim()}`), "\u{1F648}");
5161
4589
  }
5162
4590
 
5163
- // node_modules/.pnpm/execa@8.0.1/node_modules/execa/index.js
5164
- var import_node_buffer2 = require("node:buffer");
5165
- var import_node_path9 = __toESM(require("node:path"), 1);
5166
- var import_node_child_process3 = __toESM(require("node:child_process"), 1);
5167
- var import_node_process6 = __toESM(require("node:process"), 1);
5168
- var import_cross_spawn2 = __toESM(require_cross_spawn(), 1);
5169
-
5170
- // node_modules/.pnpm/strip-final-newline@3.0.0/node_modules/strip-final-newline/index.js
5171
- function stripFinalNewline(input) {
5172
- const LF = typeof input === "string" ? "\n" : "\n".charCodeAt();
5173
- const CR = typeof input === "string" ? "\r" : "\r".charCodeAt();
5174
- if (input[input.length - 1] === LF) {
5175
- input = input.slice(0, -1);
5176
- }
5177
- if (input[input.length - 1] === CR) {
5178
- input = input.slice(0, -1);
5179
- }
5180
- return input;
5181
- }
5182
-
5183
- // node_modules/.pnpm/npm-run-path@5.3.0/node_modules/npm-run-path/index.js
5184
- var import_node_process3 = __toESM(require("node:process"), 1);
5185
- var import_node_path8 = __toESM(require("node:path"), 1);
5186
- var import_node_url = require("node:url");
5187
-
5188
- // node_modules/.pnpm/path-key@4.0.0/node_modules/path-key/index.js
5189
- function pathKey(options = {}) {
5190
- const {
5191
- env = process.env,
5192
- platform = process.platform
5193
- } = options;
5194
- if (platform !== "win32") {
5195
- return "PATH";
5196
- }
5197
- return Object.keys(env).reverse().find((key) => key.toUpperCase() === "PATH") || "Path";
5198
- }
5199
-
5200
- // node_modules/.pnpm/npm-run-path@5.3.0/node_modules/npm-run-path/index.js
5201
- var npmRunPath = ({
5202
- cwd = import_node_process3.default.cwd(),
5203
- path: pathOption = import_node_process3.default.env[pathKey()],
5204
- preferLocal = true,
5205
- execPath = import_node_process3.default.execPath,
5206
- addExecPath = true
5207
- } = {}) => {
5208
- const cwdString = cwd instanceof URL ? (0, import_node_url.fileURLToPath)(cwd) : cwd;
5209
- const cwdPath = import_node_path8.default.resolve(cwdString);
5210
- const result = [];
5211
- if (preferLocal) {
5212
- applyPreferLocal(result, cwdPath);
5213
- }
5214
- if (addExecPath) {
5215
- applyExecPath(result, execPath, cwdPath);
5216
- }
5217
- return [...result, pathOption].join(import_node_path8.default.delimiter);
5218
- };
5219
- var applyPreferLocal = (result, cwdPath) => {
5220
- let previous;
5221
- while (previous !== cwdPath) {
5222
- result.push(import_node_path8.default.join(cwdPath, "node_modules/.bin"));
5223
- previous = cwdPath;
5224
- cwdPath = import_node_path8.default.resolve(cwdPath, "..");
4591
+ // packages/qwik/src/cli/utils/run-build-command.ts
4592
+ import { execaCommand } from "execa";
4593
+ async function runBuildCommand(app) {
4594
+ const pkgJsonScripts = app.packageJson.scripts;
4595
+ if (!pkgJsonScripts) {
4596
+ throw new Error(`No "scripts" property found in package.json`);
5225
4597
  }
5226
- };
5227
- var applyExecPath = (result, execPath, cwdPath) => {
5228
- const execPathString = execPath instanceof URL ? (0, import_node_url.fileURLToPath)(execPath) : execPath;
5229
- result.push(import_node_path8.default.resolve(cwdPath, execPathString, ".."));
5230
- };
5231
- var npmRunPathEnv = ({ env = import_node_process3.default.env, ...options } = {}) => {
5232
- env = { ...env };
5233
- const pathName = pathKey({ env });
5234
- options.path = env[pathName];
5235
- env[pathName] = npmRunPath(options);
5236
- return env;
5237
- };
5238
-
5239
- // node_modules/.pnpm/mimic-fn@4.0.0/node_modules/mimic-fn/index.js
5240
- var copyProperty = (to, from, property, ignoreNonConfigurable) => {
5241
- if (property === "length" || property === "prototype") {
5242
- return;
4598
+ const pkgManager = getPackageManager();
4599
+ const getScript = (name) => {
4600
+ if (pkgJsonScripts[name]) {
4601
+ return `${pkgManager} run ${name}`;
4602
+ }
4603
+ return void 0;
4604
+ };
4605
+ const isPreviewBuild = app.args.includes("preview");
4606
+ const buildLibScript = getScript("build.lib");
4607
+ const isLibraryBuild = !!buildLibScript;
4608
+ const buildClientScript = getScript("build.client");
4609
+ const buildPreviewScript = isPreviewBuild ? getScript("build.preview") : void 0;
4610
+ const buildServerScript = !isPreviewBuild ? getScript("build.server") : void 0;
4611
+ const buildStaticScript = getScript("build.static");
4612
+ const runSsgScript = getScript("ssg");
4613
+ const buildTypes = getScript("build.types");
4614
+ const lint = getScript("lint");
4615
+ const mode = app.getArg("mode");
4616
+ const prebuildScripts = Object.keys(pkgJsonScripts).filter((s2) => s2.startsWith("prebuild.")).map(getScript).filter(isString);
4617
+ const postbuildScripts = Object.keys(pkgJsonScripts).filter((s2) => s2.startsWith("postbuild.")).map(getScript).filter(isString);
4618
+ const scripts = [
4619
+ buildTypes,
4620
+ buildClientScript,
4621
+ buildLibScript,
4622
+ buildPreviewScript,
4623
+ buildServerScript,
4624
+ buildStaticScript,
4625
+ lint
4626
+ ].filter(isString);
4627
+ if (!isLibraryBuild && !buildClientScript) {
4628
+ console.log(pkgJsonScripts);
4629
+ throw new Error(`"build.client" script not found in package.json`);
5243
4630
  }
5244
- if (property === "arguments" || property === "caller") {
5245
- return;
4631
+ if (isPreviewBuild && !buildPreviewScript && !buildStaticScript) {
4632
+ throw new Error(
4633
+ `Neither "build.preview" or "build.static" script found in package.json for preview`
4634
+ );
5246
4635
  }
5247
- const toDescriptor = Object.getOwnPropertyDescriptor(to, property);
5248
- const fromDescriptor = Object.getOwnPropertyDescriptor(from, property);
5249
- if (!canCopyProperty(toDescriptor, fromDescriptor) && ignoreNonConfigurable) {
5250
- return;
4636
+ console.log(``);
4637
+ for (const script of prebuildScripts) {
4638
+ console.log(dim(script));
5251
4639
  }
5252
- Object.defineProperty(to, property, fromDescriptor);
5253
- };
5254
- var canCopyProperty = function(toDescriptor, fromDescriptor) {
5255
- return toDescriptor === void 0 || toDescriptor.configurable || toDescriptor.writable === fromDescriptor.writable && toDescriptor.enumerable === fromDescriptor.enumerable && toDescriptor.configurable === fromDescriptor.configurable && (toDescriptor.writable || toDescriptor.value === fromDescriptor.value);
5256
- };
5257
- var changePrototype = (to, from) => {
5258
- const fromPrototype = Object.getPrototypeOf(from);
5259
- if (fromPrototype === Object.getPrototypeOf(to)) {
5260
- return;
4640
+ for (const script of scripts) {
4641
+ console.log(dim(script));
5261
4642
  }
5262
- Object.setPrototypeOf(to, fromPrototype);
5263
- };
5264
- var wrappedToString = (withName, fromBody) => `/* Wrapped ${withName}*/
5265
- ${fromBody}`;
5266
- var toStringDescriptor = Object.getOwnPropertyDescriptor(Function.prototype, "toString");
5267
- var toStringName = Object.getOwnPropertyDescriptor(Function.prototype.toString, "name");
5268
- var changeToString = (to, from, name) => {
5269
- const withName = name === "" ? "" : `with ${name.trim()}() `;
5270
- const newToString = wrappedToString.bind(null, withName, from.toString());
5271
- Object.defineProperty(newToString, "name", toStringName);
5272
- Object.defineProperty(to, "toString", { ...toStringDescriptor, value: newToString });
5273
- };
5274
- function mimicFunction(to, from, { ignoreNonConfigurable = false } = {}) {
5275
- const { name } = to;
5276
- for (const property of Reflect.ownKeys(from)) {
5277
- copyProperty(to, from, property, ignoreNonConfigurable);
4643
+ for (const script of postbuildScripts) {
4644
+ console.log(dim(script));
5278
4645
  }
5279
- changePrototype(to, from);
5280
- changeToString(to, from, name);
5281
- return to;
5282
- }
5283
-
5284
- // node_modules/.pnpm/onetime@6.0.0/node_modules/onetime/index.js
5285
- var calledFunctions = /* @__PURE__ */ new WeakMap();
5286
- var onetime = (function_, options = {}) => {
5287
- if (typeof function_ !== "function") {
5288
- throw new TypeError("Expected a function");
5289
- }
5290
- let returnValue;
5291
- let callCount = 0;
5292
- const functionName = function_.displayName || function_.name || "<anonymous>";
5293
- const onetime2 = function(...arguments_) {
5294
- calledFunctions.set(onetime2, ++callCount);
5295
- if (callCount === 1) {
5296
- returnValue = function_.apply(this, arguments_);
5297
- function_ = null;
5298
- } else if (options.throw === true) {
5299
- throw new Error(`Function \`${functionName}\` can only be called once`);
5300
- }
5301
- return returnValue;
5302
- };
5303
- mimicFunction(onetime2, function_);
5304
- calledFunctions.set(onetime2, callCount);
5305
- return onetime2;
5306
- };
5307
- onetime.callCount = (function_) => {
5308
- if (!calledFunctions.has(function_)) {
5309
- throw new Error(`The given function \`${function_.name}\` is not wrapped by the \`onetime\` package`);
5310
- }
5311
- return calledFunctions.get(function_);
5312
- };
5313
- var onetime_default = onetime;
5314
-
5315
- // node_modules/.pnpm/execa@8.0.1/node_modules/execa/lib/error.js
5316
- var import_node_process4 = __toESM(require("node:process"), 1);
5317
-
5318
- // node_modules/.pnpm/human-signals@5.0.0/node_modules/human-signals/build/src/main.js
5319
- var import_node_os2 = require("node:os");
5320
-
5321
- // node_modules/.pnpm/human-signals@5.0.0/node_modules/human-signals/build/src/realtime.js
5322
- var getRealtimeSignals = () => {
5323
- const length = SIGRTMAX - SIGRTMIN + 1;
5324
- return Array.from({ length }, getRealtimeSignal);
5325
- };
5326
- var getRealtimeSignal = (value, index) => ({
5327
- name: `SIGRT${index + 1}`,
5328
- number: SIGRTMIN + index,
5329
- action: "terminate",
5330
- description: "Application-specific signal (realtime)",
5331
- standard: "posix"
5332
- });
5333
- var SIGRTMIN = 34;
5334
- var SIGRTMAX = 64;
5335
-
5336
- // node_modules/.pnpm/human-signals@5.0.0/node_modules/human-signals/build/src/signals.js
5337
- var import_node_os = require("node:os");
5338
-
5339
- // node_modules/.pnpm/human-signals@5.0.0/node_modules/human-signals/build/src/core.js
5340
- var SIGNALS = [
5341
- {
5342
- name: "SIGHUP",
5343
- number: 1,
5344
- action: "terminate",
5345
- description: "Terminal closed",
5346
- standard: "posix"
5347
- },
5348
- {
5349
- name: "SIGINT",
5350
- number: 2,
5351
- action: "terminate",
5352
- description: "User interruption with CTRL-C",
5353
- standard: "ansi"
5354
- },
5355
- {
5356
- name: "SIGQUIT",
5357
- number: 3,
5358
- action: "core",
5359
- description: "User interruption with CTRL-\\",
5360
- standard: "posix"
5361
- },
5362
- {
5363
- name: "SIGILL",
5364
- number: 4,
5365
- action: "core",
5366
- description: "Invalid machine instruction",
5367
- standard: "ansi"
5368
- },
5369
- {
5370
- name: "SIGTRAP",
5371
- number: 5,
5372
- action: "core",
5373
- description: "Debugger breakpoint",
5374
- standard: "posix"
5375
- },
5376
- {
5377
- name: "SIGABRT",
5378
- number: 6,
5379
- action: "core",
5380
- description: "Aborted",
5381
- standard: "ansi"
5382
- },
5383
- {
5384
- name: "SIGIOT",
5385
- number: 6,
5386
- action: "core",
5387
- description: "Aborted",
5388
- standard: "bsd"
5389
- },
5390
- {
5391
- name: "SIGBUS",
5392
- number: 7,
5393
- action: "core",
5394
- description: "Bus error due to misaligned, non-existing address or paging error",
5395
- standard: "bsd"
5396
- },
5397
- {
5398
- name: "SIGEMT",
5399
- number: 7,
5400
- action: "terminate",
5401
- description: "Command should be emulated but is not implemented",
5402
- standard: "other"
5403
- },
5404
- {
5405
- name: "SIGFPE",
5406
- number: 8,
5407
- action: "core",
5408
- description: "Floating point arithmetic error",
5409
- standard: "ansi"
5410
- },
5411
- {
5412
- name: "SIGKILL",
5413
- number: 9,
5414
- action: "terminate",
5415
- description: "Forced termination",
5416
- standard: "posix",
5417
- forced: true
5418
- },
5419
- {
5420
- name: "SIGUSR1",
5421
- number: 10,
5422
- action: "terminate",
5423
- description: "Application-specific signal",
5424
- standard: "posix"
5425
- },
5426
- {
5427
- name: "SIGSEGV",
5428
- number: 11,
5429
- action: "core",
5430
- description: "Segmentation fault",
5431
- standard: "ansi"
5432
- },
5433
- {
5434
- name: "SIGUSR2",
5435
- number: 12,
5436
- action: "terminate",
5437
- description: "Application-specific signal",
5438
- standard: "posix"
5439
- },
5440
- {
5441
- name: "SIGPIPE",
5442
- number: 13,
5443
- action: "terminate",
5444
- description: "Broken pipe or socket",
5445
- standard: "posix"
5446
- },
5447
- {
5448
- name: "SIGALRM",
5449
- number: 14,
5450
- action: "terminate",
5451
- description: "Timeout or timer",
5452
- standard: "posix"
5453
- },
5454
- {
5455
- name: "SIGTERM",
5456
- number: 15,
5457
- action: "terminate",
5458
- description: "Termination",
5459
- standard: "ansi"
5460
- },
5461
- {
5462
- name: "SIGSTKFLT",
5463
- number: 16,
5464
- action: "terminate",
5465
- description: "Stack is empty or overflowed",
5466
- standard: "other"
5467
- },
5468
- {
5469
- name: "SIGCHLD",
5470
- number: 17,
5471
- action: "ignore",
5472
- description: "Child process terminated, paused or unpaused",
5473
- standard: "posix"
5474
- },
5475
- {
5476
- name: "SIGCLD",
5477
- number: 17,
5478
- action: "ignore",
5479
- description: "Child process terminated, paused or unpaused",
5480
- standard: "other"
5481
- },
5482
- {
5483
- name: "SIGCONT",
5484
- number: 18,
5485
- action: "unpause",
5486
- description: "Unpaused",
5487
- standard: "posix",
5488
- forced: true
5489
- },
5490
- {
5491
- name: "SIGSTOP",
5492
- number: 19,
5493
- action: "pause",
5494
- description: "Paused",
5495
- standard: "posix",
5496
- forced: true
5497
- },
5498
- {
5499
- name: "SIGTSTP",
5500
- number: 20,
5501
- action: "pause",
5502
- description: 'Paused using CTRL-Z or "suspend"',
5503
- standard: "posix"
5504
- },
5505
- {
5506
- name: "SIGTTIN",
5507
- number: 21,
5508
- action: "pause",
5509
- description: "Background process cannot read terminal input",
5510
- standard: "posix"
5511
- },
5512
- {
5513
- name: "SIGBREAK",
5514
- number: 21,
5515
- action: "terminate",
5516
- description: "User interruption with CTRL-BREAK",
5517
- standard: "other"
5518
- },
5519
- {
5520
- name: "SIGTTOU",
5521
- number: 22,
5522
- action: "pause",
5523
- description: "Background process cannot write to terminal output",
5524
- standard: "posix"
5525
- },
5526
- {
5527
- name: "SIGURG",
5528
- number: 23,
5529
- action: "ignore",
5530
- description: "Socket received out-of-band data",
5531
- standard: "bsd"
5532
- },
5533
- {
5534
- name: "SIGXCPU",
5535
- number: 24,
5536
- action: "core",
5537
- description: "Process timed out",
5538
- standard: "bsd"
5539
- },
5540
- {
5541
- name: "SIGXFSZ",
5542
- number: 25,
5543
- action: "core",
5544
- description: "File too big",
5545
- standard: "bsd"
5546
- },
5547
- {
5548
- name: "SIGVTALRM",
5549
- number: 26,
5550
- action: "terminate",
5551
- description: "Timeout or timer",
5552
- standard: "bsd"
5553
- },
5554
- {
5555
- name: "SIGPROF",
5556
- number: 27,
5557
- action: "terminate",
5558
- description: "Timeout or timer",
5559
- standard: "bsd"
5560
- },
5561
- {
5562
- name: "SIGWINCH",
5563
- number: 28,
5564
- action: "ignore",
5565
- description: "Terminal window size changed",
5566
- standard: "bsd"
5567
- },
5568
- {
5569
- name: "SIGIO",
5570
- number: 29,
5571
- action: "terminate",
5572
- description: "I/O is available",
5573
- standard: "other"
5574
- },
5575
- {
5576
- name: "SIGPOLL",
5577
- number: 29,
5578
- action: "terminate",
5579
- description: "Watched event",
5580
- standard: "other"
5581
- },
5582
- {
5583
- name: "SIGINFO",
5584
- number: 29,
5585
- action: "ignore",
5586
- description: "Request for process information",
5587
- standard: "other"
5588
- },
5589
- {
5590
- name: "SIGPWR",
5591
- number: 30,
5592
- action: "terminate",
5593
- description: "Device running out of power",
5594
- standard: "systemv"
5595
- },
5596
- {
5597
- name: "SIGSYS",
5598
- number: 31,
5599
- action: "core",
5600
- description: "Invalid system call",
5601
- standard: "other"
5602
- },
5603
- {
5604
- name: "SIGUNUSED",
5605
- number: 31,
5606
- action: "terminate",
5607
- description: "Invalid system call",
5608
- standard: "other"
5609
- }
5610
- ];
5611
-
5612
- // node_modules/.pnpm/human-signals@5.0.0/node_modules/human-signals/build/src/signals.js
5613
- var getSignals = () => {
5614
- const realtimeSignals = getRealtimeSignals();
5615
- const signals2 = [...SIGNALS, ...realtimeSignals].map(normalizeSignal);
5616
- return signals2;
5617
- };
5618
- var normalizeSignal = ({
5619
- name,
5620
- number: defaultNumber,
5621
- description,
5622
- action,
5623
- forced = false,
5624
- standard
5625
- }) => {
5626
- const {
5627
- signals: { [name]: constantSignal }
5628
- } = import_node_os.constants;
5629
- const supported = constantSignal !== void 0;
5630
- const number = supported ? constantSignal : defaultNumber;
5631
- return { name, number, description, supported, action, forced, standard };
5632
- };
5633
-
5634
- // node_modules/.pnpm/human-signals@5.0.0/node_modules/human-signals/build/src/main.js
5635
- var getSignalsByName = () => {
5636
- const signals2 = getSignals();
5637
- return Object.fromEntries(signals2.map(getSignalByName));
5638
- };
5639
- var getSignalByName = ({
5640
- name,
5641
- number,
5642
- description,
5643
- supported,
5644
- action,
5645
- forced,
5646
- standard
5647
- }) => [name, { name, number, description, supported, action, forced, standard }];
5648
- var signalsByName = getSignalsByName();
5649
- var getSignalsByNumber = () => {
5650
- const signals2 = getSignals();
5651
- const length = SIGRTMAX + 1;
5652
- const signalsA = Array.from(
5653
- { length },
5654
- (value, number) => getSignalByNumber(number, signals2)
5655
- );
5656
- return Object.assign({}, ...signalsA);
5657
- };
5658
- var getSignalByNumber = (number, signals2) => {
5659
- const signal = findSignalByNumber(number, signals2);
5660
- if (signal === void 0) {
5661
- return {};
5662
- }
5663
- const { name, description, supported, action, forced, standard } = signal;
5664
- return {
5665
- [number]: {
5666
- name,
5667
- number,
5668
- description,
5669
- supported,
5670
- action,
5671
- forced,
5672
- standard
5673
- }
5674
- };
5675
- };
5676
- var findSignalByNumber = (number, signals2) => {
5677
- const signal = signals2.find(({ name }) => import_node_os2.constants.signals[name] === number);
5678
- if (signal !== void 0) {
5679
- return signal;
5680
- }
5681
- return signals2.find((signalA) => signalA.number === number);
5682
- };
5683
- var signalsByNumber = getSignalsByNumber();
5684
-
5685
- // node_modules/.pnpm/execa@8.0.1/node_modules/execa/lib/error.js
5686
- var getErrorPrefix = ({ timedOut, timeout, errorCode, signal, signalDescription, exitCode, isCanceled }) => {
5687
- if (timedOut) {
5688
- return `timed out after ${timeout} milliseconds`;
5689
- }
5690
- if (isCanceled) {
5691
- return "was canceled";
5692
- }
5693
- if (errorCode !== void 0) {
5694
- return `failed with ${errorCode}`;
5695
- }
5696
- if (signal !== void 0) {
5697
- return `was killed with ${signal} (${signalDescription})`;
5698
- }
5699
- if (exitCode !== void 0) {
5700
- return `failed with exit code ${exitCode}`;
5701
- }
5702
- return "failed";
5703
- };
5704
- var makeError = ({
5705
- stdout,
5706
- stderr,
5707
- all,
5708
- error,
5709
- signal,
5710
- exitCode,
5711
- command,
5712
- escapedCommand,
5713
- timedOut,
5714
- isCanceled,
5715
- killed,
5716
- parsed: { options: { timeout, cwd = import_node_process4.default.cwd() } }
5717
- }) => {
5718
- exitCode = exitCode === null ? void 0 : exitCode;
5719
- signal = signal === null ? void 0 : signal;
5720
- const signalDescription = signal === void 0 ? void 0 : signalsByName[signal].description;
5721
- const errorCode = error && error.code;
5722
- const prefix = getErrorPrefix({ timedOut, timeout, errorCode, signal, signalDescription, exitCode, isCanceled });
5723
- const execaMessage = `Command ${prefix}: ${command}`;
5724
- const isError = Object.prototype.toString.call(error) === "[object Error]";
5725
- const shortMessage = isError ? `${execaMessage}
5726
- ${error.message}` : execaMessage;
5727
- const message = [shortMessage, stderr, stdout].filter(Boolean).join("\n");
5728
- if (isError) {
5729
- error.originalMessage = error.message;
5730
- error.message = message;
5731
- } else {
5732
- error = new Error(message);
5733
- }
5734
- error.shortMessage = shortMessage;
5735
- error.command = command;
5736
- error.escapedCommand = escapedCommand;
5737
- error.exitCode = exitCode;
5738
- error.signal = signal;
5739
- error.signalDescription = signalDescription;
5740
- error.stdout = stdout;
5741
- error.stderr = stderr;
5742
- error.cwd = cwd;
5743
- if (all !== void 0) {
5744
- error.all = all;
5745
- }
5746
- if ("bufferedData" in error) {
5747
- delete error.bufferedData;
5748
- }
5749
- error.failed = true;
5750
- error.timedOut = Boolean(timedOut);
5751
- error.isCanceled = isCanceled;
5752
- error.killed = killed && !timedOut;
5753
- return error;
5754
- };
5755
-
5756
- // node_modules/.pnpm/execa@8.0.1/node_modules/execa/lib/stdio.js
5757
- var aliases = ["stdin", "stdout", "stderr"];
5758
- var hasAlias = (options) => aliases.some((alias) => options[alias] !== void 0);
5759
- var normalizeStdio = (options) => {
5760
- if (!options) {
5761
- return;
5762
- }
5763
- const { stdio } = options;
5764
- if (stdio === void 0) {
5765
- return aliases.map((alias) => options[alias]);
5766
- }
5767
- if (hasAlias(options)) {
5768
- throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${aliases.map((alias) => `\`${alias}\``).join(", ")}`);
5769
- }
5770
- if (typeof stdio === "string") {
5771
- return stdio;
5772
- }
5773
- if (!Array.isArray(stdio)) {
5774
- throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof stdio}\``);
5775
- }
5776
- const length = Math.max(stdio.length, aliases.length);
5777
- return Array.from({ length }, (value, index) => stdio[index]);
5778
- };
5779
-
5780
- // node_modules/.pnpm/execa@8.0.1/node_modules/execa/lib/kill.js
5781
- var import_node_os3 = __toESM(require("node:os"), 1);
5782
-
5783
- // node_modules/.pnpm/signal-exit@4.1.0/node_modules/signal-exit/dist/mjs/signals.js
5784
- var signals = [];
5785
- signals.push("SIGHUP", "SIGINT", "SIGTERM");
5786
- if (process.platform !== "win32") {
5787
- signals.push(
5788
- "SIGALRM",
5789
- "SIGABRT",
5790
- "SIGVTALRM",
5791
- "SIGXCPU",
5792
- "SIGXFSZ",
5793
- "SIGUSR2",
5794
- "SIGTRAP",
5795
- "SIGSYS",
5796
- "SIGQUIT",
5797
- "SIGIOT"
5798
- // should detect profiler and enable/disable accordingly.
5799
- // see #21
5800
- // 'SIGPROF'
5801
- );
5802
- }
5803
- if (process.platform === "linux") {
5804
- signals.push("SIGIO", "SIGPOLL", "SIGPWR", "SIGSTKFLT");
5805
- }
5806
-
5807
- // node_modules/.pnpm/signal-exit@4.1.0/node_modules/signal-exit/dist/mjs/index.js
5808
- var processOk = (process7) => !!process7 && typeof process7 === "object" && typeof process7.removeListener === "function" && typeof process7.emit === "function" && typeof process7.reallyExit === "function" && typeof process7.listeners === "function" && typeof process7.kill === "function" && typeof process7.pid === "number" && typeof process7.on === "function";
5809
- var kExitEmitter = Symbol.for("signal-exit emitter");
5810
- var global2 = globalThis;
5811
- var ObjectDefineProperty = Object.defineProperty.bind(Object);
5812
- var Emitter = class {
5813
- emitted = {
5814
- afterExit: false,
5815
- exit: false
5816
- };
5817
- listeners = {
5818
- afterExit: [],
5819
- exit: []
5820
- };
5821
- count = 0;
5822
- id = Math.random();
5823
- constructor() {
5824
- if (global2[kExitEmitter]) {
5825
- return global2[kExitEmitter];
5826
- }
5827
- ObjectDefineProperty(global2, kExitEmitter, {
5828
- value: this,
5829
- writable: false,
5830
- enumerable: false,
5831
- configurable: false
5832
- });
5833
- }
5834
- on(ev, fn) {
5835
- this.listeners[ev].push(fn);
5836
- }
5837
- removeListener(ev, fn) {
5838
- const list = this.listeners[ev];
5839
- const i = list.indexOf(fn);
5840
- if (i === -1) {
5841
- return;
5842
- }
5843
- if (i === 0 && list.length === 1) {
5844
- list.length = 0;
5845
- } else {
5846
- list.splice(i, 1);
5847
- }
5848
- }
5849
- emit(ev, code, signal) {
5850
- if (this.emitted[ev]) {
5851
- return false;
5852
- }
5853
- this.emitted[ev] = true;
5854
- let ret = false;
5855
- for (const fn of this.listeners[ev]) {
5856
- ret = fn(code, signal) === true || ret;
5857
- }
5858
- if (ev === "exit") {
5859
- ret = this.emit("afterExit", code, signal) || ret;
5860
- }
5861
- return ret;
5862
- }
5863
- };
5864
- var SignalExitBase = class {
5865
- };
5866
- var signalExitWrap = (handler) => {
5867
- return {
5868
- onExit(cb, opts) {
5869
- return handler.onExit(cb, opts);
5870
- },
5871
- load() {
5872
- return handler.load();
5873
- },
5874
- unload() {
5875
- return handler.unload();
5876
- }
5877
- };
5878
- };
5879
- var SignalExitFallback = class extends SignalExitBase {
5880
- onExit() {
5881
- return () => {
5882
- };
5883
- }
5884
- load() {
5885
- }
5886
- unload() {
5887
- }
5888
- };
5889
- var SignalExit = class extends SignalExitBase {
5890
- // "SIGHUP" throws an `ENOSYS` error on Windows,
5891
- // so use a supported signal instead
5892
- /* c8 ignore start */
5893
- #hupSig = process4.platform === "win32" ? "SIGINT" : "SIGHUP";
5894
- /* c8 ignore stop */
5895
- #emitter = new Emitter();
5896
- #process;
5897
- #originalProcessEmit;
5898
- #originalProcessReallyExit;
5899
- #sigListeners = {};
5900
- #loaded = false;
5901
- constructor(process7) {
5902
- super();
5903
- this.#process = process7;
5904
- this.#sigListeners = {};
5905
- for (const sig of signals) {
5906
- this.#sigListeners[sig] = () => {
5907
- const listeners = this.#process.listeners(sig);
5908
- let { count } = this.#emitter;
5909
- const p2 = process7;
5910
- if (typeof p2.__signal_exit_emitter__ === "object" && typeof p2.__signal_exit_emitter__.count === "number") {
5911
- count += p2.__signal_exit_emitter__.count;
5912
- }
5913
- if (listeners.length === count) {
5914
- this.unload();
5915
- const ret = this.#emitter.emit("exit", null, sig);
5916
- const s2 = sig === "SIGHUP" ? this.#hupSig : sig;
5917
- if (!ret)
5918
- process7.kill(process7.pid, s2);
5919
- }
5920
- };
5921
- }
5922
- this.#originalProcessReallyExit = process7.reallyExit;
5923
- this.#originalProcessEmit = process7.emit;
5924
- }
5925
- onExit(cb, opts) {
5926
- if (!processOk(this.#process)) {
5927
- return () => {
5928
- };
5929
- }
5930
- if (this.#loaded === false) {
5931
- this.load();
5932
- }
5933
- const ev = (opts == null ? void 0 : opts.alwaysLast) ? "afterExit" : "exit";
5934
- this.#emitter.on(ev, cb);
5935
- return () => {
5936
- this.#emitter.removeListener(ev, cb);
5937
- if (this.#emitter.listeners["exit"].length === 0 && this.#emitter.listeners["afterExit"].length === 0) {
5938
- this.unload();
5939
- }
5940
- };
5941
- }
5942
- load() {
5943
- if (this.#loaded) {
5944
- return;
5945
- }
5946
- this.#loaded = true;
5947
- this.#emitter.count += 1;
5948
- for (const sig of signals) {
5949
- try {
5950
- const fn = this.#sigListeners[sig];
5951
- if (fn)
5952
- this.#process.on(sig, fn);
5953
- } catch (_3) {
5954
- }
5955
- }
5956
- this.#process.emit = (ev, ...a) => {
5957
- return this.#processEmit(ev, ...a);
5958
- };
5959
- this.#process.reallyExit = (code) => {
5960
- return this.#processReallyExit(code);
5961
- };
5962
- }
5963
- unload() {
5964
- if (!this.#loaded) {
5965
- return;
5966
- }
5967
- this.#loaded = false;
5968
- signals.forEach((sig) => {
5969
- const listener = this.#sigListeners[sig];
5970
- if (!listener) {
5971
- throw new Error("Listener not defined for signal: " + sig);
5972
- }
5973
- try {
5974
- this.#process.removeListener(sig, listener);
5975
- } catch (_3) {
5976
- }
5977
- });
5978
- this.#process.emit = this.#originalProcessEmit;
5979
- this.#process.reallyExit = this.#originalProcessReallyExit;
5980
- this.#emitter.count -= 1;
5981
- }
5982
- #processReallyExit(code) {
5983
- if (!processOk(this.#process)) {
5984
- return 0;
5985
- }
5986
- this.#process.exitCode = code || 0;
5987
- this.#emitter.emit("exit", this.#process.exitCode, null);
5988
- return this.#originalProcessReallyExit.call(this.#process, this.#process.exitCode);
5989
- }
5990
- #processEmit(ev, ...args) {
5991
- const og = this.#originalProcessEmit;
5992
- if (ev === "exit" && processOk(this.#process)) {
5993
- if (typeof args[0] === "number") {
5994
- this.#process.exitCode = args[0];
5995
- }
5996
- const ret = og.call(this.#process, ev, ...args);
5997
- this.#emitter.emit("exit", this.#process.exitCode, null);
5998
- return ret;
5999
- } else {
6000
- return og.call(this.#process, ev, ...args);
6001
- }
6002
- }
6003
- };
6004
- var process4 = globalThis.process;
6005
- var {
6006
- /**
6007
- * Called when the process is exiting, whether via signal, explicit
6008
- * exit, or running out of stuff to do.
6009
- *
6010
- * If the global process object is not suitable for instrumentation,
6011
- * then this will be a no-op.
6012
- *
6013
- * Returns a function that may be used to unload signal-exit.
6014
- */
6015
- onExit,
6016
- /**
6017
- * Load the listeners. Likely you never need to call this, unless
6018
- * doing a rather deep integration with signal-exit functionality.
6019
- * Mostly exposed for the benefit of testing.
6020
- *
6021
- * @internal
6022
- */
6023
- load,
6024
- /**
6025
- * Unload the listeners. Likely you never need to call this, unless
6026
- * doing a rather deep integration with signal-exit functionality.
6027
- * Mostly exposed for the benefit of testing.
6028
- *
6029
- * @internal
6030
- */
6031
- unload
6032
- } = signalExitWrap(processOk(process4) ? new SignalExit(process4) : new SignalExitFallback());
6033
-
6034
- // node_modules/.pnpm/execa@8.0.1/node_modules/execa/lib/kill.js
6035
- var DEFAULT_FORCE_KILL_TIMEOUT = 1e3 * 5;
6036
- var spawnedKill = (kill, signal = "SIGTERM", options = {}) => {
6037
- const killResult = kill(signal);
6038
- setKillTimeout(kill, signal, options, killResult);
6039
- return killResult;
6040
- };
6041
- var setKillTimeout = (kill, signal, options, killResult) => {
6042
- if (!shouldForceKill(signal, options, killResult)) {
6043
- return;
6044
- }
6045
- const timeout = getForceKillAfterTimeout(options);
6046
- const t = setTimeout(() => {
6047
- kill("SIGKILL");
6048
- }, timeout);
6049
- if (t.unref) {
6050
- t.unref();
6051
- }
6052
- };
6053
- var shouldForceKill = (signal, { forceKillAfterTimeout }, killResult) => isSigterm(signal) && forceKillAfterTimeout !== false && killResult;
6054
- var isSigterm = (signal) => signal === import_node_os3.default.constants.signals.SIGTERM || typeof signal === "string" && signal.toUpperCase() === "SIGTERM";
6055
- var getForceKillAfterTimeout = ({ forceKillAfterTimeout = true }) => {
6056
- if (forceKillAfterTimeout === true) {
6057
- return DEFAULT_FORCE_KILL_TIMEOUT;
6058
- }
6059
- if (!Number.isFinite(forceKillAfterTimeout) || forceKillAfterTimeout < 0) {
6060
- throw new TypeError(`Expected the \`forceKillAfterTimeout\` option to be a non-negative integer, got \`${forceKillAfterTimeout}\` (${typeof forceKillAfterTimeout})`);
6061
- }
6062
- return forceKillAfterTimeout;
6063
- };
6064
- var spawnedCancel = (spawned, context) => {
6065
- const killResult = spawned.kill();
6066
- if (killResult) {
6067
- context.isCanceled = true;
6068
- }
6069
- };
6070
- var timeoutKill = (spawned, signal, reject) => {
6071
- spawned.kill(signal);
6072
- reject(Object.assign(new Error("Timed out"), { timedOut: true, signal }));
6073
- };
6074
- var setupTimeout = (spawned, { timeout, killSignal = "SIGTERM" }, spawnedPromise) => {
6075
- if (timeout === 0 || timeout === void 0) {
6076
- return spawnedPromise;
6077
- }
6078
- let timeoutId;
6079
- const timeoutPromise = new Promise((resolve2, reject) => {
6080
- timeoutId = setTimeout(() => {
6081
- timeoutKill(spawned, killSignal, reject);
6082
- }, timeout);
6083
- });
6084
- const safeSpawnedPromise = spawnedPromise.finally(() => {
6085
- clearTimeout(timeoutId);
6086
- });
6087
- return Promise.race([timeoutPromise, safeSpawnedPromise]);
6088
- };
6089
- var validateTimeout = ({ timeout }) => {
6090
- if (timeout !== void 0 && (!Number.isFinite(timeout) || timeout < 0)) {
6091
- throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${timeout}\` (${typeof timeout})`);
6092
- }
6093
- };
6094
- var setExitHandler = async (spawned, { cleanup, detached }, timedPromise) => {
6095
- if (!cleanup || detached) {
6096
- return timedPromise;
6097
- }
6098
- const removeExitHandler = onExit(() => {
6099
- spawned.kill();
6100
- });
6101
- return timedPromise.finally(() => {
6102
- removeExitHandler();
6103
- });
6104
- };
6105
-
6106
- // node_modules/.pnpm/execa@8.0.1/node_modules/execa/lib/pipe.js
6107
- var import_node_fs8 = require("node:fs");
6108
- var import_node_child_process = require("node:child_process");
6109
-
6110
- // node_modules/.pnpm/is-stream@3.0.0/node_modules/is-stream/index.js
6111
- function isStream(stream) {
6112
- return stream !== null && typeof stream === "object" && typeof stream.pipe === "function";
6113
- }
6114
- function isWritableStream(stream) {
6115
- return isStream(stream) && stream.writable !== false && typeof stream._write === "function" && typeof stream._writableState === "object";
6116
- }
6117
-
6118
- // node_modules/.pnpm/execa@8.0.1/node_modules/execa/lib/pipe.js
6119
- var isExecaChildProcess = (target) => target instanceof import_node_child_process.ChildProcess && typeof target.then === "function";
6120
- var pipeToTarget = (spawned, streamName, target) => {
6121
- if (typeof target === "string") {
6122
- spawned[streamName].pipe((0, import_node_fs8.createWriteStream)(target));
6123
- return spawned;
6124
- }
6125
- if (isWritableStream(target)) {
6126
- spawned[streamName].pipe(target);
6127
- return spawned;
6128
- }
6129
- if (!isExecaChildProcess(target)) {
6130
- throw new TypeError("The second argument must be a string, a stream or an Execa child process.");
6131
- }
6132
- if (!isWritableStream(target.stdin)) {
6133
- throw new TypeError("The target child process's stdin must be available.");
6134
- }
6135
- spawned[streamName].pipe(target.stdin);
6136
- return target;
6137
- };
6138
- var addPipeMethods = (spawned) => {
6139
- if (spawned.stdout !== null) {
6140
- spawned.pipeStdout = pipeToTarget.bind(void 0, spawned, "stdout");
6141
- }
6142
- if (spawned.stderr !== null) {
6143
- spawned.pipeStderr = pipeToTarget.bind(void 0, spawned, "stderr");
6144
- }
6145
- if (spawned.all !== void 0) {
6146
- spawned.pipeAll = pipeToTarget.bind(void 0, spawned, "all");
6147
- }
6148
- };
6149
-
6150
- // node_modules/.pnpm/execa@8.0.1/node_modules/execa/lib/stream.js
6151
- var import_node_fs9 = require("node:fs");
6152
- var import_promises = require("node:timers/promises");
6153
-
6154
- // node_modules/.pnpm/get-stream@8.0.1/node_modules/get-stream/source/contents.js
6155
- var getStreamContents = async (stream, { init: init2, convertChunk, getSize, truncateChunk, addChunk, getFinalChunk, finalize }, { maxBuffer = Number.POSITIVE_INFINITY } = {}) => {
6156
- if (!isAsyncIterable(stream)) {
6157
- throw new Error("The first argument must be a Readable, a ReadableStream, or an async iterable.");
6158
- }
6159
- const state = init2();
6160
- state.length = 0;
6161
- try {
6162
- for await (const chunk of stream) {
6163
- const chunkType = getChunkType(chunk);
6164
- const convertedChunk = convertChunk[chunkType](chunk, state);
6165
- appendChunk({ convertedChunk, state, getSize, truncateChunk, addChunk, maxBuffer });
6166
- }
6167
- appendFinalChunk({ state, convertChunk, getSize, truncateChunk, addChunk, getFinalChunk, maxBuffer });
6168
- return finalize(state);
6169
- } catch (error) {
6170
- error.bufferedData = finalize(state);
6171
- throw error;
6172
- }
6173
- };
6174
- var appendFinalChunk = ({ state, getSize, truncateChunk, addChunk, getFinalChunk, maxBuffer }) => {
6175
- const convertedChunk = getFinalChunk(state);
6176
- if (convertedChunk !== void 0) {
6177
- appendChunk({ convertedChunk, state, getSize, truncateChunk, addChunk, maxBuffer });
6178
- }
6179
- };
6180
- var appendChunk = ({ convertedChunk, state, getSize, truncateChunk, addChunk, maxBuffer }) => {
6181
- const chunkSize = getSize(convertedChunk);
6182
- const newLength = state.length + chunkSize;
6183
- if (newLength <= maxBuffer) {
6184
- addNewChunk(convertedChunk, state, addChunk, newLength);
6185
- return;
6186
- }
6187
- const truncatedChunk = truncateChunk(convertedChunk, maxBuffer - state.length);
6188
- if (truncatedChunk !== void 0) {
6189
- addNewChunk(truncatedChunk, state, addChunk, maxBuffer);
6190
- }
6191
- throw new MaxBufferError();
6192
- };
6193
- var addNewChunk = (convertedChunk, state, addChunk, newLength) => {
6194
- state.contents = addChunk(convertedChunk, state, newLength);
6195
- state.length = newLength;
6196
- };
6197
- var isAsyncIterable = (stream) => typeof stream === "object" && stream !== null && typeof stream[Symbol.asyncIterator] === "function";
6198
- var getChunkType = (chunk) => {
6199
- var _a;
6200
- const typeOfChunk = typeof chunk;
6201
- if (typeOfChunk === "string") {
6202
- return "string";
6203
- }
6204
- if (typeOfChunk !== "object" || chunk === null) {
6205
- return "others";
6206
- }
6207
- if ((_a = globalThis.Buffer) == null ? void 0 : _a.isBuffer(chunk)) {
6208
- return "buffer";
6209
- }
6210
- const prototypeName = objectToString.call(chunk);
6211
- if (prototypeName === "[object ArrayBuffer]") {
6212
- return "arrayBuffer";
6213
- }
6214
- if (prototypeName === "[object DataView]") {
6215
- return "dataView";
6216
- }
6217
- if (Number.isInteger(chunk.byteLength) && Number.isInteger(chunk.byteOffset) && objectToString.call(chunk.buffer) === "[object ArrayBuffer]") {
6218
- return "typedArray";
6219
- }
6220
- return "others";
6221
- };
6222
- var { toString: objectToString } = Object.prototype;
6223
- var MaxBufferError = class extends Error {
6224
- name = "MaxBufferError";
6225
- constructor() {
6226
- super("maxBuffer exceeded");
6227
- }
6228
- };
6229
-
6230
- // node_modules/.pnpm/get-stream@8.0.1/node_modules/get-stream/source/utils.js
6231
- var identity = (value) => value;
6232
- var noop = () => void 0;
6233
- var getContentsProp = ({ contents }) => contents;
6234
- var throwObjectStream = (chunk) => {
6235
- throw new Error(`Streams in object mode are not supported: ${String(chunk)}`);
6236
- };
6237
- var getLengthProp = (convertedChunk) => convertedChunk.length;
6238
-
6239
- // node_modules/.pnpm/get-stream@8.0.1/node_modules/get-stream/source/array-buffer.js
6240
- async function getStreamAsArrayBuffer(stream, options) {
6241
- return getStreamContents(stream, arrayBufferMethods, options);
6242
- }
6243
- var initArrayBuffer = () => ({ contents: new ArrayBuffer(0) });
6244
- var useTextEncoder = (chunk) => textEncoder.encode(chunk);
6245
- var textEncoder = new TextEncoder();
6246
- var useUint8Array = (chunk) => new Uint8Array(chunk);
6247
- var useUint8ArrayWithOffset = (chunk) => new Uint8Array(chunk.buffer, chunk.byteOffset, chunk.byteLength);
6248
- var truncateArrayBufferChunk = (convertedChunk, chunkSize) => convertedChunk.slice(0, chunkSize);
6249
- var addArrayBufferChunk = (convertedChunk, { contents, length: previousLength }, length) => {
6250
- const newContents = hasArrayBufferResize() ? resizeArrayBuffer(contents, length) : resizeArrayBufferSlow(contents, length);
6251
- new Uint8Array(newContents).set(convertedChunk, previousLength);
6252
- return newContents;
6253
- };
6254
- var resizeArrayBufferSlow = (contents, length) => {
6255
- if (length <= contents.byteLength) {
6256
- return contents;
6257
- }
6258
- const arrayBuffer = new ArrayBuffer(getNewContentsLength(length));
6259
- new Uint8Array(arrayBuffer).set(new Uint8Array(contents), 0);
6260
- return arrayBuffer;
6261
- };
6262
- var resizeArrayBuffer = (contents, length) => {
6263
- if (length <= contents.maxByteLength) {
6264
- contents.resize(length);
6265
- return contents;
6266
- }
6267
- const arrayBuffer = new ArrayBuffer(length, { maxByteLength: getNewContentsLength(length) });
6268
- new Uint8Array(arrayBuffer).set(new Uint8Array(contents), 0);
6269
- return arrayBuffer;
6270
- };
6271
- var getNewContentsLength = (length) => SCALE_FACTOR ** Math.ceil(Math.log(length) / Math.log(SCALE_FACTOR));
6272
- var SCALE_FACTOR = 2;
6273
- var finalizeArrayBuffer = ({ contents, length }) => hasArrayBufferResize() ? contents : contents.slice(0, length);
6274
- var hasArrayBufferResize = () => "resize" in ArrayBuffer.prototype;
6275
- var arrayBufferMethods = {
6276
- init: initArrayBuffer,
6277
- convertChunk: {
6278
- string: useTextEncoder,
6279
- buffer: useUint8Array,
6280
- arrayBuffer: useUint8Array,
6281
- dataView: useUint8ArrayWithOffset,
6282
- typedArray: useUint8ArrayWithOffset,
6283
- others: throwObjectStream
6284
- },
6285
- getSize: getLengthProp,
6286
- truncateChunk: truncateArrayBufferChunk,
6287
- addChunk: addArrayBufferChunk,
6288
- getFinalChunk: noop,
6289
- finalize: finalizeArrayBuffer
6290
- };
6291
-
6292
- // node_modules/.pnpm/get-stream@8.0.1/node_modules/get-stream/source/buffer.js
6293
- async function getStreamAsBuffer(stream, options) {
6294
- if (!("Buffer" in globalThis)) {
6295
- throw new Error("getStreamAsBuffer() is only supported in Node.js");
6296
- }
6297
- try {
6298
- return arrayBufferToNodeBuffer(await getStreamAsArrayBuffer(stream, options));
6299
- } catch (error) {
6300
- if (error.bufferedData !== void 0) {
6301
- error.bufferedData = arrayBufferToNodeBuffer(error.bufferedData);
6302
- }
6303
- throw error;
6304
- }
6305
- }
6306
- var arrayBufferToNodeBuffer = (arrayBuffer) => globalThis.Buffer.from(arrayBuffer);
6307
-
6308
- // node_modules/.pnpm/get-stream@8.0.1/node_modules/get-stream/source/string.js
6309
- async function getStreamAsString(stream, options) {
6310
- return getStreamContents(stream, stringMethods, options);
6311
- }
6312
- var initString = () => ({ contents: "", textDecoder: new TextDecoder() });
6313
- var useTextDecoder = (chunk, { textDecoder }) => textDecoder.decode(chunk, { stream: true });
6314
- var addStringChunk = (convertedChunk, { contents }) => contents + convertedChunk;
6315
- var truncateStringChunk = (convertedChunk, chunkSize) => convertedChunk.slice(0, chunkSize);
6316
- var getFinalStringChunk = ({ textDecoder }) => {
6317
- const finalChunk = textDecoder.decode();
6318
- return finalChunk === "" ? void 0 : finalChunk;
6319
- };
6320
- var stringMethods = {
6321
- init: initString,
6322
- convertChunk: {
6323
- string: identity,
6324
- buffer: useTextDecoder,
6325
- arrayBuffer: useTextDecoder,
6326
- dataView: useTextDecoder,
6327
- typedArray: useTextDecoder,
6328
- others: throwObjectStream
6329
- },
6330
- getSize: getLengthProp,
6331
- truncateChunk: truncateStringChunk,
6332
- addChunk: addStringChunk,
6333
- getFinalChunk: getFinalStringChunk,
6334
- finalize: getContentsProp
6335
- };
6336
-
6337
- // node_modules/.pnpm/execa@8.0.1/node_modules/execa/lib/stream.js
6338
- var import_merge_stream = __toESM(require_merge_stream(), 1);
6339
- var validateInputOptions = (input) => {
6340
- if (input !== void 0) {
6341
- throw new TypeError("The `input` and `inputFile` options cannot be both set.");
6342
- }
6343
- };
6344
- var getInputSync = ({ input, inputFile }) => {
6345
- if (typeof inputFile !== "string") {
6346
- return input;
6347
- }
6348
- validateInputOptions(input);
6349
- return (0, import_node_fs9.readFileSync)(inputFile);
6350
- };
6351
- var handleInputSync = (options) => {
6352
- const input = getInputSync(options);
6353
- if (isStream(input)) {
6354
- throw new TypeError("The `input` option cannot be a stream in sync mode");
6355
- }
6356
- return input;
6357
- };
6358
- var getInput = ({ input, inputFile }) => {
6359
- if (typeof inputFile !== "string") {
6360
- return input;
6361
- }
6362
- validateInputOptions(input);
6363
- return (0, import_node_fs9.createReadStream)(inputFile);
6364
- };
6365
- var handleInput = (spawned, options) => {
6366
- const input = getInput(options);
6367
- if (input === void 0) {
6368
- return;
6369
- }
6370
- if (isStream(input)) {
6371
- input.pipe(spawned.stdin);
6372
- } else {
6373
- spawned.stdin.end(input);
6374
- }
6375
- };
6376
- var makeAllStream = (spawned, { all }) => {
6377
- if (!all || !spawned.stdout && !spawned.stderr) {
6378
- return;
6379
- }
6380
- const mixed = (0, import_merge_stream.default)();
6381
- if (spawned.stdout) {
6382
- mixed.add(spawned.stdout);
6383
- }
6384
- if (spawned.stderr) {
6385
- mixed.add(spawned.stderr);
6386
- }
6387
- return mixed;
6388
- };
6389
- var getBufferedData = async (stream, streamPromise) => {
6390
- if (!stream || streamPromise === void 0) {
6391
- return;
6392
- }
6393
- await (0, import_promises.setTimeout)(0);
6394
- stream.destroy();
6395
- try {
6396
- return await streamPromise;
6397
- } catch (error) {
6398
- return error.bufferedData;
6399
- }
6400
- };
6401
- var getStreamPromise = (stream, { encoding, buffer, maxBuffer }) => {
6402
- if (!stream || !buffer) {
6403
- return;
6404
- }
6405
- if (encoding === "utf8" || encoding === "utf-8") {
6406
- return getStreamAsString(stream, { maxBuffer });
6407
- }
6408
- if (encoding === null || encoding === "buffer") {
6409
- return getStreamAsBuffer(stream, { maxBuffer });
6410
- }
6411
- return applyEncoding(stream, maxBuffer, encoding);
6412
- };
6413
- var applyEncoding = async (stream, maxBuffer, encoding) => {
6414
- const buffer = await getStreamAsBuffer(stream, { maxBuffer });
6415
- return buffer.toString(encoding);
6416
- };
6417
- var getSpawnedResult = async ({ stdout, stderr, all }, { encoding, buffer, maxBuffer }, processDone) => {
6418
- const stdoutPromise = getStreamPromise(stdout, { encoding, buffer, maxBuffer });
6419
- const stderrPromise = getStreamPromise(stderr, { encoding, buffer, maxBuffer });
6420
- const allPromise = getStreamPromise(all, { encoding, buffer, maxBuffer: maxBuffer * 2 });
6421
- try {
6422
- return await Promise.all([processDone, stdoutPromise, stderrPromise, allPromise]);
6423
- } catch (error) {
6424
- return Promise.all([
6425
- { error, signal: error.signal, timedOut: error.timedOut },
6426
- getBufferedData(stdout, stdoutPromise),
6427
- getBufferedData(stderr, stderrPromise),
6428
- getBufferedData(all, allPromise)
6429
- ]);
6430
- }
6431
- };
6432
-
6433
- // node_modules/.pnpm/execa@8.0.1/node_modules/execa/lib/promise.js
6434
- var nativePromisePrototype = (async () => {
6435
- })().constructor.prototype;
6436
- var descriptors = ["then", "catch", "finally"].map((property) => [
6437
- property,
6438
- Reflect.getOwnPropertyDescriptor(nativePromisePrototype, property)
6439
- ]);
6440
- var mergePromise = (spawned, promise) => {
6441
- for (const [property, descriptor] of descriptors) {
6442
- const value = typeof promise === "function" ? (...args) => Reflect.apply(descriptor.value, promise(), args) : descriptor.value.bind(promise);
6443
- Reflect.defineProperty(spawned, property, { ...descriptor, value });
6444
- }
6445
- };
6446
- var getSpawnedPromise = (spawned) => new Promise((resolve2, reject) => {
6447
- spawned.on("exit", (exitCode, signal) => {
6448
- resolve2({ exitCode, signal });
6449
- });
6450
- spawned.on("error", (error) => {
6451
- reject(error);
6452
- });
6453
- if (spawned.stdin) {
6454
- spawned.stdin.on("error", (error) => {
6455
- reject(error);
6456
- });
6457
- }
6458
- });
6459
-
6460
- // node_modules/.pnpm/execa@8.0.1/node_modules/execa/lib/command.js
6461
- var import_node_buffer = require("node:buffer");
6462
- var import_node_child_process2 = require("node:child_process");
6463
- var normalizeArgs = (file, args = []) => {
6464
- if (!Array.isArray(args)) {
6465
- return [file];
6466
- }
6467
- return [file, ...args];
6468
- };
6469
- var NO_ESCAPE_REGEXP = /^[\w.-]+$/;
6470
- var escapeArg = (arg) => {
6471
- if (typeof arg !== "string" || NO_ESCAPE_REGEXP.test(arg)) {
6472
- return arg;
6473
- }
6474
- return `"${arg.replaceAll('"', '\\"')}"`;
6475
- };
6476
- var joinCommand = (file, args) => normalizeArgs(file, args).join(" ");
6477
- var getEscapedCommand = (file, args) => normalizeArgs(file, args).map((arg) => escapeArg(arg)).join(" ");
6478
- var SPACES_REGEXP = / +/g;
6479
- var parseCommand = (command) => {
6480
- const tokens = [];
6481
- for (const token of command.trim().split(SPACES_REGEXP)) {
6482
- const previousToken = tokens.at(-1);
6483
- if (previousToken && previousToken.endsWith("\\")) {
6484
- tokens[tokens.length - 1] = `${previousToken.slice(0, -1)} ${token}`;
6485
- } else {
6486
- tokens.push(token);
6487
- }
6488
- }
6489
- return tokens;
6490
- };
6491
- var parseExpression = (expression) => {
6492
- const typeOfExpression = typeof expression;
6493
- if (typeOfExpression === "string") {
6494
- return expression;
6495
- }
6496
- if (typeOfExpression === "number") {
6497
- return String(expression);
6498
- }
6499
- if (typeOfExpression === "object" && expression !== null && !(expression instanceof import_node_child_process2.ChildProcess) && "stdout" in expression) {
6500
- const typeOfStdout = typeof expression.stdout;
6501
- if (typeOfStdout === "string") {
6502
- return expression.stdout;
6503
- }
6504
- if (import_node_buffer.Buffer.isBuffer(expression.stdout)) {
6505
- return expression.stdout.toString();
6506
- }
6507
- throw new TypeError(`Unexpected "${typeOfStdout}" stdout in template expression`);
6508
- }
6509
- throw new TypeError(`Unexpected "${typeOfExpression}" in template expression`);
6510
- };
6511
- var concatTokens = (tokens, nextTokens, isNew) => isNew || tokens.length === 0 || nextTokens.length === 0 ? [...tokens, ...nextTokens] : [
6512
- ...tokens.slice(0, -1),
6513
- `${tokens.at(-1)}${nextTokens[0]}`,
6514
- ...nextTokens.slice(1)
6515
- ];
6516
- var parseTemplate = ({ templates: templates2, expressions, tokens, index, template }) => {
6517
- const templateString = template ?? templates2.raw[index];
6518
- const templateTokens = templateString.split(SPACES_REGEXP).filter(Boolean);
6519
- const newTokens = concatTokens(
6520
- tokens,
6521
- templateTokens,
6522
- templateString.startsWith(" ")
6523
- );
6524
- if (index === expressions.length) {
6525
- return newTokens;
6526
- }
6527
- const expression = expressions[index];
6528
- const expressionTokens = Array.isArray(expression) ? expression.map((expression2) => parseExpression(expression2)) : [parseExpression(expression)];
6529
- return concatTokens(
6530
- newTokens,
6531
- expressionTokens,
6532
- templateString.endsWith(" ")
6533
- );
6534
- };
6535
- var parseTemplates = (templates2, expressions) => {
6536
- let tokens = [];
6537
- for (const [index, template] of templates2.entries()) {
6538
- tokens = parseTemplate({ templates: templates2, expressions, tokens, index, template });
6539
- }
6540
- return tokens;
6541
- };
6542
-
6543
- // node_modules/.pnpm/execa@8.0.1/node_modules/execa/lib/verbose.js
6544
- var import_node_util = require("node:util");
6545
- var import_node_process5 = __toESM(require("node:process"), 1);
6546
- var verboseDefault = (0, import_node_util.debuglog)("execa").enabled;
6547
- var padField = (field, padding) => String(field).padStart(padding, "0");
6548
- var getTimestamp = () => {
6549
- const date = /* @__PURE__ */ new Date();
6550
- return `${padField(date.getHours(), 2)}:${padField(date.getMinutes(), 2)}:${padField(date.getSeconds(), 2)}.${padField(date.getMilliseconds(), 3)}`;
6551
- };
6552
- var logCommand = (escapedCommand, { verbose }) => {
6553
- if (!verbose) {
6554
- return;
6555
- }
6556
- import_node_process5.default.stderr.write(`[${getTimestamp()}] ${escapedCommand}
6557
- `);
6558
- };
6559
-
6560
- // node_modules/.pnpm/execa@8.0.1/node_modules/execa/index.js
6561
- var DEFAULT_MAX_BUFFER = 1e3 * 1e3 * 100;
6562
- var getEnv = ({ env: envOption, extendEnv, preferLocal, localDir, execPath }) => {
6563
- const env = extendEnv ? { ...import_node_process6.default.env, ...envOption } : envOption;
6564
- if (preferLocal) {
6565
- return npmRunPathEnv({ env, cwd: localDir, execPath });
6566
- }
6567
- return env;
6568
- };
6569
- var handleArguments = (file, args, options = {}) => {
6570
- const parsed = import_cross_spawn2.default._parse(file, args, options);
6571
- file = parsed.command;
6572
- args = parsed.args;
6573
- options = parsed.options;
6574
- options = {
6575
- maxBuffer: DEFAULT_MAX_BUFFER,
6576
- buffer: true,
6577
- stripFinalNewline: true,
6578
- extendEnv: true,
6579
- preferLocal: false,
6580
- localDir: options.cwd || import_node_process6.default.cwd(),
6581
- execPath: import_node_process6.default.execPath,
6582
- encoding: "utf8",
6583
- reject: true,
6584
- cleanup: true,
6585
- all: false,
6586
- windowsHide: true,
6587
- verbose: verboseDefault,
6588
- ...options
6589
- };
6590
- options.env = getEnv(options);
6591
- options.stdio = normalizeStdio(options);
6592
- if (import_node_process6.default.platform === "win32" && import_node_path9.default.basename(file, ".exe") === "cmd") {
6593
- args.unshift("/q");
6594
- }
6595
- return { file, args, options, parsed };
6596
- };
6597
- var handleOutput = (options, value, error) => {
6598
- if (typeof value !== "string" && !import_node_buffer2.Buffer.isBuffer(value)) {
6599
- return error === void 0 ? void 0 : "";
6600
- }
6601
- if (options.stripFinalNewline) {
6602
- return stripFinalNewline(value);
6603
- }
6604
- return value;
6605
- };
6606
- function execa(file, args, options) {
6607
- const parsed = handleArguments(file, args, options);
6608
- const command = joinCommand(file, args);
6609
- const escapedCommand = getEscapedCommand(file, args);
6610
- logCommand(escapedCommand, parsed.options);
6611
- validateTimeout(parsed.options);
6612
- let spawned;
6613
- try {
6614
- spawned = import_node_child_process3.default.spawn(parsed.file, parsed.args, parsed.options);
6615
- } catch (error) {
6616
- const dummySpawned = new import_node_child_process3.default.ChildProcess();
6617
- const errorPromise = Promise.reject(makeError({
6618
- error,
6619
- stdout: "",
6620
- stderr: "",
6621
- all: "",
6622
- command,
6623
- escapedCommand,
6624
- parsed,
6625
- timedOut: false,
6626
- isCanceled: false,
6627
- killed: false
6628
- }));
6629
- mergePromise(dummySpawned, errorPromise);
6630
- return dummySpawned;
6631
- }
6632
- const spawnedPromise = getSpawnedPromise(spawned);
6633
- const timedPromise = setupTimeout(spawned, parsed.options, spawnedPromise);
6634
- const processDone = setExitHandler(spawned, parsed.options, timedPromise);
6635
- const context = { isCanceled: false };
6636
- spawned.kill = spawnedKill.bind(null, spawned.kill.bind(spawned));
6637
- spawned.cancel = spawnedCancel.bind(null, spawned, context);
6638
- const handlePromise = async () => {
6639
- const [{ error, exitCode, signal, timedOut }, stdoutResult, stderrResult, allResult] = await getSpawnedResult(spawned, parsed.options, processDone);
6640
- const stdout = handleOutput(parsed.options, stdoutResult);
6641
- const stderr = handleOutput(parsed.options, stderrResult);
6642
- const all = handleOutput(parsed.options, allResult);
6643
- if (error || exitCode !== 0 || signal !== null) {
6644
- const returnedError = makeError({
6645
- error,
6646
- exitCode,
6647
- signal,
6648
- stdout,
6649
- stderr,
6650
- all,
6651
- command,
6652
- escapedCommand,
6653
- parsed,
6654
- timedOut,
6655
- isCanceled: context.isCanceled || (parsed.options.signal ? parsed.options.signal.aborted : false),
6656
- killed: spawned.killed
6657
- });
6658
- if (!parsed.options.reject) {
6659
- return returnedError;
6660
- }
6661
- throw returnedError;
6662
- }
6663
- return {
6664
- command,
6665
- escapedCommand,
6666
- exitCode: 0,
6667
- stdout,
6668
- stderr,
6669
- all,
6670
- failed: false,
6671
- timedOut: false,
6672
- isCanceled: false,
6673
- killed: false
6674
- };
6675
- };
6676
- const handlePromiseOnce = onetime_default(handlePromise);
6677
- handleInput(spawned, parsed.options);
6678
- spawned.all = makeAllStream(spawned, parsed.options);
6679
- addPipeMethods(spawned);
6680
- mergePromise(spawned, handlePromiseOnce);
6681
- return spawned;
6682
- }
6683
- function execaSync(file, args, options) {
6684
- const parsed = handleArguments(file, args, options);
6685
- const command = joinCommand(file, args);
6686
- const escapedCommand = getEscapedCommand(file, args);
6687
- logCommand(escapedCommand, parsed.options);
6688
- const input = handleInputSync(parsed.options);
6689
- let result;
6690
- try {
6691
- result = import_node_child_process3.default.spawnSync(parsed.file, parsed.args, { ...parsed.options, input });
6692
- } catch (error) {
6693
- throw makeError({
6694
- error,
6695
- stdout: "",
6696
- stderr: "",
6697
- all: "",
6698
- command,
6699
- escapedCommand,
6700
- parsed,
6701
- timedOut: false,
6702
- isCanceled: false,
6703
- killed: false
6704
- });
6705
- }
6706
- const stdout = handleOutput(parsed.options, result.stdout, result.error);
6707
- const stderr = handleOutput(parsed.options, result.stderr, result.error);
6708
- if (result.error || result.status !== 0 || result.signal !== null) {
6709
- const error = makeError({
6710
- stdout,
6711
- stderr,
6712
- error: result.error,
6713
- signal: result.signal,
6714
- exitCode: result.status,
6715
- command,
6716
- escapedCommand,
6717
- parsed,
6718
- timedOut: result.error && result.error.code === "ETIMEDOUT",
6719
- isCanceled: false,
6720
- killed: result.signal !== null
6721
- });
6722
- if (!parsed.options.reject) {
6723
- return error;
6724
- }
6725
- throw error;
6726
- }
6727
- return {
6728
- command,
6729
- escapedCommand,
6730
- exitCode: 0,
6731
- stdout,
6732
- stderr,
6733
- failed: false,
6734
- timedOut: false,
6735
- isCanceled: false,
6736
- killed: false
6737
- };
6738
- }
6739
- var normalizeScriptStdin = ({ input, inputFile, stdio }) => input === void 0 && inputFile === void 0 && stdio === void 0 ? { stdin: "inherit" } : {};
6740
- var normalizeScriptOptions = (options = {}) => ({
6741
- preferLocal: true,
6742
- ...normalizeScriptStdin(options),
6743
- ...options
6744
- });
6745
- function create$(options) {
6746
- function $4(templatesOrOptions, ...expressions) {
6747
- if (!Array.isArray(templatesOrOptions)) {
6748
- return create$({ ...options, ...templatesOrOptions });
6749
- }
6750
- const [file, ...args] = parseTemplates(templatesOrOptions, expressions);
6751
- return execa(file, args, normalizeScriptOptions(options));
6752
- }
6753
- $4.sync = (templates2, ...expressions) => {
6754
- if (!Array.isArray(templates2)) {
6755
- throw new TypeError("Please use $(options).sync`command` instead of $.sync(options)`command`.");
6756
- }
6757
- const [file, ...args] = parseTemplates(templates2, expressions);
6758
- return execaSync(file, args, normalizeScriptOptions(options));
6759
- };
6760
- return $4;
6761
- }
6762
- var $3 = create$();
6763
- function execaCommand(command, options) {
6764
- const [file, ...args] = parseCommand(command);
6765
- return execa(file, args, options);
6766
- }
6767
-
6768
- // packages/qwik/src/cli/utils/run-build-command.ts
6769
- async function runBuildCommand(app) {
6770
- const pkgJsonScripts = app.packageJson.scripts;
6771
- if (!pkgJsonScripts) {
6772
- throw new Error(`No "scripts" property found in package.json`);
6773
- }
6774
- const pkgManager = getPackageManager();
6775
- const getScript = (name) => {
6776
- if (pkgJsonScripts[name]) {
6777
- return `${pkgManager} run ${name}`;
6778
- }
6779
- return void 0;
6780
- };
6781
- const isPreviewBuild = app.args.includes("preview");
6782
- const buildLibScript = getScript("build.lib");
6783
- const isLibraryBuild = !!buildLibScript;
6784
- const buildClientScript = getScript("build.client");
6785
- const buildPreviewScript = isPreviewBuild ? getScript("build.preview") : void 0;
6786
- const buildServerScript = !isPreviewBuild ? getScript("build.server") : void 0;
6787
- const buildStaticScript = getScript("build.static");
6788
- const runSsgScript = getScript("ssg");
6789
- const buildTypes = getScript("build.types");
6790
- const lint = getScript("lint");
6791
- const mode = app.getArg("mode");
6792
- const prebuildScripts = Object.keys(pkgJsonScripts).filter((s2) => s2.startsWith("prebuild.")).map(getScript).filter(isString);
6793
- const postbuildScripts = Object.keys(pkgJsonScripts).filter((s2) => s2.startsWith("postbuild.")).map(getScript).filter(isString);
6794
- const scripts = [
6795
- buildTypes,
6796
- buildClientScript,
6797
- buildLibScript,
6798
- buildPreviewScript,
6799
- buildServerScript,
6800
- buildStaticScript,
6801
- lint
6802
- ].filter(isString);
6803
- if (!isLibraryBuild && !buildClientScript) {
6804
- console.log(pkgJsonScripts);
6805
- throw new Error(`"build.client" script not found in package.json`);
6806
- }
6807
- if (isPreviewBuild && !buildPreviewScript && !buildStaticScript) {
6808
- throw new Error(
6809
- `Neither "build.preview" or "build.static" script found in package.json for preview`
6810
- );
6811
- }
6812
- console.log(``);
6813
- for (const script of prebuildScripts) {
6814
- console.log(dim(script));
6815
- }
6816
- for (const script of scripts) {
6817
- console.log(dim(script));
6818
- }
6819
- for (const script of postbuildScripts) {
6820
- console.log(dim(script));
6821
- }
6822
- console.log(``);
6823
- let typecheck = null;
6824
- for (const script of prebuildScripts) {
6825
- try {
6826
- await execaCommand(script, {
6827
- cwd: app.rootDir,
6828
- stdout: "inherit",
6829
- stderr: "inherit",
6830
- env: {
6831
- FORCE_COLOR: "true"
6832
- }
6833
- });
6834
- } catch (e2) {
6835
- console.error(script, "failed");
6836
- process.exitCode = 1;
6837
- throw e2;
4646
+ console.log(``);
4647
+ let typecheck = null;
4648
+ for (const script of prebuildScripts) {
4649
+ try {
4650
+ await execaCommand(script, {
4651
+ cwd: app.rootDir,
4652
+ stdout: "inherit",
4653
+ stderr: "inherit",
4654
+ env: {
4655
+ FORCE_COLOR: "true"
4656
+ }
4657
+ });
4658
+ } catch (e2) {
4659
+ console.error(script, "failed");
4660
+ process.exitCode = 1;
4661
+ throw e2;
6838
4662
  }
6839
4663
  }
6840
4664
  if (buildTypes) {
@@ -7067,10 +4891,10 @@ init_dist2();
7067
4891
  init_dist2();
7068
4892
 
7069
4893
  // packages/qwik/src/cli/migrate-v2/replace-package.ts
7070
- var import_path5 = require("path");
4894
+ import { basename } from "path";
7071
4895
 
7072
4896
  // packages/qwik/src/cli/migrate-v2/tools/binary-extensions.ts
7073
- var import_path3 = require("path");
4897
+ import { extname as extname2 } from "path";
7074
4898
  var binaryExtensions = /* @__PURE__ */ new Set([
7075
4899
  // types originally from https://github.com/sindresorhus/binary-extensions/blob/40e44b510d87a63dcf42300bc8fbcb105f45a61c/binary-extensions.json
7076
4900
  ".3dm",
@@ -7342,17 +5166,17 @@ var binaryExtensions = /* @__PURE__ */ new Set([
7342
5166
  ".zip",
7343
5167
  ".zipx"
7344
5168
  ]);
7345
- function isBinaryPath(path4) {
7346
- return binaryExtensions.has((0, import_path3.extname)(path4).toLowerCase());
5169
+ function isBinaryPath(path2) {
5170
+ return binaryExtensions.has(extname2(path2).toLowerCase());
7347
5171
  }
7348
5172
 
7349
5173
  // packages/qwik/src/cli/migrate-v2/replace-package.ts
7350
5174
  init_visit_not_ignored_files();
7351
- var import_fs3 = require("fs");
7352
5175
  init_dist2();
7353
- function updateFileContent(path4, content) {
7354
- (0, import_fs3.writeFileSync)(path4, content);
7355
- M2.info(`"${path4}" has been updated`);
5176
+ import { readFileSync as readFileSync3, writeFileSync } from "fs";
5177
+ function updateFileContent(path2, content) {
5178
+ writeFileSync(path2, content);
5179
+ M2.info(`"${path2}" has been updated`);
7356
5180
  }
7357
5181
  function replacePackage(oldPackageName, newPackageName, skipDependencies = false) {
7358
5182
  if (!skipDependencies) {
@@ -7361,12 +5185,12 @@ function replacePackage(oldPackageName, newPackageName, skipDependencies = false
7361
5185
  replaceMentions(oldPackageName, newPackageName);
7362
5186
  }
7363
5187
  function replacePackageInDependencies(oldPackageName, newPackageName) {
7364
- visitNotIgnoredFiles(".", (path4) => {
7365
- if ((0, import_path5.basename)(path4) !== "package.json") {
5188
+ visitNotIgnoredFiles(".", (path2) => {
5189
+ if (basename(path2) !== "package.json") {
7366
5190
  return;
7367
5191
  }
7368
5192
  try {
7369
- const packageJson = JSON.parse((0, import_fs3.readFileSync)(path4, "utf-8"));
5193
+ const packageJson = JSON.parse(readFileSync3(path2, "utf-8"));
7370
5194
  for (const deps of [
7371
5195
  packageJson.dependencies ?? {},
7372
5196
  packageJson.devDependencies ?? {},
@@ -7378,15 +5202,15 @@ function replacePackageInDependencies(oldPackageName, newPackageName) {
7378
5202
  delete deps[oldPackageName];
7379
5203
  }
7380
5204
  }
7381
- updateFileContent(path4, JSON.stringify(packageJson, null, 2));
5205
+ updateFileContent(path2, JSON.stringify(packageJson, null, 2));
7382
5206
  } catch (e2) {
7383
- console.warn(`Could not replace ${oldPackageName} with ${newPackageName} in ${path4}.`);
5207
+ console.warn(`Could not replace ${oldPackageName} with ${newPackageName} in ${path2}.`);
7384
5208
  }
7385
5209
  });
7386
5210
  }
7387
5211
  function replaceMentions(oldPackageName, newPackageName) {
7388
- visitNotIgnoredFiles(".", (path4) => {
7389
- if (isBinaryPath(path4)) {
5212
+ visitNotIgnoredFiles(".", (path2) => {
5213
+ if (isBinaryPath(path2)) {
7390
5214
  return;
7391
5215
  }
7392
5216
  const ignoredFiles = [
@@ -7396,25 +5220,25 @@ function replaceMentions(oldPackageName, newPackageName) {
7396
5220
  "bun.lockb",
7397
5221
  "CHANGELOG.md"
7398
5222
  ];
7399
- if (ignoredFiles.includes((0, import_path5.basename)(path4))) {
5223
+ if (ignoredFiles.includes(basename(path2))) {
7400
5224
  return;
7401
5225
  }
7402
5226
  try {
7403
- const contents = (0, import_fs3.readFileSync)(path4, "utf-8");
5227
+ const contents = readFileSync3(path2, "utf-8");
7404
5228
  if (!contents.includes(oldPackageName)) {
7405
5229
  return;
7406
5230
  }
7407
- updateFileContent(path4, contents.replace(new RegExp(oldPackageName, "g"), newPackageName));
5231
+ updateFileContent(path2, contents.replace(new RegExp(oldPackageName, "g"), newPackageName));
7408
5232
  } catch {
7409
5233
  M2.warn(
7410
- `An error was thrown when trying to update ${path4}. If you believe the migration should have updated it, be sure to review the file and open an issue.`
5234
+ `An error was thrown when trying to update ${path2}. If you believe the migration should have updated it, be sure to review the file and open an issue.`
7411
5235
  );
7412
5236
  }
7413
5237
  });
7414
5238
  }
7415
5239
 
7416
5240
  // packages/qwik/src/cli/migrate-v2/update-dependencies.ts
7417
- var import_node_child_process4 = require("node:child_process");
5241
+ import { execSync } from "node:child_process";
7418
5242
 
7419
5243
  // packages/qwik/src/cli/migrate-v2/versions.ts
7420
5244
  var versionTagPriority = ["latest", "v2", "rc", "beta", "alpha"];
@@ -7426,8 +5250,8 @@ var packageNames = [
7426
5250
  ];
7427
5251
 
7428
5252
  // packages/qwik/src/cli/migrate-v2/update-dependencies.ts
7429
- var import_semver = require("semver");
7430
5253
  init_dist2();
5254
+ import { major } from "semver";
7431
5255
  async function updateDependencies() {
7432
5256
  const packageJson = await readPackageJson(process.cwd());
7433
5257
  const version = getPackageTag();
@@ -7452,11 +5276,10 @@ async function updateDependencies() {
7452
5276
  loading.stop("Dependencies have been updated");
7453
5277
  }
7454
5278
  function getPackageTag() {
7455
- var _a;
7456
- const tags = (_a = (0, import_node_child_process4.execSync)("npm dist-tag @qwik.dev/core", {
5279
+ const tags = execSync("npm dist-tag @qwik.dev/core", {
7457
5280
  encoding: "utf-8"
7458
- })) == null ? void 0 : _a.split("\n").filter(Boolean).map(
7459
- (data) => data.split(":").map((v2) => v2 == null ? void 0 : v2.trim()).filter(Boolean)
5281
+ })?.split("\n").filter(Boolean).map(
5282
+ (data) => data.split(":").map((v2) => v2?.trim()).filter(Boolean)
7460
5283
  ).filter((v2) => v2.length === 2).sort((a, b3) => {
7461
5284
  let aIndex = versionTagPriority.indexOf(a[0]);
7462
5285
  let bIndex = versionTagPriority.indexOf(b3[0]);
@@ -7468,7 +5291,7 @@ function getPackageTag() {
7468
5291
  return aIndex - bIndex;
7469
5292
  });
7470
5293
  for (const [, version] of tags) {
7471
- if ((0, import_semver.major)(version) === 2) {
5294
+ if (major(version) === 2) {
7472
5295
  return version;
7473
5296
  }
7474
5297
  }
@@ -7476,14 +5299,13 @@ function getPackageTag() {
7476
5299
  return "2.0.0";
7477
5300
  }
7478
5301
  async function installTsMorph() {
7479
- var _a, _b;
7480
5302
  const packageJson = await readPackageJson(process.cwd());
7481
- if (((_a = packageJson.dependencies) == null ? void 0 : _a["ts-morph"]) || ((_b = packageJson.devDependencies) == null ? void 0 : _b["ts-morph"])) {
5303
+ if (packageJson.dependencies?.["ts-morph"] || packageJson.devDependencies?.["ts-morph"]) {
7482
5304
  return false;
7483
5305
  }
7484
5306
  const loading = Y2();
7485
5307
  loading.start("Fetching migration tools..");
7486
- (packageJson.devDependencies ??= {})["ts-morph"] = "23";
5308
+ (packageJson.devDependencies ?? (packageJson.devDependencies = {}))["ts-morph"] = "23";
7487
5309
  await writePackageJson(process.cwd(), packageJson);
7488
5310
  await runInstall();
7489
5311
  loading.stop("Migration tools have been loaded");
@@ -7497,10 +5319,9 @@ async function runInstall() {
7497
5319
  }
7498
5320
  }
7499
5321
  async function removeTsMorphFromPackageJson() {
7500
- var _a, _b;
7501
5322
  const packageJson = await readPackageJson(process.cwd());
7502
- (_a = packageJson.dependencies) == null ? true : delete _a["ts-morph"];
7503
- (_b = packageJson.devDependencies) == null ? true : delete _b["ts-morph"];
5323
+ delete packageJson.dependencies?.["ts-morph"];
5324
+ delete packageJson.devDependencies?.["ts-morph"];
7504
5325
  await writePackageJson(process.cwd(), packageJson);
7505
5326
  }
7506
5327
 
@@ -7558,11 +5379,11 @@ ${bold(bgRed('Warning: migration tool is experimental and will migrate your appl
7558
5379
  }
7559
5380
 
7560
5381
  // packages/qwik/src/cli/check-client/index.ts
7561
- var import_promises2 = __toESM(require("fs/promises"), 1);
7562
- var import_path6 = __toESM(require("path"), 1);
7563
- var getDiskPath = (dist) => import_path6.default.resolve(dist);
7564
- var getSrcPath = (src) => import_path6.default.resolve(src);
7565
- var getManifestPath = (dist) => import_path6.default.resolve(dist, "q-manifest.json");
5382
+ import fs8 from "fs/promises";
5383
+ import path from "path";
5384
+ var getDiskPath = (dist) => path.resolve(dist);
5385
+ var getSrcPath = (src) => path.resolve(src);
5386
+ var getManifestPath = (dist) => path.resolve(dist, "q-manifest.json");
7566
5387
  async function runQwikClientCommand(app) {
7567
5388
  try {
7568
5389
  const src = app.args[1];
@@ -7597,7 +5418,7 @@ async function goBuild(app) {
7597
5418
  }
7598
5419
  async function getManifestTs(manifestPath) {
7599
5420
  try {
7600
- const stats = await import_promises2.default.stat(manifestPath);
5421
+ const stats = await fs8.stat(manifestPath);
7601
5422
  return stats.mtimeMs;
7602
5423
  } catch (err) {
7603
5424
  if (err.code !== "ENOENT") {
@@ -7606,13 +5427,13 @@ async function getManifestTs(manifestPath) {
7606
5427
  return null;
7607
5428
  }
7608
5429
  }
7609
- async function clientDirExists(path4) {
5430
+ async function clientDirExists(path2) {
7610
5431
  try {
7611
- await import_promises2.default.access(getDiskPath(path4));
5432
+ await fs8.access(getDiskPath(path2));
7612
5433
  return true;
7613
5434
  } catch (err) {
7614
5435
  if (!(err.code === "ENOENT")) {
7615
- panic(`Error accessing disk directory ${path4}: ${err.message}`);
5436
+ panic(`Error accessing disk directory ${path2}: ${err.message}`);
7616
5437
  }
7617
5438
  return false;
7618
5439
  }
@@ -7625,7 +5446,7 @@ async function hasNewer(srcPath, timestamp) {
7625
5446
  }
7626
5447
  let items;
7627
5448
  try {
7628
- items = await import_promises2.default.readdir(dir, { withFileTypes: true });
5449
+ items = await fs8.readdir(dir, { withFileTypes: true });
7629
5450
  } catch (err) {
7630
5451
  return;
7631
5452
  }
@@ -7633,12 +5454,12 @@ async function hasNewer(srcPath, timestamp) {
7633
5454
  if (returnValue) {
7634
5455
  return;
7635
5456
  }
7636
- const fullPath = import_path6.default.join(dir, item.name);
5457
+ const fullPath = path.join(dir, item.name);
7637
5458
  try {
7638
5459
  if (item.isDirectory()) {
7639
5460
  await traverse(fullPath);
7640
5461
  } else if (item.isFile()) {
7641
- const stats = await import_promises2.default.stat(fullPath);
5462
+ const stats = await fs8.stat(fullPath);
7642
5463
  if (stats.mtimeMs > timestamp) {
7643
5464
  returnValue = true;
7644
5465
  return;
@@ -7804,10 +5625,9 @@ async function printHelp(app) {
7804
5625
  await runCommand2(Object.assign(app, { task: args[0], args }));
7805
5626
  }
7806
5627
  function printVersion() {
7807
- console.log("2.0.0-beta.11-dev+d7daca3");
5628
+ console.log("2.0.0-beta.14-dev+1e7496d");
7808
5629
  }
7809
- // Annotate the CommonJS export names for ESM import in node:
7810
- 0 && (module.exports = {
5630
+ export {
7811
5631
  runCli,
7812
5632
  updateApp
7813
- });
5633
+ };