@incajs/cli 0.0.10 → 0.0.12

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
@@ -1,143 +1,651 @@
1
1
  import { t as e } from "./chunks/rolldown-runtime-Dy4uBu1J.js";
2
- import { i as t, n, o as r, r as i, t as a } from "./chunks/defaults-CKuLLRFh.js";
3
- import o from "node:path";
4
- import { existsSync as s, lstatSync as c, realpathSync as l, statSync as u, watch as d } from "node:fs";
5
- import { chmod as f, cp as p, link as m, mkdir as h, readFile as g, readdir as _, rm as v, writeFile as y } from "node:fs/promises";
6
- import { styleText as b } from "node:util";
7
- import { fileURLToPath as x } from "node:url";
8
- import { DevEnvironment as S, build as C, buildErrorMessage as w, createServer as T } from "vite";
9
- import E from "@vitejs/plugin-vue";
10
- import { createRequire as ee } from "node:module";
11
- import { spawn as te } from "node:child_process";
12
- import { once as D } from "node:events";
13
- import ne from "node:readline";
14
- import { setTimeout as re } from "node:timers/promises";
15
- import { randomUUID as ie } from "node:crypto";
2
+ import { c as t, i as n, n as r, o as i, r as a, s as o, t as s } from "./chunks/dist-Bc5Uk6dY.js";
3
+ import { i as c, n as l, r as u, t as d } from "./chunks/defaults-TOBTBbDy.js";
4
+ import f, { resolve as p } from "node:path";
5
+ import { existsSync as m, lstatSync as h, readFileSync as g, realpathSync as _, statSync as v, watch as y } from "node:fs";
6
+ import { chmod as b, cp as x, link as S, mkdir as C, readFile as w, readdir as T, rm as E, writeFile as D } from "node:fs/promises";
7
+ import * as ee from "node:util";
8
+ import { styleText as O } from "node:util";
9
+ import { fileURLToPath as te, pathToFileURL as ne } from "node:url";
10
+ import { homedir as k } from "node:os";
11
+ import { DevEnvironment as re, build as A, buildErrorMessage as ie, createServer as ae } from "vite";
12
+ import oe from "@vitejs/plugin-vue";
13
+ import { createRequire as se } from "node:module";
14
+ import { spawn as ce } from "node:child_process";
15
+ import { once as j } from "node:events";
16
+ import le from "node:readline";
17
+ import { setTimeout as ue } from "node:timers/promises";
18
+ import { randomUUID as de } from "node:crypto";
19
+ //#region ../../node_modules/.pnpm/rc9@3.1.0/node_modules/rc9/dist/_chunks/libs/flat.mjs
20
+ function fe(e) {
21
+ return e && e.constructor && typeof e.constructor.isBuffer == "function" && e.constructor.isBuffer(e);
22
+ }
23
+ function M(e) {
24
+ return e;
25
+ }
26
+ function pe(e, t) {
27
+ t ||= {};
28
+ let n = t.delimiter || ".", r = t.maxDepth, i = t.transformKey || M, a = {};
29
+ function o(e, s, c) {
30
+ c ||= 1, Object.keys(e).forEach(function(l) {
31
+ let u = e[l], d = t.safe && Array.isArray(u), f = Object.prototype.toString.call(u), p = fe(u), m = f === "[object Object]" || f === "[object Array]", h = s ? s + n + i(l) : i(l);
32
+ if (!d && !p && m && Object.keys(u).length && (!t.maxDepth || c < r)) return o(u, h, c + 1);
33
+ a[h] = u;
34
+ });
35
+ }
36
+ return o(e), a;
37
+ }
38
+ function N(e, t) {
39
+ t ||= {};
40
+ let n = t.delimiter || ".", r = t.overwrite || !1, i = t.transformKey || M, a = {};
41
+ if (fe(e) || Object.prototype.toString.call(e) !== "[object Object]") return e;
42
+ function o(e) {
43
+ let n = Number(e);
44
+ return isNaN(n) || e.indexOf(".") !== -1 || t.object ? e : n;
45
+ }
46
+ function s(e, t, r) {
47
+ return Object.keys(r).reduce(function(t, i) {
48
+ return t[e + n + i] = r[i], t;
49
+ }, t);
50
+ }
51
+ function c(e) {
52
+ let t = Object.prototype.toString.call(e), n = t === "[object Array]", r = t === "[object Object]";
53
+ if (!e) return !0;
54
+ if (n) return !e.length;
55
+ if (r) return !Object.keys(e).length;
56
+ }
57
+ return e = Object.keys(e).reduce(function(n, r) {
58
+ let i = Object.prototype.toString.call(e[r]);
59
+ return i !== "[object Object]" && i !== "[object Array]" || c(e[r]) ? (n[r] = e[r], n) : s(r, n, pe(e[r], t));
60
+ }, {}), Object.keys(e).forEach(function(s) {
61
+ let c = s.split(n).map(i), l = o(c.shift()), u = o(c[0]), d = a;
62
+ for (; u !== void 0;) {
63
+ if (l === "__proto__") return;
64
+ let e = Object.prototype.toString.call(d[l]), n = e === "[object Object]" || e === "[object Array]";
65
+ if (!r && !n && d[l] !== void 0) return;
66
+ (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]));
67
+ }
68
+ d[l] = N(e[s], t);
69
+ }), a;
70
+ }
71
+ //#endregion
72
+ //#region ../../node_modules/.pnpm/destr@2.0.5/node_modules/destr/dist/index.mjs
73
+ var me = /"(?:_|\\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*:/, he = /"(?: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*:/, ge = /^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/;
74
+ function _e(e, t) {
75
+ if (e === "__proto__" || e === "constructor" && t && typeof t == "object" && "prototype" in t) {
76
+ ve(e);
77
+ return;
78
+ }
79
+ return t;
80
+ }
81
+ function ve(e) {
82
+ console.warn(`[destr] Dropping "${e}" key to prevent prototype pollution.`);
83
+ }
84
+ function ye(e, t = {}) {
85
+ if (typeof e != "string") return e;
86
+ if (e[0] === "\"" && e[e.length - 1] === "\"" && e.indexOf("\\") === -1) return e.slice(1, -1);
87
+ let n = e.trim();
88
+ if (n.length <= 9) switch (n.toLowerCase()) {
89
+ case "true": return !0;
90
+ case "false": return !1;
91
+ case "undefined": return;
92
+ case "null": return null;
93
+ case "nan": return NaN;
94
+ case "infinity": return Infinity;
95
+ case "-infinity": return -Infinity;
96
+ }
97
+ if (!ge.test(e)) {
98
+ if (t.strict) throw SyntaxError("[destr] Invalid JSON");
99
+ return e;
100
+ }
101
+ try {
102
+ if (me.test(e) || he.test(e)) {
103
+ if (t.strict) throw Error("[destr] Possible prototype pollution");
104
+ return JSON.parse(e, _e);
105
+ }
106
+ return JSON.parse(e);
107
+ } catch (n) {
108
+ if (t.strict) throw n;
109
+ return e;
110
+ }
111
+ }
112
+ //#endregion
113
+ //#region ../../node_modules/.pnpm/defu@6.1.7/node_modules/defu/dist/defu.mjs
114
+ function P(e) {
115
+ if (typeof e != "object" || !e) return !1;
116
+ let t = Object.getPrototypeOf(e);
117
+ 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;
118
+ }
119
+ function F(e, t, n = ".", r) {
120
+ if (!P(t)) return F(e, {}, n, r);
121
+ let i = { ...t };
122
+ for (let t of Object.keys(e)) {
123
+ if (t === "__proto__" || t === "constructor") continue;
124
+ let a = e[t];
125
+ a != null && (r && r(i, t, a, n) || (i[t] = Array.isArray(a) && Array.isArray(i[t]) ? [...a, ...i[t]] : P(a) && P(i[t]) ? F(a, i[t], (n ? `${n}.` : "") + t.toString(), r) : a));
126
+ }
127
+ return i;
128
+ }
129
+ function be(e) {
130
+ return (...t) => t.reduce((t, n) => F(t, n, "", e), {});
131
+ }
132
+ var I = be(), xe = /^\s*([^\s=]+)\s*=\s*(.*)?\s*$/, Se = /\n|\r|\r\n/, Ce = {
133
+ name: ".conf",
134
+ dir: process.cwd(),
135
+ flat: !1
136
+ };
137
+ function we(e) {
138
+ return typeof e == "string" && (e = { name: e }), {
139
+ ...Ce,
140
+ ...e
141
+ };
142
+ }
143
+ function Te(e, t = {}) {
144
+ let n = {}, r = e.split(Se);
145
+ for (let e of r) {
146
+ let t = e.match(xe);
147
+ if (!t) continue;
148
+ let r = t[1];
149
+ if (!r || r === "__proto__" || r === "constructor") continue;
150
+ let i = ye((t[2] || "").trim());
151
+ if (r.endsWith("[]")) {
152
+ let e = r.slice(0, Math.max(0, r.length - 2));
153
+ n[e] = (n[e] || []).concat(i);
154
+ continue;
155
+ }
156
+ n[r] = i;
157
+ }
158
+ return t.flat ? n : N(n, { overwrite: !0 });
159
+ }
160
+ function Ee(e, t) {
161
+ return m(e) ? Te(g(e, "utf8"), t) : {};
162
+ }
163
+ function L(e) {
164
+ return e = we(e), Ee(p(e.dir, e.name), e);
165
+ }
166
+ function De() {
167
+ return process.env.XDG_CONFIG_HOME || p(k(), ".config");
168
+ }
169
+ function Oe(e) {
170
+ return e = we(e), e.dir = De(), L(e);
171
+ }
172
+ //#endregion
173
+ //#region ../../node_modules/.pnpm/c12@4.0.0-rc.2_magicast@0.5.4/node_modules/c12/dist/index.mjs
174
+ async function ke(e) {
175
+ let t = e.env ?? process.env, n = await Ae({
176
+ cwd: e.cwd,
177
+ fileName: e.fileName ?? ".env",
178
+ env: t,
179
+ interpolate: e.interpolate ?? !0,
180
+ expandFileReferences: e.expandFileReferences ?? !1,
181
+ parse: e.parse
182
+ }), r = Le(t);
183
+ for (let e in n) e.startsWith("_") || (t[e] === void 0 || r.has(e)) && (t[e] = n[e]);
184
+ return n;
185
+ }
186
+ async function Ae(e) {
187
+ let n = Object.create(null), r = t(e.cwd || "."), i = e.fileName || ".env", a = typeof i == "string" ? [i] : i, o = Le(e.env || {});
188
+ Object.assign(n, e.env);
189
+ for (let i of a) {
190
+ let a = t(r, i);
191
+ if (!v(a, { throwIfNoEntry: !1 })?.isFile()) continue;
192
+ let s = await je(a, e.parse);
193
+ for (let e in s) e in n && !o.has(e) || (n[e] = s[e], o.add(e));
194
+ }
195
+ if (e.expandFileReferences) {
196
+ for (let e in n) if (e.endsWith("_FILE")) {
197
+ let t = e.slice(0, -5);
198
+ if (n[t] === void 0) {
199
+ let r = n[e];
200
+ r && v(r, { throwIfNoEntry: !1 })?.isFile() && (n[t] = g(r, "utf8").trim(), o.add(t));
201
+ }
202
+ }
203
+ }
204
+ return e.interpolate && Me(n), n;
205
+ }
206
+ var R = ee.parseEnv;
207
+ async function je(e, t) {
208
+ let n = g(e, "utf8");
209
+ if (t) return t(n);
210
+ if (!R) try {
211
+ let e = await import("./chunks/__vite-optional-peer-dep_dotenv_c12-CxKvRg9-.js");
212
+ R = (t) => e.parse(t);
213
+ } catch {
214
+ 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.");
215
+ }
216
+ return R(n);
217
+ }
218
+ function Me(e, t = {}, n = (e) => e) {
219
+ function r(n) {
220
+ return t[n] === void 0 ? e[n] : t[n];
221
+ }
222
+ function i(e, t = []) {
223
+ if (typeof e != "string") return e;
224
+ let a = "", o = 0;
225
+ for (; o < e.length;) {
226
+ let n = e[o];
227
+ if (n === "\\" && e[o + 1] === "$") {
228
+ a += "$", o += 2;
229
+ continue;
230
+ }
231
+ let s = n === "$" ? Fe(e, o) : void 0;
232
+ if (!s) {
233
+ a += n, o++;
234
+ continue;
235
+ }
236
+ if (t.includes(s.key)) {
237
+ if (s.defaultValue !== void 0) {
238
+ a += i(s.defaultValue, t), o = s.end;
239
+ continue;
240
+ }
241
+ return console.warn(`Please avoid recursive environment variables ( loop: ${t.join(" > ")} > ${s.key} )`), "";
242
+ }
243
+ let c = i(r(s.key), [...t, s.key]);
244
+ s.defaultValue !== void 0 && (c === void 0 || s.operator === ":-" && c === "") && (c = i(s.defaultValue, t)), a += c === void 0 ? e.slice(o, s.end) : c, o = s.end;
245
+ }
246
+ return n(a);
247
+ }
248
+ for (let t in e) e[t] = i(r(t));
249
+ }
250
+ var Ne = /\w+/y, Pe = /[\w:]+/y;
251
+ function Fe(e, t) {
252
+ let n = t + 1, r = e[n] === "{";
253
+ r && n++;
254
+ let i = r ? Pe : Ne;
255
+ i.lastIndex = n;
256
+ let a = i.exec(e);
257
+ if (!a) return;
258
+ let o = a[0];
259
+ if (n = i.lastIndex, !r) return {
260
+ key: o,
261
+ end: n
262
+ };
263
+ if (e[n] === "}") return {
264
+ key: o,
265
+ end: n + 1
266
+ };
267
+ if (e[n] === "-") {
268
+ let t = "-";
269
+ o.endsWith(":") && (o = o.slice(0, -1), t = ":-");
270
+ let r = o ? Ie(e, n + 1) : void 0;
271
+ return r ? {
272
+ key: o,
273
+ operator: t,
274
+ defaultValue: r.value,
275
+ end: r.end
276
+ } : void 0;
277
+ }
278
+ return {
279
+ key: o,
280
+ end: n
281
+ };
282
+ }
283
+ function Ie(e, t) {
284
+ let n = "", r = 1;
285
+ for (let i = t; i < e.length; i++) {
286
+ let t = e[i];
287
+ if (t === "\\" && i + 1 < e.length) {
288
+ let r = e[i + 1];
289
+ n += r === "{" || r === "}" ? r : t + r, i++;
290
+ continue;
291
+ }
292
+ if (t === "$" && e[i + 1] === "{") {
293
+ r++, n += "${", i++;
294
+ continue;
295
+ }
296
+ if (t === "{" && r++, t === "}" && (r--, r === 0)) return {
297
+ value: n,
298
+ end: i + 1
299
+ };
300
+ n += t;
301
+ }
302
+ }
303
+ function Le(e) {
304
+ let t = globalThis.__c12_dotenv_vars__ ||= /* @__PURE__ */ new Map();
305
+ return t.has(e) || t.set(e, /* @__PURE__ */ new Set()), t.get(e);
306
+ }
307
+ var Re = (e) => e?.replace(/\\/g, "/"), ze = 0, Be = {
308
+ ".json": () => JSON.parse,
309
+ ".yaml": () => import("./chunks/yaml-N2dF3WHm.js").then((e) => e.parseYAML),
310
+ ".yml": () => import("./chunks/yaml-N2dF3WHm.js").then((e) => e.parseYAML),
311
+ ".jsonc": () => import("./chunks/jsonc-BDHXk_1o.js").then((e) => e.n).then((e) => (t) => e.parseJSONC(t, { allowTrailingComma: !0 })),
312
+ ".json5": () => import("./chunks/json5-feUuPtTt.js").then((e) => e.parseJSON5),
313
+ ".toml": () => import("./chunks/toml-BERh2MAo.js").then((e) => e.parseTOML)
314
+ }, Ve = Object.freeze([
315
+ ".js",
316
+ ".ts",
317
+ ".mjs",
318
+ ".cjs",
319
+ ".mts",
320
+ ".cts",
321
+ ".json",
322
+ ".jsonc",
323
+ ".json5",
324
+ ".yaml",
325
+ ".yml",
326
+ ".toml"
327
+ ]);
328
+ async function He(e) {
329
+ 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 = {
330
+ extendKey: "extends",
331
+ ...e.extend
332
+ });
333
+ let n = e.merger || I, r = {
334
+ config: {},
335
+ cwd: e.cwd,
336
+ configFile: t(e.cwd, e.configFile),
337
+ layers: [],
338
+ _configFile: void 0
339
+ }, i = {
340
+ overrides: e.overrides,
341
+ main: void 0,
342
+ rc: void 0,
343
+ packageJson: void 0,
344
+ defaultConfig: e.defaultConfig
345
+ };
346
+ e.dotenv && await ke({
347
+ cwd: e.cwd,
348
+ ...e.dotenv === !0 ? {} : e.dotenv
349
+ });
350
+ let a = await z(".", e);
351
+ if (a.configFile && (i.main = a.config, r.configFile = a.configFile, r._configFile = a._configFile), a.meta && (r.meta = a.meta), e.rcFile) {
352
+ let t = [];
353
+ if (t.push(L({
354
+ name: e.rcFile,
355
+ dir: e.cwd
356
+ })), e.globalRc) {
357
+ let { findWorkspaceDir: n } = await import("./chunks/dist-Bp_FYhnk.js"), r = await n(e.cwd).catch(() => {});
358
+ r && t.push(L({
359
+ name: e.rcFile,
360
+ dir: r
361
+ })), t.push(Oe({ name: e.rcFile })), t.push(L({
362
+ name: e.rcFile,
363
+ dir: k()
364
+ }));
365
+ }
366
+ i.rc = n({}, ...t);
367
+ }
368
+ if (e.packageJson) {
369
+ let t = (Array.isArray(e.packageJson) ? e.packageJson : [typeof e.packageJson == "string" ? e.packageJson : e.name]).filter((e) => e && typeof e == "string"), { readPackageJSON: r } = await import("./chunks/dist-Bp_FYhnk.js"), a = await r(e.cwd).catch(() => {});
370
+ i.packageJson = n({}, ...t.map((e) => a?.[e]));
371
+ }
372
+ let o = {};
373
+ for (let e in i) {
374
+ let t = i[e];
375
+ o[e] = await (typeof t == "function" ? t({
376
+ configs: o,
377
+ rawConfigs: i
378
+ }) : t);
379
+ }
380
+ 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 Ue(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 = [...[
381
+ o.overrides && {
382
+ config: o.overrides,
383
+ configFile: void 0,
384
+ cwd: void 0
385
+ },
386
+ {
387
+ config: o.main,
388
+ configFile: e.configFile,
389
+ cwd: e.cwd
390
+ },
391
+ o.rc && {
392
+ config: o.rc,
393
+ configFile: e.rcFile
394
+ },
395
+ o.packageJson && {
396
+ config: o.packageJson,
397
+ configFile: "package.json"
398
+ }
399
+ ].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];
400
+ if (e.configFileRequired && !r._configFile) throw Error(`Required config (${r.configFile}) cannot be resolved.`);
401
+ return e.schema != null && (r.config = await Ke(r.config, e.schema)), r;
402
+ }
403
+ async function Ue(e, t) {
404
+ if (e._layers = e._layers || [], !t.extend) return;
405
+ let n = t.extend.extendKey;
406
+ typeof n == "string" && (n = [n]);
407
+ let r = [];
408
+ for (let t of n) r.push(...(Array.isArray(e[t]) ? e[t] : [e[t]]).filter(Boolean)), delete e[t];
409
+ for (let n of r) {
410
+ let r = n, i = {};
411
+ if (n.source && (i = n.options || {}, n = n.source), Array.isArray(n) && (i = n[1] || {}, n = n[0]), typeof n != "string") {
412
+ console.warn(`Cannot extend config from \`${JSON.stringify(r)}\` in ${t.cwd}`);
413
+ continue;
414
+ }
415
+ let a = await z(n, t, i);
416
+ if (!a.config) {
417
+ console.warn(`Cannot extend config from \`${n}\` in ${t.cwd}`);
418
+ continue;
419
+ }
420
+ await Ue(a.config, {
421
+ ...t,
422
+ cwd: a.cwd
423
+ }), e._layers.push(a), a.config._layers && (e._layers.push(...a.config._layers), delete a.config._layers);
424
+ }
425
+ }
426
+ var We = [
427
+ "gh:",
428
+ "github:",
429
+ "gitlab:",
430
+ "bitbucket:",
431
+ "https://",
432
+ "http://"
433
+ ], Ge = /^(@[\da-z~-][\d._a-z~-]*\/)?[\da-z~-][\d._a-z~-]*($|\/.*)/;
434
+ async function z(e, o, s = {}) {
435
+ if (o.resolve) {
436
+ let t = await o.resolve(e, o);
437
+ if (t) return t;
438
+ }
439
+ let c = o.merger || I, l = Object.keys(s.giget?.providers || {}).map((e) => `${e}:`), u = l.length > 0 ? [.../* @__PURE__ */ new Set([...l, ...We])] : We;
440
+ if (o.giget !== !1 && u.some((t) => e.startsWith(t))) {
441
+ let { downloadTemplate: n } = await import("./chunks/__vite-optional-peer-dep_giget_c12-BYcrHYBM.js").catch((t) => {
442
+ throw Error(`Extending config from \`${e}\` requires \`giget\` peer dependency to be installed.\n\nInstall it with: \`npx nypm i giget\``, { cause: t });
443
+ }), { 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);
444
+ u = r(f) === ".c12" ? i(f, l) : m(d) ? i(d, ".c12", l) : process.env.XDG_CACHE_HOME ? t(process.env.XDG_CACHE_HOME, "c12", l) : t(k(), ".cache/c12", l);
445
+ let p = s.install ? I(s.install === !0 ? {} : s.install, { ignoreWorkspace: !0 }) : !1;
446
+ m(u) && !p && await E(u, { recursive: !0 }), e = (await n(e, {
447
+ dir: u,
448
+ install: p,
449
+ force: !!p,
450
+ auth: s.auth,
451
+ ...o.giget,
452
+ ...s.giget
453
+ })).dir;
454
+ }
455
+ Ge.test(e) && (e = B(e, o) || e);
456
+ let d = n(e), f = qe(t(o.cwd, e)) ?? (!d || d === r(e)), p = t(o.cwd, f ? e : a(e));
457
+ f && (e = o.configFile);
458
+ let h = {
459
+ config: void 0,
460
+ configFile: void 0,
461
+ cwd: p,
462
+ source: e,
463
+ sourceOptions: s
464
+ };
465
+ if (h.configFile = B(t(p, e), o) || B(t(p, ".config", e.replace(/\.config$/, "")), o) || B(t(p, ".config", e), o) || e, !m(h.configFile)) return h;
466
+ h._configFile = h.configFile;
467
+ let g = n(h.configFile) || "";
468
+ if (g in Be) h.config = (await Be[g]())(await w(h.configFile, "utf8"));
469
+ else {
470
+ let e = o.resolveModule || ((e) => e.default || e);
471
+ if (o.import) h.config = e(await o.import(h.configFile));
472
+ else {
473
+ let t = ne(h.configFile);
474
+ t.search = `_${++ze}`, h.config = await import(t.href).then(e, async (t) => {
475
+ let { createJiti: n } = await import("./chunks/__vite-optional-peer-dep_jiti_c12-DZVJNj6v.js").catch(() => {
476
+ throw Error(`Failed to load config file \`${h.configFile}\`: ${t?.message}. Hint install \`jiti\` for compatibility.`, { cause: t });
477
+ }), r = n(i(o.cwd || ".", o.configFile || "/"), {
478
+ interopDefault: !0,
479
+ moduleCache: !1,
480
+ extensions: [...Ve],
481
+ ...o.jitiOptions
482
+ });
483
+ return o.import = (e) => r.import(e), e(await o.import(h.configFile));
484
+ });
485
+ }
486
+ }
487
+ 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 });
488
+ 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);
489
+ return _.length > 0 && (h.config = (o.envMerger || c)({}, ..._, h.config)), h.meta = I(h.sourceOptions.meta, h.config.$meta), delete h.config.$meta, h.sourceOptions.overrides && (h.config = c(h.sourceOptions.overrides, h.config)), h.configFile = Re(h.configFile), h.source = Re(h.source), h;
490
+ }
491
+ async function Ke(e, t) {
492
+ if (typeof t?.["~standard"]?.validate != "function") throw TypeError("Invalid `schema` option: expected a Standard Schema (https://standardschema.dev).");
493
+ let n = await t["~standard"].validate(e);
494
+ if (n.issues) {
495
+ let e = n.issues.map((e) => {
496
+ let t = e.path?.map((e) => String(typeof e == "object" ? e.key : e)).join(".");
497
+ return ` - ${t ? `${t}: ` : ""}${e.message}`;
498
+ });
499
+ throw Error(`Config validation failed (${t["~standard"].vendor}):\n${e.join("\n")}`, { cause: n.issues });
500
+ }
501
+ return n.value;
502
+ }
503
+ function B(e, t) {
504
+ let n = s(e, {
505
+ try: !0,
506
+ from: ne(i(t.cwd || ".", t.configFile || "/")),
507
+ suffixes: ["", "/index"],
508
+ extensions: Ve,
509
+ cache: !1
510
+ });
511
+ return n ? o(n) : void 0;
512
+ }
513
+ function qe(e) {
514
+ try {
515
+ return v(e).isDirectory();
516
+ } catch {
517
+ return null;
518
+ }
519
+ }
520
+ //#endregion
16
521
  //#region src/error.mts
17
- var O = class extends Error {
522
+ var V = class extends Error {
18
523
  code;
19
524
  path;
20
525
  name = "IncaError";
21
526
  constructor(e, t, n) {
22
527
  super(t), this.code = e, this.path = n;
23
528
  }
24
- }, ae = {
529
+ }, Je = {
25
530
  name: "inca",
26
531
  packageJson: "inca",
27
532
  rcFile: !1,
28
533
  globalRc: !1,
29
534
  giget: !1,
30
535
  extend: !1
31
- }, oe = /[/\\:*?"<>|\0]/;
32
- function se(e) {
33
- return e === e.trim() && e !== "" && e !== "." && e !== ".." && !oe.test(e);
536
+ }, Ye = /[/\\:*?"<>|\0]/;
537
+ function Xe(e) {
538
+ return e === e.trim() && e !== "" && e !== "." && e !== ".." && !Ye.test(e);
34
539
  }
35
- function k(e) {
36
- if (!(typeof e == "string" && se(e))) throw new O("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 \`/\\:*?"<>|\``);
540
+ function H(e) {
541
+ if (!(typeof e == "string" && Xe(e))) throw new V("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 \`/\\:*?"<>|\``);
37
542
  }
38
- var ce = process.platform === "darwin" || process.platform === "win32";
39
- function le(e, t) {
40
- let n = (e) => ce ? e.toLowerCase() : e, r = o.relative(n(e), n(t));
41
- return r === "" || r !== ".." && !r.startsWith(`..${o.sep}`) && !o.isAbsolute(r);
543
+ var Ze = process.platform === "darwin" || process.platform === "win32";
544
+ function Qe(e, t) {
545
+ let n = (e) => Ze ? e.toLowerCase() : e, r = f.relative(n(e), n(t));
546
+ return r === "" || r !== ".." && !r.startsWith(`..${f.sep}`) && !f.isAbsolute(r);
42
547
  }
43
- function A(e) {
44
- let t = o.resolve(e), n = t;
45
- for (let e; !c(n, { throwIfNoEntry: !1 }) && (e = o.dirname(n)) !== n;) n = e;
46
- return o.join(l.native(n), o.relative(n, t));
548
+ function U(e) {
549
+ let t = f.resolve(e), n = t;
550
+ for (let e; !h(n, { throwIfNoEntry: !1 }) && (e = f.dirname(n)) !== n;) n = e;
551
+ return f.join(_.native(n), f.relative(n, t));
47
552
  }
48
- function j(e, t, n) {
49
- let r = o.resolve(e, t), i;
553
+ function W(e, t, n) {
554
+ let r = f.resolve(e, t), i;
50
555
  try {
51
- let t = A(r);
556
+ let t = U(r);
52
557
  i = [
53
558
  e,
54
- o.join(e, "src"),
55
- o.join(e, "node_modules"),
559
+ f.join(e, "src"),
560
+ f.join(e, "node_modules"),
56
561
  ...n ? [n] : []
57
- ].some((e) => le(t, A(e)));
562
+ ].some((e) => Qe(t, U(e)));
58
563
  } catch {
59
564
  i = !0;
60
565
  }
61
- if (i) throw new O("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"`);
566
+ if (i) throw new V("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"`);
62
567
  }
63
- function ue(e, t, n) {
64
- let r = o.resolve(e, t ?? a.outDir);
65
- return j(e, r, n), r;
568
+ function $e(e, t, n) {
569
+ let r = f.resolve(e, t ?? d.outDir);
570
+ return W(e, r, n), r;
571
+ }
572
+ function et(e, t) {
573
+ try {
574
+ return JSON.parse(e);
575
+ } catch (e) {
576
+ throw new V("ERR_INCA_PACKAGE_JSON_INVALID", `${t} holds malformed JSON: ${e.message}`, t);
577
+ }
66
578
  }
67
- async function M(e) {
68
- let { config: t, layers: n } = await r({
579
+ async function G(e) {
580
+ let { config: t, layers: n } = await He({
69
581
  cwd: e,
70
- ...ae
71
- }), i = n?.find((e) => e.configFile === "package.json");
582
+ ...Je
583
+ }), r = n?.find((e) => e.configFile === "package.json");
72
584
  return {
73
585
  config: t,
74
- usedPackageJsonKey: Object.keys(i?.config ?? {}).length > 0
586
+ usedPackageJsonKey: Object.keys(r?.config ?? {}).length > 0
75
587
  };
76
588
  }
77
- async function de(e) {
78
- let { config: t } = await M(e), n = t.entry ? o.resolve(e, t.entry) : void 0;
589
+ async function tt(e) {
590
+ let { config: t } = await G(e), n = t.entry ? f.resolve(e, t.entry) : void 0;
79
591
  return {
80
592
  entry: n,
81
- outDir: ue(e, t.outDir, n)
593
+ outDir: $e(e, t.outDir, n)
82
594
  };
83
595
  }
84
- async function fe(e) {
85
- let t = o.join(e, "package.json"), r;
596
+ async function nt(e) {
597
+ let t = f.join(e, "package.json"), n;
86
598
  try {
87
- r = await g(t, "utf8");
599
+ n = await w(t, "utf8");
88
600
  } catch {
89
- throw new O("ERR_INCA_PACKAGE_JSON_NOT_FOUND", `no package.json found at ${t}`);
601
+ throw new V("ERR_INCA_PACKAGE_JSON_NOT_FOUND", `no package.json found at ${t}`);
90
602
  }
91
- let c = JSON.parse(r), { config: l, usedPackageJsonKey: u } = await M(e), d = l.productName ?? i(c.name);
92
- if (!d) throw new O("ERR_INCA_PRODUCT_NAME_MISSING", `${t} needs a "name", or "productName" in inca.config.ts`);
93
- k(d);
94
- let f = l.version ?? c.version ?? a.version, p = l.identifier ?? n(d), m;
95
- if (l.icon && (m = o.resolve(e, l.icon), !s(m))) throw new O("ERR_INCA_ICON_NOT_FOUND", `"icon" points to ${m}, which doesn't exist`, m);
96
- let h = l.entry ? o.resolve(e, l.entry) : void 0, _ = ue(e, l.outDir, h);
603
+ let r = et(n, t), { config: i, usedPackageJsonKey: a } = await G(e), o = i.productName ?? u(r.name);
604
+ if (!o) throw new V("ERR_INCA_PRODUCT_NAME_MISSING", `${t} needs a "name", or "productName" in inca.config.ts`);
605
+ H(o);
606
+ let s = i.version ?? r.version ?? d.version, c = i.identifier ?? l(o), p;
607
+ if (i.icon && (p = f.resolve(e, i.icon), !m(p))) throw new V("ERR_INCA_ICON_NOT_FOUND", `"icon" points to ${p}, which doesn't exist`, p);
608
+ let h = i.entry ? f.resolve(e, i.entry) : void 0, g = $e(e, i.outDir, h);
97
609
  return {
98
- productName: d,
99
- identifier: p,
100
- identifierIsDefault: l.identifier === void 0,
101
- version: f,
102
- icon: m,
103
- window: l.window,
610
+ productName: o,
611
+ identifier: c,
612
+ identifierIsDefault: i.identifier === void 0,
613
+ version: s,
614
+ icon: p,
615
+ window: i.window,
104
616
  entry: h,
105
- outDir: _,
106
- usedPackageJsonKey: u
617
+ outDir: g,
618
+ usedPackageJsonKey: a
107
619
  };
108
620
  }
109
- function pe(e) {
621
+ function rt(e) {
110
622
  return {
111
623
  name: e.productName,
112
624
  identifier: e.identifier,
113
625
  window: e.window
114
626
  };
115
627
  }
116
- async function N(e) {
117
- let { config: t } = await M(e), r = {};
118
- try {
119
- r = JSON.parse(await g(o.join(e, "package.json"), "utf8"));
120
- } catch {}
121
- let a = t.productName ?? i(r.name);
122
- a && k(a);
123
- let s = {
628
+ async function it(e) {
629
+ let { config: t } = await G(e), n = f.join(e, "package.json"), r = await w(n, "utf8").catch(() => void 0), i = r === void 0 ? {} : et(r, n), a = t.productName ?? u(i.name);
630
+ a && H(a);
631
+ let o = {
124
632
  name: a,
125
- identifier: t.identifier ?? (a ? n(a) : void 0),
633
+ identifier: t.identifier ?? (a ? l(a) : void 0),
126
634
  window: t.window
127
635
  };
128
- return Object.values(s).some((e) => e !== void 0) ? s : void 0;
636
+ return Object.values(o).some((e) => e !== void 0) ? o : void 0;
129
637
  }
130
638
  //#endregion
131
639
  //#region src/adapter/vite/captureOutput.mts
132
- function P(e, t, n) {
640
+ function at(e, t, n) {
133
641
  return {
134
642
  outDir: e,
135
- entryFile: o.join(e, t.entryFile),
643
+ entryFile: f.join(e, t.entryFile),
136
644
  files: t.files,
137
645
  changed: n
138
646
  };
139
647
  }
140
- function me(e, t) {
648
+ function ot(e, t) {
141
649
  return {
142
650
  name: "inca:capture-output",
143
651
  writeBundle(n, r) {
@@ -152,19 +660,19 @@ function me(e, t) {
152
660
  }
153
661
  //#endregion
154
662
  //#region src/adapter/vite/emitConfig.mts
155
- var F = "inca.json";
156
- function I(e) {
663
+ var st = "inca.json";
664
+ function ct(e) {
157
665
  let t = JSON.stringify(e, void 0, 2);
158
666
  if (t !== void 0 && t !== "{}") return `${t}\n`;
159
667
  }
160
- function he(e) {
161
- let t = I(e);
668
+ function lt(e) {
669
+ let t = ct(e);
162
670
  return {
163
671
  name: "inca:emit-config",
164
672
  generateBundle() {
165
673
  t && this.emitFile({
166
674
  type: "asset",
167
- fileName: F,
675
+ fileName: st,
168
676
  source: t
169
677
  });
170
678
  }
@@ -172,8 +680,8 @@ function he(e) {
172
680
  }
173
681
  //#endregion
174
682
  //#region src/adapter/vite/logger.mts
175
- var ge = "Build failed with ", _e = "Pre-transform error";
176
- function L(e, t, n = !1) {
683
+ var ut = "Build failed with ", dt = "Pre-transform error";
684
+ function ft(e, t, n = !1) {
177
685
  let r = /* @__PURE__ */ new WeakSet(), i = /* @__PURE__ */ new Set(), a = {
178
686
  hasWarned: !1,
179
687
  info(t) {
@@ -186,7 +694,7 @@ function L(e, t, n = !1) {
186
694
  i.has(e) || (i.add(e), a.warn(e));
187
695
  },
188
696
  error(e, n) {
189
- a.hasWarned = !0, n?.error && r.add(n.error), !e.includes(ge) && (e.includes(_e) || t.write(`${e.replace(/\n\s+at .*/g, "")}\n`));
697
+ a.hasWarned = !0, n?.error && r.add(n.error), !e.includes(ut) && (e.includes(dt) || t.write(`${e.replace(/\n\s+at .*/g, "")}\n`));
190
698
  },
191
699
  clearScreen() {},
192
700
  hasErrorLogged(e) {
@@ -197,7 +705,7 @@ function L(e, t, n = !1) {
197
705
  }
198
706
  //#endregion
199
707
  //#region src/adapter/vite/unsupported.mts
200
- var ve = /\.(?:css|pcss|postcss|sass|scss|less|styl|stylus)(?:\?|$)/, ye = [{
708
+ var pt = /\.(?:css|pcss|postcss|sass|scss|less|styl|stylus)(?:\?|$)/, mt = [{
201
709
  code: "ERR_INCA_UNSUPPORTED_STYLE",
202
710
  name: "a <style> block",
203
711
  matches: (e) => e.includes("vue&type=style"),
@@ -205,52 +713,52 @@ var ve = /\.(?:css|pcss|postcss|sass|scss|less|styl|stylus)(?:\?|$)/, ye = [{
205
713
  }, {
206
714
  code: "ERR_INCA_UNSUPPORTED_STYLESHEET",
207
715
  name: "a stylesheet import",
208
- matches: (e) => ve.test(e),
716
+ matches: (e) => pt.test(e),
209
717
  hint: "the renderer applies no stylesheet — use a :style binding instead"
210
718
  }];
211
- function R(e, t = ye) {
719
+ function ht(e, t = mt) {
212
720
  return {
213
721
  name: "inca:reject-unsupported",
214
722
  enforce: "pre",
215
723
  transform(n, r) {
216
724
  let i = t.find((e) => e.matches(r));
217
725
  if (!i) return null;
218
- let a = o.relative(process.cwd(), r.split("?")[0] ?? r);
726
+ let a = f.relative(process.cwd(), r.split("?")[0] ?? r);
219
727
  throw new e.IncaError(i.code, `${i.code}: ${a} uses ${i.name}, unsupported for now: ${i.hint}`);
220
728
  }
221
729
  };
222
730
  }
223
731
  //#endregion
224
732
  //#region src/adapter/vite/config.mts
225
- var be = "bundle.js";
226
- function z({ core: e, entry: t, outDir: n, mode: r, watch: i, onOutput: a, stdout: s, stderr: c, quiet: l, runtimeConfig: u }) {
733
+ var gt = "bundle.js";
734
+ function _t({ core: e, runtimeModuleName: t, entry: n, outDir: r, mode: i, watch: a, onOutput: o, stdout: s, stderr: c, quiet: l, runtimeConfig: u }) {
227
735
  return {
228
736
  configFile: !1,
229
- root: o.dirname(t),
230
- mode: r,
737
+ root: f.dirname(n),
738
+ mode: i,
231
739
  clearScreen: !1,
232
740
  logLevel: l ? "silent" : "info",
233
- customLogger: L(s, c),
234
- define: { "process.env.NODE_ENV": JSON.stringify(r) },
741
+ customLogger: ft(s, c),
742
+ define: { "process.env.NODE_ENV": JSON.stringify(i) },
235
743
  plugins: [
236
- E({ template: { compilerOptions: {
237
- runtimeModuleName: "@vue/runtime-core",
744
+ oe({ template: { compilerOptions: {
745
+ runtimeModuleName: t,
238
746
  hoistStatic: !1
239
747
  } } }),
240
- R(e),
241
- he(u),
242
- me(e, a)
748
+ ht(e),
749
+ lt(u),
750
+ ot(e, o)
243
751
  ],
244
752
  build: {
245
753
  lib: {
246
- entry: t,
754
+ entry: n,
247
755
  formats: ["es"],
248
- fileName: () => be
756
+ fileName: () => gt
249
757
  },
250
- outDir: n,
251
- emptyOutDir: r === "production",
252
- minify: r === "production",
253
- watch: i ? {} : void 0,
758
+ outDir: r,
759
+ emptyOutDir: i === "production",
760
+ minify: i === "production",
761
+ watch: a ? { buildDelay: 30 } : void 0,
254
762
  rolldownOptions: { output: {
255
763
  chunkFileNames: "chunks/[name]-[hash].js",
256
764
  assetFileNames: "assets/[name]-[hash][extname]"
@@ -260,73 +768,74 @@ function z({ core: e, entry: t, outDir: n, mode: r, watch: i, onOutput: a, stdou
260
768
  }
261
769
  //#endregion
262
770
  //#region src/adapter/vite/build.mts
263
- async function xe(e, { entry: t, outDir: n, runtimeConfig: r, stdout: i = process.stdout, stderr: a = process.stderr, quiet: o = !1 }) {
264
- let s;
265
- if (await C(z({
771
+ async function vt(e, t, { entry: n, outDir: r, runtimeConfig: i, stdout: a = process.stdout, stderr: o = process.stderr, quiet: s = !1 }) {
772
+ let c;
773
+ if (await A(_t({
266
774
  core: e,
267
- entry: t,
268
- outDir: n,
269
- runtimeConfig: r,
775
+ runtimeModuleName: t,
776
+ entry: n,
777
+ outDir: r,
778
+ runtimeConfig: i,
270
779
  mode: "production",
271
780
  watch: !1,
272
- stdout: i,
273
- stderr: a,
274
- quiet: o,
781
+ stdout: a,
782
+ stderr: o,
783
+ quiet: s,
275
784
  onOutput: (e) => {
276
- s = P(n, e);
785
+ c = at(r, e);
277
786
  }
278
- })), !s) throw new e.IncaError("ERR_INCA_BUILD_NO_OUTPUT", "build produced no output");
279
- return s;
787
+ })), !c) throw new e.IncaError("ERR_INCA_BUILD_NO_OUTPUT", "build produced no output");
788
+ return c;
280
789
  }
281
790
  //#endregion
282
791
  //#region src/adapter/vite/hmr.mts
283
- function Se(e, t) {
284
- let n = w(t, [], !1), r = [t.stack, n].filter((e) => e).join("\n");
792
+ function yt(e, t) {
793
+ let n = ie(t, [], !1), r = [t.stack, n].filter((e) => e).join("\n");
285
794
  return {
286
795
  ...e.bundlerFault(t.message),
287
796
  stack: r || null
288
797
  };
289
798
  }
290
- function B(e) {
291
- return o.join(e, "node_modules/.inca/hmr");
799
+ function bt(e) {
800
+ return f.join(e, "node_modules/.inca/hmr");
292
801
  }
293
- function Ce() {
294
- let e = o.dirname(x(import.meta.url));
295
- for (; !s(o.join(e, "package.json"));) {
296
- let t = o.dirname(e);
802
+ function xt() {
803
+ let e = f.dirname(te(import.meta.url));
804
+ for (; !m(f.join(e, "package.json"));) {
805
+ let t = f.dirname(e);
297
806
  if (t === e) throw Error("could not locate @incajs/cli's own package.json");
298
807
  e = t;
299
808
  }
300
- return o.join(e, "dist/hmr-runtime.js");
809
+ return f.join(e, "dist/hmr-runtime.js");
301
810
  }
302
- function we(e, t) {
303
- let n = o.relative(e, t).split(o.sep).join("/");
811
+ function St(e, t) {
812
+ let n = f.relative(e, t).split(f.sep).join("/");
304
813
  return n.startsWith(".") ? n : `./${n}`;
305
814
  }
306
- async function Te(e, t, n) {
307
- let r = B(e);
308
- await h(r, { recursive: !0 });
309
- let i = o.join(r, "entry.js"), a = we(r, n ?? Ce()), s = t.split(o.sep).join("/");
310
- return await y(i, `import { start } from ${JSON.stringify(a)};\nstart(${JSON.stringify(s)}).catch((err) => console.error(err));\n`), i;
815
+ async function Ct(e, t, n) {
816
+ let r = bt(e);
817
+ await C(r, { recursive: !0 });
818
+ let i = f.join(r, "entry.js"), a = St(r, n ?? xt()), o = t.split(f.sep).join("/");
819
+ return await D(i, `import { start } from ${JSON.stringify(a)};\nstart(${JSON.stringify(o)}).catch((err) => console.error(err));\n`), i;
311
820
  }
312
- function Ee(e) {
821
+ function wt(e) {
313
822
  if (e.type === "error") return e.err;
314
823
  if (e.type === "custom" && e.event === "vite:invoke") return e.data?.data?.error;
315
824
  }
316
- function De(e) {
825
+ function Tt(e) {
317
826
  if (e.type !== "custom" || e.event !== "vite:invoke") return !1;
318
827
  let t = e.data;
319
828
  return t.name === "fetchModule" && !t.data?.error;
320
829
  }
321
- function Oe(e, t, n, r, i) {
830
+ function Et(e, t, n, r, i) {
322
831
  let a = /* @__PURE__ */ new Map(), o = { send: s };
323
832
  function s(a) {
324
833
  if (a.type === "full-reload") {
325
834
  t();
326
835
  return;
327
836
  }
328
- let o = Ee(a);
329
- o ? (n(o), i.current = void 0) : De(a) && i.current && (r({
837
+ let o = wt(a);
838
+ o ? (n(o), i.current = void 0) : Tt(a) && i.current && (r({
330
839
  file: i.current.file,
331
840
  took: Date.now() - i.current.at
332
841
  }), i.current = void 0), e(a);
@@ -348,7 +857,7 @@ function Oe(e, t, n, r, i) {
348
857
  }
349
858
  };
350
859
  }
351
- function ke() {
860
+ function Dt() {
352
861
  let e = "\0inca:vite-client-shim";
353
862
  return {
354
863
  name: "inca:shim-vite-client",
@@ -361,7 +870,7 @@ function ke() {
361
870
  }
362
871
  };
363
872
  }
364
- function Ae(e) {
873
+ function Ot(e) {
365
874
  return {
366
875
  name: "inca:file-changed",
367
876
  hotUpdate(t) {
@@ -376,126 +885,131 @@ function Ae(e) {
376
885
  }
377
886
  };
378
887
  }
379
- async function je(e, { entry: t, cwd: n, runtimeConfig: r, runtimePath: i, stdout: a = process.stdout, stderr: s = process.stderr, quiet: c = !1, notify: l, reload: u, onError: d, onUpdate: f = () => {} }) {
380
- let p = await Te(n, t, i), m = I(r);
381
- m && await y(o.join(B(n), F), m);
382
- let h = { current: void 0 }, { channel: g, dispatch: _ } = Oe(l, u, (t) => d(Se(e, t)), f, h), v = await T({
888
+ async function kt(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: p = () => {} }) {
889
+ let m = await Ct(r, n, a), h = ct(i), g = f.join(bt(r), st);
890
+ h ? await D(g, h) : await E(g, { force: !0 });
891
+ let _ = { current: void 0 }, { channel: v, dispatch: y } = Et(l, u, (t) => d(yt(e, t)), p, _), b = await ae({
383
892
  configFile: !1,
384
- root: o.dirname(t),
893
+ root: f.dirname(n),
385
894
  mode: "development",
386
895
  clearScreen: !1,
387
896
  logLevel: c ? "silent" : "info",
388
- customLogger: L(a, s, c),
897
+ customLogger: ft(o, s, c),
389
898
  define: { "process.env.NODE_ENV": JSON.stringify("development") },
390
899
  server: {
391
900
  middlewareMode: !0,
392
- ws: !1
901
+ ws: !1,
902
+ watch: { awaitWriteFinish: {
903
+ stabilityThreshold: 20,
904
+ pollInterval: 10
905
+ } }
393
906
  },
394
907
  optimizeDeps: { noDiscovery: !0 },
395
908
  environments: { client: {
396
909
  consumer: "client",
397
910
  dev: {
398
911
  moduleRunnerTransform: !0,
399
- createEnvironment: (e, t) => new S(e, t, {
912
+ createEnvironment: (e, t) => new re(e, t, {
400
913
  hot: !0,
401
- transport: g
914
+ transport: v
402
915
  })
403
916
  }
404
917
  } },
405
918
  plugins: [
406
- E({ template: { compilerOptions: {
407
- runtimeModuleName: "@vue/runtime-core",
919
+ oe({ template: { compilerOptions: {
920
+ runtimeModuleName: t,
408
921
  hoistStatic: !1
409
922
  } } }),
410
- R(e),
411
- ke(),
412
- Ae(h)
923
+ ht(e),
924
+ Dt(),
925
+ Ot(_)
413
926
  ]
414
927
  });
415
928
  return {
416
- entryFile: p,
417
- dispatch: _,
418
- close: () => v.close()
929
+ entryFile: m,
930
+ dispatch: y,
931
+ close: () => b.close()
419
932
  };
420
933
  }
421
934
  //#endregion
422
935
  //#region src/adapter/vite/watch.mts
423
- async function Me(e, { onBuild: t, onError: n, stdout: r = process.stdout, stderr: i = process.stderr, quiet: a = !1, ...o }) {
424
- let { outDir: s } = o, c, l = await C(z({
936
+ async function At(e, t, { onBuild: n, onError: r, stdout: i = process.stdout, stderr: a = process.stderr, quiet: o = !1, ...s }) {
937
+ let { outDir: c } = s, l, u = await A(_t({
425
938
  core: e,
426
- ...o,
939
+ runtimeModuleName: t,
940
+ ...s,
427
941
  watch: !0,
428
- stdout: r,
429
- stderr: i,
430
- quiet: a,
942
+ stdout: i,
943
+ stderr: a,
944
+ quiet: o,
431
945
  onOutput: (e) => {
432
- t(P(s, e, c)), c = void 0;
946
+ n(at(c, e, l)), l = void 0;
433
947
  }
434
948
  }));
435
- return l.on("change", (e) => {
436
- c ??= {
949
+ return u.on("change", (e) => {
950
+ l ??= {
437
951
  file: e,
438
952
  at: Date.now()
439
953
  };
440
- }), l.on("event", (t) => {
954
+ }), u.on("event", (t) => {
441
955
  if (t.code !== "ERROR") return;
442
- c = void 0;
443
- let { errors: r } = t.error;
444
- n(e.bundlerFault(r?.[0]?.message ?? t.error.message));
445
- }), { close: () => l.close() };
956
+ l = void 0;
957
+ let { errors: n } = t.error;
958
+ r(e.bundlerFault(n?.[0]?.message ?? t.error.message));
959
+ }), { close: () => u.close() };
446
960
  }
447
961
  //#endregion
448
962
  //#region src/adapter/vite/createBundler.mts
449
- function Ne(e) {
963
+ function jt(e, t) {
450
964
  return {
451
- watch: (t) => Me(e, t),
452
- build: (t) => xe(e, t),
453
- hmr: (t) => je(e, t)
965
+ watch: (n) => At(e, t, n),
966
+ build: (n) => vt(e, t, n),
967
+ hmr: (n) => kt(e, t, n)
454
968
  };
455
969
  }
456
970
  //#endregion
457
971
  //#region src/dev-client/hostBin.mts
458
- var V = "INCA_HOST_BIN";
459
- function H() {
972
+ var Mt = "INCA_HOST_BIN";
973
+ function Nt() {
460
974
  let e = process.platform === "darwin" || process.platform === "linux" ? process.platform : void 0, t = process.arch === "arm64" || process.arch === "x64" ? process.arch : void 0;
461
975
  return e && t ? `@incajs/host-${e}-${t}` : void 0;
462
976
  }
463
- function Pe() {
464
- let e = H();
977
+ function Pt() {
978
+ let e = Nt();
465
979
  if (e) try {
466
- return ee(import.meta.url).resolve(`${e}/bin/inca-host`);
980
+ return se(import.meta.url).resolve(`${e}/bin/inca-host`);
467
981
  } catch {
468
982
  return;
469
983
  }
470
984
  }
471
- function U() {
472
- let e = process.env[V];
985
+ function K() {
986
+ let e = process.env[Mt];
473
987
  if (e) return e;
474
- let t = Pe();
988
+ let t = Pt();
475
989
  if (t) return t;
476
- let n = H();
477
- throw new O("ERR_INCA_HOST_BIN_UNRESOLVED", `no inca-host binary found — ${n ? `no ${n} package is installed for it` : `this platform (${process.platform}/${process.arch}) has no published package`}, and ${V} isn't set to one`);
990
+ let n = Nt();
991
+ throw new V("ERR_INCA_HOST_BIN_UNRESOLVED", `no inca-host binary found — ${n ? `no ${n} package is installed for it` : `this platform (${process.platform}/${process.arch}) has no published package`}, and ${Mt} isn't set to one`);
478
992
  }
479
- function W(e) {
480
- if (!u(e, { throwIfNoEntry: !1 })?.isFile()) throw new O("ERR_INCA_HOST_BIN_NOT_FOUND", `no host binary at ${e} — check that it was built`);
993
+ function q(e) {
994
+ if (!v(e, { throwIfNoEntry: !1 })?.isFile()) throw new V("ERR_INCA_HOST_BIN_NOT_FOUND", `no host binary at ${e} — check that it was built`);
481
995
  }
482
996
  //#endregion
483
997
  //#region src/dev-client/hostError.mts
484
- var G = class extends Error {
998
+ var Ft = class extends Error {
485
999
  code;
486
1000
  hostStack;
487
1001
  constructor(e, t, n = null) {
488
1002
  super(e), this.code = t, this.hostStack = n, this.name = "HostError";
489
1003
  }
490
1004
  };
491
- function Fe(e) {
1005
+ function It(e) {
492
1006
  return typeof e == "object" && !!e && e.jsonrpc === "2.0";
493
1007
  }
494
1008
  //#endregion
495
1009
  //#region src/dev-client/hostClient.mts
496
- var Ie = (e) => {
1010
+ var Lt = (e) => {
497
1011
  process.stderr.write(e.endsWith("\n") ? e : `${e}\n`);
498
- }, Le = -32e3, Re = class {
1012
+ }, Rt = -32e3, zt = class {
499
1013
  #e;
500
1014
  #t;
501
1015
  #n = 1;
@@ -505,9 +1019,9 @@ var Ie = (e) => {
505
1019
  this.#e = e;
506
1020
  }
507
1021
  async start() {
508
- let e = this.#e.hostBin ?? U();
509
- W(e);
510
- let t = te(e, ["--dev", this.#e.entryFile], {
1022
+ let e = this.#e.hostBin ?? K();
1023
+ q(e);
1024
+ let t = ce(e, ["--dev", this.#e.entryFile], {
511
1025
  stdio: [
512
1026
  "pipe",
513
1027
  "pipe",
@@ -516,10 +1030,10 @@ var Ie = (e) => {
516
1030
  env: this.#e.env
517
1031
  });
518
1032
  this.#t = t;
519
- let n = this.#e.onStderr ?? Ie;
1033
+ let n = this.#e.onStderr ?? Lt;
520
1034
  t.stderr.setEncoding("utf8"), t.stderr.on("data", (e) => n(e)), t.stdin.on("error", (e) => {
521
1035
  e.code !== "EPIPE" && n(`inca-host stdin: ${e.message}\n`);
522
- }), ne.createInterface({ input: t.stdout }).on("line", (e) => {
1036
+ }), le.createInterface({ input: t.stdout }).on("line", (e) => {
523
1037
  this.#a(e, n);
524
1038
  }), t.on("exit", (e, t) => {
525
1039
  let n = /* @__PURE__ */ Error(`inca-host exited (code=${String(e)}, signal=${String(t)}) before answering`);
@@ -529,7 +1043,7 @@ var Ie = (e) => {
529
1043
  let r = !1;
530
1044
  t.on("error", (e) => {
531
1045
  r && n(`inca-host: ${e.message}\n`);
532
- }), await D(t, "spawn"), r = !0;
1046
+ }), await j(t, "spawn"), r = !0;
533
1047
  }
534
1048
  #a(e, t) {
535
1049
  let n;
@@ -539,7 +1053,7 @@ var Ie = (e) => {
539
1053
  t(`[stray stdout] ${e}`);
540
1054
  return;
541
1055
  }
542
- if (!Fe(n)) {
1056
+ if (!It(n)) {
543
1057
  t(`[stray stdout] ${e}`);
544
1058
  return;
545
1059
  }
@@ -550,14 +1064,14 @@ var Ie = (e) => {
550
1064
  if (n.id === null) {
551
1065
  if (!("error" in n)) return;
552
1066
  let { code: e, message: r, data: i } = n.error;
553
- e === Le ? this.#e.onAppError?.({
1067
+ e === Rt ? this.#e.onAppError?.({
554
1068
  message: r,
555
1069
  stack: i?.stack ?? null
556
1070
  }) : t(`[host error ${String(e)}] ${r}\n`);
557
1071
  return;
558
1072
  }
559
1073
  let r = this.#r.get(n.id);
560
- r && (this.#r.delete(n.id), "error" in n ? r.reject(new G(n.error.message, n.error.code, n.error.data?.stack ?? null)) : r.resolve(n.result));
1074
+ r && (this.#r.delete(n.id), "error" in n ? r.reject(new Ft(n.error.message, n.error.code, n.error.data?.stack ?? null)) : r.resolve(n.result));
561
1075
  }
562
1076
  #o(e, t, n) {
563
1077
  switch (e) {
@@ -580,7 +1094,7 @@ var Ie = (e) => {
580
1094
  }
581
1095
  }
582
1096
  async #s(e) {
583
- let t = D(e, "exit");
1097
+ let t = j(e, "exit");
584
1098
  e.kill(), await t;
585
1099
  }
586
1100
  async call(e, t, n) {
@@ -621,35 +1135,35 @@ var Ie = (e) => {
621
1135
  let t = this.#t;
622
1136
  if (!t || t.exitCode !== null || t.signalCode !== null) return;
623
1137
  this.#i = !0;
624
- let n = D(t, "exit");
625
- this.call("shutdown").catch(() => {}), await Promise.race([n.then(() => "exited"), re(e, void 0, { ref: !1 }).then(() => "timeout")]) === "timeout" && (t.kill(), await n);
1138
+ let n = j(t, "exit");
1139
+ this.call("shutdown").catch(() => {}), await Promise.race([n.then(() => "exited"), ue(e, void 0, { ref: !1 }).then(() => "timeout")]) === "timeout" && (t.kill(), await n);
626
1140
  }
627
- }, ze = "[inca]", Be = new Intl.DateTimeFormat(void 0, {
1141
+ }, Bt = "[inca]", Vt = new Intl.DateTimeFormat(void 0, {
628
1142
  hour: "numeric",
629
1143
  minute: "numeric",
630
1144
  second: "numeric"
631
- }), K = { timestamp: !0 };
632
- function q(e, t, n) {
633
- let r = b(["bold", n], ze, { stream: e });
634
- return t.timestamp ? `${b("dim", Be.format(/* @__PURE__ */ new Date()), { stream: e })} ${r}` : r;
1145
+ }), J = { timestamp: !0 };
1146
+ function Ht(e, t, n) {
1147
+ let r = O(["bold", n], Bt, { stream: e });
1148
+ return t.timestamp ? `${O("dim", Vt.format(/* @__PURE__ */ new Date()), { stream: e })} ${r}` : r;
635
1149
  }
636
- function J(e, t, n = {}) {
637
- e.write(`${q(e, n, "cyan")} ${t}\n`);
1150
+ function Y(e, t, n = {}) {
1151
+ e.write(`${Ht(e, n, "cyan")} ${t}\n`);
638
1152
  }
639
- function Y(e) {
1153
+ function Ut(e) {
640
1154
  let t = e.code;
641
1155
  return typeof t == "string" ? t : null;
642
1156
  }
643
- function Ve(e) {
1157
+ function Wt(e) {
644
1158
  return /\bERR_INCA_[A-Z0-9_]+/.exec(e)?.[0] ?? null;
645
1159
  }
646
- function He(e) {
1160
+ function Gt(e) {
647
1161
  let t = e.stack;
648
1162
  if (!t) return null;
649
1163
  for (let n of [`${e.name}: ${e.message}`, e.message]) if (t.startsWith(n)) return t.slice(n.length).replace(/^\r?\n/, "") || null;
650
1164
  return t;
651
1165
  }
652
- function Ue(e) {
1166
+ function Kt(e) {
653
1167
  let t = /^(?:\w*Error: )?(ERR_INCA_[A-Z0-9_]+): /.exec(e);
654
1168
  return t ? {
655
1169
  message: e.slice(t[0].length),
@@ -662,137 +1176,139 @@ function Ue(e) {
662
1176
  };
663
1177
  }
664
1178
  function X(e) {
665
- return e instanceof G ? {
1179
+ return e instanceof Ft ? {
666
1180
  message: e.message,
667
1181
  stack: e.hostStack,
668
- code: Y(e)
1182
+ code: Ut(e)
669
1183
  } : e instanceof Error ? {
670
1184
  message: e.message,
671
- stack: He(e),
672
- code: Y(e) ?? Ve(e.message)
1185
+ stack: Gt(e),
1186
+ code: Ut(e) ?? Wt(e.message)
673
1187
  } : {
674
1188
  message: String(e),
675
1189
  stack: null,
676
1190
  code: null
677
1191
  };
678
1192
  }
679
- function We(e, t) {
680
- return e.split("\n").map((e) => /^\s*at\b/.test(e) ? b("dim", e, { stream: t }) : e).join("\n");
1193
+ function qt(e, t) {
1194
+ return e.split("\n").map((e) => /^\s*at\b/.test(e) ? O("dim", e, { stream: t }) : e).join("\n");
681
1195
  }
682
1196
  function Z(e, t, n, r = {}) {
683
- n.stack && e.write(`${We(n.stack, e)}\n`);
684
- let i = n.code ? ` (${b("bold", n.code, { stream: e })})` : "";
685
- e.write(`${q(e, r, "red")} ${t}${i}: ${n.message}\n`);
1197
+ n.stack && e.write(`${qt(n.stack, e)}\n`);
1198
+ let i = n.code ? ` (${O("bold", n.code, { stream: e })})` : "";
1199
+ e.write(`${Ht(e, r, "red")} ${t}${i}: ${n.message}\n`);
686
1200
  }
687
1201
  //#endregion
688
1202
  //#region src/defaultBundler.mts
689
- var Ge = Ne(/* @__PURE__ */ e({
690
- IncaError: () => O,
691
- bundlerFault: () => Ue
692
- }));
693
- //#endregion
694
- //#region src/entry.mts
695
- async function Ke(e) {
696
- let t = o.join(e, "src/main.mts");
697
- if (s(t)) return t;
698
- let n = o.join(e, "src/App.vue");
699
- if (s(n)) return qe(n, e);
700
- throw new O("ERR_INCA_ENTRY_NOT_FOUND", `no app entry found — expected ${t} or ${n}`);
701
- }
702
- async function qe(e, t) {
703
- let n = o.join(t, "node_modules/.inca");
704
- await h(n, { recursive: !0 });
705
- let r = o.join(n, "entry.mts"), i = JSON.stringify(e.split(o.sep).join("/"));
706
- return await y(r, `import { createIncaApp } from "incajs/vue";\nimport App from ${i};\ncreateIncaApp(App).mount();\n`), r;
1203
+ var Jt = jt(/* @__PURE__ */ e({
1204
+ IncaError: () => V,
1205
+ bundlerFault: () => Kt
1206
+ }), "incajs/vue/runtime"), Q = [
1207
+ "main.mts",
1208
+ "main.ts",
1209
+ "main.js"
1210
+ ];
1211
+ async function Yt(e) {
1212
+ let t = Q.map((t) => f.join(e, "src", t)).find((e) => m(e));
1213
+ if (t) return t;
1214
+ let n = f.join(e, "src/App.vue");
1215
+ if (m(n)) return Xt(n, e);
1216
+ throw new V("ERR_INCA_ENTRY_NOT_FOUND", `no app entry found — check that ${f.join(e, "src/main.ts")} or ${n} exists`);
1217
+ }
1218
+ async function Xt(e, t) {
1219
+ let n = f.join(t, "node_modules/.inca");
1220
+ await C(n, { recursive: !0 });
1221
+ let r = f.join(n, "entry.mts"), i = JSON.stringify(e.split(f.sep).join("/"));
1222
+ return await D(r, `import { createIncaApp } from "incajs/vue";\nimport App from ${i};\ncreateIncaApp(App).mount();\n`), r;
707
1223
  }
708
1224
  //#endregion
709
1225
  //#region src/build.mts
710
- async function Je(e = {}) {
711
- let t = e.cwd ?? process.cwd(), n = e.config ?? await de(t), r = o.resolve(t, n.outDir), i = e.bundler ?? Ge, a = e.entry ?? n.entry ?? await Ke(t);
712
- j(t, r, a);
713
- let s = e.runtimeConfig ?? await N(t);
1226
+ async function Zt(e = {}) {
1227
+ let t = e.cwd ?? process.cwd(), n = e.config ?? await tt(t), r = f.resolve(t, n.outDir), i = e.bundler ?? Jt, a = e.entry ?? n.entry ?? await Yt(t);
1228
+ W(t, r, a);
1229
+ let o = e.runtimeConfig ?? await it(t);
714
1230
  return i.build({
715
1231
  entry: a,
716
1232
  outDir: r,
717
- runtimeConfig: s,
1233
+ runtimeConfig: o,
718
1234
  stdout: e.stdout,
719
1235
  stderr: e.stderr
720
1236
  });
721
1237
  }
722
1238
  //#endregion
723
- //#region src/dev-lock.mts
724
- function Ye(e) {
725
- return o.join(e, "node_modules/.inca/dev.pid");
1239
+ //#region src/devLock.mts
1240
+ function Qt(e) {
1241
+ return f.join(e, "node_modules/.inca/dev.pid");
726
1242
  }
727
- function Xe(e) {
1243
+ function $t(e) {
728
1244
  try {
729
1245
  return process.kill(e, 0), !0;
730
1246
  } catch (e) {
731
1247
  return e.code === "EPERM";
732
1248
  }
733
1249
  }
734
- var Ze = ie();
735
- function Q(e) {
736
- return new O("ERR_INCA_DEV_RUNNING", `inca dev is already running for this app (pid ${String(e)})`);
1250
+ var en = de();
1251
+ function $(e) {
1252
+ return new V("ERR_INCA_DEV_RUNNING", `inca dev is already running for this app (pid ${String(e)})`);
737
1253
  }
738
- async function Qe(e) {
739
- let t = Ye(e), n = `${String(process.pid)}:${Ze}`, r = `${t}.${ie()}`;
740
- await h(o.dirname(t), { recursive: !0 }), await y(r, n);
1254
+ async function tn(e) {
1255
+ let t = Qt(e), n = `${String(process.pid)}:${en}`, r = `${t}.${de()}`;
1256
+ await C(f.dirname(t), { recursive: !0 }), await D(r, n);
741
1257
  let i = process.pid;
742
1258
  try {
743
1259
  for (let e = 0; e < 5; e++) {
744
1260
  try {
745
- return await m(r, t), $e(t, n);
1261
+ return await S(r, t), nn(t, n);
746
1262
  } catch (e) {
747
1263
  if (e.code !== "EEXIST") throw e;
748
1264
  }
749
- let e = await g(t, "utf8").catch(() => ""), a = Number.parseInt(e, 10);
1265
+ let e = await w(t, "utf8").catch(() => ""), a = Number.parseInt(e, 10);
750
1266
  if (a === process.pid) {
751
- if (e === n) throw Q(a);
752
- } else if (Number.isSafeInteger(a) && a > 0 && Xe(a)) throw Q(a);
753
- i = Number.isSafeInteger(a) && a > 0 ? a : i, await v(t, { force: !0 });
1267
+ if (e === n) throw $(a);
1268
+ } else if (Number.isSafeInteger(a) && a > 0 && $t(a)) throw $(a);
1269
+ i = Number.isSafeInteger(a) && a > 0 ? a : i, await E(t, { force: !0 });
754
1270
  }
755
- throw Q(i);
1271
+ throw $(i);
756
1272
  } finally {
757
- await v(r, { force: !0 });
1273
+ await E(r, { force: !0 });
758
1274
  }
759
1275
  }
760
- function $e(e, t) {
1276
+ function nn(e, t) {
761
1277
  let n = !1;
762
1278
  return async () => {
763
- n || (n = !0, await g(e, "utf8").catch(() => "") === t && await v(e, { force: !0 }));
1279
+ n || (n = !0, await w(e, "utf8").catch(() => "") === t && await E(e, { force: !0 }));
764
1280
  };
765
1281
  }
766
1282
  //#endregion
767
1283
  //#region src/plist.mts
768
- function $(e) {
1284
+ function rn(e) {
769
1285
  return e.replaceAll("&", "&amp;").replaceAll("<", "&lt;").replaceAll(">", "&gt;");
770
1286
  }
771
- function et(e) {
772
- return typeof e == "boolean" ? e ? "<true/>" : "<false/>" : `<string>${$(e)}</string>`;
1287
+ function an(e) {
1288
+ return typeof e == "boolean" ? e ? "<true/>" : "<false/>" : `<string>${rn(e)}</string>`;
773
1289
  }
774
- function tt(e) {
1290
+ function on(e) {
775
1291
  return `<?xml version="1.0" encoding="UTF-8"?>
776
1292
  <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
777
1293
  <plist version="1.0">
778
1294
  <dict>
779
- ${Object.entries(e).map(([e, t]) => `\t<key>${$(e)}</key>\n\t${et(t)}`).join("\n")}\n</dict>
1295
+ ${Object.entries(e).map(([e, t]) => `\t<key>${rn(e)}</key>\n\t${an(t)}`).join("\n")}\n</dict>
780
1296
  </plist>
781
1297
  `;
782
1298
  }
783
1299
  //#endregion
784
- //#region src/macos-app.mts
785
- async function nt(e) {
1300
+ //#region src/macosApp.mts
1301
+ async function sn(e) {
786
1302
  let { appPath: t, metadata: n, hostBin: r } = e;
787
- await v(t, {
1303
+ await E(t, {
788
1304
  recursive: !0,
789
1305
  force: !0
790
1306
  });
791
- let i = o.join(t, "Contents"), a = o.join(i, "MacOS"), s = o.join(i, "Resources");
792
- await h(a, { recursive: !0 }), await h(s, { recursive: !0 });
793
- let c = o.join(a, n.productName);
794
- e.link ? await m(r, c).catch(() => p(r, c)) : await p(r, c), await f(c, 493);
795
- let l = {
1307
+ let i = f.join(t, "Contents"), a = f.join(i, "MacOS"), o = f.join(i, "Resources");
1308
+ await C(a, { recursive: !0 }), await C(o, { recursive: !0 });
1309
+ let s = f.join(a, n.productName);
1310
+ e.link ? await S(r, s).catch(() => x(r, s)) : await x(r, s), await b(s, 493);
1311
+ let c = {
796
1312
  CFBundleName: n.productName,
797
1313
  CFBundleDisplayName: n.productName,
798
1314
  CFBundleExecutable: n.productName,
@@ -804,56 +1320,56 @@ async function nt(e) {
804
1320
  NSHighResolutionCapable: !0
805
1321
  };
806
1322
  if (n.icon) {
807
- let e = o.basename(n.icon);
808
- await p(n.icon, o.join(s, e)), l.CFBundleIconFile = e;
1323
+ let e = f.basename(n.icon);
1324
+ await x(n.icon, f.join(o, e)), c.CFBundleIconFile = e;
809
1325
  }
810
- return await y(o.join(i, "Info.plist"), tt(l)), await y(o.join(i, "PkgInfo"), "APPL????"), {
1326
+ return await D(f.join(i, "Info.plist"), on(c)), await D(f.join(i, "PkgInfo"), "APPL????"), {
811
1327
  appPath: t,
812
- executablePath: c,
813
- resourcesDir: s
1328
+ executablePath: s,
1329
+ resourcesDir: o
814
1330
  };
815
1331
  }
816
1332
  //#endregion
817
1333
  //#region src/watchForEdit.mts
818
- var rt = /^(?:inca\.config\.[a-z0-9]+|package\.json)$/, it = ["main.mts", "App.vue"];
819
- function at(e, t = {}) {
820
- let n = t.debounceMs ?? 100, r = /* @__PURE__ */ new Set(), i, a = !1, c = () => {}, l = new Promise((e) => {
821
- c = e;
822
- }), u = () => {
823
- a || (clearTimeout(i), i = setTimeout(c, n), i.unref());
824
- }, f = (e, t) => {
1334
+ var cn = /^(?:inca\.config\.[a-z0-9]+|package\.json)$/, ln = [...Q, "App.vue"];
1335
+ function un(e, t = {}) {
1336
+ let n = t.debounceMs ?? 100, r = /* @__PURE__ */ new Set(), i, a = !1, o = () => {}, s = new Promise((e) => {
1337
+ o = e;
1338
+ }), c = () => {
1339
+ a || (clearTimeout(i), i = setTimeout(o, n), i.unref());
1340
+ }, l = (e, t) => {
825
1341
  let n = e;
826
- for (let e; !s(n) && (e = o.dirname(n)) !== n;) n = e;
827
- let i = n === e ? void 0 : o.relative(n, e).split(o.sep)[0], a = d(n);
1342
+ for (let e; !m(n) && (e = f.dirname(n)) !== n;) n = e;
1343
+ let i = n === e ? void 0 : f.relative(n, e).split(f.sep)[0], a = y(n);
828
1344
  a.on("change", (e, n) => {
829
1345
  let r = n === null ? null : String(n);
830
- (r === null || (i === void 0 ? t(r) : r === i)) && u();
1346
+ (r === null || (i === void 0 ? t(r) : r === i)) && c();
831
1347
  }), a.on("error", () => {
832
- a.close(), r.delete(a), u();
1348
+ a.close(), r.delete(a), c();
833
1349
  }), r.add(a);
834
- }, p = () => {
1350
+ }, u = () => {
835
1351
  a = !0, clearTimeout(i);
836
1352
  for (let e of r) e.close();
837
1353
  r.clear();
838
1354
  };
839
1355
  try {
840
- f(e, (e) => e === "src" || rt.test(e)), f(o.join(e, "src"), (e) => it.includes(e));
1356
+ l(e, (e) => e === "src" || cn.test(e)), l(f.join(e, "src"), (e) => ln.includes(e));
841
1357
  } catch (e) {
842
- throw p(), e;
1358
+ throw u(), e;
843
1359
  }
844
1360
  return {
845
- edited: l,
1361
+ edited: s,
846
1362
  add(e) {
847
1363
  if (a) return;
848
- let t = o.resolve(e);
849
- f(o.dirname(t), (e) => e === o.basename(t));
1364
+ let t = f.resolve(e);
1365
+ l(f.dirname(t), (e) => e === f.basename(t));
850
1366
  },
851
- close: p
1367
+ close: u
852
1368
  };
853
1369
  }
854
1370
  //#endregion
855
1371
  //#region src/retryOnEdit.mts
856
- function ot(e, t) {
1372
+ function dn(e, t) {
857
1373
  return new Promise((n) => {
858
1374
  let r = () => n(!1);
859
1375
  t.addEventListener("abort", r, { once: !0 }), e.then(() => {
@@ -861,184 +1377,184 @@ function ot(e, t) {
861
1377
  });
862
1378
  });
863
1379
  }
864
- async function st(e) {
1380
+ async function fn(e) {
865
1381
  let { cwd: t, signal: n, stdout: r, stderr: i, debounceMs: a } = e, o = !1;
866
1382
  for (;;) {
867
- let c = at(t, { debounceMs: a });
1383
+ let s = un(t, { debounceMs: a });
868
1384
  try {
869
- return await e.attempt(c);
1385
+ return await e.attempt(s);
870
1386
  } catch (e) {
871
- let t = e instanceof O ? e.path : void 0;
1387
+ let t = e instanceof V ? e.path : void 0;
872
1388
  if (t) try {
873
- c.add(t);
1389
+ s.add(t);
874
1390
  } catch (t) {
875
- throw Z(i, "build failed", X(e), K), t;
1391
+ throw Z(i, "build failed", X(e), J), t;
876
1392
  }
877
- if (!n.aborted && !o && t && s(t)) {
1393
+ if (!n.aborted && !o && t && m(t)) {
878
1394
  o = !0;
879
1395
  continue;
880
1396
  }
881
- if (o = !1, Z(i, "build failed", X(e), K), n.aborted || (J(r, "waiting for a change to retry", K), !await ot(c.edited, n))) return;
882
- J(r, "retrying", K);
1397
+ if (o = !1, Z(i, "build failed", X(e), J), n.aborted || (Y(r, "waiting for a change to retry", J), !await dn(s.edited, n))) return;
1398
+ Y(r, "retrying", J);
883
1399
  } finally {
884
- c.close();
1400
+ s.close();
885
1401
  }
886
1402
  }
887
1403
  }
888
1404
  //#endregion
889
1405
  //#region src/dev.mts
890
- var ct = 1e4, lt = ["ERR_INCA_PACKAGE_JSON_NOT_FOUND", "ERR_INCA_PRODUCT_NAME_MISSING"];
891
- async function ut(e, t) {
1406
+ var pn = 1e4, mn = ["ERR_INCA_PACKAGE_JSON_NOT_FOUND", "ERR_INCA_PRODUCT_NAME_MISSING"];
1407
+ async function hn(e, t) {
892
1408
  try {
893
- return await fe(e);
1409
+ return await nt(e);
894
1410
  } catch (e) {
895
- if (!(e instanceof O) || !lt.includes(e.code)) throw e;
896
- J(t, `running unnamed — ${e.message}`, K);
1411
+ if (!(e instanceof V) || !mn.includes(e.code)) throw e;
1412
+ Y(t, `running unnamed — ${e.message}`, J);
897
1413
  return;
898
1414
  }
899
1415
  }
900
- async function dt(e, t, n, r) {
1416
+ async function gn(e, t, n, r) {
901
1417
  if (process.platform === "darwin" && t) try {
902
- return (await nt({
903
- appPath: o.join(e, "node_modules/.inca", `${t.productName}.app`),
1418
+ return (await sn({
1419
+ appPath: f.join(e, "node_modules/.inca", `${t.productName}.app`),
904
1420
  metadata: t,
905
1421
  hostBin: n,
906
1422
  link: !0
907
1423
  })).executablePath;
908
1424
  } catch (e) {
909
- J(r, `running unbundled — ${X(e).message}`, K);
1425
+ Y(r, `running unbundled — ${X(e).message}`, J);
910
1426
  return;
911
1427
  }
912
1428
  }
913
- async function ft(e, t) {
1429
+ async function _n(e, t) {
914
1430
  let n = new Set(t), r;
915
1431
  try {
916
- r = await _(e, {
1432
+ r = await T(e, {
917
1433
  recursive: !0,
918
1434
  withFileTypes: !0
919
1435
  });
920
1436
  } catch {
921
1437
  return;
922
1438
  }
923
- await Promise.all(r.filter((e) => e.isFile()).map((t) => o.relative(e, o.join(t.parentPath, t.name))).filter((e) => !n.has(e)).map((t) => v(o.join(e, t), { force: !0 })));
1439
+ await Promise.all(r.filter((e) => e.isFile()).map((t) => f.relative(e, f.join(t.parentPath, t.name))).filter((e) => !n.has(e)).map((t) => E(f.join(e, t), { force: !0 })));
924
1440
  }
925
- function pt(e) {
1441
+ function vn(e) {
926
1442
  let { NO_COLOR: t, FORCE_COLOR: n } = process.env;
927
1443
  if (!(!e.isTTY || t || n)) return {
928
1444
  ...process.env,
929
1445
  FORCE_COLOR: "1"
930
1446
  };
931
1447
  }
932
- async function mt(e) {
933
- let t = e.cwd ?? process.cwd(), n = await Qe(t);
1448
+ async function yn(e) {
1449
+ let t = e.cwd ?? process.cwd(), n = await tn(t);
934
1450
  try {
935
- let n = e.hostBin ?? U();
936
- W(n);
937
- let r = e.bundler ?? Ge, i = e.stdout ?? process.stdout, a = e.stderr ?? process.stderr, s = e.experimentalHmr ? r.hmr?.bind(r) : void 0;
938
- if (e.experimentalHmr && !s) throw new O("ERR_INCA_HMR_UNSUPPORTED", "--experimental-hmr was set, but the configured bundler has no HMR support");
939
- let c = await st({
1451
+ let n = e.hostBin ?? K();
1452
+ q(n);
1453
+ let r = e.bundler ?? Jt, i = e.stdout ?? process.stdout, a = e.stderr ?? process.stderr, o = e.experimentalHmr ? r.hmr?.bind(r) : void 0;
1454
+ if (e.experimentalHmr && !o) throw new V("ERR_INCA_HMR_UNSUPPORTED", "--experimental-hmr was set, but the configured bundler has no HMR support");
1455
+ let s = await fn({
940
1456
  cwd: t,
941
1457
  signal: e.signal,
942
1458
  stdout: i,
943
1459
  stderr: a,
944
1460
  async attempt() {
945
- let n = await de(t), r = o.resolve(t, n.outDir), a = e.entry ?? n.entry ?? await Ke(t);
946
- j(t, r, a);
947
- let s = await ut(t, i);
1461
+ let n = await tt(t), r = f.resolve(t, n.outDir), a = e.entry ?? n.entry ?? await Yt(t);
1462
+ W(t, r, a);
1463
+ let o = await hn(t, i);
948
1464
  return {
949
1465
  outDir: r,
950
1466
  entry: a,
951
- metadata: s,
952
- runtimeConfig: s ? pe(s) : await N(t)
1467
+ metadata: o,
1468
+ runtimeConfig: o ? rt(o) : await it(t)
953
1469
  };
954
1470
  }
955
1471
  });
956
- if (!c) return;
957
- let { outDir: l, entry: u, metadata: d, runtimeConfig: f } = c, p = await dt(t, d, n, i) ?? n, m, h = !1, g = !1, _ = !1, v, y = Promise.resolve(), x = () => {}, S = new Promise((e) => {
958
- x = e;
1472
+ if (!s) return;
1473
+ let { outDir: c, entry: l, metadata: u, runtimeConfig: d } = s, p = await gn(t, u, n, i) ?? n, m, h = !1, g = !1, _ = !1, v, y = Promise.resolve(), b = () => {}, x = new Promise((e) => {
1474
+ b = e;
959
1475
  });
960
- async function C() {
1476
+ async function S() {
961
1477
  try {
962
- return await m?.call("reload", void 0, ct), !0;
1478
+ return await m?.call("reload", void 0, pn), !0;
963
1479
  } catch (e) {
964
- return Z(a, "reload failed", X(e), K), !1;
1480
+ return Z(a, "reload failed", X(e), J), !1;
965
1481
  }
966
1482
  }
967
- async function w(e, t) {
968
- let n = new Re({
1483
+ async function C(e, t) {
1484
+ let n = new zt({
969
1485
  entryFile: e,
970
1486
  hostBin: p,
971
- env: pt(a),
1487
+ env: vn(a),
972
1488
  onStderr: (e) => a.write(e),
973
1489
  onReady: () => {
974
- h = !0, J(i, "ready", K), g && (g = !1, C());
1490
+ h = !0, Y(i, "ready", J), g && (g = !1, S());
975
1491
  },
976
- onAppError: (e) => Z(a, "app error", e, K),
1492
+ onAppError: (e) => Z(a, "app error", e, J),
977
1493
  onExit: (e, t) => {
978
1494
  _ = !h, v = {
979
1495
  code: e,
980
1496
  signal: t
981
- }, J(i, "host exited — stopping", K), x();
1497
+ }, Y(i, "host exited — stopping", J), b();
982
1498
  },
983
1499
  integrations: t
984
1500
  });
985
1501
  try {
986
1502
  await n.start();
987
1503
  } catch (e) {
988
- Z(a, "failed to start inca-host", X(e), K);
1504
+ Z(a, "failed to start inca-host", X(e), J);
989
1505
  return;
990
1506
  }
991
1507
  m = n;
992
1508
  }
993
- async function T(e) {
994
- if (await ft(e.outDir, e.files), !m) {
995
- await w(e.entryFile);
1509
+ async function w(e) {
1510
+ if (await _n(e.outDir, e.files), !m) {
1511
+ await C(e.entryFile);
996
1512
  return;
997
1513
  }
998
1514
  if (!h) {
999
1515
  g = !0;
1000
1516
  return;
1001
1517
  }
1002
- if (await C() && e.changed) {
1003
- let n = b("dim", o.relative(t, e.changed.file), { stream: i }), r = Date.now() - e.changed.at;
1004
- J(i, `${b("green", "reload")} ${n} (${r}ms)`, K);
1518
+ if (await S() && e.changed) {
1519
+ let n = O("dim", f.relative(t, e.changed.file), { stream: i }), r = Date.now() - e.changed.at;
1520
+ Y(i, `${O("green", "reload")} ${n} (${r}ms)`, J);
1005
1521
  }
1006
1522
  }
1007
- let E;
1008
- if (s) {
1009
- let e = await s({
1010
- entry: u,
1523
+ let T;
1524
+ if (o) {
1525
+ let e = await o({
1526
+ entry: l,
1011
1527
  cwd: t,
1012
- runtimeConfig: f,
1528
+ runtimeConfig: d,
1013
1529
  stdout: i,
1014
1530
  stderr: a,
1015
1531
  notify: (e) => m?.notify("vite", e),
1016
- reload: () => void C(),
1017
- onError: (e) => Z(a, "build failed", e, K),
1532
+ reload: () => void S(),
1533
+ onError: (e) => Z(a, "build failed", e, J),
1018
1534
  onUpdate: ({ file: e, took: n }) => {
1019
- let r = b("dim", o.relative(t, e), { stream: i });
1020
- J(i, `${b("green", "update")} ${r} (${n}ms)`, K);
1535
+ let r = O("dim", f.relative(t, e), { stream: i });
1536
+ Y(i, `${O("green", "update")} ${r} (${n}ms)`, J);
1021
1537
  }
1022
1538
  });
1023
- await w(e.entryFile, { vite: (t) => e.dispatch(t) }), E = e, m || x();
1024
- } else E = await r.watch({
1025
- entry: u,
1026
- outDir: l,
1027
- runtimeConfig: f,
1539
+ await C(e.entryFile, { vite: (t) => e.dispatch(t) }), T = e, m || b();
1540
+ } else T = await r.watch({
1541
+ entry: l,
1542
+ outDir: c,
1543
+ runtimeConfig: d,
1028
1544
  mode: "development",
1029
1545
  stdout: i,
1030
1546
  stderr: a,
1031
1547
  onBuild: (e) => {
1032
- y = y.then(() => T(e));
1548
+ y = y.then(() => w(e));
1033
1549
  },
1034
1550
  onError: (e) => {
1035
- Z(a, "build failed", e, K);
1551
+ Z(a, "build failed", e, J);
1036
1552
  }
1037
1553
  });
1038
- if (e.signal.aborted ? x() : e.signal.addEventListener("abort", () => x(), { once: !0 }), await S, await y, await m?.stop(), await E.close(), _) throw new O("ERR_INCA_HOST_EXITED_EARLY", "the host exited before it was ready");
1554
+ if (e.signal.aborted ? b() : e.signal.addEventListener("abort", () => b(), { once: !0 }), await x, await y, await m?.stop(), await T.close(), _) throw new V("ERR_INCA_HOST_EXITED_EARLY", "the host exited before it was ready");
1039
1555
  if (v && v.code !== 0 && v.signal !== "SIGINT" && v.signal !== "SIGTERM") {
1040
1556
  let { code: e, signal: t } = v;
1041
- throw new O("ERR_INCA_HOST_CRASHED", `the host exited with ${t ? `signal ${t}` : `code ${e}`}`);
1557
+ throw new V("ERR_INCA_HOST_CRASHED", `the host exited with ${t ? `signal ${t}` : `code ${e}`}`);
1042
1558
  }
1043
1559
  } finally {
1044
1560
  await n();
@@ -1046,72 +1562,72 @@ async function mt(e) {
1046
1562
  }
1047
1563
  //#endregion
1048
1564
  //#region src/package.mts
1049
- function ht() {
1565
+ function bn() {
1050
1566
  if (process.platform === "darwin") return "macos";
1051
1567
  if (process.platform === "linux") return "linux";
1052
- throw new O("ERR_INCA_PLATFORM_UNSUPPORTED", `inca package doesn't support ${process.platform} yet`);
1568
+ throw new V("ERR_INCA_PLATFORM_UNSUPPORTED", `inca package doesn't support ${process.platform} yet`);
1053
1569
  }
1054
- async function gt(e, t) {
1570
+ async function xn(e, t) {
1055
1571
  await Promise.all(e.files.map(async (n) => {
1056
- let r = o.join(t, n);
1057
- await h(o.dirname(r), { recursive: !0 }), await p(o.join(e.outDir, n), r);
1572
+ let r = f.join(t, n);
1573
+ await C(f.dirname(r), { recursive: !0 }), await x(f.join(e.outDir, n), r);
1058
1574
  }));
1059
1575
  }
1060
- function _t(e, t) {
1576
+ function Sn(e, t) {
1061
1577
  let n = e.files.map((e) => e.split("/")[0] ?? e).find((e) => e.toLowerCase() === t.toLowerCase());
1062
- if (n !== void 0) throw new O("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`);
1578
+ if (n !== void 0) throw new V("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`);
1063
1579
  }
1064
- async function vt({ metadata: e, output: t, hostBin: n }) {
1065
- let { appPath: r, resourcesDir: i } = await nt({
1066
- appPath: o.join(t.outDir, `${e.productName}.app`),
1580
+ async function Cn({ metadata: e, output: t, hostBin: n }) {
1581
+ let { appPath: r, resourcesDir: i } = await sn({
1582
+ appPath: f.join(t.outDir, `${e.productName}.app`),
1067
1583
  metadata: e,
1068
1584
  hostBin: n
1069
1585
  });
1070
- return await gt(t, i), r;
1586
+ return await xn(t, i), r;
1071
1587
  }
1072
- async function yt({ metadata: e, output: n, hostBin: r }) {
1073
- let i = t(e.productName);
1074
- _t(n, i);
1075
- let a = o.join(n.outDir, i);
1076
- await v(a, {
1588
+ async function wn({ metadata: e, output: t, hostBin: n }) {
1589
+ let r = c(e.productName);
1590
+ Sn(t, r);
1591
+ let i = f.join(t.outDir, r);
1592
+ await E(i, {
1077
1593
  recursive: !0,
1078
1594
  force: !0
1079
- }), await h(a, { recursive: !0 });
1080
- let s = o.join(a, i);
1081
- return await p(r, s), await f(s, 493), await gt(n, a), a;
1082
- }
1083
- async function bt(e = {}) {
1084
- let t = e.cwd ?? process.cwd(), n = e.stdout ?? process.stdout, r = e.target ?? ht(), i = await fe(t);
1085
- i.usedPackageJsonKey && J(n, "the \"inca\" key in package.json is deprecated — move these settings to inca.config.ts"), i.identifierIsDefault && J(n, `no "identifier" set in inca.config.ts — using generated identifier ${i.identifier}`);
1086
- let a = await Je({
1595
+ }), await C(i, { recursive: !0 });
1596
+ let a = f.join(i, r);
1597
+ return await x(n, a), await b(a, 493), await xn(t, i), i;
1598
+ }
1599
+ async function Tn(e = {}) {
1600
+ let t = e.cwd ?? process.cwd(), n = e.stdout ?? process.stdout, r = e.target ?? bn(), i = await nt(t);
1601
+ i.usedPackageJsonKey && Y(n, "the \"inca\" key in package.json is deprecated — move these settings to inca.config.ts"), i.identifierIsDefault && Y(n, `no "identifier" set in inca.config.ts — using generated identifier ${i.identifier}`);
1602
+ let a = await Zt({
1087
1603
  cwd: t,
1088
1604
  entry: e.entry,
1089
1605
  config: i,
1090
- runtimeConfig: pe(i),
1606
+ runtimeConfig: rt(i),
1091
1607
  bundler: e.bundler,
1092
1608
  stdout: n,
1093
1609
  stderr: e.stderr
1094
- }), o = e.hostBin ?? U();
1095
- W(o);
1610
+ }), o = e.hostBin ?? K();
1611
+ q(o);
1096
1612
  let s = {
1097
1613
  metadata: i,
1098
1614
  output: a,
1099
1615
  hostBin: o
1100
1616
  };
1101
- return { appPath: r === "macos" ? await vt(s) : await yt(s) };
1617
+ return { appPath: r === "macos" ? await Cn(s) : await wn(s) };
1102
1618
  }
1103
1619
  //#endregion
1104
1620
  //#region src/cli.mts
1105
- var xt = "Usage: inca <dev|build|package>";
1106
- function St(e) {
1107
- return o.relative(process.cwd(), e);
1621
+ var En = "Usage: inca <dev|build|package>";
1622
+ function Dn(e) {
1623
+ return f.relative(process.cwd(), e);
1108
1624
  }
1109
- async function Ct(e = process.argv) {
1625
+ async function On(e = process.argv) {
1110
1626
  let t = e[2];
1111
1627
  if (t === "build") {
1112
1628
  try {
1113
- let e = await Je();
1114
- J(process.stdout, `built ${St(e.entryFile)}`);
1629
+ let e = await Zt();
1630
+ Y(process.stdout, `built ${Dn(e.entryFile)}`);
1115
1631
  } catch (e) {
1116
1632
  Z(process.stderr, "build failed", X(e)), process.exitCode = 1;
1117
1633
  }
@@ -1119,19 +1635,19 @@ async function Ct(e = process.argv) {
1119
1635
  }
1120
1636
  if (t === "package") {
1121
1637
  try {
1122
- let { appPath: e } = await bt();
1123
- J(process.stdout, `packaged ${St(e)}`);
1638
+ let { appPath: e } = await Tn();
1639
+ Y(process.stdout, `packaged ${Dn(e)}`);
1124
1640
  } catch (e) {
1125
1641
  Z(process.stderr, "package failed", X(e)), process.exitCode = 1;
1126
1642
  }
1127
1643
  return;
1128
1644
  }
1129
1645
  if (t !== "dev") {
1130
- process.stderr.write(`${xt}\n`), process.exitCode = 1;
1646
+ process.stderr.write(`${En}\n`), process.exitCode = 1;
1131
1647
  return;
1132
1648
  }
1133
1649
  let n = new AbortController(), r = () => {
1134
- n.signal.aborted || (J(process.stderr, "shutting down", { timestamp: !0 }), n.abort());
1650
+ n.signal.aborted || (Y(process.stderr, "shutting down", { timestamp: !0 }), n.abort());
1135
1651
  };
1136
1652
  process.on("SIGINT", r), process.on("SIGTERM", r);
1137
1653
  let i = e.includes("--experimental-hmr") || ![
@@ -1139,9 +1655,9 @@ async function Ct(e = process.argv) {
1139
1655
  "0",
1140
1656
  "false"
1141
1657
  ].includes(process.env.INCA_EXPERIMENTAL_HMR ?? "");
1142
- i && J(process.stdout, "experimental HMR active", { timestamp: !0 });
1658
+ i && Y(process.stdout, "experimental HMR active", { timestamp: !0 });
1143
1659
  try {
1144
- await mt({
1660
+ await yn({
1145
1661
  signal: n.signal,
1146
1662
  experimentalHmr: i
1147
1663
  });
@@ -1150,4 +1666,4 @@ async function Ct(e = process.argv) {
1150
1666
  }
1151
1667
  }
1152
1668
  //#endregion
1153
- export { Ct as run };
1669
+ export { On as run };