@incajs/cli 0.0.17 → 0.0.18
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 +273 -261
- package/dist/vite/hmr.d.mts +8 -0
- package/dist/vite-runtime.js +8 -7
- package/package.json +5 -5
package/dist/cli.js
CHANGED
|
@@ -7,27 +7,27 @@ import * as ee from "node:util";
|
|
|
7
7
|
import { parseArgs as x, styleText as S } from "node:util";
|
|
8
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
9
|
import { fileURLToPath as ne, pathToFileURL as re } from "node:url";
|
|
10
|
-
import { homedir as
|
|
11
|
-
import { createRequire as
|
|
12
|
-
import { spawn as
|
|
13
|
-
import { once as
|
|
14
|
-
import
|
|
15
|
-
import { setTimeout as
|
|
16
|
-
import { DevEnvironment as
|
|
17
|
-
import
|
|
18
|
-
import { randomUUID as
|
|
10
|
+
import { homedir as ie } from "node:os";
|
|
11
|
+
import { createRequire as ae } from "node:module";
|
|
12
|
+
import { spawn as oe } from "node:child_process";
|
|
13
|
+
import { once as A } from "node:events";
|
|
14
|
+
import se from "node:readline";
|
|
15
|
+
import { setTimeout as ce } from "node:timers/promises";
|
|
16
|
+
import { DevEnvironment as le, build as ue, buildErrorMessage as de, createServer as fe } from "vite";
|
|
17
|
+
import pe from "@vitejs/plugin-vue";
|
|
18
|
+
import { randomUUID as me } from "node:crypto";
|
|
19
19
|
//#region ../../node_modules/.pnpm/citty@0.2.2/node_modules/citty/dist/_chunks/libs/scule.mjs
|
|
20
|
-
var
|
|
20
|
+
var he = /\d/, ge = [
|
|
21
21
|
"-",
|
|
22
22
|
"_",
|
|
23
23
|
"/",
|
|
24
24
|
"."
|
|
25
25
|
];
|
|
26
|
-
function
|
|
27
|
-
if (!
|
|
26
|
+
function _e(e = "") {
|
|
27
|
+
if (!he.test(e)) return e !== e.toLowerCase();
|
|
28
28
|
}
|
|
29
|
-
function
|
|
30
|
-
let n = t ??
|
|
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 =
|
|
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
|
|
55
|
+
function ye(e) {
|
|
56
56
|
return e ? e[0].toUpperCase() + e.slice(1) : "";
|
|
57
57
|
}
|
|
58
|
-
function
|
|
58
|
+
function be(e) {
|
|
59
59
|
return e ? e[0].toLowerCase() + e.slice(1) : "";
|
|
60
60
|
}
|
|
61
|
-
function
|
|
62
|
-
return e ? (Array.isArray(e) ? e :
|
|
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
|
|
65
|
-
return
|
|
64
|
+
function j(e, t) {
|
|
65
|
+
return be(xe(e || "", t));
|
|
66
66
|
}
|
|
67
|
-
function
|
|
68
|
-
return e ? (Array.isArray(e) ? e :
|
|
67
|
+
function Se(e, t) {
|
|
68
|
+
return e ? (Array.isArray(e) ? e : ve(e)).map((e) => e.toLowerCase()).join(t ?? "-") : "";
|
|
69
69
|
}
|
|
70
|
-
function
|
|
71
|
-
return
|
|
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
|
|
75
|
+
function M(e) {
|
|
76
76
|
return Array.isArray(e) ? e : e === void 0 ? [] : [e];
|
|
77
77
|
}
|
|
78
|
-
function
|
|
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
|
|
83
|
+
function N(e) {
|
|
84
84
|
return typeof e == "function" ? e() : e;
|
|
85
85
|
}
|
|
86
|
-
var
|
|
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
|
|
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
|
|
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
|
-
})(),
|
|
169
|
-
function
|
|
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 =
|
|
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 =
|
|
179
|
+
let t = j(e.name), r = Se(e.name);
|
|
180
180
|
if (t !== e.name || r !== e.name) {
|
|
181
|
-
let i =
|
|
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 =
|
|
186
|
-
return e[t] ?? e[
|
|
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
|
|
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
|
|
196
|
-
} else if (e.required && o[e.name] === void 0) throw new
|
|
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
|
|
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:
|
|
204
|
+
alias: M(r.alias)
|
|
205
205
|
});
|
|
206
206
|
return t;
|
|
207
207
|
}
|
|
208
|
-
async function
|
|
209
|
-
return Promise.all(e.map((e) =>
|
|
208
|
+
async function ke(e) {
|
|
209
|
+
return Promise.all(e.map((e) => N(e)));
|
|
210
210
|
}
|
|
211
|
-
function
|
|
211
|
+
function B(e) {
|
|
212
212
|
return e;
|
|
213
213
|
}
|
|
214
|
-
async function
|
|
215
|
-
let n = await
|
|
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
|
|
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
|
|
224
|
+
let r = await N(e.subCommands);
|
|
225
225
|
if (r && Object.keys(r).length > 0) {
|
|
226
|
-
let i =
|
|
226
|
+
let i = Ae(t.rawArgs, n), a = t.rawArgs[i];
|
|
227
227
|
if (a) {
|
|
228
|
-
let e = await
|
|
229
|
-
if (!e) throw new
|
|
230
|
-
await
|
|
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
|
|
232
|
+
let n = await N(e.default);
|
|
233
233
|
if (n) {
|
|
234
|
-
if (e.run) throw new
|
|
235
|
-
let i = await
|
|
236
|
-
if (!i) throw new
|
|
237
|
-
await
|
|
238
|
-
} else if (!e.run) throw new
|
|
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
|
|
262
|
-
let r = await
|
|
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 =
|
|
265
|
-
if (a) return
|
|
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
|
|
270
|
-
if (t in e) return
|
|
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
|
|
273
|
-
if (r?.alias &&
|
|
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
|
|
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("=") &&
|
|
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
|
|
286
|
-
let n = e.replace(/^-{1,2}/, ""), r =
|
|
287
|
-
for (let [e, i] of Object.entries(t)) if ((i.type === "string" || i.type === "enum") && (r ===
|
|
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
|
|
290
|
+
async function Me(e, t) {
|
|
291
291
|
try {
|
|
292
|
-
console.log(await
|
|
292
|
+
console.log(await Pe(e, t) + "\n");
|
|
293
293
|
} catch (e) {
|
|
294
294
|
console.error(e);
|
|
295
295
|
}
|
|
296
296
|
}
|
|
297
|
-
var
|
|
298
|
-
async function
|
|
299
|
-
let n = await
|
|
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([
|
|
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(", ") +
|
|
305
|
-
if (o.push([
|
|
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([
|
|
307
|
+
o.push([L(n), [e.negativeDescription, t ? R("(Required)") : ""].filter(Boolean).join(" ")]);
|
|
308
308
|
}
|
|
309
|
-
t && l.push(`--${e.name}` +
|
|
309
|
+
t && l.push(`--${e.name}` + W(e));
|
|
310
310
|
}
|
|
311
311
|
if (e.subCommands) {
|
|
312
|
-
let t = [], n = await
|
|
312
|
+
let t = [], n = await N(e.subCommands);
|
|
313
313
|
for (let [e, r] of Object.entries(n)) {
|
|
314
|
-
let n = await
|
|
314
|
+
let n = await N((await N(r))?.meta);
|
|
315
315
|
if (n?.hidden) continue;
|
|
316
|
-
let i =
|
|
317
|
-
c.push([
|
|
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(
|
|
322
|
+
u.push(R(`${n.description} (${a + (d ? ` v${d}` : "")})`), "");
|
|
323
323
|
let f = o.length > 0 || s.length > 0;
|
|
324
|
-
return u.push(`${
|
|
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
|
|
327
|
-
let t = e.valueHint ? `=<${e.valueHint}>` : "", n = t || `=<${
|
|
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
|
|
331
|
-
let n = t ?
|
|
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
|
|
339
|
-
let n = t.rawArgs || process.argv.slice(2), r = t.showUsage ||
|
|
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
|
|
342
|
-
if (t.help.length > 0 && n.some((e) => t.help.includes(e))) await r(...await
|
|
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
|
|
345
|
+
if (!t?.version) throw new P("No version specified", "E_NO_VERSION");
|
|
346
346
|
console.log(t.version);
|
|
347
|
-
} else await
|
|
347
|
+
} else await V(e, { rawArgs: n });
|
|
348
348
|
} catch (t) {
|
|
349
|
-
t instanceof
|
|
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
|
|
353
|
-
let t = await
|
|
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
|
|
356
|
+
for (let e of M(i.alias)) r.add(e);
|
|
357
357
|
}
|
|
358
358
|
return {
|
|
359
|
-
help:
|
|
360
|
-
version:
|
|
359
|
+
help: Re("help", "h", n, r),
|
|
360
|
+
version: Re("version", "v", n, r)
|
|
361
361
|
};
|
|
362
362
|
}
|
|
363
|
-
function
|
|
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
|
|
368
|
+
var ze = "0.0.18", 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
|
|
371
|
+
function Ve(e) {
|
|
372
372
|
return e && e.constructor && typeof e.constructor.isBuffer == "function" && e.constructor.isBuffer(e);
|
|
373
373
|
}
|
|
374
|
-
function
|
|
374
|
+
function He(e) {
|
|
375
375
|
return e;
|
|
376
376
|
}
|
|
377
|
-
function
|
|
377
|
+
function Ue(e, t) {
|
|
378
378
|
t ||= {};
|
|
379
|
-
let n = t.delimiter || ".", r = t.maxDepth, i = t.transformKey ||
|
|
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 =
|
|
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
|
|
389
|
+
function We(e, t) {
|
|
390
390
|
t ||= {};
|
|
391
|
-
let n = t.delimiter || ".", r = t.overwrite || !1, i = t.transformKey ||
|
|
392
|
-
if (
|
|
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,
|
|
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] =
|
|
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
|
|
425
|
-
function
|
|
426
|
-
if (e === "__proto__" || e === "constructor" && t && typeof t == "object" && "prototype" in t)
|
|
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
|
|
429
|
+
function Ye(e) {
|
|
430
430
|
console.warn(`[destr] Dropping "${e}" key to prevent prototype pollution.`);
|
|
431
431
|
}
|
|
432
|
-
function
|
|
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 (!
|
|
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 (
|
|
450
|
+
if (Ge.test(e) || Ke.test(e)) {
|
|
451
451
|
if (t.strict) throw Error("[destr] Possible prototype pollution");
|
|
452
|
-
return JSON.parse(e,
|
|
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
|
|
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 (!
|
|
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]] :
|
|
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 =
|
|
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 :
|
|
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(
|
|
513
|
+
return process.env.XDG_CONFIG_HOME || b(ie(), ".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:
|
|
706
|
+
dir: ie()
|
|
707
707
|
}));
|
|
708
708
|
}
|
|
709
709
|
i.rc = n({}, ...t);
|
|
@@ -780,7 +780,7 @@ 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(
|
|
783
|
+
u = r(f) === ".c12" ? i(f, l) : p(d) ? i(d, ".c12", l) : process.env.XDG_CACHE_HOME ? t(process.env.XDG_CACHE_HOME, "c12", l) : t(ie(), ".cache/c12", l);
|
|
784
784
|
let m = s.install ? K(s.install === !0 ? {} : s.install, { ignoreWorkspace: !0 }) : !1;
|
|
785
785
|
p(u) && !m && await O(u, { recursive: !0 }), e = (await n(e, {
|
|
786
786
|
dir: u,
|
|
@@ -986,7 +986,7 @@ function Wt() {
|
|
|
986
986
|
function Gt() {
|
|
987
987
|
let e = Wt();
|
|
988
988
|
if (e) try {
|
|
989
|
-
return
|
|
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 =
|
|
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
|
-
}),
|
|
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
|
|
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 =
|
|
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 =
|
|
1148
|
-
this.call("shutdown").catch(() => {}), await Promise.race([n.then(() => "exited"),
|
|
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
|
-
|
|
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
|
|
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 =
|
|
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
|
|
@@ -1424,33 +1424,39 @@ 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
|
-
|
|
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 k(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
|
|
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
|
|
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
1455
|
t();
|
|
1450
1456
|
return;
|
|
1451
1457
|
}
|
|
1452
|
-
let o =
|
|
1453
|
-
o ? (n(o), i.current = void 0) :
|
|
1458
|
+
let o = Mn(a);
|
|
1459
|
+
o ? (n(o), i.current = void 0) : Nn(a) && i.current && (r({
|
|
1454
1460
|
file: i.current.file,
|
|
1455
1461
|
took: Date.now() - i.current.at
|
|
1456
1462
|
}), i.current = void 0), e(a);
|
|
@@ -1472,7 +1478,7 @@ function Mn(e, t, n, r, i) {
|
|
|
1472
1478
|
}
|
|
1473
1479
|
};
|
|
1474
1480
|
}
|
|
1475
|
-
function
|
|
1481
|
+
function Fn() {
|
|
1476
1482
|
let e = "\0inca:vite-client-shim";
|
|
1477
1483
|
return {
|
|
1478
1484
|
name: "inca:shim-vite-client",
|
|
@@ -1485,7 +1491,7 @@ function Nn() {
|
|
|
1485
1491
|
}
|
|
1486
1492
|
};
|
|
1487
1493
|
}
|
|
1488
|
-
function
|
|
1494
|
+
function In(e) {
|
|
1489
1495
|
return {
|
|
1490
1496
|
name: "inca:file-changed",
|
|
1491
1497
|
hotUpdate(t) {
|
|
@@ -1500,10 +1506,11 @@ function Pn(e) {
|
|
|
1500
1506
|
}
|
|
1501
1507
|
};
|
|
1502
1508
|
}
|
|
1503
|
-
async function
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1509
|
+
async function Ln(e, t, { entry: n, cwd: r, runtimeConfig: i, runtimePath: a, stdout: o = process.stdout, stderr: s = process.stderr, quiet: c = !1, notify: l, reload: u, onError: d, onUpdate: f = () => {} }) {
|
|
1510
|
+
await E(En(r), { recursive: !0 });
|
|
1511
|
+
let p = pn(i), m = y.join(En(r), fn);
|
|
1512
|
+
p ? await k(m, p) : await O(m, { force: !0 });
|
|
1513
|
+
let h = { current: void 0 }, { channel: g, dispatch: _ } = Pn(l, u, (t) => d(Tn(e, t)), f, h), v = await fe({
|
|
1507
1514
|
configFile: !1,
|
|
1508
1515
|
root: y.dirname(n),
|
|
1509
1516
|
mode: "development",
|
|
@@ -1524,32 +1531,37 @@ async function Fn(e, t, { entry: n, cwd: r, runtimeConfig: i, runtimePath: a, st
|
|
|
1524
1531
|
consumer: "client",
|
|
1525
1532
|
dev: {
|
|
1526
1533
|
moduleRunnerTransform: !0,
|
|
1527
|
-
createEnvironment: (e, t) => new
|
|
1534
|
+
createEnvironment: (e, t) => new le(e, t, {
|
|
1528
1535
|
hot: !0,
|
|
1529
|
-
transport:
|
|
1536
|
+
transport: g
|
|
1530
1537
|
})
|
|
1531
1538
|
}
|
|
1532
1539
|
} },
|
|
1533
1540
|
plugins: [
|
|
1534
|
-
|
|
1541
|
+
pe({ template: { compilerOptions: {
|
|
1535
1542
|
runtimeModuleName: t,
|
|
1536
1543
|
hoistStatic: !1
|
|
1537
1544
|
} } }),
|
|
1538
1545
|
bn(e),
|
|
1539
|
-
|
|
1540
|
-
|
|
1546
|
+
Fn(),
|
|
1547
|
+
In(h)
|
|
1541
1548
|
]
|
|
1542
|
-
});
|
|
1549
|
+
}), b;
|
|
1550
|
+
try {
|
|
1551
|
+
b = await jn(r, n, An(v.environments.client.config.define), a);
|
|
1552
|
+
} catch (e) {
|
|
1553
|
+
throw await v.close(), e;
|
|
1554
|
+
}
|
|
1543
1555
|
return {
|
|
1544
|
-
entryFile:
|
|
1545
|
-
dispatch:
|
|
1546
|
-
close: () =>
|
|
1556
|
+
entryFile: b,
|
|
1557
|
+
dispatch: _,
|
|
1558
|
+
close: () => v.close()
|
|
1547
1559
|
};
|
|
1548
1560
|
}
|
|
1549
1561
|
//#endregion
|
|
1550
1562
|
//#region src/vite/watch.mts
|
|
1551
|
-
async function
|
|
1552
|
-
let { outDir: c } = s, l, u = await
|
|
1563
|
+
async function Rn(e, t, { onBuild: n, onError: r, stdout: i = process.stdout, stderr: a = process.stderr, quiet: o = !1, ...s }) {
|
|
1564
|
+
let { outDir: c } = s, l, u = await ue(Sn({
|
|
1553
1565
|
core: e,
|
|
1554
1566
|
runtimeModuleName: t,
|
|
1555
1567
|
...s,
|
|
@@ -1575,28 +1587,28 @@ async function In(e, t, { onBuild: n, onError: r, stdout: i = process.stdout, st
|
|
|
1575
1587
|
}
|
|
1576
1588
|
//#endregion
|
|
1577
1589
|
//#region src/vite/createBundler.mts
|
|
1578
|
-
function
|
|
1590
|
+
function zn(e, t) {
|
|
1579
1591
|
return {
|
|
1580
|
-
watch: (n) =>
|
|
1592
|
+
watch: (n) => Rn(e, t, n),
|
|
1581
1593
|
build: (n) => Cn(e, t, n),
|
|
1582
|
-
hmr: (n) =>
|
|
1594
|
+
hmr: (n) => Ln(e, t, n)
|
|
1583
1595
|
};
|
|
1584
1596
|
}
|
|
1585
1597
|
//#endregion
|
|
1586
1598
|
//#region src/defaultBundler.mts
|
|
1587
|
-
var
|
|
1599
|
+
var Bn = zn(ln, "incajs/vue/runtime"), Vn = [
|
|
1588
1600
|
"main.mts",
|
|
1589
1601
|
"main.ts",
|
|
1590
1602
|
"main.js"
|
|
1591
1603
|
];
|
|
1592
|
-
async function
|
|
1593
|
-
let t =
|
|
1604
|
+
async function Hn(e) {
|
|
1605
|
+
let t = Vn.map((t) => y.join(e, "src", t)).find((e) => p(e));
|
|
1594
1606
|
if (t) return t;
|
|
1595
1607
|
let n = y.join(e, "src/App.vue");
|
|
1596
|
-
if (p(n)) return
|
|
1608
|
+
if (p(n)) return Un(n, e);
|
|
1597
1609
|
throw new Y("ERR_INCA_ENTRY_NOT_FOUND", `no app entry found. check that ${y.join(e, "src/main.ts")} or ${n} exists`);
|
|
1598
1610
|
}
|
|
1599
|
-
async function
|
|
1611
|
+
async function Un(e, t) {
|
|
1600
1612
|
let n = y.join(t, "node_modules/.inca");
|
|
1601
1613
|
await E(n, { recursive: !0 });
|
|
1602
1614
|
let r = y.join(n, "entry.mts"), i = JSON.stringify(e.split(y.sep).join("/"));
|
|
@@ -1608,8 +1620,8 @@ async function Vn(e, t) {
|
|
|
1608
1620
|
}
|
|
1609
1621
|
//#endregion
|
|
1610
1622
|
//#region src/build.mts
|
|
1611
|
-
async function
|
|
1612
|
-
let t = e.cwd ?? process.cwd(), n = e.config ?? await zt(t), r = y.resolve(t, n.outDir), i = e.bundler ??
|
|
1623
|
+
async function Wn(e = {}) {
|
|
1624
|
+
let t = e.cwd ?? process.cwd(), n = e.config ?? await zt(t), r = y.resolve(t, n.outDir), i = e.bundler ?? Bn, a = e.entry ?? n.entry ?? await Hn(t);
|
|
1613
1625
|
Ft(t, r, a);
|
|
1614
1626
|
let o = e.runtimeConfig ?? await Ht(t);
|
|
1615
1627
|
return i.build({
|
|
@@ -1623,43 +1635,43 @@ async function Hn(e = {}) {
|
|
|
1623
1635
|
}
|
|
1624
1636
|
//#endregion
|
|
1625
1637
|
//#region src/devLock.mts
|
|
1626
|
-
function
|
|
1638
|
+
function Gn(e) {
|
|
1627
1639
|
return y.join(e, "node_modules/.inca/dev.pid");
|
|
1628
1640
|
}
|
|
1629
|
-
function
|
|
1641
|
+
function Kn(e) {
|
|
1630
1642
|
try {
|
|
1631
1643
|
return process.kill(e, 0), !0;
|
|
1632
1644
|
} catch (e) {
|
|
1633
1645
|
return e.code === "EPERM";
|
|
1634
1646
|
}
|
|
1635
1647
|
}
|
|
1636
|
-
var
|
|
1637
|
-
function
|
|
1648
|
+
var qn = me();
|
|
1649
|
+
function Jn(e) {
|
|
1638
1650
|
return new Y("ERR_INCA_DEV_RUNNING", `inca dev is already running for this app (pid ${String(e)})`);
|
|
1639
1651
|
}
|
|
1640
|
-
async function
|
|
1641
|
-
let t =
|
|
1652
|
+
async function Yn(e) {
|
|
1653
|
+
let t = Gn(e), n = `${String(process.pid)}:${qn}`, r = `${t}.${me()}`;
|
|
1642
1654
|
await E(y.dirname(t), { recursive: !0 }), await k(r, n);
|
|
1643
1655
|
let i = process.pid;
|
|
1644
1656
|
try {
|
|
1645
1657
|
for (let e = 0; e < 5; e++) {
|
|
1646
1658
|
try {
|
|
1647
|
-
return await T(r, t),
|
|
1659
|
+
return await T(r, t), Xn(t, n);
|
|
1648
1660
|
} catch (e) {
|
|
1649
1661
|
if (e.code !== "EEXIST") throw e;
|
|
1650
1662
|
}
|
|
1651
1663
|
let e = await D(t, "utf8").catch(() => ""), a = Number.parseInt(e, 10);
|
|
1652
1664
|
if (a === process.pid) {
|
|
1653
|
-
if (e === n) throw
|
|
1654
|
-
} else if (Number.isSafeInteger(a) && a > 0 &&
|
|
1665
|
+
if (e === n) throw Jn(a);
|
|
1666
|
+
} else if (Number.isSafeInteger(a) && a > 0 && Kn(a)) throw Jn(a);
|
|
1655
1667
|
i = Number.isSafeInteger(a) && a > 0 ? a : i, await O(t, { force: !0 });
|
|
1656
1668
|
}
|
|
1657
|
-
throw
|
|
1669
|
+
throw Jn(i);
|
|
1658
1670
|
} finally {
|
|
1659
1671
|
await O(r, { force: !0 });
|
|
1660
1672
|
}
|
|
1661
1673
|
}
|
|
1662
|
-
function
|
|
1674
|
+
function Xn(e, t) {
|
|
1663
1675
|
let n = !1;
|
|
1664
1676
|
return async () => {
|
|
1665
1677
|
n || (n = !0, await D(e, "utf8").catch(() => "") === t && await O(e, { force: !0 }));
|
|
@@ -1667,26 +1679,26 @@ function Jn(e, t) {
|
|
|
1667
1679
|
}
|
|
1668
1680
|
//#endregion
|
|
1669
1681
|
//#region src/plist.mts
|
|
1670
|
-
function
|
|
1682
|
+
function Zn(e) {
|
|
1671
1683
|
return e.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">");
|
|
1672
1684
|
}
|
|
1673
|
-
function
|
|
1674
|
-
return typeof e == "boolean" ? e ? "<true/>" : "<false/>" : `<string>${
|
|
1685
|
+
function Qn(e) {
|
|
1686
|
+
return typeof e == "boolean" ? e ? "<true/>" : "<false/>" : `<string>${Zn(e)}</string>`;
|
|
1675
1687
|
}
|
|
1676
|
-
function
|
|
1688
|
+
function $n(e) {
|
|
1677
1689
|
return wn`
|
|
1678
1690
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
1679
1691
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
1680
1692
|
<plist version="1.0">
|
|
1681
1693
|
<dict>
|
|
1682
|
-
${Object.entries(e).map(([e, t]) => `\t<key>${
|
|
1694
|
+
${Object.entries(e).map(([e, t]) => `\t<key>${Zn(e)}</key>\n\t${Qn(t)}`).join("\n")}
|
|
1683
1695
|
</dict>
|
|
1684
1696
|
</plist>
|
|
1685
1697
|
`;
|
|
1686
1698
|
}
|
|
1687
1699
|
//#endregion
|
|
1688
1700
|
//#region src/macosApp.mts
|
|
1689
|
-
async function
|
|
1701
|
+
async function er(e) {
|
|
1690
1702
|
let { appPath: t, metadata: n, hostBin: r } = e;
|
|
1691
1703
|
await O(t, {
|
|
1692
1704
|
recursive: !0,
|
|
@@ -1711,7 +1723,7 @@ async function Qn(e) {
|
|
|
1711
1723
|
let e = y.basename(n.icon);
|
|
1712
1724
|
await w(n.icon, y.join(o, e)), c.CFBundleIconFile = e;
|
|
1713
1725
|
}
|
|
1714
|
-
return await k(y.join(i, "Info.plist"),
|
|
1726
|
+
return await k(y.join(i, "Info.plist"), $n(c)), await k(y.join(i, "PkgInfo"), "APPL????"), {
|
|
1715
1727
|
appPath: t,
|
|
1716
1728
|
executablePath: s,
|
|
1717
1729
|
resourcesDir: o
|
|
@@ -1719,8 +1731,8 @@ async function Qn(e) {
|
|
|
1719
1731
|
}
|
|
1720
1732
|
//#endregion
|
|
1721
1733
|
//#region src/watchForEdit.mts
|
|
1722
|
-
var
|
|
1723
|
-
function
|
|
1734
|
+
var tr = /^(?:inca\.config\.[a-z0-9]+|package\.json)$/, nr = [...Vn, "App.vue"];
|
|
1735
|
+
function rr(e, t = {}) {
|
|
1724
1736
|
let n = t.debounceMs ?? 100, r = /* @__PURE__ */ new Set(), i, a = !1, o = () => {}, s = new Promise((e) => {
|
|
1725
1737
|
o = e;
|
|
1726
1738
|
}), c = () => {
|
|
@@ -1741,7 +1753,7 @@ function tr(e, t = {}) {
|
|
|
1741
1753
|
r.clear();
|
|
1742
1754
|
};
|
|
1743
1755
|
try {
|
|
1744
|
-
l(e, (e) => e === "src" ||
|
|
1756
|
+
l(e, (e) => e === "src" || tr.test(e)), l(y.join(e, "src"), (e) => nr.includes(e));
|
|
1745
1757
|
} catch (e) {
|
|
1746
1758
|
throw u(), e;
|
|
1747
1759
|
}
|
|
@@ -1757,7 +1769,7 @@ function tr(e, t = {}) {
|
|
|
1757
1769
|
}
|
|
1758
1770
|
//#endregion
|
|
1759
1771
|
//#region src/retryOnEdit.mts
|
|
1760
|
-
function
|
|
1772
|
+
function ir(e, t) {
|
|
1761
1773
|
return new Promise((n) => {
|
|
1762
1774
|
let r = () => n(!1);
|
|
1763
1775
|
t.addEventListener("abort", r, { once: !0 }), e.then(() => {
|
|
@@ -1765,10 +1777,10 @@ function nr(e, t) {
|
|
|
1765
1777
|
});
|
|
1766
1778
|
});
|
|
1767
1779
|
}
|
|
1768
|
-
async function
|
|
1780
|
+
async function ar(e) {
|
|
1769
1781
|
let { cwd: t, signal: n, stdout: r, stderr: i, debounceMs: a } = e, o = !1;
|
|
1770
1782
|
for (;;) {
|
|
1771
|
-
let s =
|
|
1783
|
+
let s = rr(t, { debounceMs: a });
|
|
1772
1784
|
try {
|
|
1773
1785
|
return await e.attempt(s);
|
|
1774
1786
|
} catch (e) {
|
|
@@ -1782,7 +1794,7 @@ async function rr(e) {
|
|
|
1782
1794
|
o = !0;
|
|
1783
1795
|
continue;
|
|
1784
1796
|
}
|
|
1785
|
-
if (o = !1, $(i, "build failed", Q(e), X), n.aborted || (Z(r, "waiting for a change to retry", X), !await
|
|
1797
|
+
if (o = !1, $(i, "build failed", Q(e), X), n.aborted || (Z(r, "waiting for a change to retry", X), !await ir(s.edited, n))) return;
|
|
1786
1798
|
Z(r, "retrying", X);
|
|
1787
1799
|
} finally {
|
|
1788
1800
|
s.close();
|
|
@@ -1791,19 +1803,19 @@ async function rr(e) {
|
|
|
1791
1803
|
}
|
|
1792
1804
|
//#endregion
|
|
1793
1805
|
//#region src/dev.mts
|
|
1794
|
-
var
|
|
1795
|
-
async function
|
|
1806
|
+
var or = 1e4, sr = ["ERR_INCA_PACKAGE_JSON_NOT_FOUND", "ERR_INCA_PRODUCT_NAME_MISSING"];
|
|
1807
|
+
async function cr(e, t) {
|
|
1796
1808
|
try {
|
|
1797
1809
|
return await Bt(e);
|
|
1798
1810
|
} catch (e) {
|
|
1799
|
-
if (!(e instanceof Y) || !
|
|
1811
|
+
if (!(e instanceof Y) || !sr.includes(e.code)) throw e;
|
|
1800
1812
|
Z(t, `running unnamed. ${e.message}`, X);
|
|
1801
1813
|
return;
|
|
1802
1814
|
}
|
|
1803
1815
|
}
|
|
1804
|
-
async function
|
|
1816
|
+
async function lr(e, t, n, r) {
|
|
1805
1817
|
if (process.platform === "darwin" && t) try {
|
|
1806
|
-
return (await
|
|
1818
|
+
return (await er({
|
|
1807
1819
|
appPath: y.join(e, "node_modules/.inca", `${t.productName}.app`),
|
|
1808
1820
|
metadata: t,
|
|
1809
1821
|
hostBin: n,
|
|
@@ -1814,7 +1826,7 @@ async function sr(e, t, n, r) {
|
|
|
1814
1826
|
return;
|
|
1815
1827
|
}
|
|
1816
1828
|
}
|
|
1817
|
-
async function
|
|
1829
|
+
async function ur(e, t) {
|
|
1818
1830
|
let n = new Set(t), r;
|
|
1819
1831
|
try {
|
|
1820
1832
|
r = await te(e, {
|
|
@@ -1826,29 +1838,29 @@ async function cr(e, t) {
|
|
|
1826
1838
|
}
|
|
1827
1839
|
await Promise.all(r.filter((e) => e.isFile()).map((t) => y.relative(e, y.join(t.parentPath, t.name))).filter((e) => !n.has(e)).map((t) => O(y.join(e, t), { force: !0 })));
|
|
1828
1840
|
}
|
|
1829
|
-
function
|
|
1841
|
+
function dr(e) {
|
|
1830
1842
|
let { NO_COLOR: t, FORCE_COLOR: n } = process.env;
|
|
1831
1843
|
if (!(!e.isTTY || t || n)) return {
|
|
1832
1844
|
...process.env,
|
|
1833
1845
|
FORCE_COLOR: "1"
|
|
1834
1846
|
};
|
|
1835
1847
|
}
|
|
1836
|
-
async function
|
|
1837
|
-
let t = e.cwd ?? process.cwd(), n = await
|
|
1848
|
+
async function fr(e) {
|
|
1849
|
+
let t = e.cwd ?? process.cwd(), n = await Yn(t);
|
|
1838
1850
|
try {
|
|
1839
1851
|
let n = e.hostBin ?? Kt();
|
|
1840
1852
|
qt(n);
|
|
1841
|
-
let r = e.bundler ??
|
|
1853
|
+
let r = e.bundler ?? Bn, i = e.stdout ?? process.stdout, a = e.stderr ?? process.stderr, o = e.experimentalHmr ? r.hmr?.bind(r) : void 0;
|
|
1842
1854
|
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
|
|
1855
|
+
let s = await ar({
|
|
1844
1856
|
cwd: t,
|
|
1845
1857
|
signal: e.signal,
|
|
1846
1858
|
stdout: i,
|
|
1847
1859
|
stderr: a,
|
|
1848
1860
|
async attempt() {
|
|
1849
|
-
let n = await zt(t), r = y.resolve(t, n.outDir), a = e.entry ?? n.entry ?? await
|
|
1861
|
+
let n = await zt(t), r = y.resolve(t, n.outDir), a = e.entry ?? n.entry ?? await Hn(t);
|
|
1850
1862
|
Ft(t, r, a);
|
|
1851
|
-
let o = await
|
|
1863
|
+
let o = await cr(t, i);
|
|
1852
1864
|
return {
|
|
1853
1865
|
outDir: r,
|
|
1854
1866
|
entry: a,
|
|
@@ -1858,12 +1870,12 @@ async function ur(e) {
|
|
|
1858
1870
|
}
|
|
1859
1871
|
});
|
|
1860
1872
|
if (!s) return;
|
|
1861
|
-
let { outDir: c, entry: l, metadata: u, runtimeConfig: d } = s, f = await
|
|
1873
|
+
let { outDir: c, entry: l, metadata: u, runtimeConfig: d } = s, f = await lr(t, u, n, i) ?? n, p, m = !1, h = !1, g = !1, _, v = Promise.resolve(), b = () => {}, ee = new Promise((e) => {
|
|
1862
1874
|
b = e;
|
|
1863
1875
|
});
|
|
1864
1876
|
async function x() {
|
|
1865
1877
|
try {
|
|
1866
|
-
return await p?.call("reload", void 0,
|
|
1878
|
+
return await p?.call("reload", void 0, or), !0;
|
|
1867
1879
|
} catch (e) {
|
|
1868
1880
|
return $(a, "reload failed", Q(e), X), !1;
|
|
1869
1881
|
}
|
|
@@ -1872,7 +1884,7 @@ async function ur(e) {
|
|
|
1872
1884
|
let n = new Qt({
|
|
1873
1885
|
entryFile: e,
|
|
1874
1886
|
hostBin: f,
|
|
1875
|
-
env:
|
|
1887
|
+
env: dr(a),
|
|
1876
1888
|
onStderr: (e) => a.write(e),
|
|
1877
1889
|
onReady: () => {
|
|
1878
1890
|
m = !0, Z(i, "ready", X), h && (h = !1, x());
|
|
@@ -1895,7 +1907,7 @@ async function ur(e) {
|
|
|
1895
1907
|
p = n;
|
|
1896
1908
|
}
|
|
1897
1909
|
async function w(e) {
|
|
1898
|
-
if (await
|
|
1910
|
+
if (await ur(e.outDir, e.files), !p) await C(e.entryFile);
|
|
1899
1911
|
else if (!m) h = !0;
|
|
1900
1912
|
else if (await x() && e.changed) {
|
|
1901
1913
|
let n = S("dim", y.relative(t, e.changed.file), { stream: i }), r = Date.now() - e.changed.at;
|
|
@@ -1947,44 +1959,44 @@ async function ur(e) {
|
|
|
1947
1959
|
}
|
|
1948
1960
|
//#endregion
|
|
1949
1961
|
//#region src/package.mts
|
|
1950
|
-
function
|
|
1962
|
+
function pr() {
|
|
1951
1963
|
if (process.platform === "darwin") return "macos";
|
|
1952
1964
|
if (process.platform === "linux") return "linux";
|
|
1953
1965
|
throw new Y("ERR_INCA_PLATFORM_UNSUPPORTED", `inca package doesn't support ${process.platform} yet`);
|
|
1954
1966
|
}
|
|
1955
|
-
async function
|
|
1967
|
+
async function mr(e, t) {
|
|
1956
1968
|
await Promise.all(e.files.map(async (n) => {
|
|
1957
1969
|
let r = y.join(t, n);
|
|
1958
1970
|
await E(y.dirname(r), { recursive: !0 }), await w(y.join(e.outDir, n), r);
|
|
1959
1971
|
}));
|
|
1960
1972
|
}
|
|
1961
|
-
function
|
|
1973
|
+
function hr(e, t) {
|
|
1962
1974
|
let n = e.files.map((e) => e.split("/")[0] ?? e).find((e) => e.toLowerCase() === t.toLowerCase());
|
|
1963
1975
|
if (n !== void 0) throw new Y("ERR_INCA_PRODUCT_NAME_INVALID", `the packaged app's directory "${t}" collides with "${n}" in the build output. Set a different "productName" in inca.config.ts`);
|
|
1964
1976
|
}
|
|
1965
|
-
async function
|
|
1966
|
-
let { appPath: r, resourcesDir: i } = await
|
|
1977
|
+
async function gr({ metadata: e, output: t, hostBin: n }) {
|
|
1978
|
+
let { appPath: r, resourcesDir: i } = await er({
|
|
1967
1979
|
appPath: y.join(t.outDir, `${e.productName}.app`),
|
|
1968
1980
|
metadata: e,
|
|
1969
1981
|
hostBin: n
|
|
1970
1982
|
});
|
|
1971
|
-
return await
|
|
1983
|
+
return await mr(t, i), r;
|
|
1972
1984
|
}
|
|
1973
|
-
async function
|
|
1985
|
+
async function _r({ metadata: e, output: t, hostBin: n }) {
|
|
1974
1986
|
let r = c(e.productName);
|
|
1975
|
-
|
|
1987
|
+
hr(t, r);
|
|
1976
1988
|
let i = y.join(t.outDir, r);
|
|
1977
1989
|
await O(i, {
|
|
1978
1990
|
recursive: !0,
|
|
1979
1991
|
force: !0
|
|
1980
1992
|
}), await E(i, { recursive: !0 });
|
|
1981
1993
|
let a = y.join(i, r);
|
|
1982
|
-
return await w(n, a), await C(a, 493), await
|
|
1994
|
+
return await w(n, a), await C(a, 493), await mr(t, i), i;
|
|
1983
1995
|
}
|
|
1984
|
-
async function
|
|
1985
|
-
let t = e.cwd ?? process.cwd(), n = e.stdout ?? process.stdout, r = e.target ??
|
|
1996
|
+
async function vr(e = {}) {
|
|
1997
|
+
let t = e.cwd ?? process.cwd(), n = e.stdout ?? process.stdout, r = e.target ?? pr(), i = await Bt(t);
|
|
1986
1998
|
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
|
|
1999
|
+
let a = await Wn({
|
|
1988
2000
|
cwd: t,
|
|
1989
2001
|
entry: e.entry,
|
|
1990
2002
|
config: i,
|
|
@@ -2000,19 +2012,19 @@ async function gr(e = {}) {
|
|
|
2000
2012
|
output: a,
|
|
2001
2013
|
hostBin: o
|
|
2002
2014
|
};
|
|
2003
|
-
return { appPath: r === "macos" ? await
|
|
2015
|
+
return { appPath: r === "macos" ? await gr(s) : await _r(s) };
|
|
2004
2016
|
}
|
|
2005
2017
|
//#endregion
|
|
2006
2018
|
//#region src/cli.mts
|
|
2007
|
-
function
|
|
2019
|
+
function yr(e) {
|
|
2008
2020
|
return y.relative(process.cwd(), e);
|
|
2009
2021
|
}
|
|
2010
|
-
var
|
|
2022
|
+
var br = {
|
|
2011
2023
|
type: "boolean",
|
|
2012
2024
|
description: "Write a source map",
|
|
2013
2025
|
negativeDescription: "Skip the source map"
|
|
2014
2026
|
};
|
|
2015
|
-
function
|
|
2027
|
+
function xr() {
|
|
2016
2028
|
for (let e of [
|
|
2017
2029
|
0,
|
|
2018
2030
|
1,
|
|
@@ -2021,35 +2033,35 @@ function yr() {
|
|
|
2021
2033
|
f.closeSync(e);
|
|
2022
2034
|
} catch {}
|
|
2023
2035
|
}
|
|
2024
|
-
var
|
|
2036
|
+
var Sr = B({
|
|
2025
2037
|
meta: {
|
|
2026
2038
|
name: "build",
|
|
2027
2039
|
description: "Bundle the app into dist"
|
|
2028
2040
|
},
|
|
2029
|
-
args: { sourcemap:
|
|
2041
|
+
args: { sourcemap: br },
|
|
2030
2042
|
async run({ args: e }) {
|
|
2031
2043
|
try {
|
|
2032
|
-
let t = await
|
|
2033
|
-
Z(process.stdout, `built ${
|
|
2044
|
+
let t = await Wn({ sourcemap: e.sourcemap });
|
|
2045
|
+
Z(process.stdout, `built ${yr(t.entryFile)}`);
|
|
2034
2046
|
} catch (e) {
|
|
2035
2047
|
$(process.stderr, "build failed", Q(e)), process.exitCode = 1;
|
|
2036
2048
|
}
|
|
2037
2049
|
}
|
|
2038
|
-
}),
|
|
2050
|
+
}), Cr = B({
|
|
2039
2051
|
meta: {
|
|
2040
2052
|
name: "package",
|
|
2041
2053
|
description: "Package the app as an application bundle"
|
|
2042
2054
|
},
|
|
2043
|
-
args: { sourcemap:
|
|
2055
|
+
args: { sourcemap: br },
|
|
2044
2056
|
async run({ args: e }) {
|
|
2045
2057
|
try {
|
|
2046
|
-
let { appPath: t } = await
|
|
2047
|
-
Z(process.stdout, `packaged ${
|
|
2058
|
+
let { appPath: t } = await vr({ sourcemap: e.sourcemap });
|
|
2059
|
+
Z(process.stdout, `packaged ${yr(t)}`);
|
|
2048
2060
|
} catch (e) {
|
|
2049
2061
|
$(process.stderr, "package failed", Q(e)), process.exitCode = 1;
|
|
2050
2062
|
}
|
|
2051
2063
|
}
|
|
2052
|
-
}),
|
|
2064
|
+
}), wr = B({
|
|
2053
2065
|
meta: {
|
|
2054
2066
|
name: "dev",
|
|
2055
2067
|
description: "Run the app in a development window"
|
|
@@ -2071,28 +2083,28 @@ var br = V({
|
|
|
2071
2083
|
].includes(process.env.INCA_EXPERIMENTAL_HMR ?? "");
|
|
2072
2084
|
r && Z(process.stdout, "experimental HMR active", { timestamp: !0 });
|
|
2073
2085
|
try {
|
|
2074
|
-
await
|
|
2086
|
+
await fr({
|
|
2075
2087
|
signal: t.signal,
|
|
2076
2088
|
experimentalHmr: r
|
|
2077
|
-
}), t.signal.aborted &&
|
|
2089
|
+
}), t.signal.aborted && xr();
|
|
2078
2090
|
} catch (e) {
|
|
2079
2091
|
$(process.stderr, "dev failed", Q(e), { timestamp: !0 }), process.exitCode = 1;
|
|
2080
2092
|
}
|
|
2081
2093
|
}
|
|
2082
|
-
}),
|
|
2094
|
+
}), Tr = B({
|
|
2083
2095
|
meta: {
|
|
2084
2096
|
name: "inca",
|
|
2085
|
-
version:
|
|
2086
|
-
description:
|
|
2097
|
+
version: ze,
|
|
2098
|
+
description: Be
|
|
2087
2099
|
},
|
|
2088
2100
|
subCommands: {
|
|
2089
|
-
dev:
|
|
2090
|
-
build:
|
|
2091
|
-
package:
|
|
2101
|
+
dev: wr,
|
|
2102
|
+
build: Sr,
|
|
2103
|
+
package: Cr
|
|
2092
2104
|
}
|
|
2093
2105
|
});
|
|
2094
|
-
async function
|
|
2095
|
-
await
|
|
2106
|
+
async function Er(e = process.argv) {
|
|
2107
|
+
await Ie(Tr, { rawArgs: e.slice(2) });
|
|
2096
2108
|
}
|
|
2097
2109
|
//#endregion
|
|
2098
|
-
export {
|
|
2110
|
+
export { Er as run };
|
package/dist/vite/hmr.d.mts
CHANGED
|
@@ -20,6 +20,14 @@ interface UpdateError {
|
|
|
20
20
|
* `buildErrorMessage` follows the stack.
|
|
21
21
|
*/
|
|
22
22
|
export declare function faultOfUpdate(core: AdapterCore, error: UpdateError): BuildFailure;
|
|
23
|
+
/**
|
|
24
|
+
* The `define` entries set on `globalThis` in the development window, as values: those whose
|
|
25
|
+
* key is a plain identifier and whose code is a JSON literal. A string value is code, and any
|
|
26
|
+
* other value is read as its JSON form.
|
|
27
|
+
* @param define - the development server's resolved `define`
|
|
28
|
+
* @returns the values by key
|
|
29
|
+
*/
|
|
30
|
+
export declare function globalsOfDefine(define: Record<string, unknown> | undefined): Record<string, unknown>;
|
|
23
31
|
/**
|
|
24
32
|
* Starts a Vite dev server driving the app over its dev channel instead of
|
|
25
33
|
* a browser: a `"client"` environment with a custom {@link HotChannel}
|
package/dist/vite-runtime.js
CHANGED
|
@@ -1154,10 +1154,11 @@ function wt() {
|
|
|
1154
1154
|
function Tt(e) {
|
|
1155
1155
|
return typeof e == "object" && !!e && "runnerError" in e;
|
|
1156
1156
|
}
|
|
1157
|
-
async function Et(e) {
|
|
1158
|
-
|
|
1157
|
+
async function Et(e, t = {}) {
|
|
1158
|
+
Object.assign(globalThis, t);
|
|
1159
|
+
let n = () => {}, r = new yt({
|
|
1159
1160
|
transport: {
|
|
1160
|
-
...St(() =>
|
|
1161
|
+
...St(() => n()),
|
|
1161
1162
|
timeout: 0
|
|
1162
1163
|
},
|
|
1163
1164
|
hmr: { logger: {
|
|
@@ -1167,15 +1168,15 @@ async function Et(e) {
|
|
|
1167
1168
|
sourcemapInterceptor: !1
|
|
1168
1169
|
}, wt());
|
|
1169
1170
|
for (;;) {
|
|
1170
|
-
let
|
|
1171
|
-
|
|
1171
|
+
let t = new Promise((e) => {
|
|
1172
|
+
n = e;
|
|
1172
1173
|
});
|
|
1173
1174
|
try {
|
|
1174
|
-
return await
|
|
1175
|
+
return await r.import(e);
|
|
1175
1176
|
} catch (e) {
|
|
1176
1177
|
Tt(e) || Promise.reject(e), globalThis.__inca_dev__?.setLoadFailed?.(!0);
|
|
1177
1178
|
}
|
|
1178
|
-
await
|
|
1179
|
+
await t, r.clearCache(), globalThis.__inca_dev__?.setLoadFailed?.(!1);
|
|
1179
1180
|
}
|
|
1180
1181
|
}
|
|
1181
1182
|
//#endregion
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@incajs/cli",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.18",
|
|
4
4
|
"description": "Commands to develop, bundle, and package Incarnative.js apps.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"bundler",
|
|
@@ -72,10 +72,10 @@
|
|
|
72
72
|
}
|
|
73
73
|
},
|
|
74
74
|
"optionalDependencies": {
|
|
75
|
-
"@incajs/host-darwin-arm64": "0.0.
|
|
76
|
-
"@incajs/host-darwin-x64": "0.0.
|
|
77
|
-
"@incajs/host-linux-arm64": "0.0.
|
|
78
|
-
"@incajs/host-linux-x64": "0.0.
|
|
75
|
+
"@incajs/host-darwin-arm64": "0.0.18",
|
|
76
|
+
"@incajs/host-darwin-x64": "0.0.18",
|
|
77
|
+
"@incajs/host-linux-arm64": "0.0.18",
|
|
78
|
+
"@incajs/host-linux-x64": "0.0.18"
|
|
79
79
|
},
|
|
80
80
|
"engines": {
|
|
81
81
|
"node": ">=22.18"
|