@incajs/cli 0.0.17 → 0.0.19

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 A } from "node:os";
11
- import { createRequire as ie } from "node:module";
12
- import { spawn as ae } from "node:child_process";
13
- import { once as j } from "node:events";
14
- import oe from "node:readline";
15
- import { setTimeout as se } from "node:timers/promises";
16
- import { DevEnvironment as ce, build as le, buildErrorMessage as ue, createServer as de } from "vite";
17
- import fe from "@vitejs/plugin-vue";
18
- import { randomUUID as pe } 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 k } 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";
19
19
  //#region ../../node_modules/.pnpm/citty@0.2.2/node_modules/citty/dist/_chunks/libs/scule.mjs
20
- var me = /\d/, he = [
20
+ var he = /\d/, ge = [
21
21
  "-",
22
22
  "_",
23
23
  "/",
24
24
  "."
25
25
  ];
26
- function ge(e = "") {
27
- if (!me.test(e)) return e !== e.toLowerCase();
26
+ function _e(e = "") {
27
+ if (!he.test(e)) return e !== e.toLowerCase();
28
28
  }
29
- function _e(e, t) {
30
- let n = t ?? he, r = [];
29
+ function ve(e, t) {
30
+ let n = t ?? ge, 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 _e(e, t) {
36
36
  r.push(i), i = "", a = void 0;
37
37
  continue;
38
38
  }
39
- let s = ge(t);
39
+ let s = _e(t);
40
40
  if (o === !1) {
41
41
  if (a === !1 && s === !0) {
42
42
  r.push(i), i = t, a = s;
@@ -52,44 +52,44 @@ function _e(e, t) {
52
52
  }
53
53
  return r.push(i), r;
54
54
  }
55
- function ve(e) {
55
+ function ye(e) {
56
56
  return e ? e[0].toUpperCase() + e.slice(1) : "";
57
57
  }
58
- function ye(e) {
58
+ function be(e) {
59
59
  return e ? e[0].toLowerCase() + e.slice(1) : "";
60
60
  }
61
- function be(e, t) {
62
- return e ? (Array.isArray(e) ? e : _e(e)).map((e) => ve(t?.normalize ? e.toLowerCase() : e)).join("") : "";
61
+ function xe(e, t) {
62
+ return e ? (Array.isArray(e) ? e : ve(e)).map((e) => ye(t?.normalize ? e.toLowerCase() : e)).join("") : "";
63
63
  }
64
- function M(e, t) {
65
- return ye(be(e || "", t));
64
+ function j(e, t) {
65
+ return be(xe(e || "", t));
66
66
  }
67
- function xe(e, t) {
68
- return e ? (Array.isArray(e) ? e : _e(e)).map((e) => e.toLowerCase()).join(t ?? "-") : "";
67
+ function Se(e, t) {
68
+ return e ? (Array.isArray(e) ? e : ve(e)).map((e) => e.toLowerCase()).join(t ?? "-") : "";
69
69
  }
70
- function Se(e) {
71
- return xe(e || "", "_");
70
+ function Ce(e) {
71
+ return Se(e || "", "_");
72
72
  }
73
73
  //#endregion
74
74
  //#region ../../node_modules/.pnpm/citty@0.2.2/node_modules/citty/dist/index.mjs
75
- function N(e) {
75
+ function M(e) {
76
76
  return Array.isArray(e) ? e : e === void 0 ? [] : [e];
77
77
  }
78
- function Ce(e, t = "") {
78
+ function we(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 P(e) {
83
+ function N(e) {
84
84
  return typeof e == "function" ? e() : e;
85
85
  }
86
- var F = class extends Error {
86
+ var P = class extends Error {
87
87
  code;
88
88
  constructor(e, t) {
89
89
  super(e), this.name = "CLIError", this.code = t;
90
90
  }
91
91
  };
92
- function we(e = [], t = {}) {
92
+ function Te(e = [], t = {}) {
93
93
  let n = new Set(t.boolean || []), r = new Set(t.string || []), i = t.alias || {}, a = t.default || {}, o = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map();
94
94
  for (let [e, t] of Object.entries(i)) {
95
95
  let n = t;
@@ -162,80 +162,80 @@ function we(e = [], t = {}) {
162
162
  for (let [e, t] of o.entries()) h[e] !== void 0 && h[t] === void 0 && (h[t] = h[e]), h[t] !== void 0 && h[e] === void 0 && (h[e] = h[t]), h[e] !== h[t] && a[t] === h[t] && (h[t] = h[e]);
163
163
  return h;
164
164
  }
165
- var Te = /* @__PURE__ */ (() => {
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
- })(), I = (e, t = 39) => (n) => Te ? 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
- function Ee(e, t) {
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);
169
+ function De(e, t) {
170
170
  let n = {
171
171
  boolean: [],
172
172
  string: [],
173
173
  alias: {},
174
174
  default: {}
175
- }, r = De(t);
175
+ }, r = Oe(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 = M(e.name), r = xe(e.name);
179
+ let t = j(e.name), r = Se(e.name);
180
180
  if (t !== e.name || r !== e.name) {
181
- let i = N(n.alias[e.name] || []);
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
- let i = we(e, n), [ ...a] = i._, o = new Proxy(i, { get(e, t) {
186
- return e[t] ?? e[M(t)] ?? e[xe(t)];
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)];
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 F(`Missing required positional argument: ${e.name.toUpperCase()}`, "EARG");
191
+ else if (e.default === void 0 && e.required !== !1) throw new P(`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 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");
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");
197
197
  return o;
198
198
  }
199
- function De(e) {
199
+ function Oe(e) {
200
200
  let t = [];
201
201
  for (let [n, r] of Object.entries(e || {})) t.push({
202
202
  ...r,
203
203
  name: n,
204
- alias: N(r.alias)
204
+ alias: M(r.alias)
205
205
  });
206
206
  return t;
207
207
  }
208
- async function Oe(e) {
209
- return Promise.all(e.map((e) => P(e)));
208
+ async function ke(e) {
209
+ return Promise.all(e.map((e) => N(e)));
210
210
  }
211
- function V(e) {
211
+ function B(e) {
212
212
  return e;
213
213
  }
214
- async function H(e, t) {
215
- let n = await P(e.args || {}), r = Ee(t.rawArgs, n), i = {
214
+ async function V(e, t) {
215
+ let n = await N(e.args || {}), r = De(t.rawArgs, n), i = {
216
216
  rawArgs: t.rawArgs,
217
217
  args: r,
218
218
  data: t.data,
219
219
  cmd: e
220
- }, a = await Oe(e.plugins ?? []), o, s;
220
+ }, a = await ke(e.plugins ?? []), o, s;
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 P(e.subCommands);
224
+ let r = await N(e.subCommands);
225
225
  if (r && Object.keys(r).length > 0) {
226
- let i = ke(t.rawArgs, n), a = t.rawArgs[i];
226
+ let i = Ae(t.rawArgs, n), a = t.rawArgs[i];
227
227
  if (a) {
228
- let e = await W(r, a);
229
- if (!e) throw new F(`Unknown command ${R(a)}`, "E_UNKNOWN_COMMAND");
230
- await H(e, { rawArgs: t.rawArgs.slice(i + 1) });
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) });
231
231
  } else {
232
- let n = await P(e.default);
232
+ let n = await N(e.default);
233
233
  if (n) {
234
- if (e.run) throw new F("Cannot specify both 'run' and 'default' on the same command.", "E_DEFAULT_CONFLICT");
235
- let i = await W(r, n);
236
- if (!i) throw new F(`Default sub command ${R(n)} not found in subCommands.`, "E_UNKNOWN_COMMAND");
237
- await H(i, { rawArgs: t.rawArgs });
238
- } else if (!e.run) throw new F("No command specified.", "E_NO_COMMAND");
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");
239
239
  }
240
240
  }
241
241
  typeof e.run == "function" && (o = await e.run(i));
@@ -258,138 +258,138 @@ async function H(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 U(e, t, n) {
262
- let r = await P(e.subCommands);
261
+ async function H(e, t, n) {
262
+ let r = await N(e.subCommands);
263
263
  if (r && Object.keys(r).length > 0) {
264
- let n = ke(t, await P(e.args || {})), i = t[n], a = await W(r, i);
265
- if (a) return U(a, t.slice(n + 1), e);
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);
266
266
  }
267
267
  return [e, n];
268
268
  }
269
- async function W(e, t) {
270
- if (t in e) return P(e[t]);
269
+ async function U(e, t) {
270
+ if (t in e) return N(e[t]);
271
271
  for (let n of Object.values(e)) {
272
- let e = await P(n), r = await P(e?.meta);
273
- if (r?.alias && N(r.alias).includes(t)) return e;
272
+ let e = await N(n), r = await N(e?.meta);
273
+ if (r?.alias && M(r.alias).includes(t)) return e;
274
274
  }
275
275
  }
276
- function ke(e, t) {
276
+ function Ae(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("=") && Ae(r, t) && n++;
280
+ if (r.startsWith("-")) !r.includes("=") && je(r, t) && n++;
281
281
  else return n;
282
282
  }
283
283
  return -1;
284
284
  }
285
- function Ae(e, t) {
286
- let n = e.replace(/^-{1,2}/, ""), r = M(n);
287
- for (let [e, i] of Object.entries(t)) if ((i.type === "string" || i.type === "enum") && (r === M(e) || (Array.isArray(i.alias) ? i.alias : i.alias ? [i.alias] : []).includes(n))) return !0;
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;
288
288
  return !1;
289
289
  }
290
- async function je(e, t) {
290
+ async function Me(e, t) {
291
291
  try {
292
- console.log(await Ne(e, t) + "\n");
292
+ console.log(await Pe(e, t) + "\n");
293
293
  } catch (e) {
294
294
  console.error(e);
295
295
  }
296
296
  }
297
- var Me = /^no[-A-Z]/;
298
- async function Ne(e, t) {
299
- let n = await P(e.meta || {}), r = De(await P(e.args || {})), i = await P(t?.meta || {}), a = `${i.name ? `${i.name} ` : ""}` + (n.name || process.argv[1]), o = [], s = [], c = [], l = [];
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 = [];
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([R(t + G(e)), Pe(e, n)]), l.push(n ? `<${t}>` : `[${t}]`);
302
+ s.push([L(t + W(e)), Fe(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(", ") + G(e);
305
- if (o.push([R(n), Pe(e, t)]), e.type === "boolean" && (e.default === !0 || e.negativeDescription) && !Me.test(e.name)) {
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)) {
306
306
  let n = [...(e.alias || []).map((e) => `--no-${e}`), `--no-${e.name}`].join(", ");
307
- o.push([R(n), [e.negativeDescription, t ? z("(Required)") : ""].filter(Boolean).join(" ")]);
307
+ o.push([L(n), [e.negativeDescription, t ? R("(Required)") : ""].filter(Boolean).join(" ")]);
308
308
  }
309
- t && l.push(`--${e.name}` + G(e));
309
+ t && l.push(`--${e.name}` + W(e));
310
310
  }
311
311
  if (e.subCommands) {
312
- let t = [], n = await P(e.subCommands);
312
+ let t = [], n = await N(e.subCommands);
313
313
  for (let [e, r] of Object.entries(n)) {
314
- let n = await P((await P(r))?.meta);
314
+ let n = await N((await N(r))?.meta);
315
315
  if (n?.hidden) continue;
316
- let i = N(n?.alias), a = [e, ...i].join(", ");
317
- c.push([R(a), n?.description || ""]), t.push(e, ...i);
316
+ let i = M(n?.alias), a = [e, ...i].join(", ");
317
+ c.push([L(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(z(`${n.description} (${a + (d ? ` v${d}` : "")})`), "");
322
+ u.push(R(`${n.description} (${a + (d ? ` v${d}` : "")})`), "");
323
323
  let f = o.length > 0 || s.length > 0;
324
- return u.push(`${B(L("USAGE"))} ${R(`${a}${f ? " [OPTIONS]" : ""} ${l.join(" ")}`)}`, ""), s.length > 0 && (u.push(B(L("ARGUMENTS")), ""), u.push(Ce(s, " ")), u.push("")), o.length > 0 && (u.push(B(L("OPTIONS")), ""), u.push(Ce(o, " ")), u.push("")), c.length > 0 && (u.push(B(L("COMMANDS")), ""), u.push(Ce(c, " ")), u.push("", `Use ${R(`${a} <command> --help`)} for more information about a command.`)), u.filter((e) => typeof e == "string").join("\n");
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");
325
325
  }
326
- function G(e) {
327
- let t = e.valueHint ? `=<${e.valueHint}>` : "", n = t || `=<${Se(e.name)}>`;
326
+ function W(e) {
327
+ let t = e.valueHint ? `=<${e.valueHint}>` : "", n = t || `=<${Ce(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 Pe(e, t) {
331
- let n = t ? z("(Required)") : "", r = e.default === void 0 ? "" : z(`(Default: ${e.default})`);
330
+ function Fe(e, t) {
331
+ let n = t ? R("(Required)") : "", r = e.default === void 0 ? "" : R(`(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 Fe(e, t = {}) {
339
- let n = t.rawArgs || process.argv.slice(2), r = t.showUsage || je;
338
+ async function Ie(e, t = {}) {
339
+ let n = t.rawArgs || process.argv.slice(2), r = t.showUsage || Me;
340
340
  try {
341
- let t = await Ie(e);
342
- if (t.help.length > 0 && n.some((e) => t.help.includes(e))) await r(...await U(e, n)), process.exit(0);
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);
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 F("No version specified", "E_NO_VERSION");
345
+ if (!t?.version) throw new P("No version specified", "E_NO_VERSION");
346
346
  console.log(t.version);
347
- } else await H(e, { rawArgs: n });
347
+ } else await V(e, { rawArgs: n });
348
348
  } catch (t) {
349
- t instanceof F ? (await r(...await U(e, n)), console.error(t.message)) : console.error(t, "\n"), process.exit(1);
349
+ t instanceof P ? (await r(...await H(e, n)), console.error(t.message)) : console.error(t, "\n"), process.exit(1);
350
350
  }
351
351
  }
352
- async function Ie(e) {
353
- let t = await P(e.args || {}), n = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set();
352
+ async function Le(e) {
353
+ let t = await N(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
- for (let e of N(i.alias)) r.add(e);
356
+ for (let e of M(i.alias)) r.add(e);
357
357
  }
358
358
  return {
359
- help: Le("help", "h", n, r),
360
- version: Le("version", "v", n, r)
359
+ help: Re("help", "h", n, r),
360
+ version: Re("version", "v", n, r)
361
361
  };
362
362
  }
363
- function Le(e, t, n, r) {
363
+ function Re(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 Re = "0.0.17", ze = "Commands to develop, bundle, and package Incarnative.js apps.";
368
+ var ze = "0.0.19", Be = "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 Be(e) {
371
+ function Ve(e) {
372
372
  return e && e.constructor && typeof e.constructor.isBuffer == "function" && e.constructor.isBuffer(e);
373
373
  }
374
- function Ve(e) {
374
+ function He(e) {
375
375
  return e;
376
376
  }
377
- function He(e, t) {
377
+ function Ue(e, t) {
378
378
  t ||= {};
379
- let n = t.delimiter || ".", r = t.maxDepth, i = t.transformKey || Ve, a = {};
379
+ let n = t.delimiter || ".", r = t.maxDepth, i = t.transformKey || He, 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 = Be(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 = Ve(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 Ue(e, t) {
389
+ function We(e, t) {
390
390
  t ||= {};
391
- let n = t.delimiter || ".", r = t.overwrite || !1, i = t.transformKey || Ve, a = {};
392
- if (Be(e) || Object.prototype.toString.call(e) !== "[object Object]") return e;
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;
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 Ue(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, He(e[r], t));
410
+ return i !== "[object Object]" && i !== "[object Array]" || c(e[r]) ? (n[r] = e[r], n) : s(r, n, Ue(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 Ue(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] = Ue(e[s], t);
419
+ d[l] = We(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 We = /"(?:_|\\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*:/, Ge = /"(?: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*:/, Ke = /^\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) Je(e);
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);
427
427
  else return t;
428
428
  }
429
- function Je(e) {
429
+ function Ye(e) {
430
430
  console.warn(`[destr] Dropping "${e}" key to prevent prototype pollution.`);
431
431
  }
432
- function Ye(e, t = {}) {
432
+ function Xe(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 Ye(e, t = {}) {
442
442
  case "infinity": return Infinity;
443
443
  case "-infinity": return -Infinity;
444
444
  }
445
- if (!Ke.test(e)) {
445
+ if (!qe.test(e)) {
446
446
  if (t.strict) throw SyntaxError("[destr] Invalid JSON");
447
447
  return e;
448
448
  }
449
449
  try {
450
- if (We.test(e) || Ge.test(e)) {
450
+ if (Ge.test(e) || Ke.test(e)) {
451
451
  if (t.strict) throw Error("[destr] Possible prototype pollution");
452
- return JSON.parse(e, qe);
452
+ return JSON.parse(e, Je);
453
453
  }
454
454
  return JSON.parse(e);
455
455
  } catch (n) {
@@ -459,18 +459,18 @@ function Ye(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 Xe(e) {
462
+ function G(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
467
  function Ze(e, t, n = ".", r) {
468
- if (!Xe(t)) return Ze(e, {}, n, r);
468
+ if (!G(t)) return Ze(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]] : Xe(a) && Xe(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]] : G(a) && G(i[t]) ? Ze(a, i[t], (n ? `${n}.` : "") + t.toString(), r) : a));
474
474
  }
475
475
  return i;
476
476
  }
@@ -495,13 +495,13 @@ function rt(e, t = {}) {
495
495
  if (!t) continue;
496
496
  let r = t[1];
497
497
  if (!r || r === "__proto__" || r === "constructor") continue;
498
- let i = Ye((t[2] || "").trim());
498
+ let i = Xe((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 : Ue(n, { overwrite: !0 });
504
+ return t.flat ? n : We(n, { overwrite: !0 });
505
505
  }
506
506
  function it(e, t) {
507
507
  return p(e) ? rt(h(e, "utf8"), t) : {};
@@ -510,7 +510,7 @@ function q(e) {
510
510
  return e = nt(e), it(b(e.dir, e.name), e);
511
511
  }
512
512
  function at() {
513
- return process.env.XDG_CONFIG_HOME || b(A(), ".config");
513
+ return process.env.XDG_CONFIG_HOME || b(k(), ".config");
514
514
  }
515
515
  function ot(e) {
516
516
  return e = nt(e), e.dir = at(), q(e);
@@ -703,7 +703,7 @@ async function xt(e) {
703
703
  dir: r
704
704
  })), t.push(ot({ name: e.rcFile })), t.push(q({
705
705
  name: e.rcFile,
706
- dir: A()
706
+ dir: k()
707
707
  }));
708
708
  }
709
709
  i.rc = n({}, ...t);
@@ -780,9 +780,9 @@ async function Tt(e, o, s = {}) {
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(A(), ".cache/c12", l);
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(k(), ".cache/c12", l);
784
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, {
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,
@@ -804,12 +804,12 @@ async function Tt(e, o, s = {}) {
804
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;
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 yt) h.config = (await yt[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);
812
+ let t = ie(h.configFile);
813
813
  t.search = `_${++vt}`, 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 });
@@ -842,7 +842,7 @@ async function Et(e, t) {
842
842
  function J(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
847
  extensions: bt,
848
848
  cache: !1
@@ -936,7 +936,7 @@ async function zt(e) {
936
936
  async function Bt(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
941
  throw new Y("ERR_INCA_PACKAGE_JSON_NOT_FOUND", `no package.json found at ${t}`);
942
942
  }
@@ -967,7 +967,7 @@ function Vt(e) {
967
967
  };
968
968
  }
969
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);
970
+ let { config: t } = await Rt(e), n = y.join(e, "package.json"), r = await E(n, "utf8").catch(() => void 0), i = r === void 0 ? {} : Lt(r, n), a = t.productName ?? u(i.name);
971
971
  a && jt(a);
972
972
  let o = {
973
973
  name: a,
@@ -986,7 +986,7 @@ function Wt() {
986
986
  function Gt() {
987
987
  let e = Wt();
988
988
  if (e) try {
989
- return ie(import.meta.url).resolve(`${e}/bin/inca-host`);
989
+ return ae(import.meta.url).resolve(`${e}/bin/inca-host`);
990
990
  } catch {
991
991
  return;
992
992
  }
@@ -1030,7 +1030,7 @@ var Xt = (e) => {
1030
1030
  async start() {
1031
1031
  let e = this.#e.hostBin ?? Kt();
1032
1032
  qt(e);
1033
- let t = ae(e, ["--dev", this.#e.entryFile], {
1033
+ let t = oe(e, ["--dev", this.#e.entryFile], {
1034
1034
  stdio: [
1035
1035
  "pipe",
1036
1036
  "pipe",
@@ -1042,7 +1042,7 @@ var Xt = (e) => {
1042
1042
  let n = this.#e.onStderr ?? Xt;
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
- }), oe.createInterface({ input: t.stdout }).on("line", (e) => {
1045
+ }), se.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 j(t, "spawn"), r = !0;
1055
+ }), await A(t, "spawn"), r = !0;
1056
1056
  }
1057
1057
  #a(e, t) {
1058
1058
  let n;
@@ -1103,7 +1103,7 @@ var Xt = (e) => {
1103
1103
  }
1104
1104
  }
1105
1105
  async #s(e) {
1106
- let t = j(e, "exit");
1106
+ let t = A(e, "exit");
1107
1107
  e.kill(), await t;
1108
1108
  }
1109
1109
  async call(e, t, n) {
@@ -1144,8 +1144,8 @@ 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 = j(t, "exit");
1148
- this.call("shutdown").catch(() => {}), await Promise.race([n.then(() => "exited"), se(e, void 0, { ref: !1 }).then(() => "timeout")]) === "timeout" && (t.kill(), await n);
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);
1149
1149
  }
1150
1150
  }, $t = "[inca]", en = new Intl.DateTimeFormat(void 0, {
1151
1151
  hour: "numeric",
@@ -1323,7 +1323,7 @@ function Sn({ core: e, runtimeModuleName: t, entry: n, outDir: r, mode: i, sourc
1323
1323
  customLogger: _n(c, l),
1324
1324
  define: { "process.env.NODE_ENV": JSON.stringify(i) },
1325
1325
  plugins: [
1326
- fe({ template: { compilerOptions: {
1326
+ pe({ template: { compilerOptions: {
1327
1327
  runtimeModuleName: t,
1328
1328
  hoistStatic: !1
1329
1329
  } } }),
@@ -1354,7 +1354,7 @@ function Sn({ core: e, runtimeModuleName: t, entry: n, outDir: r, mode: i, sourc
1354
1354
  //#region src/vite/build.mts
1355
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 }) {
1356
1356
  let l;
1357
- if (await le(Sn({
1357
+ if (await ue(Sn({
1358
1358
  core: e,
1359
1359
  runtimeModuleName: t,
1360
1360
  entry: n,
@@ -1402,7 +1402,7 @@ function wn(e) {
1402
1402
  //#endregion
1403
1403
  //#region src/vite/hmr.mts
1404
1404
  function Tn(e, t) {
1405
- let n = ue(t, [], !1), r = [t.stack, n].filter((e) => e).join("\n");
1405
+ let n = de(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
@@ -1412,7 +1412,7 @@ function En(e) {
1412
1412
  return y.join(e, "node_modules/.inca/hmr");
1413
1413
  }
1414
1414
  function Dn() {
1415
- let e = y.dirname(ne(import.meta.url));
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");
@@ -1424,33 +1424,40 @@ function On(e, t) {
1424
1424
  let n = y.relative(e, t).split(y.sep).join("/");
1425
1425
  return n.startsWith(".") ? n : `./${n}`;
1426
1426
  }
1427
- async function kn(e, t, n) {
1428
- let r = En(e);
1429
- await E(r, { recursive: !0 });
1430
- let i = y.join(r, "entry.js"), a = On(r, n ?? Dn()), o = t.split(y.sep).join("/");
1431
- return await k(i, wn`
1432
- import { start } from ${JSON.stringify(a)};
1433
- await start(${JSON.stringify(o)});
1434
- `), i;
1435
- }
1427
+ var kn = /^[A-Za-z_$][\w$]*$/;
1436
1428
  function An(e) {
1429
+ let t = {};
1430
+ for (let [n, r] of Object.entries(e ?? {})) if (kn.test(n)) try {
1431
+ t[n] = JSON.parse(typeof r == "string" ? r : JSON.stringify(r));
1432
+ } catch {}
1433
+ return t;
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 O(a, wn`
1438
+ import { start } from ${JSON.stringify(o)};
1439
+ await start(${JSON.stringify(s)}, ${JSON.stringify(n)});
1440
+ `), a;
1441
+ }
1442
+ function Mn(e) {
1437
1443
  if (e.type === "error") return e.err;
1438
1444
  if (e.type === "custom" && e.event === "vite:invoke") return e.data?.data?.error;
1439
1445
  }
1440
- function jn(e) {
1446
+ function Nn(e) {
1441
1447
  if (e.type !== "custom" || e.event !== "vite:invoke") return !1;
1442
1448
  let t = e.data;
1443
1449
  return t.name === "fetchModule" && !t.data?.error;
1444
1450
  }
1445
- function Mn(e, t, n, r, i) {
1451
+ function Pn(e, t, n, r, i) {
1446
1452
  let a = /* @__PURE__ */ new Map(), o = { send: s };
1447
1453
  function s(a) {
1448
1454
  if (a.type === "full-reload") {
1449
- t();
1455
+ let e = i.current;
1456
+ i.current = void 0, t(e);
1450
1457
  return;
1451
1458
  }
1452
- let o = An(a);
1453
- o ? (n(o), i.current = void 0) : jn(a) && i.current && (r({
1459
+ let o = Mn(a);
1460
+ o ? (n(o), i.current = void 0) : Nn(a) && i.current && (r({
1454
1461
  file: i.current.file,
1455
1462
  took: Date.now() - i.current.at
1456
1463
  }), i.current = void 0), e(a);
@@ -1472,7 +1479,7 @@ function Mn(e, t, n, r, i) {
1472
1479
  }
1473
1480
  };
1474
1481
  }
1475
- function Nn() {
1482
+ function Fn() {
1476
1483
  let e = "\0inca:vite-client-shim";
1477
1484
  return {
1478
1485
  name: "inca:shim-vite-client",
@@ -1485,7 +1492,7 @@ function Nn() {
1485
1492
  }
1486
1493
  };
1487
1494
  }
1488
- function Pn(e) {
1495
+ function In(e) {
1489
1496
  return {
1490
1497
  name: "inca:file-changed",
1491
1498
  hotUpdate(t) {
@@ -1500,10 +1507,11 @@ function Pn(e) {
1500
1507
  }
1501
1508
  };
1502
1509
  }
1503
- async function Fn(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 = () => {} }) {
1504
- let p = await kn(r, n, a), m = pn(i), h = y.join(En(r), fn);
1505
- m ? await k(h, m) : await O(h, { force: !0 });
1506
- let g = { current: void 0 }, { channel: _, dispatch: v } = Mn(l, u, (t) => d(Tn(e, t)), f, g), b = await de({
1510
+ 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 = () => {} }) {
1511
+ await T(En(r), { recursive: !0 });
1512
+ let p = pn(i), m = y.join(En(r), fn);
1513
+ p ? await O(m, p) : await D(m, { force: !0 });
1514
+ let h = { current: void 0 }, { channel: g, dispatch: _ } = Pn(l, u, (t) => d(Tn(e, t)), f, h), v = await fe({
1507
1515
  configFile: !1,
1508
1516
  root: y.dirname(n),
1509
1517
  mode: "development",
@@ -1524,32 +1532,37 @@ async function Fn(e, t, { entry: n, cwd: r, runtimeConfig: i, runtimePath: a, st
1524
1532
  consumer: "client",
1525
1533
  dev: {
1526
1534
  moduleRunnerTransform: !0,
1527
- createEnvironment: (e, t) => new ce(e, t, {
1535
+ createEnvironment: (e, t) => new le(e, t, {
1528
1536
  hot: !0,
1529
- transport: _
1537
+ transport: g
1530
1538
  })
1531
1539
  }
1532
1540
  } },
1533
1541
  plugins: [
1534
- fe({ template: { compilerOptions: {
1542
+ pe({ template: { compilerOptions: {
1535
1543
  runtimeModuleName: t,
1536
1544
  hoistStatic: !1
1537
1545
  } } }),
1538
1546
  bn(e),
1539
- Nn(),
1540
- Pn(g)
1547
+ Fn(),
1548
+ In(h)
1541
1549
  ]
1542
- });
1550
+ }), b;
1551
+ try {
1552
+ b = await jn(r, n, An(v.environments.client.config.define), a);
1553
+ } catch (e) {
1554
+ throw await v.close(), e;
1555
+ }
1543
1556
  return {
1544
- entryFile: p,
1545
- dispatch: v,
1546
- close: () => b.close()
1557
+ entryFile: b,
1558
+ dispatch: _,
1559
+ close: () => v.close()
1547
1560
  };
1548
1561
  }
1549
1562
  //#endregion
1550
1563
  //#region src/vite/watch.mts
1551
- async function In(e, t, { onBuild: n, onError: r, stdout: i = process.stdout, stderr: a = process.stderr, quiet: o = !1, ...s }) {
1552
- let { outDir: c } = s, l, u = await le(Sn({
1564
+ async function Rn(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 ue(Sn({
1553
1566
  core: e,
1554
1567
  runtimeModuleName: t,
1555
1568
  ...s,
@@ -1575,32 +1588,32 @@ async function In(e, t, { onBuild: n, onError: r, stdout: i = process.stdout, st
1575
1588
  }
1576
1589
  //#endregion
1577
1590
  //#region src/vite/createBundler.mts
1578
- function Ln(e, t) {
1591
+ function zn(e, t) {
1579
1592
  return {
1580
- watch: (n) => In(e, t, n),
1593
+ watch: (n) => Rn(e, t, n),
1581
1594
  build: (n) => Cn(e, t, n),
1582
- hmr: (n) => Fn(e, t, n)
1595
+ hmr: (n) => Ln(e, t, n)
1583
1596
  };
1584
1597
  }
1585
1598
  //#endregion
1586
1599
  //#region src/defaultBundler.mts
1587
- var Rn = Ln(ln, "incajs/vue/runtime"), zn = [
1600
+ var Bn = zn(ln, "incajs/vue/runtime"), Vn = [
1588
1601
  "main.mts",
1589
1602
  "main.ts",
1590
1603
  "main.js"
1591
1604
  ];
1592
- async function Bn(e) {
1593
- let t = zn.map((t) => y.join(e, "src", t)).find((e) => p(e));
1605
+ async function Hn(e) {
1606
+ let t = Vn.map((t) => y.join(e, "src", t)).find((e) => p(e));
1594
1607
  if (t) return t;
1595
1608
  let n = y.join(e, "src/App.vue");
1596
- if (p(n)) return Vn(n, e);
1609
+ if (p(n)) return Un(n, e);
1597
1610
  throw new Y("ERR_INCA_ENTRY_NOT_FOUND", `no app entry found. check that ${y.join(e, "src/main.ts")} or ${n} exists`);
1598
1611
  }
1599
- async function Vn(e, t) {
1612
+ async function Un(e, t) {
1600
1613
  let n = y.join(t, "node_modules/.inca");
1601
- await E(n, { recursive: !0 });
1614
+ await T(n, { recursive: !0 });
1602
1615
  let r = y.join(n, "entry.mts"), i = JSON.stringify(e.split(y.sep).join("/"));
1603
- return await k(r, wn`
1616
+ return await O(r, wn`
1604
1617
  import { createIncaApp } from "incajs/vue";
1605
1618
  import App from ${i};
1606
1619
  createIncaApp(App).mount();
@@ -1608,8 +1621,8 @@ async function Vn(e, t) {
1608
1621
  }
1609
1622
  //#endregion
1610
1623
  //#region src/build.mts
1611
- async function Hn(e = {}) {
1612
- let t = e.cwd ?? process.cwd(), n = e.config ?? await zt(t), r = y.resolve(t, n.outDir), i = e.bundler ?? Rn, a = e.entry ?? n.entry ?? await Bn(t);
1624
+ async function Wn(e = {}) {
1625
+ 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);
1613
1626
  Ft(t, r, a);
1614
1627
  let o = e.runtimeConfig ?? await Ht(t);
1615
1628
  return i.build({
@@ -1623,79 +1636,79 @@ async function Hn(e = {}) {
1623
1636
  }
1624
1637
  //#endregion
1625
1638
  //#region src/devLock.mts
1626
- function Un(e) {
1639
+ function Gn(e) {
1627
1640
  return y.join(e, "node_modules/.inca/dev.pid");
1628
1641
  }
1629
- function Wn(e) {
1642
+ function Kn(e) {
1630
1643
  try {
1631
1644
  return process.kill(e, 0), !0;
1632
1645
  } catch (e) {
1633
1646
  return e.code === "EPERM";
1634
1647
  }
1635
1648
  }
1636
- var Gn = pe();
1637
- function Kn(e) {
1649
+ var qn = me();
1650
+ function Jn(e) {
1638
1651
  return new Y("ERR_INCA_DEV_RUNNING", `inca dev is already running for this app (pid ${String(e)})`);
1639
1652
  }
1640
- async function qn(e) {
1641
- let t = Un(e), n = `${String(process.pid)}:${Gn}`, r = `${t}.${pe()}`;
1642
- await E(y.dirname(t), { recursive: !0 }), await k(r, n);
1653
+ async function Yn(e) {
1654
+ let t = Gn(e), n = `${String(process.pid)}:${qn}`, r = `${t}.${me()}`;
1655
+ await T(y.dirname(t), { recursive: !0 }), await O(r, n);
1643
1656
  let i = process.pid;
1644
1657
  try {
1645
1658
  for (let e = 0; e < 5; e++) {
1646
1659
  try {
1647
- return await T(r, t), Jn(t, n);
1660
+ return await te(r, t), Xn(t, n);
1648
1661
  } catch (e) {
1649
1662
  if (e.code !== "EEXIST") throw e;
1650
1663
  }
1651
- 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);
1652
1665
  if (a === process.pid) {
1653
- if (e === n) throw Kn(a);
1654
- } else if (Number.isSafeInteger(a) && a > 0 && Wn(a)) throw Kn(a);
1655
- i = Number.isSafeInteger(a) && a > 0 ? a : i, await O(t, { force: !0 });
1666
+ if (e === n) throw Jn(a);
1667
+ } else if (Number.isSafeInteger(a) && a > 0 && Kn(a)) throw Jn(a);
1668
+ i = Number.isSafeInteger(a) && a > 0 ? a : i, await D(t, { force: !0 });
1656
1669
  }
1657
- throw Kn(i);
1670
+ throw Jn(i);
1658
1671
  } finally {
1659
- await O(r, { force: !0 });
1672
+ await D(r, { force: !0 });
1660
1673
  }
1661
1674
  }
1662
- function Jn(e, t) {
1675
+ function Xn(e, t) {
1663
1676
  let n = !1;
1664
1677
  return async () => {
1665
- 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 }));
1666
1679
  };
1667
1680
  }
1668
1681
  //#endregion
1669
1682
  //#region src/plist.mts
1670
- function Yn(e) {
1683
+ function Zn(e) {
1671
1684
  return e.replaceAll("&", "&amp;").replaceAll("<", "&lt;").replaceAll(">", "&gt;");
1672
1685
  }
1673
- function Xn(e) {
1674
- return typeof e == "boolean" ? e ? "<true/>" : "<false/>" : `<string>${Yn(e)}</string>`;
1686
+ function Qn(e) {
1687
+ return typeof e == "boolean" ? e ? "<true/>" : "<false/>" : `<string>${Zn(e)}</string>`;
1675
1688
  }
1676
- function Zn(e) {
1689
+ function $n(e) {
1677
1690
  return wn`
1678
1691
  <?xml version="1.0" encoding="UTF-8"?>
1679
1692
  <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
1680
1693
  <plist version="1.0">
1681
1694
  <dict>
1682
- ${Object.entries(e).map(([e, t]) => `\t<key>${Yn(e)}</key>\n\t${Xn(t)}`).join("\n")}
1695
+ ${Object.entries(e).map(([e, t]) => `\t<key>${Zn(e)}</key>\n\t${Qn(t)}`).join("\n")}
1683
1696
  </dict>
1684
1697
  </plist>
1685
1698
  `;
1686
1699
  }
1687
1700
  //#endregion
1688
1701
  //#region src/macosApp.mts
1689
- async function Qn(e) {
1702
+ async function er(e) {
1690
1703
  let { appPath: t, metadata: n, hostBin: r } = e;
1691
- await O(t, {
1704
+ await D(t, {
1692
1705
  recursive: !0,
1693
1706
  force: !0
1694
1707
  });
1695
1708
  let i = y.join(t, "Contents"), a = y.join(i, "MacOS"), o = y.join(i, "Resources");
1696
- await E(a, { recursive: !0 }), await E(o, { recursive: !0 });
1709
+ await T(a, { recursive: !0 }), await T(o, { recursive: !0 });
1697
1710
  let s = y.join(a, n.productName);
1698
- 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);
1699
1712
  let c = {
1700
1713
  CFBundleName: n.productName,
1701
1714
  CFBundleDisplayName: n.productName,
@@ -1711,7 +1724,7 @@ async function Qn(e) {
1711
1724
  let e = y.basename(n.icon);
1712
1725
  await w(n.icon, y.join(o, e)), c.CFBundleIconFile = e;
1713
1726
  }
1714
- return await k(y.join(i, "Info.plist"), Zn(c)), await k(y.join(i, "PkgInfo"), "APPL????"), {
1727
+ return await O(y.join(i, "Info.plist"), $n(c)), await O(y.join(i, "PkgInfo"), "APPL????"), {
1715
1728
  appPath: t,
1716
1729
  executablePath: s,
1717
1730
  resourcesDir: o
@@ -1719,8 +1732,8 @@ async function Qn(e) {
1719
1732
  }
1720
1733
  //#endregion
1721
1734
  //#region src/watchForEdit.mts
1722
- var $n = /^(?:inca\.config\.[a-z0-9]+|package\.json)$/, er = [...zn, "App.vue"];
1723
- function tr(e, t = {}) {
1735
+ var tr = /^(?:inca\.config\.[a-z0-9]+|package\.json)$/, nr = [...Vn, "App.vue"];
1736
+ function rr(e, t = {}) {
1724
1737
  let n = t.debounceMs ?? 100, r = /* @__PURE__ */ new Set(), i, a = !1, o = () => {}, s = new Promise((e) => {
1725
1738
  o = e;
1726
1739
  }), c = () => {
@@ -1741,7 +1754,7 @@ function tr(e, t = {}) {
1741
1754
  r.clear();
1742
1755
  };
1743
1756
  try {
1744
- l(e, (e) => e === "src" || $n.test(e)), l(y.join(e, "src"), (e) => er.includes(e));
1757
+ l(e, (e) => e === "src" || tr.test(e)), l(y.join(e, "src"), (e) => nr.includes(e));
1745
1758
  } catch (e) {
1746
1759
  throw u(), e;
1747
1760
  }
@@ -1757,7 +1770,7 @@ function tr(e, t = {}) {
1757
1770
  }
1758
1771
  //#endregion
1759
1772
  //#region src/retryOnEdit.mts
1760
- function nr(e, t) {
1773
+ function ir(e, t) {
1761
1774
  return new Promise((n) => {
1762
1775
  let r = () => n(!1);
1763
1776
  t.addEventListener("abort", r, { once: !0 }), e.then(() => {
@@ -1765,10 +1778,10 @@ function nr(e, t) {
1765
1778
  });
1766
1779
  });
1767
1780
  }
1768
- async function rr(e) {
1781
+ async function ar(e) {
1769
1782
  let { cwd: t, signal: n, stdout: r, stderr: i, debounceMs: a } = e, o = !1;
1770
1783
  for (;;) {
1771
- let s = tr(t, { debounceMs: a });
1784
+ let s = rr(t, { debounceMs: a });
1772
1785
  try {
1773
1786
  return await e.attempt(s);
1774
1787
  } catch (e) {
@@ -1782,7 +1795,7 @@ async function rr(e) {
1782
1795
  o = !0;
1783
1796
  continue;
1784
1797
  }
1785
- if (o = !1, $(i, "build failed", Q(e), X), n.aborted || (Z(r, "waiting for a change to retry", X), !await nr(s.edited, n))) return;
1798
+ 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;
1786
1799
  Z(r, "retrying", X);
1787
1800
  } finally {
1788
1801
  s.close();
@@ -1791,19 +1804,19 @@ async function rr(e) {
1791
1804
  }
1792
1805
  //#endregion
1793
1806
  //#region src/dev.mts
1794
- var ir = 1e4, ar = ["ERR_INCA_PACKAGE_JSON_NOT_FOUND", "ERR_INCA_PRODUCT_NAME_MISSING"];
1795
- async function or(e, t) {
1807
+ var or = 1e4, sr = ["ERR_INCA_PACKAGE_JSON_NOT_FOUND", "ERR_INCA_PRODUCT_NAME_MISSING"];
1808
+ async function cr(e, t) {
1796
1809
  try {
1797
1810
  return await Bt(e);
1798
1811
  } catch (e) {
1799
- if (!(e instanceof Y) || !ar.includes(e.code)) throw e;
1812
+ if (!(e instanceof Y) || !sr.includes(e.code)) throw e;
1800
1813
  Z(t, `running unnamed. ${e.message}`, X);
1801
1814
  return;
1802
1815
  }
1803
1816
  }
1804
- async function sr(e, t, n, r) {
1817
+ async function lr(e, t, n, r) {
1805
1818
  if (process.platform === "darwin" && t) try {
1806
- return (await Qn({
1819
+ return (await er({
1807
1820
  appPath: y.join(e, "node_modules/.inca", `${t.productName}.app`),
1808
1821
  metadata: t,
1809
1822
  hostBin: n,
@@ -1814,41 +1827,41 @@ async function sr(e, t, n, r) {
1814
1827
  return;
1815
1828
  }
1816
1829
  }
1817
- async function cr(e, t) {
1830
+ async function ur(e, t) {
1818
1831
  let n = new Set(t), r;
1819
1832
  try {
1820
- r = await te(e, {
1833
+ r = await ne(e, {
1821
1834
  recursive: !0,
1822
1835
  withFileTypes: !0
1823
1836
  });
1824
1837
  } catch {
1825
1838
  return;
1826
1839
  }
1827
- 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 })));
1828
1841
  }
1829
- function lr(e) {
1842
+ function dr(e) {
1830
1843
  let { NO_COLOR: t, FORCE_COLOR: n } = process.env;
1831
1844
  if (!(!e.isTTY || t || n)) return {
1832
1845
  ...process.env,
1833
1846
  FORCE_COLOR: "1"
1834
1847
  };
1835
1848
  }
1836
- async function ur(e) {
1837
- let t = e.cwd ?? process.cwd(), n = await qn(t);
1849
+ async function fr(e) {
1850
+ let t = e.cwd ?? process.cwd(), n = await Yn(t);
1838
1851
  try {
1839
1852
  let n = e.hostBin ?? Kt();
1840
1853
  qt(n);
1841
- let r = e.bundler ?? Rn, i = e.stdout ?? process.stdout, a = e.stderr ?? process.stderr, o = e.experimentalHmr ? r.hmr?.bind(r) : void 0;
1854
+ let r = e.bundler ?? Bn, i = e.stdout ?? process.stdout, a = e.stderr ?? process.stderr, o = e.experimentalHmr ? r.hmr?.bind(r) : void 0;
1842
1855
  if (e.experimentalHmr && !o) throw new Y("ERR_INCA_HMR_UNSUPPORTED", "--experimental-hmr was set, but the configured bundler has no HMR support");
1843
- let s = await rr({
1856
+ let s = await ar({
1844
1857
  cwd: t,
1845
1858
  signal: e.signal,
1846
1859
  stdout: i,
1847
1860
  stderr: a,
1848
1861
  async attempt() {
1849
- let n = await zt(t), r = y.resolve(t, n.outDir), a = e.entry ?? n.entry ?? await Bn(t);
1862
+ let n = await zt(t), r = y.resolve(t, n.outDir), a = e.entry ?? n.entry ?? await Hn(t);
1850
1863
  Ft(t, r, a);
1851
- let o = await or(t, i);
1864
+ let o = await cr(t, i);
1852
1865
  return {
1853
1866
  outDir: r,
1854
1867
  entry: a,
@@ -1858,21 +1871,26 @@ async function ur(e) {
1858
1871
  }
1859
1872
  });
1860
1873
  if (!s) return;
1861
- let { outDir: c, entry: l, metadata: u, runtimeConfig: d } = s, f = await sr(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 lr(t, u, n, i) ?? n, p, m = !1, h = !1, g = !1, _, v = Promise.resolve(), b = () => {}, ee = new Promise((e) => {
1862
1875
  b = e;
1863
1876
  });
1864
1877
  async function x() {
1865
1878
  try {
1866
- return await p?.call("reload", void 0, ir), !0;
1879
+ return await p?.call("reload", void 0, or), !0;
1867
1880
  } catch (e) {
1868
1881
  return $(a, "reload failed", Q(e), X), !1;
1869
1882
  }
1870
1883
  }
1871
- async function C(e, t) {
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)`, X);
1888
+ }
1889
+ async function w(e, t) {
1872
1890
  let n = new Qt({
1873
1891
  entryFile: e,
1874
1892
  hostBin: f,
1875
- env: lr(a),
1893
+ env: dr(a),
1876
1894
  onStderr: (e) => a.write(e),
1877
1895
  onReady: () => {
1878
1896
  m = !0, Z(i, "ready", X), h && (h = !1, x());
@@ -1894,13 +1912,8 @@ async function ur(e) {
1894
1912
  }
1895
1913
  p = n;
1896
1914
  }
1897
- async function w(e) {
1898
- if (await cr(e.outDir, e.files), !p) await C(e.entryFile);
1899
- else if (!m) h = !0;
1900
- else if (await x() && e.changed) {
1901
- let n = S("dim", y.relative(t, e.changed.file), { stream: i }), r = Date.now() - e.changed.at;
1902
- Z(i, `${S("green", "reload")} ${n} (${r}ms)`, X);
1903
- }
1915
+ async function te(e) {
1916
+ await ur(e.outDir, e.files), p ? m ? await x() && C(e.changed) : h = !0 : await w(e.entryFile);
1904
1917
  }
1905
1918
  let T;
1906
1919
  if (o) {
@@ -1911,8 +1924,10 @@ async function ur(e) {
1911
1924
  stdout: i,
1912
1925
  stderr: a,
1913
1926
  notify: (e) => p?.notify("vite", e),
1914
- reload: () => {
1915
- m ? x() : h = !0;
1927
+ reload: (e) => {
1928
+ m ? x().then((t) => {
1929
+ t && C(e);
1930
+ }) : h = !0;
1916
1931
  },
1917
1932
  onError: (e) => $(a, "build failed", e, X),
1918
1933
  onUpdate: ({ file: e, took: n }) => {
@@ -1921,7 +1936,7 @@ async function ur(e) {
1921
1936
  Z(i, `${S("green", "update")} ${r} (${n}ms)`, X);
1922
1937
  }
1923
1938
  });
1924
- 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();
1925
1940
  } else T = await r.watch({
1926
1941
  entry: l,
1927
1942
  outDir: c,
@@ -1930,7 +1945,7 @@ async function ur(e) {
1930
1945
  stdout: i,
1931
1946
  stderr: a,
1932
1947
  onBuild: (e) => {
1933
- v = v.then(() => w(e));
1948
+ v = v.then(() => te(e));
1934
1949
  },
1935
1950
  onError: (e) => {
1936
1951
  $(a, "build failed", e, X);
@@ -1947,44 +1962,44 @@ async function ur(e) {
1947
1962
  }
1948
1963
  //#endregion
1949
1964
  //#region src/package.mts
1950
- function dr() {
1965
+ function pr() {
1951
1966
  if (process.platform === "darwin") return "macos";
1952
1967
  if (process.platform === "linux") return "linux";
1953
1968
  throw new Y("ERR_INCA_PLATFORM_UNSUPPORTED", `inca package doesn't support ${process.platform} yet`);
1954
1969
  }
1955
- async function fr(e, t) {
1970
+ async function mr(e, t) {
1956
1971
  await Promise.all(e.files.map(async (n) => {
1957
1972
  let r = y.join(t, n);
1958
- 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);
1959
1974
  }));
1960
1975
  }
1961
- function pr(e, t) {
1976
+ function hr(e, t) {
1962
1977
  let n = e.files.map((e) => e.split("/")[0] ?? e).find((e) => e.toLowerCase() === t.toLowerCase());
1963
1978
  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`);
1964
1979
  }
1965
- async function mr({ metadata: e, output: t, hostBin: n }) {
1966
- let { appPath: r, resourcesDir: i } = await Qn({
1980
+ async function gr({ metadata: e, output: t, hostBin: n }) {
1981
+ let { appPath: r, resourcesDir: i } = await er({
1967
1982
  appPath: y.join(t.outDir, `${e.productName}.app`),
1968
1983
  metadata: e,
1969
1984
  hostBin: n
1970
1985
  });
1971
- return await fr(t, i), r;
1986
+ return await mr(t, i), r;
1972
1987
  }
1973
- async function hr({ metadata: e, output: t, hostBin: n }) {
1988
+ async function _r({ metadata: e, output: t, hostBin: n }) {
1974
1989
  let r = c(e.productName);
1975
- pr(t, r);
1990
+ hr(t, r);
1976
1991
  let i = y.join(t.outDir, r);
1977
- await O(i, {
1992
+ await D(i, {
1978
1993
  recursive: !0,
1979
1994
  force: !0
1980
- }), await E(i, { recursive: !0 });
1995
+ }), await T(i, { recursive: !0 });
1981
1996
  let a = y.join(i, r);
1982
- return await w(n, a), await C(a, 493), await fr(t, i), i;
1997
+ return await w(n, a), await C(a, 493), await mr(t, i), i;
1983
1998
  }
1984
- async function gr(e = {}) {
1985
- let t = e.cwd ?? process.cwd(), n = e.stdout ?? process.stdout, r = e.target ?? dr(), i = await Bt(t);
1999
+ async function vr(e = {}) {
2000
+ let t = e.cwd ?? process.cwd(), n = e.stdout ?? process.stdout, r = e.target ?? pr(), i = await Bt(t);
1986
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}`);
1987
- let a = await Hn({
2002
+ let a = await Wn({
1988
2003
  cwd: t,
1989
2004
  entry: e.entry,
1990
2005
  config: i,
@@ -2000,19 +2015,19 @@ async function gr(e = {}) {
2000
2015
  output: a,
2001
2016
  hostBin: o
2002
2017
  };
2003
- return { appPath: r === "macos" ? await mr(s) : await hr(s) };
2018
+ return { appPath: r === "macos" ? await gr(s) : await _r(s) };
2004
2019
  }
2005
2020
  //#endregion
2006
2021
  //#region src/cli.mts
2007
- function _r(e) {
2022
+ function yr(e) {
2008
2023
  return y.relative(process.cwd(), e);
2009
2024
  }
2010
- var vr = {
2025
+ var br = {
2011
2026
  type: "boolean",
2012
2027
  description: "Write a source map",
2013
2028
  negativeDescription: "Skip the source map"
2014
2029
  };
2015
- function yr() {
2030
+ function xr() {
2016
2031
  for (let e of [
2017
2032
  0,
2018
2033
  1,
@@ -2021,35 +2036,35 @@ function yr() {
2021
2036
  f.closeSync(e);
2022
2037
  } catch {}
2023
2038
  }
2024
- var br = V({
2039
+ var Sr = B({
2025
2040
  meta: {
2026
2041
  name: "build",
2027
2042
  description: "Bundle the app into dist"
2028
2043
  },
2029
- args: { sourcemap: vr },
2044
+ args: { sourcemap: br },
2030
2045
  async run({ args: e }) {
2031
2046
  try {
2032
- let t = await Hn({ sourcemap: e.sourcemap });
2033
- Z(process.stdout, `built ${_r(t.entryFile)}`);
2047
+ let t = await Wn({ sourcemap: e.sourcemap });
2048
+ Z(process.stdout, `built ${yr(t.entryFile)}`);
2034
2049
  } catch (e) {
2035
2050
  $(process.stderr, "build failed", Q(e)), process.exitCode = 1;
2036
2051
  }
2037
2052
  }
2038
- }), xr = V({
2053
+ }), Cr = B({
2039
2054
  meta: {
2040
2055
  name: "package",
2041
2056
  description: "Package the app as an application bundle"
2042
2057
  },
2043
- args: { sourcemap: vr },
2058
+ args: { sourcemap: br },
2044
2059
  async run({ args: e }) {
2045
2060
  try {
2046
- let { appPath: t } = await gr({ sourcemap: e.sourcemap });
2047
- Z(process.stdout, `packaged ${_r(t)}`);
2061
+ let { appPath: t } = await vr({ sourcemap: e.sourcemap });
2062
+ Z(process.stdout, `packaged ${yr(t)}`);
2048
2063
  } catch (e) {
2049
2064
  $(process.stderr, "package failed", Q(e)), process.exitCode = 1;
2050
2065
  }
2051
2066
  }
2052
- }), Sr = V({
2067
+ }), wr = B({
2053
2068
  meta: {
2054
2069
  name: "dev",
2055
2070
  description: "Run the app in a development window"
@@ -2071,28 +2086,28 @@ var br = V({
2071
2086
  ].includes(process.env.INCA_EXPERIMENTAL_HMR ?? "");
2072
2087
  r && Z(process.stdout, "experimental HMR active", { timestamp: !0 });
2073
2088
  try {
2074
- await ur({
2089
+ await fr({
2075
2090
  signal: t.signal,
2076
2091
  experimentalHmr: r
2077
- }), t.signal.aborted && yr();
2092
+ }), t.signal.aborted && xr();
2078
2093
  } catch (e) {
2079
2094
  $(process.stderr, "dev failed", Q(e), { timestamp: !0 }), process.exitCode = 1;
2080
2095
  }
2081
2096
  }
2082
- }), Cr = V({
2097
+ }), Tr = B({
2083
2098
  meta: {
2084
2099
  name: "inca",
2085
- version: Re,
2086
- description: ze
2100
+ version: ze,
2101
+ description: Be
2087
2102
  },
2088
2103
  subCommands: {
2089
- dev: Sr,
2090
- build: br,
2091
- package: xr
2104
+ dev: wr,
2105
+ build: Sr,
2106
+ package: Cr
2092
2107
  }
2093
2108
  });
2094
- async function wr(e = process.argv) {
2095
- await Fe(Cr, { rawArgs: e.slice(2) });
2109
+ async function Er(e = process.argv) {
2110
+ await Ie(Tr, { rawArgs: e.slice(2) });
2096
2111
  }
2097
2112
  //#endregion
2098
- export { wr as run };
2113
+ export { Er as run };