@incajs/cli 0.0.18 → 0.0.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.js CHANGED
@@ -5,29 +5,29 @@ import f, { existsSync as p, lstatSync as m, readFileSync as h, realpathSync as
5
5
  import y, { resolve as b } from "node:path";
6
6
  import * as ee from "node:util";
7
7
  import { parseArgs as x, styleText as S } from "node:util";
8
- import { chmod as C, cp as w, link as T, mkdir as E, readFile as D, readdir as te, rm as O, writeFile as k } from "node:fs/promises";
9
- import { fileURLToPath as ne, pathToFileURL as re } from "node:url";
10
- import { homedir as ie } from "node:os";
11
- import { createRequire as ae } from "node:module";
12
- import { spawn as oe } from "node:child_process";
13
- import { once as A } from "node:events";
14
- import se from "node:readline";
15
- import { setTimeout as ce } from "node:timers/promises";
16
- import { DevEnvironment as le, build as ue, buildErrorMessage as de, createServer as fe } from "vite";
17
- import pe from "@vitejs/plugin-vue";
18
- import { randomUUID as me } from "node:crypto";
8
+ import { chmod as C, cp as w, link as te, mkdir as T, readFile as E, readdir as ne, rm as D, writeFile as O } from "node:fs/promises";
9
+ import { fileURLToPath as re, pathToFileURL as ie } from "node:url";
10
+ import { homedir as ae } from "node:os";
11
+ import { createRequire as oe } from "node:module";
12
+ import { spawn as se, spawnSync as ce } from "node:child_process";
13
+ import { once as k } from "node:events";
14
+ import le from "node:readline";
15
+ import { setTimeout as ue } from "node:timers/promises";
16
+ import { DevEnvironment as de, build as fe, buildErrorMessage as pe, createServer as me } from "vite";
17
+ import he from "@vitejs/plugin-vue";
18
+ import { randomUUID as ge } from "node:crypto";
19
19
  //#region ../../node_modules/.pnpm/citty@0.2.2/node_modules/citty/dist/_chunks/libs/scule.mjs
20
- var he = /\d/, ge = [
20
+ var _e = /\d/, ve = [
21
21
  "-",
22
22
  "_",
23
23
  "/",
24
24
  "."
25
25
  ];
26
- function _e(e = "") {
27
- if (!he.test(e)) return e !== e.toLowerCase();
26
+ function ye(e = "") {
27
+ if (!_e.test(e)) return e !== e.toLowerCase();
28
28
  }
29
- function ve(e, t) {
30
- let n = t ?? ge, r = [];
29
+ function be(e, t) {
30
+ let n = t ?? ve, r = [];
31
31
  if (!e || typeof e != "string") return r;
32
32
  let i = "", a, o;
33
33
  for (let t of e) {
@@ -36,7 +36,7 @@ function ve(e, t) {
36
36
  r.push(i), i = "", a = void 0;
37
37
  continue;
38
38
  }
39
- let s = _e(t);
39
+ let s = ye(t);
40
40
  if (o === !1) {
41
41
  if (a === !1 && s === !0) {
42
42
  r.push(i), i = t, a = s;
@@ -52,38 +52,38 @@ function ve(e, t) {
52
52
  }
53
53
  return r.push(i), r;
54
54
  }
55
- function ye(e) {
55
+ function xe(e) {
56
56
  return e ? e[0].toUpperCase() + e.slice(1) : "";
57
57
  }
58
- function be(e) {
58
+ function Se(e) {
59
59
  return e ? e[0].toLowerCase() + e.slice(1) : "";
60
60
  }
61
- function xe(e, t) {
62
- return e ? (Array.isArray(e) ? e : ve(e)).map((e) => ye(t?.normalize ? e.toLowerCase() : e)).join("") : "";
61
+ function Ce(e, t) {
62
+ return e ? (Array.isArray(e) ? e : be(e)).map((e) => xe(t?.normalize ? e.toLowerCase() : e)).join("") : "";
63
63
  }
64
- function j(e, t) {
65
- return be(xe(e || "", t));
64
+ function A(e, t) {
65
+ return Se(Ce(e || "", t));
66
66
  }
67
- function Se(e, t) {
68
- return e ? (Array.isArray(e) ? e : ve(e)).map((e) => e.toLowerCase()).join(t ?? "-") : "";
67
+ function j(e, t) {
68
+ return e ? (Array.isArray(e) ? e : be(e)).map((e) => e.toLowerCase()).join(t ?? "-") : "";
69
69
  }
70
- function Ce(e) {
71
- return Se(e || "", "_");
70
+ function we(e) {
71
+ return j(e || "", "_");
72
72
  }
73
73
  //#endregion
74
74
  //#region ../../node_modules/.pnpm/citty@0.2.2/node_modules/citty/dist/index.mjs
75
75
  function M(e) {
76
76
  return Array.isArray(e) ? e : e === void 0 ? [] : [e];
77
77
  }
78
- function we(e, t = "") {
78
+ function N(e, t = "") {
79
79
  let n = [];
80
80
  for (let t of e) for (let [e, r] of t.entries()) n[e] = Math.max(n[e] || 0, r.length);
81
81
  return e.map((e) => e.map((e, r) => t + e[r === 0 ? "padStart" : "padEnd"](n[r])).join(" ")).join("\n");
82
82
  }
83
- function N(e) {
83
+ function P(e) {
84
84
  return typeof e == "function" ? e() : e;
85
85
  }
86
- var P = class extends Error {
86
+ var F = class extends Error {
87
87
  code;
88
88
  constructor(e, t) {
89
89
  super(e), this.name = "CLIError", this.code = t;
@@ -165,7 +165,7 @@ function Te(e = [], t = {}) {
165
165
  var Ee = /* @__PURE__ */ (() => {
166
166
  let e = globalThis.process?.env ?? {};
167
167
  return e.NO_COLOR === "1" || e.TERM === "dumb" || e.TEST || e.CI;
168
- })(), F = (e, t = 39) => (n) => Ee ? n : `\u001B[${e}m${n}\u001B[${t}m`, I = /* @__PURE__ */ F(1, 22), L = /* @__PURE__ */ F(36), R = /* @__PURE__ */ F(90), z = /* @__PURE__ */ F(4, 24);
168
+ })(), I = (e, t = 39) => (n) => Ee ? n : `\u001B[${e}m${n}\u001B[${t}m`, L = /* @__PURE__ */ I(1, 22), R = /* @__PURE__ */ I(36), z = /* @__PURE__ */ I(90), B = /* @__PURE__ */ I(4, 24);
169
169
  function De(e, t) {
170
170
  let n = {
171
171
  boolean: [],
@@ -176,24 +176,24 @@ function De(e, t) {
176
176
  for (let e of r) {
177
177
  if (e.type === "positional") continue;
178
178
  e.type === "string" || e.type === "enum" ? n.string.push(e.name) : e.type === "boolean" && n.boolean.push(e.name), e.default !== void 0 && (n.default[e.name] = e.default), e.alias && (n.alias[e.name] = e.alias);
179
- let t = j(e.name), r = Se(e.name);
179
+ let t = A(e.name), r = j(e.name);
180
180
  if (t !== e.name || r !== e.name) {
181
181
  let i = M(n.alias[e.name] || []);
182
182
  t !== e.name && !i.includes(t) && i.push(t), r !== e.name && !i.includes(r) && i.push(r), i.length > 0 && (n.alias[e.name] = i);
183
183
  }
184
184
  }
185
185
  let i = Te(e, n), [ ...a] = i._, o = new Proxy(i, { get(e, t) {
186
- return e[t] ?? e[j(t)] ?? e[Se(t)];
186
+ return e[t] ?? e[A(t)] ?? e[j(t)];
187
187
  } });
188
188
  for (let [, e] of r.entries()) if (e.type === "positional") {
189
189
  let t = a.shift();
190
190
  if (t !== void 0) o[e.name] = t;
191
- else if (e.default === void 0 && e.required !== !1) throw new P(`Missing required positional argument: ${e.name.toUpperCase()}`, "EARG");
191
+ else if (e.default === void 0 && e.required !== !1) throw new F(`Missing required positional argument: ${e.name.toUpperCase()}`, "EARG");
192
192
  else o[e.name] = e.default;
193
193
  } else if (e.type === "enum") {
194
194
  let t = o[e.name], n = e.options || [];
195
- if (t !== void 0 && n.length > 0 && !n.includes(t)) throw new P(`Invalid value for argument: ${L(`--${e.name}`)} (${L(t)}). Expected one of: ${n.map((e) => L(e)).join(", ")}.`, "EARG");
196
- } else if (e.required && o[e.name] === void 0) throw new P(`Missing required argument: --${e.name}`, "EARG");
195
+ if (t !== void 0 && n.length > 0 && !n.includes(t)) throw new F(`Invalid value for argument: ${R(`--${e.name}`)} (${R(t)}). Expected one of: ${n.map((e) => R(e)).join(", ")}.`, "EARG");
196
+ } else if (e.required && o[e.name] === void 0) throw new F(`Missing required argument: --${e.name}`, "EARG");
197
197
  return o;
198
198
  }
199
199
  function Oe(e) {
@@ -206,13 +206,13 @@ function Oe(e) {
206
206
  return t;
207
207
  }
208
208
  async function ke(e) {
209
- return Promise.all(e.map((e) => N(e)));
209
+ return Promise.all(e.map((e) => P(e)));
210
210
  }
211
- function B(e) {
211
+ function V(e) {
212
212
  return e;
213
213
  }
214
- async function V(e, t) {
215
- let n = await N(e.args || {}), r = De(t.rawArgs, n), i = {
214
+ async function Ae(e, t) {
215
+ let n = await P(e.args || {}), r = De(t.rawArgs, n), i = {
216
216
  rawArgs: t.rawArgs,
217
217
  args: r,
218
218
  data: t.data,
@@ -221,21 +221,21 @@ async function V(e, t) {
221
221
  try {
222
222
  for (let e of a) await e.setup?.(i);
223
223
  typeof e.setup == "function" && await e.setup(i);
224
- let r = await N(e.subCommands);
224
+ let r = await P(e.subCommands);
225
225
  if (r && Object.keys(r).length > 0) {
226
- let i = Ae(t.rawArgs, n), a = t.rawArgs[i];
226
+ let i = Ne(t.rawArgs, n), a = t.rawArgs[i];
227
227
  if (a) {
228
- let e = await U(r, a);
229
- if (!e) throw new P(`Unknown command ${L(a)}`, "E_UNKNOWN_COMMAND");
230
- await V(e, { rawArgs: t.rawArgs.slice(i + 1) });
228
+ let e = await Me(r, a);
229
+ if (!e) throw new F(`Unknown command ${R(a)}`, "E_UNKNOWN_COMMAND");
230
+ await Ae(e, { rawArgs: t.rawArgs.slice(i + 1) });
231
231
  } else {
232
- let n = await N(e.default);
232
+ let n = await P(e.default);
233
233
  if (n) {
234
- if (e.run) throw new P("Cannot specify both 'run' and 'default' on the same command.", "E_DEFAULT_CONFLICT");
235
- let i = await U(r, n);
236
- if (!i) throw new P(`Default sub command ${L(n)} not found in subCommands.`, "E_UNKNOWN_COMMAND");
237
- await V(i, { rawArgs: t.rawArgs });
238
- } else if (!e.run) throw new P("No command specified.", "E_NO_COMMAND");
234
+ if (e.run) throw new F("Cannot specify both 'run' and 'default' on the same command.", "E_DEFAULT_CONFLICT");
235
+ let i = await Me(r, n);
236
+ if (!i) throw new F(`Default sub command ${R(n)} not found in subCommands.`, "E_UNKNOWN_COMMAND");
237
+ await Ae(i, { rawArgs: t.rawArgs });
238
+ } else if (!e.run) throw new F("No command specified.", "E_NO_COMMAND");
239
239
  }
240
240
  }
241
241
  typeof e.run == "function" && (o = await e.run(i));
@@ -258,138 +258,138 @@ async function V(e, t) {
258
258
  if (c.length > 1) throw Error("Multiple cleanup errors", { cause: c });
259
259
  return { result: o };
260
260
  }
261
- async function H(e, t, n) {
262
- let r = await N(e.subCommands);
261
+ async function je(e, t, n) {
262
+ let r = await P(e.subCommands);
263
263
  if (r && Object.keys(r).length > 0) {
264
- let n = Ae(t, await N(e.args || {})), i = t[n], a = await U(r, i);
265
- if (a) return H(a, t.slice(n + 1), e);
264
+ let n = Ne(t, await P(e.args || {})), i = t[n], a = await Me(r, i);
265
+ if (a) return je(a, t.slice(n + 1), e);
266
266
  }
267
267
  return [e, n];
268
268
  }
269
- async function U(e, t) {
270
- if (t in e) return N(e[t]);
269
+ async function Me(e, t) {
270
+ if (t in e) return P(e[t]);
271
271
  for (let n of Object.values(e)) {
272
- let e = await N(n), r = await N(e?.meta);
272
+ let e = await P(n), r = await P(e?.meta);
273
273
  if (r?.alias && M(r.alias).includes(t)) return e;
274
274
  }
275
275
  }
276
- function Ae(e, t) {
276
+ function Ne(e, t) {
277
277
  for (let n = 0; n < e.length; n++) {
278
278
  let r = e[n];
279
279
  if (r === "--") return -1;
280
- if (r.startsWith("-")) !r.includes("=") && je(r, t) && n++;
280
+ if (r.startsWith("-")) !r.includes("=") && Pe(r, t) && n++;
281
281
  else return n;
282
282
  }
283
283
  return -1;
284
284
  }
285
- function je(e, t) {
286
- let n = e.replace(/^-{1,2}/, ""), r = j(n);
287
- for (let [e, i] of Object.entries(t)) if ((i.type === "string" || i.type === "enum") && (r === j(e) || (Array.isArray(i.alias) ? i.alias : i.alias ? [i.alias] : []).includes(n))) return !0;
285
+ function Pe(e, t) {
286
+ let n = e.replace(/^-{1,2}/, ""), r = A(n);
287
+ for (let [e, i] of Object.entries(t)) if ((i.type === "string" || i.type === "enum") && (r === A(e) || (Array.isArray(i.alias) ? i.alias : i.alias ? [i.alias] : []).includes(n))) return !0;
288
288
  return !1;
289
289
  }
290
- async function Me(e, t) {
290
+ async function Fe(e, t) {
291
291
  try {
292
- console.log(await Pe(e, t) + "\n");
292
+ console.log(await Le(e, t) + "\n");
293
293
  } catch (e) {
294
294
  console.error(e);
295
295
  }
296
296
  }
297
- var Ne = /^no[-A-Z]/;
298
- async function Pe(e, t) {
299
- let n = await N(e.meta || {}), r = Oe(await N(e.args || {})), i = await N(t?.meta || {}), a = `${i.name ? `${i.name} ` : ""}` + (n.name || process.argv[1]), o = [], s = [], c = [], l = [];
297
+ var Ie = /^no[-A-Z]/;
298
+ async function Le(e, t) {
299
+ let n = await P(e.meta || {}), r = Oe(await P(e.args || {})), i = await P(t?.meta || {}), a = `${i.name ? `${i.name} ` : ""}` + (n.name || process.argv[1]), o = [], s = [], c = [], l = [];
300
300
  for (let e of r) if (e.type === "positional") {
301
301
  let t = e.name.toUpperCase(), n = e.required !== !1 && e.default === void 0;
302
- s.push([L(t + W(e)), Fe(e, n)]), l.push(n ? `<${t}>` : `[${t}]`);
302
+ s.push([R(t + Re(e)), ze(e, n)]), l.push(n ? `<${t}>` : `[${t}]`);
303
303
  } else {
304
- let t = e.required === !0 && e.default === void 0, n = [...(e.alias || []).map((e) => `-${e}`), `--${e.name}`].join(", ") + W(e);
305
- if (o.push([L(n), Fe(e, t)]), e.type === "boolean" && (e.default === !0 || e.negativeDescription) && !Ne.test(e.name)) {
304
+ let t = e.required === !0 && e.default === void 0, n = [...(e.alias || []).map((e) => `-${e}`), `--${e.name}`].join(", ") + Re(e);
305
+ if (o.push([R(n), ze(e, t)]), e.type === "boolean" && (e.default === !0 || e.negativeDescription) && !Ie.test(e.name)) {
306
306
  let n = [...(e.alias || []).map((e) => `--no-${e}`), `--no-${e.name}`].join(", ");
307
- o.push([L(n), [e.negativeDescription, t ? R("(Required)") : ""].filter(Boolean).join(" ")]);
307
+ o.push([R(n), [e.negativeDescription, t ? z("(Required)") : ""].filter(Boolean).join(" ")]);
308
308
  }
309
- t && l.push(`--${e.name}` + W(e));
309
+ t && l.push(`--${e.name}` + Re(e));
310
310
  }
311
311
  if (e.subCommands) {
312
- let t = [], n = await N(e.subCommands);
312
+ let t = [], n = await P(e.subCommands);
313
313
  for (let [e, r] of Object.entries(n)) {
314
- let n = await N((await N(r))?.meta);
314
+ let n = await P((await P(r))?.meta);
315
315
  if (n?.hidden) continue;
316
316
  let i = M(n?.alias), a = [e, ...i].join(", ");
317
- c.push([L(a), n?.description || ""]), t.push(e, ...i);
317
+ c.push([R(a), n?.description || ""]), t.push(e, ...i);
318
318
  }
319
319
  l.push(t.join("|"));
320
320
  }
321
321
  let u = [], d = n.version || i.version;
322
- u.push(R(`${n.description} (${a + (d ? ` v${d}` : "")})`), "");
322
+ u.push(z(`${n.description} (${a + (d ? ` v${d}` : "")})`), "");
323
323
  let f = o.length > 0 || s.length > 0;
324
- return u.push(`${z(I("USAGE"))} ${L(`${a}${f ? " [OPTIONS]" : ""} ${l.join(" ")}`)}`, ""), s.length > 0 && (u.push(z(I("ARGUMENTS")), ""), u.push(we(s, " ")), u.push("")), o.length > 0 && (u.push(z(I("OPTIONS")), ""), u.push(we(o, " ")), u.push("")), c.length > 0 && (u.push(z(I("COMMANDS")), ""), u.push(we(c, " ")), u.push("", `Use ${L(`${a} <command> --help`)} for more information about a command.`)), u.filter((e) => typeof e == "string").join("\n");
324
+ return u.push(`${B(L("USAGE"))} ${R(`${a}${f ? " [OPTIONS]" : ""} ${l.join(" ")}`)}`, ""), s.length > 0 && (u.push(B(L("ARGUMENTS")), ""), u.push(N(s, " ")), u.push("")), o.length > 0 && (u.push(B(L("OPTIONS")), ""), u.push(N(o, " ")), u.push("")), c.length > 0 && (u.push(B(L("COMMANDS")), ""), u.push(N(c, " ")), u.push("", `Use ${R(`${a} <command> --help`)} for more information about a command.`)), u.filter((e) => typeof e == "string").join("\n");
325
325
  }
326
- function W(e) {
327
- let t = e.valueHint ? `=<${e.valueHint}>` : "", n = t || `=<${Ce(e.name)}>`;
326
+ function Re(e) {
327
+ let t = e.valueHint ? `=<${e.valueHint}>` : "", n = t || `=<${we(e.name)}>`;
328
328
  return !e.type || e.type === "positional" || e.type === "boolean" ? t : e.type === "enum" && e.options?.length ? `=<${e.options.join("|")}>` : n;
329
329
  }
330
- function Fe(e, t) {
331
- let n = t ? R("(Required)") : "", r = e.default === void 0 ? "" : R(`(Default: ${e.default})`);
330
+ function ze(e, t) {
331
+ let n = t ? z("(Required)") : "", r = e.default === void 0 ? "" : z(`(Default: ${e.default})`);
332
332
  return [
333
333
  e.description,
334
334
  n,
335
335
  r
336
336
  ].filter(Boolean).join(" ");
337
337
  }
338
- async function Ie(e, t = {}) {
339
- let n = t.rawArgs || process.argv.slice(2), r = t.showUsage || Me;
338
+ async function Be(e, t = {}) {
339
+ let n = t.rawArgs || process.argv.slice(2), r = t.showUsage || Fe;
340
340
  try {
341
- let t = await Le(e);
342
- if (t.help.length > 0 && n.some((e) => t.help.includes(e))) await r(...await H(e, n)), process.exit(0);
341
+ let t = await Ve(e);
342
+ if (t.help.length > 0 && n.some((e) => t.help.includes(e))) await r(...await je(e, n)), process.exit(0);
343
343
  else if (n.length === 1 && t.version.includes(n[0])) {
344
344
  let t = typeof e.meta == "function" ? await e.meta() : await e.meta;
345
- if (!t?.version) throw new P("No version specified", "E_NO_VERSION");
345
+ if (!t?.version) throw new F("No version specified", "E_NO_VERSION");
346
346
  console.log(t.version);
347
- } else await V(e, { rawArgs: n });
347
+ } else await Ae(e, { rawArgs: n });
348
348
  } catch (t) {
349
- t instanceof P ? (await r(...await H(e, n)), console.error(t.message)) : console.error(t, "\n"), process.exit(1);
349
+ t instanceof F ? (await r(...await je(e, n)), console.error(t.message)) : console.error(t, "\n"), process.exit(1);
350
350
  }
351
351
  }
352
- async function Le(e) {
353
- let t = await N(e.args || {}), n = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set();
352
+ async function Ve(e) {
353
+ let t = await P(e.args || {}), n = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set();
354
354
  for (let [e, i] of Object.entries(t)) {
355
355
  n.add(e);
356
356
  for (let e of M(i.alias)) r.add(e);
357
357
  }
358
358
  return {
359
- help: Re("help", "h", n, r),
360
- version: Re("version", "v", n, r)
359
+ help: He("help", "h", n, r),
360
+ version: He("version", "v", n, r)
361
361
  };
362
362
  }
363
- function Re(e, t, n, r) {
363
+ function He(e, t, n, r) {
364
364
  return n.has(e) || r.has(e) ? [] : n.has(t) || r.has(t) ? [`--${e}`] : [`--${e}`, `-${t}`];
365
365
  }
366
366
  //#endregion
367
367
  //#region package.json
368
- var ze = "0.0.18", Be = "Commands to develop, bundle, and package Incarnative.js apps.";
368
+ var Ue = "0.0.20", We = "Commands to develop, bundle, and package Incarnative.js apps.";
369
369
  //#endregion
370
370
  //#region ../../node_modules/.pnpm/rc9@3.1.0/node_modules/rc9/dist/_chunks/libs/flat.mjs
371
- function Ve(e) {
371
+ function Ge(e) {
372
372
  return e && e.constructor && typeof e.constructor.isBuffer == "function" && e.constructor.isBuffer(e);
373
373
  }
374
- function He(e) {
374
+ function Ke(e) {
375
375
  return e;
376
376
  }
377
- function Ue(e, t) {
377
+ function qe(e, t) {
378
378
  t ||= {};
379
- let n = t.delimiter || ".", r = t.maxDepth, i = t.transformKey || He, a = {};
379
+ let n = t.delimiter || ".", r = t.maxDepth, i = t.transformKey || Ke, a = {};
380
380
  function o(e, s, c) {
381
381
  c ||= 1, Object.keys(e).forEach(function(l) {
382
- let u = e[l], d = t.safe && Array.isArray(u), f = Object.prototype.toString.call(u), p = Ve(u), m = f === "[object Object]" || f === "[object Array]", h = s ? s + n + i(l) : i(l);
382
+ let u = e[l], d = t.safe && Array.isArray(u), f = Object.prototype.toString.call(u), p = Ge(u), m = f === "[object Object]" || f === "[object Array]", h = s ? s + n + i(l) : i(l);
383
383
  if (!d && !p && m && Object.keys(u).length && (!t.maxDepth || c < r)) return o(u, h, c + 1);
384
384
  a[h] = u;
385
385
  });
386
386
  }
387
387
  return o(e), a;
388
388
  }
389
- function We(e, t) {
389
+ function Je(e, t) {
390
390
  t ||= {};
391
- let n = t.delimiter || ".", r = t.overwrite || !1, i = t.transformKey || He, a = {};
392
- if (Ve(e) || Object.prototype.toString.call(e) !== "[object Object]") return e;
391
+ let n = t.delimiter || ".", r = t.overwrite || !1, i = t.transformKey || Ke, a = {};
392
+ if (Ge(e) || Object.prototype.toString.call(e) !== "[object Object]") return e;
393
393
  function o(e) {
394
394
  let n = Number(e);
395
395
  return isNaN(n) || e.indexOf(".") !== -1 || t.object ? e : n;
@@ -407,7 +407,7 @@ function We(e, t) {
407
407
  }
408
408
  return e = Object.keys(e).reduce(function(n, r) {
409
409
  let i = Object.prototype.toString.call(e[r]);
410
- return i !== "[object Object]" && i !== "[object Array]" || c(e[r]) ? (n[r] = e[r], n) : s(r, n, Ue(e[r], t));
410
+ return i !== "[object Object]" && i !== "[object Array]" || c(e[r]) ? (n[r] = e[r], n) : s(r, n, qe(e[r], t));
411
411
  }, {}), Object.keys(e).forEach(function(s) {
412
412
  let c = s.split(n).map(i), l = o(c.shift()), u = o(c[0]), d = a;
413
413
  for (; u !== void 0;) {
@@ -416,20 +416,20 @@ function We(e, t) {
416
416
  if (!r && !n && d[l] !== void 0) return;
417
417
  (r && !n || !r && d[l] == null) && (d[l] = typeof u == "number" && !t.object ? [] : {}), d = d[l], c.length > 0 && (l = o(c.shift()), u = o(c[0]));
418
418
  }
419
- d[l] = We(e[s], t);
419
+ d[l] = Je(e[s], t);
420
420
  }), a;
421
421
  }
422
422
  //#endregion
423
423
  //#region ../../node_modules/.pnpm/destr@2.0.5/node_modules/destr/dist/index.mjs
424
- var Ge = /"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/, Ke = /"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/, qe = /^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/;
425
- function Je(e, t) {
426
- if (e === "__proto__" || e === "constructor" && t && typeof t == "object" && "prototype" in t) Ye(e);
424
+ var Ye = /"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/, Xe = /"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/, Ze = /^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/;
425
+ function Qe(e, t) {
426
+ if (e === "__proto__" || e === "constructor" && t && typeof t == "object" && "prototype" in t) $e(e);
427
427
  else return t;
428
428
  }
429
- function Ye(e) {
429
+ function $e(e) {
430
430
  console.warn(`[destr] Dropping "${e}" key to prevent prototype pollution.`);
431
431
  }
432
- function Xe(e, t = {}) {
432
+ function et(e, t = {}) {
433
433
  if (typeof e != "string") return e;
434
434
  if (e[0] === "\"" && e[e.length - 1] === "\"" && e.indexOf("\\") === -1) return e.slice(1, -1);
435
435
  let n = e.trim();
@@ -442,14 +442,14 @@ function Xe(e, t = {}) {
442
442
  case "infinity": return Infinity;
443
443
  case "-infinity": return -Infinity;
444
444
  }
445
- if (!qe.test(e)) {
445
+ if (!Ze.test(e)) {
446
446
  if (t.strict) throw SyntaxError("[destr] Invalid JSON");
447
447
  return e;
448
448
  }
449
449
  try {
450
- if (Ge.test(e) || Ke.test(e)) {
450
+ if (Ye.test(e) || Xe.test(e)) {
451
451
  if (t.strict) throw Error("[destr] Possible prototype pollution");
452
- return JSON.parse(e, Je);
452
+ return JSON.parse(e, Qe);
453
453
  }
454
454
  return JSON.parse(e);
455
455
  } catch (n) {
@@ -459,83 +459,83 @@ function Xe(e, t = {}) {
459
459
  }
460
460
  //#endregion
461
461
  //#region ../../node_modules/.pnpm/defu@6.1.7/node_modules/defu/dist/defu.mjs
462
- function G(e) {
462
+ function tt(e) {
463
463
  if (typeof e != "object" || !e) return !1;
464
464
  let t = Object.getPrototypeOf(e);
465
465
  return t !== null && t !== Object.prototype && Object.getPrototypeOf(t) !== null || Symbol.iterator in e ? !1 : Symbol.toStringTag in e ? Object.prototype.toString.call(e) === "[object Module]" : !0;
466
466
  }
467
- function Ze(e, t, n = ".", r) {
468
- if (!G(t)) return Ze(e, {}, n, r);
467
+ function nt(e, t, n = ".", r) {
468
+ if (!tt(t)) return nt(e, {}, n, r);
469
469
  let i = { ...t };
470
470
  for (let t of Object.keys(e)) {
471
471
  if (t === "__proto__" || t === "constructor") continue;
472
472
  let a = e[t];
473
- a != null && (r && r(i, t, a, n) || (i[t] = Array.isArray(a) && Array.isArray(i[t]) ? [...a, ...i[t]] : G(a) && G(i[t]) ? Ze(a, i[t], (n ? `${n}.` : "") + t.toString(), r) : a));
473
+ a != null && (r && r(i, t, a, n) || (i[t] = Array.isArray(a) && Array.isArray(i[t]) ? [...a, ...i[t]] : tt(a) && tt(i[t]) ? nt(a, i[t], (n ? `${n}.` : "") + t.toString(), r) : a));
474
474
  }
475
475
  return i;
476
476
  }
477
- function Qe(e) {
478
- return (...t) => t.reduce((t, n) => Ze(t, n, "", e), {});
477
+ function rt(e) {
478
+ return (...t) => t.reduce((t, n) => nt(t, n, "", e), {});
479
479
  }
480
- var K = Qe(), $e = /^\s*([^\s=]+)\s*=\s*(.*)?\s*$/, et = /\n|\r|\r\n/, tt = {
480
+ var H = rt(), it = /^\s*([^\s=]+)\s*=\s*(.*)?\s*$/, at = /\n|\r|\r\n/, ot = {
481
481
  name: ".conf",
482
482
  dir: process.cwd(),
483
483
  flat: !1
484
484
  };
485
- function nt(e) {
485
+ function st(e) {
486
486
  return typeof e == "string" && (e = { name: e }), {
487
- ...tt,
487
+ ...ot,
488
488
  ...e
489
489
  };
490
490
  }
491
- function rt(e, t = {}) {
492
- let n = {}, r = e.split(et);
491
+ function ct(e, t = {}) {
492
+ let n = {}, r = e.split(at);
493
493
  for (let e of r) {
494
- let t = e.match($e);
494
+ let t = e.match(it);
495
495
  if (!t) continue;
496
496
  let r = t[1];
497
497
  if (!r || r === "__proto__" || r === "constructor") continue;
498
- let i = Xe((t[2] || "").trim());
498
+ let i = et((t[2] || "").trim());
499
499
  if (r.endsWith("[]")) {
500
500
  let e = r.slice(0, Math.max(0, r.length - 2));
501
501
  n[e] = (n[e] || []).concat(i);
502
502
  } else n[r] = i;
503
503
  }
504
- return t.flat ? n : We(n, { overwrite: !0 });
504
+ return t.flat ? n : Je(n, { overwrite: !0 });
505
505
  }
506
- function it(e, t) {
507
- return p(e) ? rt(h(e, "utf8"), t) : {};
506
+ function lt(e, t) {
507
+ return p(e) ? ct(h(e, "utf8"), t) : {};
508
508
  }
509
- function q(e) {
510
- return e = nt(e), it(b(e.dir, e.name), e);
509
+ function U(e) {
510
+ return e = st(e), lt(b(e.dir, e.name), e);
511
511
  }
512
- function at() {
513
- return process.env.XDG_CONFIG_HOME || b(ie(), ".config");
512
+ function ut() {
513
+ return process.env.XDG_CONFIG_HOME || b(ae(), ".config");
514
514
  }
515
- function ot(e) {
516
- return e = nt(e), e.dir = at(), q(e);
515
+ function dt(e) {
516
+ return e = st(e), e.dir = ut(), U(e);
517
517
  }
518
518
  //#endregion
519
519
  //#region ../../node_modules/.pnpm/c12@4.0.0-rc.2_magicast@0.5.4/node_modules/c12/dist/index.mjs
520
- async function st(e) {
521
- let t = e.env ?? process.env, n = await ct({
520
+ async function ft(e) {
521
+ let t = e.env ?? process.env, n = await pt({
522
522
  cwd: e.cwd,
523
523
  fileName: e.fileName ?? ".env",
524
524
  env: t,
525
525
  interpolate: e.interpolate ?? !0,
526
526
  expandFileReferences: e.expandFileReferences ?? !1,
527
527
  parse: e.parse
528
- }), r = gt(t);
528
+ }), r = bt(t);
529
529
  for (let e in n) e.startsWith("_") || (t[e] === void 0 || r.has(e)) && (t[e] = n[e]);
530
530
  return n;
531
531
  }
532
- async function ct(e) {
533
- let n = Object.create(null), r = t(e.cwd || "."), i = e.fileName || ".env", a = typeof i == "string" ? [i] : i, o = gt(e.env || {});
532
+ async function pt(e) {
533
+ let n = Object.create(null), r = t(e.cwd || "."), i = e.fileName || ".env", a = typeof i == "string" ? [i] : i, o = bt(e.env || {});
534
534
  Object.assign(n, e.env);
535
535
  for (let i of a) {
536
536
  let a = t(r, i);
537
537
  if (!_(a, { throwIfNoEntry: !1 })?.isFile()) continue;
538
- let s = await ut(a, e.parse);
538
+ let s = await mt(a, e.parse);
539
539
  for (let e in s) e in n && !o.has(e) || (n[e] = s[e], o.add(e));
540
540
  }
541
541
  if (e.expandFileReferences) {
@@ -547,21 +547,21 @@ async function ct(e) {
547
547
  }
548
548
  }
549
549
  }
550
- return e.interpolate && dt(n), n;
550
+ return e.interpolate && ht(n), n;
551
551
  }
552
- var lt = ee.parseEnv;
553
- async function ut(e, t) {
552
+ var W = ee.parseEnv;
553
+ async function mt(e, t) {
554
554
  let n = h(e, "utf8");
555
555
  if (t) return t(n);
556
- if (!lt) try {
556
+ if (!W) try {
557
557
  let e = await import("./chunks/__vite-optional-peer-dep_dotenv_c12-CxKvRg9-.js");
558
- lt = (t) => e.parse(t);
558
+ W = (t) => e.parse(t);
559
559
  } catch {
560
560
  throw Error("Failed to parse .env file: `node:util.parseEnv` is not available and `dotenv` package is not installed. Please upgrade your runtime, install `dotenv` as a dependency or provide a custom `parse` option.");
561
561
  }
562
- return lt(n);
562
+ return W(n);
563
563
  }
564
- function dt(e, t = {}, n = (e) => e) {
564
+ function ht(e, t = {}, n = (e) => e) {
565
565
  function r(n) {
566
566
  return t[n] === void 0 ? e[n] : t[n];
567
567
  }
@@ -574,7 +574,7 @@ function dt(e, t = {}, n = (e) => e) {
574
574
  a += "$", o += 2;
575
575
  continue;
576
576
  }
577
- let s = n === "$" ? mt(e, o) : void 0;
577
+ let s = n === "$" ? vt(e, o) : void 0;
578
578
  if (!s) {
579
579
  a += n, o++;
580
580
  continue;
@@ -593,11 +593,11 @@ function dt(e, t = {}, n = (e) => e) {
593
593
  }
594
594
  for (let t in e) e[t] = i(r(t));
595
595
  }
596
- var ft = /\w+/y, pt = /[\w:]+/y;
597
- function mt(e, t) {
596
+ var gt = /\w+/y, _t = /[\w:]+/y;
597
+ function vt(e, t) {
598
598
  let n = t + 1, r = e[n] === "{";
599
599
  r && n++;
600
- let i = r ? pt : ft;
600
+ let i = r ? _t : gt;
601
601
  i.lastIndex = n;
602
602
  let a = i.exec(e);
603
603
  if (!a) return;
@@ -613,7 +613,7 @@ function mt(e, t) {
613
613
  if (e[n] === "-") {
614
614
  let t = "-";
615
615
  o.endsWith(":") && (o = o.slice(0, -1), t = ":-");
616
- let r = o ? ht(e, n + 1) : void 0;
616
+ let r = o ? yt(e, n + 1) : void 0;
617
617
  return r ? {
618
618
  key: o,
619
619
  operator: t,
@@ -626,7 +626,7 @@ function mt(e, t) {
626
626
  end: n
627
627
  };
628
628
  }
629
- function ht(e, t) {
629
+ function yt(e, t) {
630
630
  let n = "", r = 1;
631
631
  for (let i = t; i < e.length; i++) {
632
632
  let t = e[i];
@@ -643,18 +643,18 @@ function ht(e, t) {
643
643
  }
644
644
  }
645
645
  }
646
- function gt(e) {
646
+ function bt(e) {
647
647
  let t = globalThis.__c12_dotenv_vars__ ||= /* @__PURE__ */ new Map();
648
648
  return t.has(e) || t.set(e, /* @__PURE__ */ new Set()), t.get(e);
649
649
  }
650
- var _t = (e) => e?.replace(/\\/g, "/"), vt = 0, yt = {
650
+ var xt = (e) => e?.replace(/\\/g, "/"), St = 0, Ct = {
651
651
  ".json": () => JSON.parse,
652
652
  ".yaml": () => import("./chunks/yaml-U_oPOIGK.js").then((e) => e.parseYAML),
653
653
  ".yml": () => import("./chunks/yaml-U_oPOIGK.js").then((e) => e.parseYAML),
654
654
  ".jsonc": () => import("./chunks/jsonc-BDHXk_1o.js").then((e) => e.n).then((e) => (t) => e.parseJSONC(t, { allowTrailingComma: !0 })),
655
655
  ".json5": () => import("./chunks/json5-RapVXICN.js").then((e) => e.parseJSON5),
656
656
  ".toml": () => import("./chunks/toml-CgS7wGvD.js").then((e) => e.parseTOML)
657
- }, bt = Object.freeze([
657
+ }, wt = Object.freeze([
658
658
  ".js",
659
659
  ".ts",
660
660
  ".mjs",
@@ -668,12 +668,12 @@ var _t = (e) => e?.replace(/\\/g, "/"), vt = 0, yt = {
668
668
  ".yml",
669
669
  ".toml"
670
670
  ]);
671
- async function xt(e) {
671
+ async function Tt(e) {
672
672
  e.cwd = t(process.cwd(), e.cwd || "."), e.name = e.name || "config", e.envName = e.envName ?? process.env.NODE_ENV, e.configFile = e.configFile ?? (e.name === "config" ? "config" : `${e.name}.config`), e.rcFile = e.rcFile ?? `.${e.name}rc`, e.extend !== !1 && (e.extend = {
673
673
  extendKey: "extends",
674
674
  ...e.extend
675
675
  });
676
- let n = e.merger || K, r = {
676
+ let n = e.merger || H, r = {
677
677
  config: {},
678
678
  cwd: e.cwd,
679
679
  configFile: t(e.cwd, e.configFile),
@@ -686,24 +686,24 @@ async function xt(e) {
686
686
  packageJson: void 0,
687
687
  defaultConfig: e.defaultConfig
688
688
  };
689
- e.dotenv && await st({
689
+ e.dotenv && await ft({
690
690
  cwd: e.cwd,
691
691
  ...e.dotenv === !0 ? {} : e.dotenv
692
692
  });
693
- let a = await Tt(".", e);
693
+ let a = await kt(".", e);
694
694
  if (a.configFile && (i.main = a.config, r.configFile = a.configFile, r._configFile = a._configFile), a.meta && (r.meta = a.meta), e.rcFile) {
695
695
  let t = [];
696
- if (t.push(q({
696
+ if (t.push(U({
697
697
  name: e.rcFile,
698
698
  dir: e.cwd
699
699
  })), e.globalRc) {
700
700
  let { findWorkspaceDir: n } = await import("./chunks/dist-DrnNGO2a.js"), r = await n(e.cwd).catch(() => {});
701
- r && t.push(q({
701
+ r && t.push(U({
702
702
  name: e.rcFile,
703
703
  dir: r
704
- })), t.push(ot({ name: e.rcFile })), t.push(q({
704
+ })), t.push(dt({ name: e.rcFile })), t.push(U({
705
705
  name: e.rcFile,
706
- dir: ie()
706
+ dir: ae()
707
707
  }));
708
708
  }
709
709
  i.rc = n({}, ...t);
@@ -720,7 +720,7 @@ async function xt(e) {
720
720
  rawConfigs: i
721
721
  }) : t);
722
722
  }
723
- if (Array.isArray(o.main) ? r.config = o.main : (r.config = n(o.overrides, o.main, o.rc, o.packageJson, o.defaultConfig), e.extend && (await St(r.config, e), r.layers = r.config._layers, delete r.config._layers, r.config = n(r.config, ...r.layers.map((e) => e.config)))), r.layers = [...[
723
+ if (Array.isArray(o.main) ? r.config = o.main : (r.config = n(o.overrides, o.main, o.rc, o.packageJson, o.defaultConfig), e.extend && (await Et(r.config, e), r.layers = r.config._layers, delete r.config._layers, r.config = n(r.config, ...r.layers.map((e) => e.config)))), r.layers = [...[
724
724
  o.overrides && {
725
725
  config: o.overrides,
726
726
  configFile: void 0,
@@ -741,9 +741,9 @@ async function xt(e) {
741
741
  }
742
742
  ].filter((e) => e && e.config), ...r.layers], e.defaults && (r.config = n(r.config, e.defaults)), e.omit$Keys) for (let e in r.config) e.startsWith("$") && delete r.config[e];
743
743
  if (e.configFileRequired && !r._configFile) throw Error(`Required config (${r.configFile}) cannot be resolved.`);
744
- return e.schema != null && (r.config = await Et(r.config, e.schema)), r;
744
+ return e.schema != null && (r.config = await At(r.config, e.schema)), r;
745
745
  }
746
- async function St(e, t) {
746
+ async function Et(e, t) {
747
747
  if (e._layers = e._layers || [], !t.extend) return;
748
748
  let n = t.extend.extendKey;
749
749
  typeof n == "string" && (n = [n]);
@@ -755,34 +755,34 @@ async function St(e, t) {
755
755
  console.warn(`Cannot extend config from \`${JSON.stringify(r)}\` in ${t.cwd}`);
756
756
  continue;
757
757
  }
758
- let a = await Tt(n, t, i);
759
- a.config ? (await St(a.config, {
758
+ let a = await kt(n, t, i);
759
+ a.config ? (await Et(a.config, {
760
760
  ...t,
761
761
  cwd: a.cwd
762
762
  }), e._layers.push(a), a.config._layers && (e._layers.push(...a.config._layers), delete a.config._layers)) : console.warn(`Cannot extend config from \`${n}\` in ${t.cwd}`);
763
763
  }
764
764
  }
765
- var Ct = [
765
+ var Dt = [
766
766
  "gh:",
767
767
  "github:",
768
768
  "gitlab:",
769
769
  "bitbucket:",
770
770
  "https://",
771
771
  "http://"
772
- ], wt = /^(@[\da-z~-][\d._a-z~-]*\/)?[\da-z~-][\d._a-z~-]*($|\/.*)/;
773
- async function Tt(e, o, s = {}) {
772
+ ], Ot = /^(@[\da-z~-][\d._a-z~-]*\/)?[\da-z~-][\d._a-z~-]*($|\/.*)/;
773
+ async function kt(e, o, s = {}) {
774
774
  if (o.resolve) {
775
775
  let t = await o.resolve(e, o);
776
776
  if (t) return t;
777
777
  }
778
- let c = o.merger || K, l = Object.keys(s.giget?.providers || {}).map((e) => `${e}:`), u = l.length > 0 ? [.../* @__PURE__ */ new Set([...l, ...Ct])] : Ct;
778
+ let c = o.merger || H, l = Object.keys(s.giget?.providers || {}).map((e) => `${e}:`), u = l.length > 0 ? [.../* @__PURE__ */ new Set([...l, ...Dt])] : Dt;
779
779
  if (o.giget !== !1 && u.some((t) => e.startsWith(t))) {
780
780
  let { downloadTemplate: n } = await import("./chunks/__vite-optional-peer-dep_giget_c12-BYcrHYBM.js").catch((t) => {
781
781
  throw Error(`Extending config from \`${e}\` requires \`giget\` peer dependency to be installed.\n\nInstall it with: \`npx nypm i giget\``, { cause: t });
782
782
  }), { digest: c } = await import("./chunks/ohash-Cc4pJh84.js").then((e) => e.dist_exports), l = e.replace(/\W+/g, "_").split("_").splice(0, 3).join("_") + "_" + c(e).slice(0, 10).replace(/[-_]/g, ""), u, d = t(o.cwd, "node_modules"), f = a(o.cwd);
783
- u = r(f) === ".c12" ? i(f, l) : p(d) ? i(d, ".c12", l) : process.env.XDG_CACHE_HOME ? t(process.env.XDG_CACHE_HOME, "c12", l) : t(ie(), ".cache/c12", l);
784
- let m = s.install ? K(s.install === !0 ? {} : s.install, { ignoreWorkspace: !0 }) : !1;
785
- p(u) && !m && await O(u, { recursive: !0 }), e = (await n(e, {
783
+ u = r(f) === ".c12" ? i(f, l) : p(d) ? i(d, ".c12", l) : process.env.XDG_CACHE_HOME ? t(process.env.XDG_CACHE_HOME, "c12", l) : t(ae(), ".cache/c12", l);
784
+ let m = s.install ? H(s.install === !0 ? {} : s.install, { ignoreWorkspace: !0 }) : !1;
785
+ p(u) && !m && await D(u, { recursive: !0 }), e = (await n(e, {
786
786
  dir: u,
787
787
  install: m,
788
788
  force: !!m,
@@ -791,8 +791,8 @@ async function Tt(e, o, s = {}) {
791
791
  ...s.giget
792
792
  })).dir;
793
793
  }
794
- wt.test(e) && (e = J(e, o) || e);
795
- let d = n(e), f = Dt(t(o.cwd, e)) ?? (!d || d === r(e)), m = t(o.cwd, f ? e : a(e));
794
+ Ot.test(e) && (e = G(e, o) || e);
795
+ let d = n(e), f = jt(t(o.cwd, e)) ?? (!d || d === r(e)), m = t(o.cwd, f ? e : a(e));
796
796
  f && (e = o.configFile);
797
797
  let h = {
798
798
  config: void 0,
@@ -801,22 +801,22 @@ async function Tt(e, o, s = {}) {
801
801
  source: e,
802
802
  sourceOptions: s
803
803
  };
804
- if (h.configFile = J(t(m, e), o) || J(t(m, ".config", e.replace(/\.config$/, "")), o) || J(t(m, ".config", e), o) || e, !p(h.configFile)) return h;
804
+ if (h.configFile = G(t(m, e), o) || G(t(m, ".config", e.replace(/\.config$/, "")), o) || G(t(m, ".config", e), o) || e, !p(h.configFile)) return h;
805
805
  h._configFile = h.configFile;
806
806
  let g = n(h.configFile) || "";
807
- if (g in yt) h.config = (await yt[g]())(await D(h.configFile, "utf8"));
807
+ if (g in Ct) h.config = (await Ct[g]())(await E(h.configFile, "utf8"));
808
808
  else {
809
809
  let e = o.resolveModule || ((e) => e.default || e);
810
810
  if (o.import) h.config = e(await o.import(h.configFile));
811
811
  else {
812
- let t = re(h.configFile);
813
- t.search = `_${++vt}`, h.config = await import(t.href).then(e, async (t) => {
812
+ let t = ie(h.configFile);
813
+ t.search = `_${++St}`, h.config = await import(t.href).then(e, async (t) => {
814
814
  let { createJiti: n } = await import("./chunks/__vite-optional-peer-dep_jiti_c12-DZVJNj6v.js").catch(() => {
815
815
  throw Error(`Failed to load config file \`${h.configFile}\`: ${t?.message}. Hint install \`jiti\` for compatibility.`, { cause: t });
816
816
  }), r = n(i(o.cwd || ".", o.configFile || "/"), {
817
817
  interopDefault: !0,
818
818
  moduleCache: !1,
819
- extensions: [...bt],
819
+ extensions: [...wt],
820
820
  ...o.jitiOptions
821
821
  });
822
822
  return o.import = (e) => r.import(e), e(await o.import(h.configFile));
@@ -825,9 +825,9 @@ async function Tt(e, o, s = {}) {
825
825
  }
826
826
  typeof h.config == "function" && (h.config = await h.config(o.context)), h.config && typeof h.config == "object" && !Array.isArray(h.config) && !Object.isExtensible(h.config) && (h.config = { ...h.config });
827
827
  let _ = (Array.isArray(o.envName) ? o.envName : [o.envName]).filter(Boolean).reverse().flatMap((e) => [h.config.$env?.[e], h.config["$" + e]]).filter((e) => e && Object.keys(e).length > 0);
828
- return _.length > 0 && (h.config = (o.envMerger || c)({}, ..._, h.config)), h.meta = K(h.sourceOptions.meta, h.config.$meta), delete h.config.$meta, h.sourceOptions.overrides && (h.config = c(h.sourceOptions.overrides, h.config)), h.configFile = _t(h.configFile), h.source = _t(h.source), h;
828
+ return _.length > 0 && (h.config = (o.envMerger || c)({}, ..._, h.config)), h.meta = H(h.sourceOptions.meta, h.config.$meta), delete h.config.$meta, h.sourceOptions.overrides && (h.config = c(h.sourceOptions.overrides, h.config)), h.configFile = xt(h.configFile), h.source = xt(h.source), h;
829
829
  }
830
- async function Et(e, t) {
830
+ async function At(e, t) {
831
831
  if (typeof t?.["~standard"]?.validate != "function") throw TypeError("Invalid `schema` option: expected a Standard Schema (https://standardschema.dev).");
832
832
  let n = await t["~standard"].validate(e);
833
833
  if (n.issues) {
@@ -839,17 +839,17 @@ async function Et(e, t) {
839
839
  }
840
840
  return n.value;
841
841
  }
842
- function J(e, t) {
842
+ function G(e, t) {
843
843
  let n = s(e, {
844
844
  try: !0,
845
- from: re(i(t.cwd || ".", t.configFile || "/")),
845
+ from: ie(i(t.cwd || ".", t.configFile || "/")),
846
846
  suffixes: ["", "/index"],
847
- extensions: bt,
847
+ extensions: wt,
848
848
  cache: !1
849
849
  });
850
850
  return n ? o(n) : void 0;
851
851
  }
852
- function Dt(e) {
852
+ function jt(e) {
853
853
  try {
854
854
  return _(e).isDirectory();
855
855
  } catch {
@@ -858,94 +858,94 @@ function Dt(e) {
858
858
  }
859
859
  //#endregion
860
860
  //#region src/error.mts
861
- var Y = class extends Error {
861
+ var K = class extends Error {
862
862
  code;
863
863
  path;
864
864
  name = "IncaError";
865
865
  constructor(e, t, n) {
866
866
  super(t), this.code = e, this.path = n;
867
867
  }
868
- }, Ot = {
868
+ }, Mt = {
869
869
  name: "inca",
870
870
  packageJson: "inca",
871
871
  rcFile: !1,
872
872
  globalRc: !1,
873
873
  giget: !1,
874
874
  extend: !1
875
- }, kt = /[/\\:*?"<>|\0]/;
876
- function At(e) {
877
- return e === e.trim() && e !== "" && e !== "." && e !== ".." && !kt.test(e);
875
+ }, Nt = /[/\\:*?"<>|\0]/;
876
+ function Pt(e) {
877
+ return e === e.trim() && e !== "" && e !== "." && e !== ".." && !Nt.test(e);
878
878
  }
879
- function jt(e) {
880
- if (!(typeof e == "string" && At(e))) throw new Y("ERR_INCA_PRODUCT_NAME_INVALID", `${JSON.stringify(e)} can't name a directory. set a "productName" in inca.config.ts with no leading or trailing space, and none of \`/\\:*?"<>|\``);
879
+ function Ft(e) {
880
+ if (!(typeof e == "string" && Pt(e))) throw new K("ERR_INCA_PRODUCT_NAME_INVALID", `${JSON.stringify(e)} can't name a directory. set a "productName" in inca.config.ts with no leading or trailing space, and none of \`/\\:*?"<>|\``);
881
881
  }
882
- var Mt = process.platform === "darwin" || process.platform === "win32";
883
- function Nt(e, t) {
884
- let n = (e) => Mt ? e.toLowerCase() : e, r = y.relative(n(e), n(t));
882
+ var It = process.platform === "darwin" || process.platform === "win32";
883
+ function Lt(e, t) {
884
+ let n = (e) => It ? e.toLowerCase() : e, r = y.relative(n(e), n(t));
885
885
  return r === "" || r !== ".." && !r.startsWith(`..${y.sep}`) && !y.isAbsolute(r);
886
886
  }
887
- function Pt(e) {
887
+ function Rt(e) {
888
888
  let t = y.resolve(e), n = t;
889
889
  for (let e; !m(n, { throwIfNoEntry: !1 }) && (e = y.dirname(n)) !== n;) n = e;
890
890
  return y.join(g.native(n), y.relative(n, t));
891
891
  }
892
- function Ft(e, t, n) {
892
+ function zt(e, t, n) {
893
893
  let r = y.resolve(e, t), i;
894
894
  try {
895
- let t = Pt(r);
895
+ let t = Rt(r);
896
896
  i = [
897
897
  e,
898
898
  y.join(e, "src"),
899
899
  y.join(e, "node_modules"),
900
900
  ...n ? [n] : []
901
- ].some((e) => Nt(t, Pt(e)));
901
+ ].some((e) => Lt(t, Rt(e)));
902
902
  } catch {
903
903
  i = !0;
904
904
  }
905
- if (i) throw new Y("ERR_INCA_OUT_DIR_INVALID", `"outDir" resolves to ${r}, which holds the app's own files. Set it to a directory the build can own, such as "dist"`);
905
+ if (i) throw new K("ERR_INCA_OUT_DIR_INVALID", `"outDir" resolves to ${r}, which holds the app's own files. Set it to a directory the build can own, such as "dist"`);
906
906
  }
907
- function It(e, t, n) {
907
+ function Bt(e, t, n) {
908
908
  let r = y.resolve(e, t ?? d.outDir);
909
- return Ft(e, r, n), r;
909
+ return zt(e, r, n), r;
910
910
  }
911
- function Lt(e, t) {
911
+ function Vt(e, t) {
912
912
  try {
913
913
  return JSON.parse(e);
914
914
  } catch (e) {
915
- throw new Y("ERR_INCA_PACKAGE_JSON_INVALID", `${t} holds malformed JSON: ${e.message}`, t);
915
+ throw new K("ERR_INCA_PACKAGE_JSON_INVALID", `${t} holds malformed JSON: ${e.message}`, t);
916
916
  }
917
917
  }
918
- async function Rt(e) {
919
- let { config: t, layers: n } = await xt({
918
+ async function Ht(e) {
919
+ let { config: t, layers: n } = await Tt({
920
920
  cwd: e,
921
- ...Ot
921
+ ...Mt
922
922
  }), r = n?.find((e) => e.configFile === "package.json");
923
923
  return {
924
924
  config: t,
925
925
  usedPackageJsonKey: Object.keys(r?.config ?? {}).length > 0
926
926
  };
927
927
  }
928
- async function zt(e) {
929
- let { config: t } = await Rt(e), n = t.entry ? y.resolve(e, t.entry) : void 0;
928
+ async function Ut(e) {
929
+ let { config: t } = await Ht(e), n = t.entry ? y.resolve(e, t.entry) : void 0;
930
930
  return {
931
931
  entry: n,
932
- outDir: It(e, t.outDir, n),
932
+ outDir: Bt(e, t.outDir, n),
933
933
  sourcemap: t.sourcemap ?? d.sourcemap
934
934
  };
935
935
  }
936
- async function Bt(e) {
936
+ async function Wt(e) {
937
937
  let t = y.join(e, "package.json"), n;
938
938
  try {
939
- n = await D(t, "utf8");
939
+ n = await E(t, "utf8");
940
940
  } catch {
941
- throw new Y("ERR_INCA_PACKAGE_JSON_NOT_FOUND", `no package.json found at ${t}`);
941
+ throw new K("ERR_INCA_PACKAGE_JSON_NOT_FOUND", `no package.json found at ${t}`);
942
942
  }
943
- let r = Lt(n, t), { config: i, usedPackageJsonKey: a } = await Rt(e), o = i.productName ?? u(r.name);
944
- if (!o) throw new Y("ERR_INCA_PRODUCT_NAME_MISSING", `${t} needs a "name", or "productName" in inca.config.ts`);
945
- jt(o);
943
+ let r = Vt(n, t), { config: i, usedPackageJsonKey: a } = await Ht(e), o = i.productName ?? u(r.name);
944
+ if (!o) throw new K("ERR_INCA_PRODUCT_NAME_MISSING", `${t} needs a "name", or "productName" in inca.config.ts`);
945
+ Ft(o);
946
946
  let s = i.version ?? r.version ?? d.version, c = i.identifier ?? l(o), f;
947
- if (i.icon && (f = y.resolve(e, i.icon), !p(f))) throw new Y("ERR_INCA_ICON_NOT_FOUND", `"icon" points to ${f}, which doesn't exist`, f);
948
- let m = i.entry ? y.resolve(e, i.entry) : void 0, h = It(e, i.outDir, m);
947
+ if (i.icon && (f = y.resolve(e, i.icon), !p(f))) throw new K("ERR_INCA_ICON_NOT_FOUND", `"icon" points to ${f}, which doesn't exist`, f);
948
+ let m = i.entry ? y.resolve(e, i.entry) : void 0, h = Bt(e, i.outDir, m);
949
949
  return {
950
950
  productName: o,
951
951
  identifier: c,
@@ -959,16 +959,16 @@ async function Bt(e) {
959
959
  usedPackageJsonKey: a
960
960
  };
961
961
  }
962
- function Vt(e) {
962
+ function Gt(e) {
963
963
  return {
964
964
  name: e.productName,
965
965
  identifier: e.identifier,
966
966
  window: e.window
967
967
  };
968
968
  }
969
- async function Ht(e) {
970
- let { config: t } = await Rt(e), n = y.join(e, "package.json"), r = await D(n, "utf8").catch(() => void 0), i = r === void 0 ? {} : Lt(r, n), a = t.productName ?? u(i.name);
971
- a && jt(a);
969
+ async function Kt(e) {
970
+ let { config: t } = await Ht(e), n = y.join(e, "package.json"), r = await E(n, "utf8").catch(() => void 0), i = r === void 0 ? {} : Vt(r, n), a = t.productName ?? u(i.name);
971
+ a && Ft(a);
972
972
  let o = {
973
973
  name: a,
974
974
  identifier: t.identifier ?? (a ? l(a) : void 0),
@@ -978,47 +978,47 @@ async function Ht(e) {
978
978
  }
979
979
  //#endregion
980
980
  //#region src/dev-client/hostBin.mts
981
- var Ut = "INCA_HOST_BIN";
982
- function Wt() {
981
+ var qt = "INCA_HOST_BIN";
982
+ function Jt() {
983
983
  let e = process.platform === "darwin" || process.platform === "linux" ? process.platform : void 0, t = process.arch === "arm64" || process.arch === "x64" ? process.arch : void 0;
984
984
  return e && t ? `@incajs/host-${e}-${t}` : void 0;
985
985
  }
986
- function Gt() {
987
- let e = Wt();
986
+ function Yt() {
987
+ let e = Jt();
988
988
  if (e) try {
989
- return ae(import.meta.url).resolve(`${e}/bin/inca-host`);
989
+ return oe(import.meta.url).resolve(`${e}/bin/inca-host`);
990
990
  } catch {
991
991
  return;
992
992
  }
993
993
  }
994
- function Kt() {
995
- let e = process.env[Ut];
994
+ function q() {
995
+ let e = process.env[qt];
996
996
  if (e) return e;
997
- let t = Gt();
997
+ let t = Yt();
998
998
  if (t) return t;
999
- let n = Wt();
1000
- throw new Y("ERR_INCA_HOST_BIN_UNRESOLVED", `no host binary found. ${n ? `no ${n} package is installed for it` : `this platform (${process.platform}/${process.arch}) has no published package`}, and ${Ut} isn't set to one`);
999
+ let n = Jt();
1000
+ throw new K("ERR_INCA_HOST_BIN_UNRESOLVED", `no host binary found. ${n ? `no ${n} package is installed for it` : `this platform (${process.platform}/${process.arch}) has no published package`}, and ${qt} isn't set to one`);
1001
1001
  }
1002
- function qt(e) {
1003
- if (!_(e, { throwIfNoEntry: !1 })?.isFile()) throw new Y("ERR_INCA_HOST_BIN_NOT_FOUND", `no host binary at ${e}. check that it was built`);
1002
+ function J(e) {
1003
+ if (!_(e, { throwIfNoEntry: !1 })?.isFile()) throw new K("ERR_INCA_HOST_BIN_NOT_FOUND", `no host binary at ${e}. check that it was built`);
1004
1004
  }
1005
1005
  //#endregion
1006
1006
  //#region src/dev-client/hostError.mts
1007
- var Jt = class extends Error {
1007
+ var Xt = class extends Error {
1008
1008
  code;
1009
1009
  hostStack;
1010
1010
  constructor(e, t, n = null) {
1011
1011
  super(e), this.code = t, this.hostStack = n, this.name = "HostError";
1012
1012
  }
1013
1013
  };
1014
- function Yt(e) {
1014
+ function Zt(e) {
1015
1015
  return typeof e == "object" && !!e && e.jsonrpc === "2.0";
1016
1016
  }
1017
1017
  //#endregion
1018
1018
  //#region src/dev-client/hostClient.mts
1019
- var Xt = (e) => {
1019
+ var Qt = (e) => {
1020
1020
  process.stderr.write(e.endsWith("\n") ? e : `${e}\n`);
1021
- }, Zt = -32e3, Qt = class {
1021
+ }, $t = -32e3, en = class {
1022
1022
  #e;
1023
1023
  #t;
1024
1024
  #n = 1;
@@ -1028,9 +1028,9 @@ var Xt = (e) => {
1028
1028
  this.#e = e;
1029
1029
  }
1030
1030
  async start() {
1031
- let e = this.#e.hostBin ?? Kt();
1032
- qt(e);
1033
- let t = oe(e, ["--dev", this.#e.entryFile], {
1031
+ let e = this.#e.hostBin ?? q();
1032
+ J(e);
1033
+ let t = se(e, ["--dev", this.#e.entryFile], {
1034
1034
  stdio: [
1035
1035
  "pipe",
1036
1036
  "pipe",
@@ -1039,10 +1039,10 @@ var Xt = (e) => {
1039
1039
  env: this.#e.env
1040
1040
  });
1041
1041
  this.#t = t;
1042
- let n = this.#e.onStderr ?? Xt;
1042
+ let n = this.#e.onStderr ?? Qt;
1043
1043
  t.stderr.setEncoding("utf8"), t.stderr.on("data", (e) => n(e)), t.stdin.on("error", (e) => {
1044
1044
  e.code !== "EPIPE" && n(`host stdin: ${e.message}\n`);
1045
- }), se.createInterface({ input: t.stdout }).on("line", (e) => {
1045
+ }), le.createInterface({ input: t.stdout }).on("line", (e) => {
1046
1046
  this.#a(e, n);
1047
1047
  }), t.on("exit", (e, t) => {
1048
1048
  let n = /* @__PURE__ */ Error(`the host exited (code=${String(e)}, signal=${String(t)}) before answering`);
@@ -1052,7 +1052,7 @@ var Xt = (e) => {
1052
1052
  let r = !1;
1053
1053
  t.on("error", (e) => {
1054
1054
  r && n(`host: ${e.message}\n`);
1055
- }), await A(t, "spawn"), r = !0;
1055
+ }), await k(t, "spawn"), r = !0;
1056
1056
  }
1057
1057
  #a(e, t) {
1058
1058
  let n;
@@ -1062,7 +1062,7 @@ var Xt = (e) => {
1062
1062
  t(`[stray stdout] ${e}`);
1063
1063
  return;
1064
1064
  }
1065
- if (!Yt(n)) {
1065
+ if (!Zt(n)) {
1066
1066
  t(`[stray stdout] ${e}`);
1067
1067
  return;
1068
1068
  }
@@ -1073,14 +1073,14 @@ var Xt = (e) => {
1073
1073
  if (n.id === null) {
1074
1074
  if (!("error" in n)) return;
1075
1075
  let { code: e, message: r, data: i } = n.error;
1076
- e === Zt ? this.#e.onAppError?.({
1076
+ e === $t ? this.#e.onAppError?.({
1077
1077
  message: r,
1078
1078
  stack: i?.stack ?? null
1079
1079
  }) : t(`[host error ${String(e)}] ${r}\n`);
1080
1080
  return;
1081
1081
  }
1082
1082
  let r = this.#r.get(n.id);
1083
- r && (this.#r.delete(n.id), "error" in n ? r.reject(new Jt(n.error.message, n.error.code, n.error.data?.stack ?? null)) : r.resolve(n.result));
1083
+ r && (this.#r.delete(n.id), "error" in n ? r.reject(new Xt(n.error.message, n.error.code, n.error.data?.stack ?? null)) : r.resolve(n.result));
1084
1084
  }
1085
1085
  #o(e, t, n) {
1086
1086
  switch (e) {
@@ -1103,7 +1103,7 @@ var Xt = (e) => {
1103
1103
  }
1104
1104
  }
1105
1105
  async #s(e) {
1106
- let t = A(e, "exit");
1106
+ let t = k(e, "exit");
1107
1107
  e.kill(), await t;
1108
1108
  }
1109
1109
  async call(e, t, n) {
@@ -1144,38 +1144,38 @@ var Xt = (e) => {
1144
1144
  let t = this.#t;
1145
1145
  if (!t || t.exitCode !== null || t.signalCode !== null) return;
1146
1146
  this.#i = !0;
1147
- let n = A(t, "exit");
1148
- this.call("shutdown").catch(() => {}), await Promise.race([n.then(() => "exited"), ce(e, void 0, { ref: !1 }).then(() => "timeout")]) === "timeout" && (t.kill(), await n);
1147
+ let n = k(t, "exit");
1148
+ this.call("shutdown").catch(() => {}), await Promise.race([n.then(() => "exited"), ue(e, void 0, { ref: !1 }).then(() => "timeout")]) === "timeout" && (t.kill(), await n);
1149
1149
  }
1150
- }, $t = "[inca]", en = new Intl.DateTimeFormat(void 0, {
1150
+ }, tn = "[inca]", nn = new Intl.DateTimeFormat(void 0, {
1151
1151
  hour: "numeric",
1152
1152
  minute: "numeric",
1153
1153
  second: "numeric"
1154
- }), X = { timestamp: !0 };
1155
- function tn(e, t, n) {
1156
- let r = S(["bold", n], $t, { stream: e });
1157
- return t.timestamp ? `${S("dim", en.format(/* @__PURE__ */ new Date()), { stream: e })} ${r}` : r;
1154
+ }), Y = { timestamp: !0 };
1155
+ function X(e, t, n) {
1156
+ let r = S(["bold", n], tn, { stream: e });
1157
+ return t.timestamp ? `${S("dim", nn.format(/* @__PURE__ */ new Date()), { stream: e })} ${r}` : r;
1158
1158
  }
1159
1159
  function Z(e, t, n = {}) {
1160
- e.write(`${tn(e, n, "cyan")} ${t}\n`);
1160
+ e.write(`${X(e, n, "cyan")} ${t}\n`);
1161
1161
  }
1162
- function nn(e, t, n = {}) {
1163
- e.write(`${tn(e, n, "yellow")} ${t}\n`);
1162
+ function rn(e, t, n = {}) {
1163
+ e.write(`${X(e, n, "yellow")} ${t}\n`);
1164
1164
  }
1165
- function rn(e) {
1165
+ function an(e) {
1166
1166
  let t = e.code;
1167
1167
  return typeof t == "string" ? t : null;
1168
1168
  }
1169
- function an(e) {
1169
+ function on(e) {
1170
1170
  return /\bERR_INCA_[A-Z0-9_]+/.exec(e)?.[0] ?? null;
1171
1171
  }
1172
- function on(e) {
1172
+ function sn(e) {
1173
1173
  let t = e.stack;
1174
1174
  if (!t) return null;
1175
1175
  for (let n of [`${e.name}: ${e.message}`, e.message]) if (t.startsWith(n)) return t.slice(n.length).replace(/^\r?\n/, "") || null;
1176
1176
  return t;
1177
1177
  }
1178
- function sn(e) {
1178
+ function cn(e) {
1179
1179
  let t = /^(?:\w*Error: )?(ERR_INCA_[A-Z0-9_]+): /.exec(e);
1180
1180
  return t ? {
1181
1181
  message: e.slice(t[0].length),
@@ -1188,37 +1188,37 @@ function sn(e) {
1188
1188
  };
1189
1189
  }
1190
1190
  function Q(e) {
1191
- return e instanceof Jt ? {
1191
+ return e instanceof Xt ? {
1192
1192
  message: e.message,
1193
1193
  stack: e.hostStack,
1194
- code: rn(e)
1194
+ code: an(e)
1195
1195
  } : e instanceof Error ? {
1196
1196
  message: e.message,
1197
- stack: on(e),
1198
- code: rn(e) ?? an(e.message)
1197
+ stack: sn(e),
1198
+ code: an(e) ?? on(e.message)
1199
1199
  } : {
1200
1200
  message: String(e),
1201
1201
  stack: null,
1202
1202
  code: null
1203
1203
  };
1204
1204
  }
1205
- function cn(e, t) {
1205
+ function ln(e, t) {
1206
1206
  return e.split("\n").map((e) => /^\s*at\b/.test(e) ? S("dim", e, { stream: t }) : e).join("\n");
1207
1207
  }
1208
1208
  function $(e, t, n, r = {}) {
1209
- n.stack && e.write(`${cn(n.stack, e)}\n`);
1209
+ n.stack && e.write(`${ln(n.stack, e)}\n`);
1210
1210
  let i = n.code ? ` (${S("bold", n.code, { stream: e })})` : "";
1211
- e.write(`${tn(e, r, "red")} ${t}${i}: ${n.message}\n`);
1211
+ e.write(`${X(e, r, "red")} ${t}${i}: ${n.message}\n`);
1212
1212
  }
1213
1213
  //#endregion
1214
1214
  //#region src/adapterCore.mts
1215
- var ln = /* @__PURE__ */ e({
1216
- IncaError: () => Y,
1217
- bundlerFault: () => sn
1215
+ var un = /* @__PURE__ */ e({
1216
+ IncaError: () => K,
1217
+ bundlerFault: () => cn
1218
1218
  });
1219
1219
  //#endregion
1220
1220
  //#region src/vite/captureOutput.mts
1221
- function un(e, t, n) {
1221
+ function dn(e, t, n) {
1222
1222
  return {
1223
1223
  outDir: e,
1224
1224
  entryFile: y.join(e, t.entryFile),
@@ -1226,7 +1226,7 @@ function un(e, t, n) {
1226
1226
  changed: n
1227
1227
  };
1228
1228
  }
1229
- function dn(e, t) {
1229
+ function fn(e, t) {
1230
1230
  return {
1231
1231
  name: "inca:capture-output",
1232
1232
  writeBundle(n, r) {
@@ -1241,19 +1241,19 @@ function dn(e, t) {
1241
1241
  }
1242
1242
  //#endregion
1243
1243
  //#region src/vite/emitConfig.mts
1244
- var fn = "inca.json";
1245
- function pn(e) {
1244
+ var pn = "inca.json";
1245
+ function mn(e) {
1246
1246
  let t = JSON.stringify(e, void 0, 2);
1247
1247
  if (t !== void 0 && t !== "{}") return `${t}\n`;
1248
1248
  }
1249
- function mn(e) {
1250
- let t = pn(e);
1249
+ function hn(e) {
1250
+ let t = mn(e);
1251
1251
  return {
1252
1252
  name: "inca:emit-config",
1253
1253
  generateBundle() {
1254
1254
  t && this.emitFile({
1255
1255
  type: "asset",
1256
- fileName: fn,
1256
+ fileName: pn,
1257
1257
  source: t
1258
1258
  });
1259
1259
  }
@@ -1261,8 +1261,8 @@ function mn(e) {
1261
1261
  }
1262
1262
  //#endregion
1263
1263
  //#region src/vite/logger.mts
1264
- var hn = "Build failed with ", gn = "Pre-transform error";
1265
- function _n(e, t, n = !1) {
1264
+ var gn = "Build failed with ", _n = "Pre-transform error";
1265
+ function vn(e, t, n = !1) {
1266
1266
  let r = /* @__PURE__ */ new WeakSet(), i = /* @__PURE__ */ new Set(), a = {
1267
1267
  hasWarned: !1,
1268
1268
  info(t) {
@@ -1275,7 +1275,7 @@ function _n(e, t, n = !1) {
1275
1275
  i.has(e) || (i.add(e), a.warn(e));
1276
1276
  },
1277
1277
  error(e, n) {
1278
- a.hasWarned = !0, n?.error && r.add(n.error), !e.includes(hn) && (e.includes(gn) || t.write(`${e.replace(/\n\s+at .*/g, "")}\n`));
1278
+ a.hasWarned = !0, n?.error && r.add(n.error), !e.includes(gn) && (e.includes(_n) || t.write(`${e.replace(/\n\s+at .*/g, "")}\n`));
1279
1279
  },
1280
1280
  clearScreen() {},
1281
1281
  hasErrorLogged(e) {
@@ -1286,7 +1286,7 @@ function _n(e, t, n = !1) {
1286
1286
  }
1287
1287
  //#endregion
1288
1288
  //#region src/vite/unsupported.mts
1289
- var vn = /\.(?:css|pcss|postcss|sass|scss|less|styl|stylus)(?:\?|$)/, yn = [{
1289
+ var yn = /\.(?:css|pcss|postcss|sass|scss|less|styl|stylus)(?:\?|$)/, bn = [{
1290
1290
  code: "ERR_INCA_UNSUPPORTED_STYLE",
1291
1291
  name: "a <style> block",
1292
1292
  matches: (e) => e.includes("vue&type=style"),
@@ -1294,10 +1294,10 @@ var vn = /\.(?:css|pcss|postcss|sass|scss|less|styl|stylus)(?:\?|$)/, yn = [{
1294
1294
  }, {
1295
1295
  code: "ERR_INCA_UNSUPPORTED_STYLESHEET",
1296
1296
  name: "a stylesheet import",
1297
- matches: (e) => vn.test(e),
1297
+ matches: (e) => yn.test(e),
1298
1298
  hint: "the renderer applies no stylesheet. use a :style binding instead"
1299
1299
  }];
1300
- function bn(e, t = yn) {
1300
+ function xn(e, t = bn) {
1301
1301
  return {
1302
1302
  name: "inca:reject-unsupported",
1303
1303
  enforce: "pre",
@@ -1311,8 +1311,8 @@ function bn(e, t = yn) {
1311
1311
  }
1312
1312
  //#endregion
1313
1313
  //#region src/vite/config.mts
1314
- var xn = "bundle.js";
1315
- function Sn({ core: e, runtimeModuleName: t, entry: n, outDir: r, mode: i, sourcemap: a = !1, watch: o, onOutput: s, stdout: c, stderr: l, quiet: u, runtimeConfig: d }) {
1314
+ var Sn = "bundle.js";
1315
+ function Cn({ core: e, runtimeModuleName: t, entry: n, outDir: r, mode: i, sourcemap: a = !1, watch: o, onOutput: s, stdout: c, stderr: l, quiet: u, runtimeConfig: d }) {
1316
1316
  let f = i === "development" || a;
1317
1317
  return {
1318
1318
  configFile: !1,
@@ -1320,22 +1320,22 @@ function Sn({ core: e, runtimeModuleName: t, entry: n, outDir: r, mode: i, sourc
1320
1320
  mode: i,
1321
1321
  clearScreen: !1,
1322
1322
  logLevel: u ? "silent" : "info",
1323
- customLogger: _n(c, l),
1323
+ customLogger: vn(c, l),
1324
1324
  define: { "process.env.NODE_ENV": JSON.stringify(i) },
1325
1325
  plugins: [
1326
- pe({ template: { compilerOptions: {
1326
+ he({ template: { compilerOptions: {
1327
1327
  runtimeModuleName: t,
1328
1328
  hoistStatic: !1
1329
1329
  } } }),
1330
- bn(e),
1331
- mn(d),
1332
- dn(e, s)
1330
+ xn(e),
1331
+ hn(d),
1332
+ fn(e, s)
1333
1333
  ],
1334
1334
  build: {
1335
1335
  lib: {
1336
1336
  entry: n,
1337
1337
  formats: ["es"],
1338
- fileName: () => xn
1338
+ fileName: () => Sn
1339
1339
  },
1340
1340
  outDir: r,
1341
1341
  emptyOutDir: i === "production",
@@ -1352,9 +1352,9 @@ function Sn({ core: e, runtimeModuleName: t, entry: n, outDir: r, mode: i, sourc
1352
1352
  }
1353
1353
  //#endregion
1354
1354
  //#region src/vite/build.mts
1355
- async function Cn(e, t, { entry: n, outDir: r, sourcemap: i, runtimeConfig: a, stdout: o = process.stdout, stderr: s = process.stderr, quiet: c = !1 }) {
1355
+ async function wn(e, t, { entry: n, outDir: r, sourcemap: i, runtimeConfig: a, stdout: o = process.stdout, stderr: s = process.stderr, quiet: c = !1 }) {
1356
1356
  let l;
1357
- if (await ue(Sn({
1357
+ if (await fe(Cn({
1358
1358
  core: e,
1359
1359
  runtimeModuleName: t,
1360
1360
  entry: n,
@@ -1367,14 +1367,14 @@ async function Cn(e, t, { entry: n, outDir: r, sourcemap: i, runtimeConfig: a, s
1367
1367
  stderr: s,
1368
1368
  quiet: c,
1369
1369
  onOutput: (e) => {
1370
- l = un(r, e);
1370
+ l = dn(r, e);
1371
1371
  }
1372
1372
  })), !l) throw new e.IncaError("ERR_INCA_BUILD_NO_OUTPUT", "build produced no output");
1373
1373
  return l;
1374
1374
  }
1375
1375
  //#endregion
1376
1376
  //#region ../../node_modules/.pnpm/ts-dedent@2.3.0/node_modules/ts-dedent/esm/index.js
1377
- function wn(e) {
1377
+ function Tn(e) {
1378
1378
  var t = [...arguments].slice(1), n = Array.from(typeof e == "string" ? [e] : e);
1379
1379
  n[n.length - 1] = n[n.length - 1].replace(/\r?\n([\t ]*)$/, "");
1380
1380
  var r = n.reduce(function(e, t) {
@@ -1401,18 +1401,18 @@ function wn(e) {
1401
1401
  }
1402
1402
  //#endregion
1403
1403
  //#region src/vite/hmr.mts
1404
- function Tn(e, t) {
1405
- let n = de(t, [], !1), r = [t.stack, n].filter((e) => e).join("\n");
1404
+ function En(e, t) {
1405
+ let n = pe(t, [], !1), r = [t.stack, n].filter((e) => e).join("\n");
1406
1406
  return {
1407
1407
  ...e.bundlerFault(t.message),
1408
1408
  stack: r || null
1409
1409
  };
1410
1410
  }
1411
- function En(e) {
1411
+ function Dn(e) {
1412
1412
  return y.join(e, "node_modules/.inca/hmr");
1413
1413
  }
1414
- function Dn() {
1415
- let e = y.dirname(ne(import.meta.url));
1414
+ function On() {
1415
+ let e = y.dirname(re(import.meta.url));
1416
1416
  for (; !p(y.join(e, "package.json"));) {
1417
1417
  let t = y.dirname(e);
1418
1418
  if (t === e) throw Error("could not locate @incajs/cli's own package.json");
@@ -1420,43 +1420,44 @@ function Dn() {
1420
1420
  }
1421
1421
  return y.join(e, "dist/vite-runtime.js");
1422
1422
  }
1423
- function On(e, t) {
1423
+ function kn(e, t) {
1424
1424
  let n = y.relative(e, t).split(y.sep).join("/");
1425
1425
  return n.startsWith(".") ? n : `./${n}`;
1426
1426
  }
1427
- var kn = /^[A-Za-z_$][\w$]*$/;
1428
- function An(e) {
1427
+ var An = /^[A-Za-z_$][\w$]*$/;
1428
+ function jn(e) {
1429
1429
  let t = {};
1430
- for (let [n, r] of Object.entries(e ?? {})) if (kn.test(n)) try {
1430
+ for (let [n, r] of Object.entries(e ?? {})) if (An.test(n)) try {
1431
1431
  t[n] = JSON.parse(typeof r == "string" ? r : JSON.stringify(r));
1432
1432
  } catch {}
1433
1433
  return t;
1434
1434
  }
1435
- async function jn(e, t, n, r) {
1436
- let i = En(e), a = y.join(i, "entry.js"), o = On(i, r ?? Dn()), s = t.split(y.sep).join("/");
1437
- return await k(a, wn`
1435
+ async function Mn(e, t, n, r) {
1436
+ let i = Dn(e), a = y.join(i, "entry.js"), o = kn(i, r ?? On()), s = t.split(y.sep).join("/");
1437
+ return await O(a, Tn`
1438
1438
  import { start } from ${JSON.stringify(o)};
1439
1439
  await start(${JSON.stringify(s)}, ${JSON.stringify(n)});
1440
1440
  `), a;
1441
1441
  }
1442
- function Mn(e) {
1442
+ function Nn(e) {
1443
1443
  if (e.type === "error") return e.err;
1444
1444
  if (e.type === "custom" && e.event === "vite:invoke") return e.data?.data?.error;
1445
1445
  }
1446
- function Nn(e) {
1446
+ function Pn(e) {
1447
1447
  if (e.type !== "custom" || e.event !== "vite:invoke") return !1;
1448
1448
  let t = e.data;
1449
1449
  return t.name === "fetchModule" && !t.data?.error;
1450
1450
  }
1451
- function Pn(e, t, n, r, i) {
1451
+ function Fn(e, t, n, r, i) {
1452
1452
  let a = /* @__PURE__ */ new Map(), o = { send: s };
1453
1453
  function s(a) {
1454
1454
  if (a.type === "full-reload") {
1455
- t();
1455
+ let e = i.current;
1456
+ i.current = void 0, t(e);
1456
1457
  return;
1457
1458
  }
1458
- let o = Mn(a);
1459
- o ? (n(o), i.current = void 0) : Nn(a) && i.current && (r({
1459
+ let o = Nn(a);
1460
+ o ? (n(o), i.current = void 0) : Pn(a) && i.current && (r({
1460
1461
  file: i.current.file,
1461
1462
  took: Date.now() - i.current.at
1462
1463
  }), i.current = void 0), e(a);
@@ -1478,7 +1479,7 @@ function Pn(e, t, n, r, i) {
1478
1479
  }
1479
1480
  };
1480
1481
  }
1481
- function Fn() {
1482
+ function In() {
1482
1483
  let e = "\0inca:vite-client-shim";
1483
1484
  return {
1484
1485
  name: "inca:shim-vite-client",
@@ -1491,7 +1492,7 @@ function Fn() {
1491
1492
  }
1492
1493
  };
1493
1494
  }
1494
- function In(e) {
1495
+ function Ln(e) {
1495
1496
  return {
1496
1497
  name: "inca:file-changed",
1497
1498
  hotUpdate(t) {
@@ -1506,17 +1507,17 @@ function In(e) {
1506
1507
  }
1507
1508
  };
1508
1509
  }
1509
- async function Ln(e, t, { entry: n, cwd: r, runtimeConfig: i, runtimePath: a, stdout: o = process.stdout, stderr: s = process.stderr, quiet: c = !1, notify: l, reload: u, onError: d, onUpdate: f = () => {} }) {
1510
- await E(En(r), { recursive: !0 });
1511
- let p = pn(i), m = y.join(En(r), fn);
1512
- p ? await k(m, p) : await O(m, { force: !0 });
1513
- let h = { current: void 0 }, { channel: g, dispatch: _ } = Pn(l, u, (t) => d(Tn(e, t)), f, h), v = await fe({
1510
+ async function Rn(e, t, { entry: n, cwd: r, runtimeConfig: i, runtimePath: a, stdout: o = process.stdout, stderr: s = process.stderr, quiet: c = !1, notify: l, reload: u, onError: d, onUpdate: f = () => {} }) {
1511
+ await T(Dn(r), { recursive: !0 });
1512
+ let p = mn(i), m = y.join(Dn(r), pn);
1513
+ p ? await O(m, p) : await D(m, { force: !0 });
1514
+ let h = { current: void 0 }, { channel: g, dispatch: _ } = Fn(l, u, (t) => d(En(e, t)), f, h), v = await me({
1514
1515
  configFile: !1,
1515
1516
  root: y.dirname(n),
1516
1517
  mode: "development",
1517
1518
  clearScreen: !1,
1518
1519
  logLevel: c ? "silent" : "info",
1519
- customLogger: _n(o, s, c),
1520
+ customLogger: vn(o, s, c),
1520
1521
  define: { "process.env.NODE_ENV": JSON.stringify("development") },
1521
1522
  server: {
1522
1523
  middlewareMode: !0,
@@ -1531,24 +1532,24 @@ async function Ln(e, t, { entry: n, cwd: r, runtimeConfig: i, runtimePath: a, st
1531
1532
  consumer: "client",
1532
1533
  dev: {
1533
1534
  moduleRunnerTransform: !0,
1534
- createEnvironment: (e, t) => new le(e, t, {
1535
+ createEnvironment: (e, t) => new de(e, t, {
1535
1536
  hot: !0,
1536
1537
  transport: g
1537
1538
  })
1538
1539
  }
1539
1540
  } },
1540
1541
  plugins: [
1541
- pe({ template: { compilerOptions: {
1542
+ he({ template: { compilerOptions: {
1542
1543
  runtimeModuleName: t,
1543
1544
  hoistStatic: !1
1544
1545
  } } }),
1545
- bn(e),
1546
- Fn(),
1547
- In(h)
1546
+ xn(e),
1547
+ In(),
1548
+ Ln(h)
1548
1549
  ]
1549
1550
  }), b;
1550
1551
  try {
1551
- b = await jn(r, n, An(v.environments.client.config.define), a);
1552
+ b = await Mn(r, n, jn(v.environments.client.config.define), a);
1552
1553
  } catch (e) {
1553
1554
  throw await v.close(), e;
1554
1555
  }
@@ -1560,8 +1561,8 @@ async function Ln(e, t, { entry: n, cwd: r, runtimeConfig: i, runtimePath: a, st
1560
1561
  }
1561
1562
  //#endregion
1562
1563
  //#region src/vite/watch.mts
1563
- async function Rn(e, t, { onBuild: n, onError: r, stdout: i = process.stdout, stderr: a = process.stderr, quiet: o = !1, ...s }) {
1564
- let { outDir: c } = s, l, u = await ue(Sn({
1564
+ async function zn(e, t, { onBuild: n, onError: r, stdout: i = process.stdout, stderr: a = process.stderr, quiet: o = !1, ...s }) {
1565
+ let { outDir: c } = s, l, u = await fe(Cn({
1565
1566
  core: e,
1566
1567
  runtimeModuleName: t,
1567
1568
  ...s,
@@ -1570,7 +1571,7 @@ async function Rn(e, t, { onBuild: n, onError: r, stdout: i = process.stdout, st
1570
1571
  stderr: a,
1571
1572
  quiet: o,
1572
1573
  onOutput: (e) => {
1573
- n(un(c, e, l)), l = void 0;
1574
+ n(dn(c, e, l)), l = void 0;
1574
1575
  }
1575
1576
  }));
1576
1577
  return u.on("change", (e) => {
@@ -1587,32 +1588,32 @@ async function Rn(e, t, { onBuild: n, onError: r, stdout: i = process.stdout, st
1587
1588
  }
1588
1589
  //#endregion
1589
1590
  //#region src/vite/createBundler.mts
1590
- function zn(e, t) {
1591
+ function Bn(e, t) {
1591
1592
  return {
1592
- watch: (n) => Rn(e, t, n),
1593
- build: (n) => Cn(e, t, n),
1594
- hmr: (n) => Ln(e, t, n)
1593
+ watch: (n) => zn(e, t, n),
1594
+ build: (n) => wn(e, t, n),
1595
+ hmr: (n) => Rn(e, t, n)
1595
1596
  };
1596
1597
  }
1597
1598
  //#endregion
1598
1599
  //#region src/defaultBundler.mts
1599
- var Bn = zn(ln, "incajs/vue/runtime"), Vn = [
1600
+ var Vn = Bn(un, "incajs/vue/runtime"), Hn = [
1600
1601
  "main.mts",
1601
1602
  "main.ts",
1602
1603
  "main.js"
1603
1604
  ];
1604
- async function Hn(e) {
1605
- let t = Vn.map((t) => y.join(e, "src", t)).find((e) => p(e));
1605
+ async function Un(e) {
1606
+ let t = Hn.map((t) => y.join(e, "src", t)).find((e) => p(e));
1606
1607
  if (t) return t;
1607
1608
  let n = y.join(e, "src/App.vue");
1608
- if (p(n)) return Un(n, e);
1609
- throw new Y("ERR_INCA_ENTRY_NOT_FOUND", `no app entry found. check that ${y.join(e, "src/main.ts")} or ${n} exists`);
1609
+ if (p(n)) return Wn(n, e);
1610
+ throw new K("ERR_INCA_ENTRY_NOT_FOUND", `no app entry found. check that ${y.join(e, "src/main.ts")} or ${n} exists`);
1610
1611
  }
1611
- async function Un(e, t) {
1612
+ async function Wn(e, t) {
1612
1613
  let n = y.join(t, "node_modules/.inca");
1613
- await E(n, { recursive: !0 });
1614
+ await T(n, { recursive: !0 });
1614
1615
  let r = y.join(n, "entry.mts"), i = JSON.stringify(e.split(y.sep).join("/"));
1615
- return await k(r, wn`
1616
+ return await O(r, Tn`
1616
1617
  import { createIncaApp } from "incajs/vue";
1617
1618
  import App from ${i};
1618
1619
  createIncaApp(App).mount();
@@ -1620,10 +1621,10 @@ async function Un(e, t) {
1620
1621
  }
1621
1622
  //#endregion
1622
1623
  //#region src/build.mts
1623
- async function Wn(e = {}) {
1624
- let t = e.cwd ?? process.cwd(), n = e.config ?? await zt(t), r = y.resolve(t, n.outDir), i = e.bundler ?? Bn, a = e.entry ?? n.entry ?? await Hn(t);
1625
- Ft(t, r, a);
1626
- let o = e.runtimeConfig ?? await Ht(t);
1624
+ async function Gn(e = {}) {
1625
+ let t = e.cwd ?? process.cwd(), n = e.config ?? await Ut(t), r = y.resolve(t, n.outDir), i = e.bundler ?? Vn, a = e.entry ?? n.entry ?? await Un(t);
1626
+ zt(t, r, a);
1627
+ let o = e.runtimeConfig ?? await Kt(t);
1627
1628
  return i.build({
1628
1629
  entry: a,
1629
1630
  outDir: r,
@@ -1635,79 +1636,79 @@ async function Wn(e = {}) {
1635
1636
  }
1636
1637
  //#endregion
1637
1638
  //#region src/devLock.mts
1638
- function Gn(e) {
1639
+ function Kn(e) {
1639
1640
  return y.join(e, "node_modules/.inca/dev.pid");
1640
1641
  }
1641
- function Kn(e) {
1642
+ function qn(e) {
1642
1643
  try {
1643
1644
  return process.kill(e, 0), !0;
1644
1645
  } catch (e) {
1645
1646
  return e.code === "EPERM";
1646
1647
  }
1647
1648
  }
1648
- var qn = me();
1649
- function Jn(e) {
1650
- return new Y("ERR_INCA_DEV_RUNNING", `inca dev is already running for this app (pid ${String(e)})`);
1649
+ var Jn = ge();
1650
+ function Yn(e) {
1651
+ return new K("ERR_INCA_DEV_RUNNING", `inca dev is already running for this app (pid ${String(e)})`);
1651
1652
  }
1652
- async function Yn(e) {
1653
- let t = Gn(e), n = `${String(process.pid)}:${qn}`, r = `${t}.${me()}`;
1654
- await E(y.dirname(t), { recursive: !0 }), await k(r, n);
1653
+ async function Xn(e) {
1654
+ let t = Kn(e), n = `${String(process.pid)}:${Jn}`, r = `${t}.${ge()}`;
1655
+ await T(y.dirname(t), { recursive: !0 }), await O(r, n);
1655
1656
  let i = process.pid;
1656
1657
  try {
1657
1658
  for (let e = 0; e < 5; e++) {
1658
1659
  try {
1659
- return await T(r, t), Xn(t, n);
1660
+ return await te(r, t), Zn(t, n);
1660
1661
  } catch (e) {
1661
1662
  if (e.code !== "EEXIST") throw e;
1662
1663
  }
1663
- let e = await D(t, "utf8").catch(() => ""), a = Number.parseInt(e, 10);
1664
+ let e = await E(t, "utf8").catch(() => ""), a = Number.parseInt(e, 10);
1664
1665
  if (a === process.pid) {
1665
- if (e === n) throw Jn(a);
1666
- } else if (Number.isSafeInteger(a) && a > 0 && Kn(a)) throw Jn(a);
1667
- i = Number.isSafeInteger(a) && a > 0 ? a : i, await O(t, { force: !0 });
1666
+ if (e === n) throw Yn(a);
1667
+ } else if (Number.isSafeInteger(a) && a > 0 && qn(a)) throw Yn(a);
1668
+ i = Number.isSafeInteger(a) && a > 0 ? a : i, await D(t, { force: !0 });
1668
1669
  }
1669
- throw Jn(i);
1670
+ throw Yn(i);
1670
1671
  } finally {
1671
- await O(r, { force: !0 });
1672
+ await D(r, { force: !0 });
1672
1673
  }
1673
1674
  }
1674
- function Xn(e, t) {
1675
+ function Zn(e, t) {
1675
1676
  let n = !1;
1676
1677
  return async () => {
1677
- n || (n = !0, await D(e, "utf8").catch(() => "") === t && await O(e, { force: !0 }));
1678
+ n || (n = !0, await E(e, "utf8").catch(() => "") === t && await D(e, { force: !0 }));
1678
1679
  };
1679
1680
  }
1680
1681
  //#endregion
1681
1682
  //#region src/plist.mts
1682
- function Zn(e) {
1683
- return e.replaceAll("&", "&amp;").replaceAll("<", "&lt;").replaceAll(">", "&gt;");
1684
- }
1685
1683
  function Qn(e) {
1686
- return typeof e == "boolean" ? e ? "<true/>" : "<false/>" : `<string>${Zn(e)}</string>`;
1684
+ return e.replaceAll("&", "&amp;").replaceAll("<", "&lt;").replaceAll(">", "&gt;");
1687
1685
  }
1688
1686
  function $n(e) {
1689
- return wn`
1687
+ return typeof e == "boolean" ? e ? "<true/>" : "<false/>" : `<string>${Qn(e)}</string>`;
1688
+ }
1689
+ function er(e) {
1690
+ return Tn`
1690
1691
  <?xml version="1.0" encoding="UTF-8"?>
1691
1692
  <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
1692
1693
  <plist version="1.0">
1693
1694
  <dict>
1694
- ${Object.entries(e).map(([e, t]) => `\t<key>${Zn(e)}</key>\n\t${Qn(t)}`).join("\n")}
1695
+ ${Object.entries(e).map(([e, t]) => `\t<key>${Qn(e)}</key>\n\t${$n(t)}`).join("\n")}
1695
1696
  </dict>
1696
1697
  </plist>
1697
1698
  `;
1698
1699
  }
1699
1700
  //#endregion
1700
1701
  //#region src/macosApp.mts
1701
- async function er(e) {
1702
+ async function tr(e) {
1702
1703
  let { appPath: t, metadata: n, hostBin: r } = e;
1703
- await O(t, {
1704
+ await D(t, {
1704
1705
  recursive: !0,
1705
1706
  force: !0
1706
1707
  });
1707
1708
  let i = y.join(t, "Contents"), a = y.join(i, "MacOS"), o = y.join(i, "Resources");
1708
- await E(a, { recursive: !0 }), await E(o, { recursive: !0 });
1709
+ await T(a, { recursive: !0 }), await T(o, { recursive: !0 });
1709
1710
  let s = y.join(a, n.productName);
1710
- e.link ? await T(r, s).catch(() => w(r, s)) : await w(r, s), await C(s, 493);
1711
+ e.link ? await te(r, s).catch(() => w(r, s)) : await w(r, s), await C(s, 493);
1711
1712
  let c = {
1712
1713
  CFBundleName: n.productName,
1713
1714
  CFBundleDisplayName: n.productName,
@@ -1723,7 +1724,7 @@ async function er(e) {
1723
1724
  let e = y.basename(n.icon);
1724
1725
  await w(n.icon, y.join(o, e)), c.CFBundleIconFile = e;
1725
1726
  }
1726
- return await k(y.join(i, "Info.plist"), $n(c)), await k(y.join(i, "PkgInfo"), "APPL????"), {
1727
+ return await O(y.join(i, "Info.plist"), er(c)), await O(y.join(i, "PkgInfo"), "APPL????"), {
1727
1728
  appPath: t,
1728
1729
  executablePath: s,
1729
1730
  resourcesDir: o
@@ -1731,8 +1732,8 @@ async function er(e) {
1731
1732
  }
1732
1733
  //#endregion
1733
1734
  //#region src/watchForEdit.mts
1734
- var tr = /^(?:inca\.config\.[a-z0-9]+|package\.json)$/, nr = [...Vn, "App.vue"];
1735
- function rr(e, t = {}) {
1735
+ var nr = /^(?:inca\.config\.[a-z0-9]+|package\.json)$/, rr = [...Hn, "App.vue"];
1736
+ function ir(e, t = {}) {
1736
1737
  let n = t.debounceMs ?? 100, r = /* @__PURE__ */ new Set(), i, a = !1, o = () => {}, s = new Promise((e) => {
1737
1738
  o = e;
1738
1739
  }), c = () => {
@@ -1753,7 +1754,7 @@ function rr(e, t = {}) {
1753
1754
  r.clear();
1754
1755
  };
1755
1756
  try {
1756
- l(e, (e) => e === "src" || tr.test(e)), l(y.join(e, "src"), (e) => nr.includes(e));
1757
+ l(e, (e) => e === "src" || nr.test(e)), l(y.join(e, "src"), (e) => rr.includes(e));
1757
1758
  } catch (e) {
1758
1759
  throw u(), e;
1759
1760
  }
@@ -1769,7 +1770,7 @@ function rr(e, t = {}) {
1769
1770
  }
1770
1771
  //#endregion
1771
1772
  //#region src/retryOnEdit.mts
1772
- function ir(e, t) {
1773
+ function ar(e, t) {
1773
1774
  return new Promise((n) => {
1774
1775
  let r = () => n(!1);
1775
1776
  t.addEventListener("abort", r, { once: !0 }), e.then(() => {
@@ -1777,25 +1778,25 @@ function ir(e, t) {
1777
1778
  });
1778
1779
  });
1779
1780
  }
1780
- async function ar(e) {
1781
+ async function or(e) {
1781
1782
  let { cwd: t, signal: n, stdout: r, stderr: i, debounceMs: a } = e, o = !1;
1782
1783
  for (;;) {
1783
- let s = rr(t, { debounceMs: a });
1784
+ let s = ir(t, { debounceMs: a });
1784
1785
  try {
1785
1786
  return await e.attempt(s);
1786
1787
  } catch (e) {
1787
- let t = e instanceof Y ? e.path : void 0;
1788
+ let t = e instanceof K ? e.path : void 0;
1788
1789
  if (t) try {
1789
1790
  s.add(t);
1790
1791
  } catch (t) {
1791
- throw $(i, "build failed", Q(e), X), t;
1792
+ throw $(i, "build failed", Q(e), Y), t;
1792
1793
  }
1793
1794
  if (!n.aborted && !o && t && p(t)) {
1794
1795
  o = !0;
1795
1796
  continue;
1796
1797
  }
1797
- if (o = !1, $(i, "build failed", Q(e), X), n.aborted || (Z(r, "waiting for a change to retry", X), !await ir(s.edited, n))) return;
1798
- Z(r, "retrying", X);
1798
+ if (o = !1, $(i, "build failed", Q(e), Y), n.aborted || (Z(r, "waiting for a change to retry", Y), !await ar(s.edited, n))) return;
1799
+ Z(r, "retrying", Y);
1799
1800
  } finally {
1800
1801
  s.close();
1801
1802
  }
@@ -1803,116 +1804,116 @@ async function ar(e) {
1803
1804
  }
1804
1805
  //#endregion
1805
1806
  //#region src/dev.mts
1806
- var or = 1e4, sr = ["ERR_INCA_PACKAGE_JSON_NOT_FOUND", "ERR_INCA_PRODUCT_NAME_MISSING"];
1807
- async function cr(e, t) {
1807
+ var sr = 1e4, cr = ["ERR_INCA_PACKAGE_JSON_NOT_FOUND", "ERR_INCA_PRODUCT_NAME_MISSING"];
1808
+ async function lr(e, t) {
1808
1809
  try {
1809
- return await Bt(e);
1810
+ return await Wt(e);
1810
1811
  } catch (e) {
1811
- if (!(e instanceof Y) || !sr.includes(e.code)) throw e;
1812
- Z(t, `running unnamed. ${e.message}`, X);
1812
+ if (!(e instanceof K) || !cr.includes(e.code)) throw e;
1813
+ Z(t, `running unnamed. ${e.message}`, Y);
1813
1814
  return;
1814
1815
  }
1815
1816
  }
1816
- async function lr(e, t, n, r) {
1817
+ async function ur(e, t, n, r) {
1817
1818
  if (process.platform === "darwin" && t) try {
1818
- return (await er({
1819
+ return (await tr({
1819
1820
  appPath: y.join(e, "node_modules/.inca", `${t.productName}.app`),
1820
1821
  metadata: t,
1821
1822
  hostBin: n,
1822
1823
  link: !0
1823
1824
  })).executablePath;
1824
1825
  } catch (e) {
1825
- Z(r, `running unbundled. ${Q(e).message}`, X);
1826
+ Z(r, `running unbundled. ${Q(e).message}`, Y);
1826
1827
  return;
1827
1828
  }
1828
1829
  }
1829
- async function ur(e, t) {
1830
+ async function dr(e, t) {
1830
1831
  let n = new Set(t), r;
1831
1832
  try {
1832
- r = await te(e, {
1833
+ r = await ne(e, {
1833
1834
  recursive: !0,
1834
1835
  withFileTypes: !0
1835
1836
  });
1836
1837
  } catch {
1837
1838
  return;
1838
1839
  }
1839
- await Promise.all(r.filter((e) => e.isFile()).map((t) => y.relative(e, y.join(t.parentPath, t.name))).filter((e) => !n.has(e)).map((t) => O(y.join(e, t), { force: !0 })));
1840
+ await Promise.all(r.filter((e) => e.isFile()).map((t) => y.relative(e, y.join(t.parentPath, t.name))).filter((e) => !n.has(e)).map((t) => D(y.join(e, t), { force: !0 })));
1840
1841
  }
1841
- function dr(e) {
1842
+ function fr(e) {
1842
1843
  let { NO_COLOR: t, FORCE_COLOR: n } = process.env;
1843
1844
  if (!(!e.isTTY || t || n)) return {
1844
1845
  ...process.env,
1845
1846
  FORCE_COLOR: "1"
1846
1847
  };
1847
1848
  }
1848
- async function fr(e) {
1849
- let t = e.cwd ?? process.cwd(), n = await Yn(t);
1849
+ async function pr(e) {
1850
+ let t = e.cwd ?? process.cwd(), n = await Xn(t);
1850
1851
  try {
1851
- let n = e.hostBin ?? Kt();
1852
- qt(n);
1853
- let r = e.bundler ?? Bn, i = e.stdout ?? process.stdout, a = e.stderr ?? process.stderr, o = e.experimentalHmr ? r.hmr?.bind(r) : void 0;
1854
- if (e.experimentalHmr && !o) throw new Y("ERR_INCA_HMR_UNSUPPORTED", "--experimental-hmr was set, but the configured bundler has no HMR support");
1855
- let s = await ar({
1852
+ let n = e.hostBin ?? q();
1853
+ J(n);
1854
+ let r = e.bundler ?? Vn, i = e.stdout ?? process.stdout, a = e.stderr ?? process.stderr, o = e.experimentalHmr ? r.hmr?.bind(r) : void 0;
1855
+ if (e.experimentalHmr && !o) throw new K("ERR_INCA_HMR_UNSUPPORTED", "--experimental-hmr was set, but the configured bundler has no HMR support");
1856
+ let s = await or({
1856
1857
  cwd: t,
1857
1858
  signal: e.signal,
1858
1859
  stdout: i,
1859
1860
  stderr: a,
1860
1861
  async attempt() {
1861
- let n = await zt(t), r = y.resolve(t, n.outDir), a = e.entry ?? n.entry ?? await Hn(t);
1862
- Ft(t, r, a);
1863
- let o = await cr(t, i);
1862
+ let n = await Ut(t), r = y.resolve(t, n.outDir), a = e.entry ?? n.entry ?? await Un(t);
1863
+ zt(t, r, a);
1864
+ let o = await lr(t, i);
1864
1865
  return {
1865
1866
  outDir: r,
1866
1867
  entry: a,
1867
1868
  metadata: o,
1868
- runtimeConfig: o ? Vt(o) : await Ht(t)
1869
+ runtimeConfig: o ? Gt(o) : await Kt(t)
1869
1870
  };
1870
1871
  }
1871
1872
  });
1872
1873
  if (!s) return;
1873
- let { outDir: c, entry: l, metadata: u, runtimeConfig: d } = s, f = await lr(t, u, n, i) ?? n, p, m = !1, h = !1, g = !1, _, v = Promise.resolve(), b = () => {}, ee = new Promise((e) => {
1874
+ let { outDir: c, entry: l, metadata: u, runtimeConfig: d } = s, f = await ur(t, u, n, i) ?? n, p, m = !1, h = !1, g = !1, _, v = Promise.resolve(), b = () => {}, ee = new Promise((e) => {
1874
1875
  b = e;
1875
1876
  });
1876
1877
  async function x() {
1877
1878
  try {
1878
- return await p?.call("reload", void 0, or), !0;
1879
+ return await p?.call("reload", void 0, sr), !0;
1879
1880
  } catch (e) {
1880
- return $(a, "reload failed", Q(e), X), !1;
1881
+ return $(a, "reload failed", Q(e), Y), !1;
1881
1882
  }
1882
1883
  }
1883
- async function C(e, t) {
1884
- let n = new Qt({
1884
+ function C(e) {
1885
+ if (!e) return;
1886
+ let n = S("dim", y.relative(t, e.file), { stream: i }), r = Date.now() - e.at;
1887
+ Z(i, `${S("green", "reload")} ${n} (${r}ms)`, Y);
1888
+ }
1889
+ async function w(e, t) {
1890
+ let n = new en({
1885
1891
  entryFile: e,
1886
1892
  hostBin: f,
1887
- env: dr(a),
1893
+ env: fr(a),
1888
1894
  onStderr: (e) => a.write(e),
1889
1895
  onReady: () => {
1890
- m = !0, Z(i, "ready", X), h && (h = !1, x());
1896
+ m = !0, Z(i, "ready", Y), h && (h = !1, x());
1891
1897
  },
1892
- onAppError: (e) => $(a, "app error", e, X),
1898
+ onAppError: (e) => $(a, "app error", e, Y),
1893
1899
  onExit: (e, t) => {
1894
1900
  g = !m, _ = {
1895
1901
  code: e,
1896
1902
  signal: t
1897
- }, Z(i, "host exited. stopping", X), b();
1903
+ }, Z(i, "host exited. stopping", Y), b();
1898
1904
  },
1899
1905
  integrations: t
1900
1906
  });
1901
1907
  try {
1902
1908
  await n.start();
1903
1909
  } catch (e) {
1904
- $(a, "failed to start the host", Q(e), X);
1910
+ $(a, "failed to start the host", Q(e), Y);
1905
1911
  return;
1906
1912
  }
1907
1913
  p = n;
1908
1914
  }
1909
- async function w(e) {
1910
- if (await ur(e.outDir, e.files), !p) await C(e.entryFile);
1911
- else if (!m) h = !0;
1912
- else if (await x() && e.changed) {
1913
- let n = S("dim", y.relative(t, e.changed.file), { stream: i }), r = Date.now() - e.changed.at;
1914
- Z(i, `${S("green", "reload")} ${n} (${r}ms)`, X);
1915
- }
1915
+ async function te(e) {
1916
+ await dr(e.outDir, e.files), p ? m ? await x() && C(e.changed) : h = !0 : await w(e.entryFile);
1916
1917
  }
1917
1918
  let T;
1918
1919
  if (o) {
@@ -1923,17 +1924,19 @@ async function fr(e) {
1923
1924
  stdout: i,
1924
1925
  stderr: a,
1925
1926
  notify: (e) => p?.notify("vite", e),
1926
- reload: () => {
1927
- m ? x() : h = !0;
1927
+ reload: (e) => {
1928
+ m ? x().then((t) => {
1929
+ t && C(e);
1930
+ }) : h = !0;
1928
1931
  },
1929
- onError: (e) => $(a, "build failed", e, X),
1932
+ onError: (e) => $(a, "build failed", e, Y),
1930
1933
  onUpdate: ({ file: e, took: n }) => {
1931
1934
  if (!m) return;
1932
1935
  let r = S("dim", y.relative(t, e), { stream: i });
1933
- Z(i, `${S("green", "update")} ${r} (${n}ms)`, X);
1936
+ Z(i, `${S("green", "update")} ${r} (${n}ms)`, Y);
1934
1937
  }
1935
1938
  });
1936
- await C(e.entryFile, { vite: (t) => e.dispatch(t) }), T = e, p || b();
1939
+ await w(e.entryFile, { vite: (t) => e.dispatch(t) }), T = e, p || b();
1937
1940
  } else T = await r.watch({
1938
1941
  entry: l,
1939
1942
  outDir: c,
@@ -1942,16 +1945,16 @@ async function fr(e) {
1942
1945
  stdout: i,
1943
1946
  stderr: a,
1944
1947
  onBuild: (e) => {
1945
- v = v.then(() => w(e));
1948
+ v = v.then(() => te(e));
1946
1949
  },
1947
1950
  onError: (e) => {
1948
- $(a, "build failed", e, X);
1951
+ $(a, "build failed", e, Y);
1949
1952
  }
1950
1953
  });
1951
- if (e.signal.aborted ? b() : e.signal.addEventListener("abort", () => b(), { once: !0 }), await ee, await v, await p?.stop(), await T.close(), g) throw new Y("ERR_INCA_HOST_EXITED_EARLY", "the host exited before it was ready");
1954
+ if (e.signal.aborted ? b() : e.signal.addEventListener("abort", () => b(), { once: !0 }), await ee, await v, await p?.stop(), await T.close(), g) throw new K("ERR_INCA_HOST_EXITED_EARLY", "the host exited before it was ready");
1952
1955
  if (_ && _.code !== 0 && _.signal !== "SIGINT" && _.signal !== "SIGTERM") {
1953
1956
  let { code: e, signal: t } = _;
1954
- throw new Y("ERR_INCA_HOST_CRASHED", `the host exited with ${t ? `signal ${t}` : `code ${e}`}`);
1957
+ throw new K("ERR_INCA_HOST_CRASHED", `the host exited with ${t ? `signal ${t}` : `code ${e}`}`);
1955
1958
  }
1956
1959
  } finally {
1957
1960
  await n();
@@ -1959,72 +1962,116 @@ async function fr(e) {
1959
1962
  }
1960
1963
  //#endregion
1961
1964
  //#region src/package.mts
1962
- function pr() {
1965
+ function mr() {
1963
1966
  if (process.platform === "darwin") return "macos";
1964
1967
  if (process.platform === "linux") return "linux";
1965
- throw new Y("ERR_INCA_PLATFORM_UNSUPPORTED", `inca package doesn't support ${process.platform} yet`);
1968
+ throw new K("ERR_INCA_PLATFORM_UNSUPPORTED", `inca package doesn't support ${process.platform} yet`);
1966
1969
  }
1967
- async function mr(e, t) {
1970
+ async function hr(e, t) {
1968
1971
  await Promise.all(e.files.map(async (n) => {
1969
1972
  let r = y.join(t, n);
1970
- await E(y.dirname(r), { recursive: !0 }), await w(y.join(e.outDir, n), r);
1973
+ await T(y.dirname(r), { recursive: !0 }), await w(y.join(e.outDir, n), r);
1971
1974
  }));
1972
1975
  }
1973
- function hr(e, t) {
1976
+ function gr(e, t) {
1974
1977
  let n = e.files.map((e) => e.split("/")[0] ?? e).find((e) => e.toLowerCase() === t.toLowerCase());
1975
- if (n !== void 0) throw new Y("ERR_INCA_PRODUCT_NAME_INVALID", `the packaged app's directory "${t}" collides with "${n}" in the build output. Set a different "productName" in inca.config.ts`);
1978
+ if (n !== void 0) throw new K("ERR_INCA_PRODUCT_NAME_INVALID", `the packaged app's directory "${t}" collides with "${n}" in the build output. Set a different "productName" in inca.config.ts`);
1976
1979
  }
1977
- async function gr({ metadata: e, output: t, hostBin: n }) {
1978
- let { appPath: r, resourcesDir: i } = await er({
1980
+ async function _r({ metadata: e, output: t, hostBin: n }) {
1981
+ let { appPath: r, resourcesDir: i } = await tr({
1979
1982
  appPath: y.join(t.outDir, `${e.productName}.app`),
1980
1983
  metadata: e,
1981
1984
  hostBin: n
1982
1985
  });
1983
- return await mr(t, i), r;
1986
+ return await hr(t, i), r;
1984
1987
  }
1985
- async function _r({ metadata: e, output: t, hostBin: n }) {
1988
+ async function vr({ metadata: e, output: t, hostBin: n }) {
1986
1989
  let r = c(e.productName);
1987
- hr(t, r);
1990
+ gr(t, r);
1988
1991
  let i = y.join(t.outDir, r);
1989
- await O(i, {
1992
+ await D(i, {
1990
1993
  recursive: !0,
1991
1994
  force: !0
1992
- }), await E(i, { recursive: !0 });
1995
+ }), await T(i, { recursive: !0 });
1993
1996
  let a = y.join(i, r);
1994
- return await w(n, a), await C(a, 493), await mr(t, i), i;
1997
+ return await w(n, a), await C(a, 493), await hr(t, i), i;
1995
1998
  }
1996
- async function vr(e = {}) {
1997
- let t = e.cwd ?? process.cwd(), n = e.stdout ?? process.stdout, r = e.target ?? pr(), i = await Bt(t);
1999
+ async function yr(e = {}) {
2000
+ let t = e.cwd ?? process.cwd(), n = e.stdout ?? process.stdout, r = e.target ?? mr(), i = await Wt(t);
1998
2001
  i.usedPackageJsonKey && Z(n, "the \"inca\" key in package.json is deprecated. move these settings to inca.config.ts"), i.identifierIsDefault && Z(n, `no "identifier" set in inca.config.ts. using generated identifier ${i.identifier}`);
1999
- let a = await Wn({
2002
+ let a = await Gn({
2000
2003
  cwd: t,
2001
2004
  entry: e.entry,
2002
2005
  config: i,
2003
2006
  sourcemap: e.sourcemap,
2004
- runtimeConfig: Vt(i),
2007
+ runtimeConfig: Gt(i),
2005
2008
  bundler: e.bundler,
2006
2009
  stdout: n,
2007
2010
  stderr: e.stderr
2008
- }), o = e.hostBin ?? Kt();
2009
- qt(o);
2011
+ }), o = e.hostBin ?? q();
2012
+ J(o);
2010
2013
  let s = {
2011
2014
  metadata: i,
2012
2015
  output: a,
2013
2016
  hostBin: o
2014
2017
  };
2015
- return { appPath: r === "macos" ? await gr(s) : await _r(s) };
2018
+ return { appPath: r === "macos" ? await _r(s) : await vr(s) };
2019
+ }
2020
+ //#endregion
2021
+ //#region src/printConfig.mts
2022
+ var br = {
2023
+ productName: "a string",
2024
+ identifier: "a string",
2025
+ window: "an object",
2026
+ "window.width": "a number",
2027
+ "window.height": "a number",
2028
+ "window.title": "a string",
2029
+ "window.resizable": "true or false",
2030
+ "window.minWidth": "a number",
2031
+ "window.minHeight": "a number"
2032
+ };
2033
+ function xr(e) {
2034
+ return typeof e == "number" ? "a number" : typeof e == "string" ? "a string" : typeof e == "boolean" ? "true or false" : "an object";
2035
+ }
2036
+ function Sr(e, t, n) {
2037
+ let r = `failed to read ${t}: `, i = e.split("\n")[0] ?? "";
2038
+ if (!i.startsWith(r)) return;
2039
+ let a = i.slice(r.length), o = a.indexOf("]: "), s;
2040
+ try {
2041
+ s = JSON.parse(a.slice(0, o + 1));
2042
+ } catch {
2043
+ return;
2044
+ }
2045
+ if (!Array.isArray(s)) return;
2046
+ let [c, ...l] = s, u = [c === "name" ? "productName" : c, ...l].join("."), d = br[u];
2047
+ if (!d) return;
2048
+ let f = s.reduce((e, t) => e?.[t], n), p = xr(f) === d ? "the host can't use it" : `it must be ${d}`;
2049
+ return new K("ERR_INCA_CONFIG_INVALID", `${u} in inca.config.ts is ${JSON.stringify(f)}. ${p}`);
2050
+ }
2051
+ async function Cr(e = {}) {
2052
+ let t = e.cwd ?? process.cwd(), n = e.hostBin ?? q();
2053
+ J(n);
2054
+ let r = await Kt(t) ?? {}, i = y.join(t, "node_modules/.inca/config"), a = y.join(i, "bundle.js"), o = y.join(i, "inca.json");
2055
+ await T(i, { recursive: !0 }), await O(a, ""), await O(o, JSON.stringify(r, void 0, 2));
2056
+ let s = ce(n, ["--print-config", a], { encoding: "utf8" });
2057
+ if (s.error) throw s.error;
2058
+ if (s.status !== 0) {
2059
+ let e = Sr(s.stderr, o, r);
2060
+ if (e) throw e;
2061
+ }
2062
+ return (e.stdout ?? process.stdout).write(s.stdout), (e.stderr ?? process.stderr).write(s.stderr), s.status ?? 1;
2016
2063
  }
2017
2064
  //#endregion
2018
2065
  //#region src/cli.mts
2019
- function yr(e) {
2066
+ function wr(e) {
2020
2067
  return y.relative(process.cwd(), e);
2021
2068
  }
2022
- var br = {
2069
+ var Tr = {
2023
2070
  type: "boolean",
2024
2071
  description: "Write a source map",
2025
2072
  negativeDescription: "Skip the source map"
2026
2073
  };
2027
- function xr() {
2074
+ function Er() {
2028
2075
  for (let e of [
2029
2076
  0,
2030
2077
  1,
@@ -2033,35 +2080,47 @@ function xr() {
2033
2080
  f.closeSync(e);
2034
2081
  } catch {}
2035
2082
  }
2036
- var Sr = B({
2083
+ var Dr = V({
2037
2084
  meta: {
2038
2085
  name: "build",
2039
2086
  description: "Bundle the app into dist"
2040
2087
  },
2041
- args: { sourcemap: br },
2088
+ args: { sourcemap: Tr },
2042
2089
  async run({ args: e }) {
2043
2090
  try {
2044
- let t = await Wn({ sourcemap: e.sourcemap });
2045
- Z(process.stdout, `built ${yr(t.entryFile)}`);
2091
+ let t = await Gn({ sourcemap: e.sourcemap });
2092
+ Z(process.stdout, `built ${wr(t.entryFile)}`);
2046
2093
  } catch (e) {
2047
2094
  $(process.stderr, "build failed", Q(e)), process.exitCode = 1;
2048
2095
  }
2049
2096
  }
2050
- }), Cr = B({
2097
+ }), Or = V({
2051
2098
  meta: {
2052
2099
  name: "package",
2053
2100
  description: "Package the app as an application bundle"
2054
2101
  },
2055
- args: { sourcemap: br },
2102
+ args: { sourcemap: Tr },
2056
2103
  async run({ args: e }) {
2057
2104
  try {
2058
- let { appPath: t } = await vr({ sourcemap: e.sourcemap });
2059
- Z(process.stdout, `packaged ${yr(t)}`);
2105
+ let { appPath: t } = await yr({ sourcemap: e.sourcemap });
2106
+ Z(process.stdout, `packaged ${wr(t)}`);
2060
2107
  } catch (e) {
2061
2108
  $(process.stderr, "package failed", Q(e)), process.exitCode = 1;
2062
2109
  }
2063
2110
  }
2064
- }), wr = B({
2111
+ }), kr = V({
2112
+ meta: {
2113
+ name: "config",
2114
+ description: "Print the settings the host applies to the app"
2115
+ },
2116
+ async run() {
2117
+ try {
2118
+ process.exitCode = await Cr();
2119
+ } catch (e) {
2120
+ $(process.stderr, "config failed", Q(e)), process.exitCode = 1;
2121
+ }
2122
+ }
2123
+ }), Ar = V({
2065
2124
  meta: {
2066
2125
  name: "dev",
2067
2126
  description: "Run the app in a development window"
@@ -2071,7 +2130,7 @@ var Sr = B({
2071
2130
  description: "Apply edits without a reload (or set INCA_EXPERIMENTAL_HMR)"
2072
2131
  } },
2073
2132
  async run({ args: e }) {
2074
- "sourcemap" in e && nn(process.stderr, "dev ignores --sourcemap and --no-sourcemap", { timestamp: !0 });
2133
+ "sourcemap" in e && rn(process.stderr, "dev ignores --sourcemap and --no-sourcemap", { timestamp: !0 });
2075
2134
  let t = new AbortController(), n = () => {
2076
2135
  t.signal.aborted || (Z(process.stderr, "shutting down", { timestamp: !0 }), t.abort());
2077
2136
  };
@@ -2083,28 +2142,29 @@ var Sr = B({
2083
2142
  ].includes(process.env.INCA_EXPERIMENTAL_HMR ?? "");
2084
2143
  r && Z(process.stdout, "experimental HMR active", { timestamp: !0 });
2085
2144
  try {
2086
- await fr({
2145
+ await pr({
2087
2146
  signal: t.signal,
2088
2147
  experimentalHmr: r
2089
- }), t.signal.aborted && xr();
2148
+ }), t.signal.aborted && Er();
2090
2149
  } catch (e) {
2091
2150
  $(process.stderr, "dev failed", Q(e), { timestamp: !0 }), process.exitCode = 1;
2092
2151
  }
2093
2152
  }
2094
- }), Tr = B({
2153
+ }), jr = V({
2095
2154
  meta: {
2096
2155
  name: "inca",
2097
- version: ze,
2098
- description: Be
2156
+ version: Ue,
2157
+ description: We
2099
2158
  },
2100
2159
  subCommands: {
2101
- dev: wr,
2102
- build: Sr,
2103
- package: Cr
2160
+ dev: Ar,
2161
+ build: Dr,
2162
+ package: Or,
2163
+ config: kr
2104
2164
  }
2105
2165
  });
2106
- async function Er(e = process.argv) {
2107
- await Ie(Tr, { rawArgs: e.slice(2) });
2166
+ async function Mr(e = process.argv) {
2167
+ await Be(jr, { rawArgs: e.slice(2) });
2108
2168
  }
2109
2169
  //#endregion
2110
- export { Er as run };
2170
+ export { Mr as run };