@incajs/cli 0.0.8 → 0.0.10
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/README.md +2 -2
- package/dist/adapter/types.d.mts +10 -21
- package/dist/adapter/vite/build.d.mts +2 -1
- package/dist/adapter/vite/captureOutput.d.mts +2 -1
- package/dist/adapter/vite/config.d.mts +3 -1
- package/dist/adapter/vite/createBundler.d.mts +4 -0
- package/dist/adapter/vite/hmr.d.mts +25 -2
- package/dist/adapter/vite/index.d.mts +1 -3
- package/dist/adapter/vite/unsupported.d.mts +2 -1
- package/dist/adapter/vite/watch.d.mts +2 -1
- package/dist/adapterCore.d.mts +10 -0
- package/dist/chunks/{defaults-DNvHueCI.js → defaults-CKuLLRFh.js} +342 -266
- package/dist/chunks/{dist-BvTGFq3F.js → dist-AuwuGWnE.js} +28 -28
- package/dist/chunks/jsonc-BDHXk_1o.js +40 -0
- package/dist/chunks/{ohash-CHaRSTtv.js → ohash-Cc4pJh84.js} +1 -1
- package/dist/chunks/rolldown-runtime-Dy4uBu1J.js +11 -0
- package/dist/cli.js +487 -376
- package/dist/config/types.d.mts +1 -1
- package/dist/config.js +1 -1
- package/dist/dev-client/hostClient.d.mts +2 -0
- package/dist/dev.d.mts +10 -4
- package/dist/error.d.mts +5 -1
- package/dist/hmr-runtime.js +114 -112
- package/dist/log.d.mts +4 -0
- package/dist/retryOnEdit.d.mts +32 -0
- package/dist/watchForEdit.d.mts +27 -0
- package/package.json +11 -10
- package/dist/chunks/jsonc-BdzClvC8.js +0 -46
package/dist/config/types.d.mts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* deprecated — this file wins where both are present.
|
|
5
5
|
*/
|
|
6
6
|
export interface IncaConfig {
|
|
7
|
-
/** Path to an icon file, resolved
|
|
7
|
+
/** Path to an icon file, resolved from the app's root directory. */
|
|
8
8
|
icon?: string;
|
|
9
9
|
/**
|
|
10
10
|
* A reverse-DNS-style unique id — e.g. macOS's `CFBundleIdentifier`.
|
package/dist/config.js
CHANGED
|
@@ -4,6 +4,8 @@ export interface HostClientOptions {
|
|
|
4
4
|
entryFile: string;
|
|
5
5
|
/** Overrides which `inca-host` binary gets spawned, in place of automatic resolution. */
|
|
6
6
|
hostBin?: string;
|
|
7
|
+
/** The environment the host starts with. Defaults to this process's own. */
|
|
8
|
+
env?: NodeJS.ProcessEnv;
|
|
7
9
|
/**
|
|
8
10
|
* Every diagnostic line the transport itself produces: the host's real
|
|
9
11
|
* stderr, a stray stdout line, and a `ready` protocol mismatch. Defaults
|
package/dist/dev.d.mts
CHANGED
|
@@ -31,9 +31,15 @@ export interface DevOptions {
|
|
|
31
31
|
* reloads it on every rebuild — until `options.signal` aborts or the host
|
|
32
32
|
* exits on its own.
|
|
33
33
|
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
34
|
+
* A config or entry that can't be used before the first build is printed as
|
|
35
|
+
* `build failed`. `dev` then retries after the next edit to the config or the
|
|
36
|
+
* entry.
|
|
37
|
+
*
|
|
38
|
+
* @throws if another `inca dev` is already running for this app.
|
|
39
|
+
* @throws if the host binary can't be resolved or isn't a file.
|
|
40
|
+
* @throws if `experimentalHmr` is set and the bundler has no HMR support.
|
|
41
|
+
* @throws if the operating system refuses a file watcher.
|
|
42
|
+
* @throws if the host exits before it is ready, or exits non-zero or by a
|
|
43
|
+
* signal other than SIGINT/SIGTERM afterwards.
|
|
38
44
|
*/
|
|
39
45
|
export declare function dev(options: DevOptions): Promise<void>;
|
package/dist/error.d.mts
CHANGED
|
@@ -6,6 +6,10 @@
|
|
|
6
6
|
*/
|
|
7
7
|
export declare class IncaError extends Error {
|
|
8
8
|
readonly code: string;
|
|
9
|
+
/** A file whose creation or change may resolve the error. */
|
|
10
|
+
readonly path?: string | undefined;
|
|
9
11
|
readonly name = "IncaError";
|
|
10
|
-
constructor(code: string, message: string
|
|
12
|
+
constructor(code: string, message: string,
|
|
13
|
+
/** A file whose creation or change may resolve the error. */
|
|
14
|
+
path?: string | undefined);
|
|
11
15
|
}
|
package/dist/hmr-runtime.js
CHANGED
|
@@ -11,7 +11,7 @@ globalThis.TextDecoder === void 0 && (globalThis.TextDecoder = class {
|
|
|
11
11
|
}
|
|
12
12
|
});
|
|
13
13
|
//#endregion
|
|
14
|
-
//#region ../../node_modules/.pnpm/vite@8.3.
|
|
14
|
+
//#region ../../node_modules/.pnpm/vite@8.3.1_@types+node@26.6.3/node_modules/vite/dist/node/module-runner.js
|
|
15
15
|
var e = "sourceMa";
|
|
16
16
|
e += "ppingURL";
|
|
17
17
|
var t = typeof process < "u" && process.platform === "win32";
|
|
@@ -52,15 +52,17 @@ for (let e = 0; e < p.length; e++) {
|
|
|
52
52
|
let t = p.charCodeAt(e);
|
|
53
53
|
m[e] = t, h[t] = e;
|
|
54
54
|
}
|
|
55
|
-
function g(e
|
|
56
|
-
let
|
|
55
|
+
function g(e) {
|
|
56
|
+
let t = 0, n = 0, r = 0;
|
|
57
57
|
do
|
|
58
|
-
|
|
59
|
-
while (
|
|
60
|
-
|
|
61
|
-
|
|
58
|
+
r = h[e.next()], t |= (r & 31) << n, n += 5;
|
|
59
|
+
while (r & 32);
|
|
60
|
+
return t;
|
|
61
|
+
}
|
|
62
|
+
function _(e) {
|
|
63
|
+
return e & 1 ? -2147483648 | -(e >>> 1) : e >>> 1;
|
|
62
64
|
}
|
|
63
|
-
function
|
|
65
|
+
function v(e, t) {
|
|
64
66
|
return e.pos >= t ? !1 : e.peek() !== f;
|
|
65
67
|
}
|
|
66
68
|
var ee = class {
|
|
@@ -84,7 +86,7 @@ function te(e) {
|
|
|
84
86
|
let e = n.indexOf(";"), t = [], l = !0, u = 0;
|
|
85
87
|
for (i = 0; n.pos < e;) {
|
|
86
88
|
let r;
|
|
87
|
-
i
|
|
89
|
+
i += _(g(n)), i < u && (l = !1), u = i, v(n, e) ? (a += _(g(n)), o += _(g(n)), s += _(g(n)), v(n, e) ? (c += _(g(n)), r = [
|
|
88
90
|
i,
|
|
89
91
|
a,
|
|
90
92
|
o,
|
|
@@ -107,53 +109,53 @@ function ne(e) {
|
|
|
107
109
|
function re(e, t) {
|
|
108
110
|
return e[0] - t[0];
|
|
109
111
|
}
|
|
110
|
-
var
|
|
112
|
+
var y = 0, ie = 1, ae = 2, oe = 3, se = 4, b = !1;
|
|
111
113
|
function ce(e, t, n, r) {
|
|
112
114
|
for (; n <= r;) {
|
|
113
|
-
let i = n + (r - n >> 1), a = e[i][
|
|
114
|
-
if (a === 0) return
|
|
115
|
+
let i = n + (r - n >> 1), a = e[i][y] - t;
|
|
116
|
+
if (a === 0) return b = !0, i;
|
|
115
117
|
a < 0 ? n = i + 1 : r = i - 1;
|
|
116
118
|
}
|
|
117
|
-
return
|
|
119
|
+
return b = !1, n - 1;
|
|
118
120
|
}
|
|
119
121
|
function le(e, t, n) {
|
|
120
|
-
for (let r = n + 1; r < e.length && e[r][
|
|
122
|
+
for (let r = n + 1; r < e.length && e[r][y] === t; n = r++);
|
|
121
123
|
return n;
|
|
122
124
|
}
|
|
123
125
|
function ue(e, t, n) {
|
|
124
|
-
for (let r = n - 1; r >= 0 && e[r][
|
|
126
|
+
for (let r = n - 1; r >= 0 && e[r][y] === t; n = r--);
|
|
125
127
|
return n;
|
|
126
128
|
}
|
|
127
129
|
function de(e, t, n, r) {
|
|
128
130
|
let { lastKey: i, lastNeedle: a, lastIndex: o } = n, s = 0, c = e.length - 1;
|
|
129
131
|
if (r === i) {
|
|
130
|
-
if (t === a) return
|
|
132
|
+
if (t === a) return b = o !== -1 && e[o][y] === t, o;
|
|
131
133
|
t >= a ? s = o === -1 ? 0 : o : c = o;
|
|
132
134
|
}
|
|
133
135
|
return n.lastKey = r, n.lastNeedle = t, n.lastIndex = ce(e, t, s, c);
|
|
134
136
|
}
|
|
135
137
|
var fe = "`line` must be greater than 0 (lines start at line 1)", pe = "`column` must be greater than or equal to 0 (columns start at column 0)";
|
|
136
|
-
function
|
|
138
|
+
function x(e) {
|
|
137
139
|
return e;
|
|
138
140
|
}
|
|
139
141
|
function me(e) {
|
|
140
142
|
var t;
|
|
141
|
-
return (t =
|
|
143
|
+
return (t = x(e))._decoded || (t._decoded = te(x(e)._encoded));
|
|
142
144
|
}
|
|
143
145
|
function he(e, t) {
|
|
144
146
|
let { line: n, column: r, bias: i } = t;
|
|
145
147
|
if (n--, n < 0) throw Error(fe);
|
|
146
148
|
if (r < 0) throw Error(pe);
|
|
147
149
|
let a = me(e);
|
|
148
|
-
if (n >= a.length) return
|
|
149
|
-
let o = a[n], s = ge(o,
|
|
150
|
-
if (s === -1) return
|
|
150
|
+
if (n >= a.length) return S(null, null, null, null);
|
|
151
|
+
let o = a[n], s = ge(o, x(e)._decodedMemo, n, r, i || 1);
|
|
152
|
+
if (s === -1) return S(null, null, null, null);
|
|
151
153
|
let c = o[s];
|
|
152
|
-
if (c.length === 1) return
|
|
154
|
+
if (c.length === 1) return S(null, null, null, null);
|
|
153
155
|
let { names: l, resolvedSources: u } = e;
|
|
154
|
-
return
|
|
156
|
+
return S(u[c[ie]], c[ae] + 1, c[oe], c.length === 5 ? l[c[se]] : null);
|
|
155
157
|
}
|
|
156
|
-
function
|
|
158
|
+
function S(e, t, n, r) {
|
|
157
159
|
return {
|
|
158
160
|
source: e,
|
|
159
161
|
line: t,
|
|
@@ -163,10 +165,10 @@ function x(e, t, n, r) {
|
|
|
163
165
|
}
|
|
164
166
|
function ge(e, t, n, r, i) {
|
|
165
167
|
let a = de(e, r, t, n);
|
|
166
|
-
return
|
|
168
|
+
return b ? a = (i === -1 ? le : ue)(e, r, a) : i === -1 && a++, a === -1 || a === e.length ? -1 : a;
|
|
167
169
|
}
|
|
168
170
|
var _e = /^[A-Za-z]:\//;
|
|
169
|
-
function
|
|
171
|
+
function C(e = "") {
|
|
170
172
|
return e && e.replace(/\\/g, "/").replace(_e, (e) => e.toUpperCase());
|
|
171
173
|
}
|
|
172
174
|
var ve = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/, ye = /^[A-Za-z]:$/;
|
|
@@ -174,13 +176,13 @@ function be() {
|
|
|
174
176
|
return typeof process < "u" && typeof process.cwd == "function" ? process.cwd().replace(/\\/g, "/") : "/";
|
|
175
177
|
}
|
|
176
178
|
var xe = function(...e) {
|
|
177
|
-
e = e.map((e) =>
|
|
179
|
+
e = e.map((e) => C(e));
|
|
178
180
|
let t = "", n = !1;
|
|
179
181
|
for (let r = e.length - 1; r >= -1 && !n; r--) {
|
|
180
182
|
let i = r >= 0 ? e[r] : be();
|
|
181
|
-
|
|
183
|
+
i && i.length !== 0 && (t = `${i}/${t}`, n = w(i));
|
|
182
184
|
}
|
|
183
|
-
return t = Se(t, !n), n && !
|
|
185
|
+
return t = Se(t, !n), n && !w(t) ? `/${t}` : t.length > 0 ? t : ".";
|
|
184
186
|
};
|
|
185
187
|
function Se(e, t) {
|
|
186
188
|
let n = "", r = 0, i = -1, a = 0, o = null;
|
|
@@ -210,27 +212,27 @@ function Se(e, t) {
|
|
|
210
212
|
}
|
|
211
213
|
return n;
|
|
212
214
|
}
|
|
213
|
-
var
|
|
215
|
+
var w = function(e) {
|
|
214
216
|
return ve.test(e);
|
|
215
217
|
}, Ce = function(e) {
|
|
216
|
-
let t =
|
|
217
|
-
return t.length === 1 && ye.test(t[0]) && (t[0] += "/"), t.join("/") || (
|
|
218
|
-
}, we = new TextDecoder(),
|
|
218
|
+
let t = C(e).replace(/\/$/, "").split("/").slice(0, -1);
|
|
219
|
+
return t.length === 1 && ye.test(t[0]) && (t[0] += "/"), t.join("/") || (w(e) ? "/" : ".");
|
|
220
|
+
}, we = new TextDecoder(), T = (() => {
|
|
219
221
|
let e = typeof Buffer == "function" ? Buffer : void 0;
|
|
220
222
|
return e && typeof e.from == "function" ? (t) => e.from(t, "base64").toString("utf-8") : (e) => we.decode(Uint8Array.from(atob(e), (e) => e.charCodeAt(0)));
|
|
221
223
|
})(), Te = /%/g, Ee = /\\/g, De = /\n/g, Oe = /\r/g, ke = /\t/g, Ae = /\?/g, je = /#/g;
|
|
222
224
|
function Me(e) {
|
|
223
225
|
return e.includes("%") && (e = e.replace(Te, "%25")), !t && e.includes("\\") && (e = e.replace(Ee, "%5C")), e.includes("\n") && (e = e.replace(De, "%0A")), e.includes("\r") && (e = e.replace(Oe, "%0D")), e.includes(" ") && (e = e.replace(ke, "%09")), e;
|
|
224
226
|
}
|
|
225
|
-
var
|
|
226
|
-
function
|
|
227
|
-
let n =
|
|
227
|
+
var E = Ce, D = xe;
|
|
228
|
+
function O(e) {
|
|
229
|
+
let n = D(e), r = e.charCodeAt(e.length - 1);
|
|
228
230
|
return (r === 47 || t && r === 92) && n.at(-1) !== "/" && (n += "/"), n = Me(n), n.includes("?") && (n = n.replace(Ae, "%3F")), n.includes("#") && (n = n.replace(je, "%23")), new URL(`file://${n}`).href;
|
|
229
231
|
}
|
|
230
|
-
function
|
|
232
|
+
function k(e) {
|
|
231
233
|
return e.replace(/\//g, "\\");
|
|
232
234
|
}
|
|
233
|
-
var
|
|
235
|
+
var A = class {
|
|
234
236
|
map;
|
|
235
237
|
_encoded;
|
|
236
238
|
_decoded;
|
|
@@ -244,8 +246,8 @@ var k = class {
|
|
|
244
246
|
this.map = e;
|
|
245
247
|
let { mappings: n, names: r, sources: i } = e;
|
|
246
248
|
this.version = e.version, this.names = r || [], this._encoded = n || "", this._decodedMemo = Ne(), this.url = t, this.file = t;
|
|
247
|
-
let a =
|
|
248
|
-
this.resolvedSources = (i || []).map((e) =>
|
|
249
|
+
let a = E(t);
|
|
250
|
+
this.resolvedSources = (i || []).map((e) => D(a, e || ""));
|
|
249
251
|
}
|
|
250
252
|
};
|
|
251
253
|
function Ne() {
|
|
@@ -307,7 +309,7 @@ var Fe = RegExp(`//# ${e}=data:application/json;base64,(.+)`), Ie = class {
|
|
|
307
309
|
let r = `//# ${e}=data:application/json;base64,`, i = n.meta.code.lastIndexOf(r);
|
|
308
310
|
if (i === -1) return null;
|
|
309
311
|
let a = Fe.exec(n.meta.code.slice(i))?.[1];
|
|
310
|
-
return a ? (n.map = new
|
|
312
|
+
return a ? (n.map = new A(JSON.parse(T(a)), n.file), n.map) : null;
|
|
311
313
|
}
|
|
312
314
|
clear() {
|
|
313
315
|
this.idToModuleMap.clear(), this.fileToModulesMap.clear(), this.urlToIdModuleMap.clear();
|
|
@@ -488,7 +490,7 @@ var Ve = class {
|
|
|
488
490
|
for (; n-- > 0;) t += "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[Math.random() * 64 | 0];
|
|
489
491
|
return t;
|
|
490
492
|
};
|
|
491
|
-
function
|
|
493
|
+
function j(e) {
|
|
492
494
|
let t = Error(e.message || "Unknown invoke error");
|
|
493
495
|
return Object.assign(t, e, { runnerError: /* @__PURE__ */ Error("RunnerError") }), t;
|
|
494
496
|
}
|
|
@@ -505,7 +507,7 @@ var We = (e) => {
|
|
|
505
507
|
data: n
|
|
506
508
|
}
|
|
507
509
|
});
|
|
508
|
-
if ("error" in r) throw
|
|
510
|
+
if ("error" in r) throw j(r.error);
|
|
509
511
|
return r.result;
|
|
510
512
|
}
|
|
511
513
|
};
|
|
@@ -563,7 +565,7 @@ var We = (e) => {
|
|
|
563
565
|
try {
|
|
564
566
|
return await s;
|
|
565
567
|
} catch (e) {
|
|
566
|
-
throw
|
|
568
|
+
throw j(e);
|
|
567
569
|
}
|
|
568
570
|
}
|
|
569
571
|
};
|
|
@@ -592,7 +594,7 @@ var We = (e) => {
|
|
|
592
594
|
if (t.send) {
|
|
593
595
|
if (!n) {
|
|
594
596
|
if (r) await r;
|
|
595
|
-
else throw new
|
|
597
|
+
else throw new M("send was called before connect");
|
|
596
598
|
}
|
|
597
599
|
await t.send(e);
|
|
598
600
|
}
|
|
@@ -600,12 +602,12 @@ var We = (e) => {
|
|
|
600
602
|
async invoke(e, i) {
|
|
601
603
|
if (!n) {
|
|
602
604
|
if (r) await r;
|
|
603
|
-
else throw new
|
|
605
|
+
else throw new M("invoke was called before connect");
|
|
604
606
|
}
|
|
605
607
|
return t.invoke(e, i);
|
|
606
608
|
}
|
|
607
609
|
};
|
|
608
|
-
},
|
|
610
|
+
}, M = class extends Error {
|
|
609
611
|
constructor(e) {
|
|
610
612
|
super(e), this.name = "SendBeforeConnectError";
|
|
611
613
|
}
|
|
@@ -625,16 +627,16 @@ const {${i.join(", ")}} = pkg;
|
|
|
625
627
|
}
|
|
626
628
|
}
|
|
627
629
|
}
|
|
628
|
-
var
|
|
629
|
-
`${JSON.stringify(
|
|
630
|
+
var N = "__vite_ssr_exports__", P = "__vite_ssr_import__", F = "__vite_ssr_dynamic_import__", I = "__vite_ssr_exportAll__", L = "__vite_ssr_exportName__", R = "__vite_ssr_import_meta__", z = "vite-module-runner:import-meta-resolve/v1/";
|
|
631
|
+
`${JSON.stringify(z)}${JSON.stringify(z)}`;
|
|
630
632
|
var qe = new Proxy({}, { get(e, t) {
|
|
631
633
|
throw Error(`[module runner] Dynamic access of "import.meta.env" is not supported. Please, use "import.meta.env.${String(t)}" instead.`);
|
|
632
634
|
} });
|
|
633
635
|
function Je(e) {
|
|
634
|
-
let n =
|
|
636
|
+
let n = O(e), r = e, i = E(e);
|
|
635
637
|
return {
|
|
636
|
-
filename: t ?
|
|
637
|
-
dirname: t ?
|
|
638
|
+
filename: t ? k(r) : r,
|
|
639
|
+
dirname: t ? k(i) : i,
|
|
638
640
|
url: n,
|
|
639
641
|
env: qe,
|
|
640
642
|
resolve(e, t) {
|
|
@@ -645,10 +647,10 @@ function Je(e) {
|
|
|
645
647
|
}
|
|
646
648
|
};
|
|
647
649
|
}
|
|
648
|
-
var
|
|
650
|
+
var B = class {
|
|
649
651
|
startOffset = u() + 1;
|
|
650
652
|
async runInlinedModule(e, t) {
|
|
651
|
-
await new c(
|
|
653
|
+
await new c(N, R, P, F, I, L, "\"use strict\";\n" + t)(e[N], e[R], e[P], e[F], e[I], e[L]), Object.seal(e[N]);
|
|
652
654
|
}
|
|
653
655
|
runExternalModule(e) {
|
|
654
656
|
return import(e);
|
|
@@ -695,7 +697,7 @@ function Ze(e) {
|
|
|
695
697
|
await n.notifyListeners(t.event, t.data);
|
|
696
698
|
break;
|
|
697
699
|
case "full-reload": {
|
|
698
|
-
let { triggeredBy: r } = t, a = r ?
|
|
700
|
+
let { triggeredBy: r } = t, a = r ? V(e, Qe(e, i(r))) : $e(e);
|
|
699
701
|
if (!a.size) break;
|
|
700
702
|
n.logger.debug("program reload"), await n.notifyListeners("vite:beforeFullReload", t), e.evaluatedModules.clear();
|
|
701
703
|
for (let t of a) {
|
|
@@ -728,7 +730,7 @@ function Qe(e, t) {
|
|
|
728
730
|
let n = e.evaluatedModules.getModulesByFile(t);
|
|
729
731
|
return n ? [...n].map((e) => e.id) : [];
|
|
730
732
|
}
|
|
731
|
-
function
|
|
733
|
+
function V(e, t, n = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set()) {
|
|
732
734
|
for (let i of t) {
|
|
733
735
|
if (n.has(i)) continue;
|
|
734
736
|
n.add(i);
|
|
@@ -738,7 +740,7 @@ function B(e, t, n = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set()) {
|
|
|
738
740
|
r.add(t.url);
|
|
739
741
|
continue;
|
|
740
742
|
}
|
|
741
|
-
for (let i of t.importers)
|
|
743
|
+
for (let i of t.importers) V(e, [i], n, r);
|
|
742
744
|
}
|
|
743
745
|
}
|
|
744
746
|
return r;
|
|
@@ -747,32 +749,32 @@ function $e(e, t = /* @__PURE__ */ new Set()) {
|
|
|
747
749
|
for (let n of e.evaluatedModules.idToModuleMap.values()) n.importers.size || t.add(n.url);
|
|
748
750
|
return t;
|
|
749
751
|
}
|
|
750
|
-
var
|
|
751
|
-
debug:
|
|
752
|
-
error:
|
|
752
|
+
var H = () => {}, et = {
|
|
753
|
+
debug: H,
|
|
754
|
+
error: H
|
|
753
755
|
}, tt = {
|
|
754
756
|
debug: (...e) => console.log("[vite]", ...e),
|
|
755
757
|
error: (e) => console.log("[vite]", e)
|
|
756
|
-
},
|
|
758
|
+
}, U = {}, W = {}, G = /* @__PURE__ */ new Set(), K = /* @__PURE__ */ new Set(), q = /* @__PURE__ */ new Set(), J = (e) => ((...t) => {
|
|
757
759
|
for (let n of e) {
|
|
758
760
|
let e = n(...t);
|
|
759
761
|
if (e) return e;
|
|
760
762
|
}
|
|
761
763
|
return null;
|
|
762
|
-
}), nt =
|
|
764
|
+
}), nt = J(K), rt = J(q), Y = !1, it = Error.prepareStackTrace;
|
|
763
765
|
function at(e, t) {
|
|
764
|
-
|
|
766
|
+
G.delete(e.evaluatedModules), t.retrieveFile && K.delete(t.retrieveFile), t.retrieveSourceMap && q.delete(t.retrieveSourceMap), G.size === 0 && (Error.prepareStackTrace = it, Y = !1);
|
|
765
767
|
}
|
|
766
768
|
function ot(e, t = {}) {
|
|
767
|
-
return
|
|
769
|
+
return Y ||= (Error.prepareStackTrace = ht, !0), G.add(e.evaluatedModules), t.retrieveFile && K.add(t.retrieveFile), t.retrieveSourceMap && q.add(t.retrieveSourceMap), () => at(e, t);
|
|
768
770
|
}
|
|
769
|
-
function
|
|
771
|
+
function X(e, t) {
|
|
770
772
|
if (!e) return t;
|
|
771
|
-
let n =
|
|
772
|
-
return a && /^\/\w:/.test(o) ? (a += "/", a + i(
|
|
773
|
+
let n = E(i(e)), r = /^\w+:\/\/[^/]*/.exec(n), a = r ? r[0] : "", o = n.slice(a.length);
|
|
774
|
+
return a && /^\/\w:/.test(o) ? (a += "/", a + i(D(o, t))) : a + D(o, t);
|
|
773
775
|
}
|
|
774
776
|
function st(e) {
|
|
775
|
-
for (let t of
|
|
777
|
+
for (let t of G) {
|
|
776
778
|
let n = t.getModuleSourceMapById(e.source);
|
|
777
779
|
if (n) return {
|
|
778
780
|
url: e.source,
|
|
@@ -782,13 +784,13 @@ function st(e) {
|
|
|
782
784
|
}
|
|
783
785
|
return null;
|
|
784
786
|
}
|
|
785
|
-
function
|
|
786
|
-
if (e in
|
|
787
|
+
function Z(e) {
|
|
788
|
+
if (e in W) return W[e];
|
|
787
789
|
let t = nt(e);
|
|
788
|
-
return typeof t == "string" ? (
|
|
790
|
+
return typeof t == "string" ? (W[e] = t, t) : null;
|
|
789
791
|
}
|
|
790
792
|
function ct(e) {
|
|
791
|
-
let t =
|
|
793
|
+
let t = Z(e);
|
|
792
794
|
if (!t) return null;
|
|
793
795
|
let n = /\/\/[@#]\s*sourceMappingURL=([^\s'"]+)\s*$|\/\*[@#]\s*sourceMappingURL=[^\s*'"]+\s*\*\/\s*$/gm, r, i;
|
|
794
796
|
for (; i = n.exec(t);) r = i;
|
|
@@ -801,45 +803,45 @@ function ut(e) {
|
|
|
801
803
|
let n = ct(e);
|
|
802
804
|
if (!n) return null;
|
|
803
805
|
let r;
|
|
804
|
-
return lt.test(n) ? (r =
|
|
806
|
+
return lt.test(n) ? (r = T(n.slice(n.indexOf(",") + 1)), n = e) : (n = X(e, n), r = Z(n)), r ? {
|
|
805
807
|
url: n,
|
|
806
808
|
map: r
|
|
807
809
|
} : null;
|
|
808
810
|
}
|
|
809
|
-
function
|
|
811
|
+
function dt(e) {
|
|
810
812
|
if (!e.source) return e;
|
|
811
813
|
let t = st(e);
|
|
812
|
-
if (t ||=
|
|
814
|
+
if (t ||= U[e.source], !t) {
|
|
813
815
|
let n = ut(e.source);
|
|
814
816
|
if (n && n.map) {
|
|
815
817
|
let r = n.url;
|
|
816
|
-
t =
|
|
818
|
+
t = U[e.source] = {
|
|
817
819
|
url: r,
|
|
818
|
-
map: new
|
|
820
|
+
map: new A(typeof n.map == "string" ? JSON.parse(n.map) : n.map, r)
|
|
819
821
|
};
|
|
820
822
|
let i = t.map?.map.sourcesContent;
|
|
821
823
|
t.map && i && t.map.resolvedSources.forEach((e, t) => {
|
|
822
824
|
let n = i[t];
|
|
823
825
|
if (n && e && r) {
|
|
824
|
-
let t =
|
|
825
|
-
|
|
826
|
+
let t = X(r, e);
|
|
827
|
+
W[t] = n;
|
|
826
828
|
}
|
|
827
829
|
});
|
|
828
|
-
} else t =
|
|
830
|
+
} else t = U[e.source] = {
|
|
829
831
|
url: null,
|
|
830
832
|
map: null
|
|
831
833
|
};
|
|
832
834
|
}
|
|
833
835
|
if (t.map && t.url) {
|
|
834
836
|
let n = Pe(t.map, e);
|
|
835
|
-
if (n && n.source != null) return n.source =
|
|
837
|
+
if (n && n.source != null) return n.source = X(t.url, n.source), t.vite && (n._vite = !0), n;
|
|
836
838
|
}
|
|
837
839
|
return e;
|
|
838
840
|
}
|
|
839
|
-
function
|
|
841
|
+
function ft(e) {
|
|
840
842
|
let t = /^eval at ([^(]+) \((.+):(\d+):(\d+)\)$/.exec(e);
|
|
841
843
|
if (t) {
|
|
842
|
-
let e =
|
|
844
|
+
let e = dt({
|
|
843
845
|
name: null,
|
|
844
846
|
source: t[2],
|
|
845
847
|
line: +t[3],
|
|
@@ -847,9 +849,9 @@ function Q(e) {
|
|
|
847
849
|
});
|
|
848
850
|
return `eval at ${t[1]} (${e.source}:${e.line}:${e.column + 1})`;
|
|
849
851
|
}
|
|
850
|
-
return t = /^eval at ([^(]+) \((.+)\)$/.exec(e), t ? `eval at ${t[1]} (${
|
|
852
|
+
return t = /^eval at ([^(]+) \((.+)\)$/.exec(e), t ? `eval at ${t[1]} (${ft(t[2])})` : e;
|
|
851
853
|
}
|
|
852
|
-
function
|
|
854
|
+
function pt() {
|
|
853
855
|
let e, t = "";
|
|
854
856
|
if (this.isNative()) t = "native";
|
|
855
857
|
else {
|
|
@@ -871,29 +873,29 @@ function dt() {
|
|
|
871
873
|
}
|
|
872
874
|
return i && (n += ` (${t})`), n;
|
|
873
875
|
}
|
|
874
|
-
function
|
|
876
|
+
function Q(e) {
|
|
875
877
|
let t = Object.create(null);
|
|
876
878
|
return Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach((n) => {
|
|
877
879
|
let r = n;
|
|
878
880
|
t[r] = /^(?:is|get)/.test(n) ? function() {
|
|
879
881
|
return e[r].call(e);
|
|
880
882
|
} : e[r];
|
|
881
|
-
}), t.toString =
|
|
883
|
+
}), t.toString = pt, t;
|
|
882
884
|
}
|
|
883
|
-
function
|
|
885
|
+
function mt(e, t) {
|
|
884
886
|
if (t === void 0 && (t = {
|
|
885
887
|
nextPosition: null,
|
|
886
888
|
curPosition: null
|
|
887
889
|
}), e.isNative()) return t.curPosition = null, e;
|
|
888
890
|
let n = e.getFileName() || e.getScriptNameOrSourceURL();
|
|
889
891
|
if (n) {
|
|
890
|
-
let r =
|
|
892
|
+
let r = dt({
|
|
891
893
|
name: null,
|
|
892
894
|
source: n,
|
|
893
895
|
line: e.getLineNumber() ?? 0,
|
|
894
896
|
column: (e.getColumnNumber() ?? 1) - 1
|
|
895
897
|
});
|
|
896
|
-
t.curPosition = r, e =
|
|
898
|
+
t.curPosition = r, e = Q(e);
|
|
897
899
|
let i = e.getFunctionName;
|
|
898
900
|
return e.getFunctionName = function() {
|
|
899
901
|
let e = t.nextPosition == null ? i() : t.nextPosition.name || i();
|
|
@@ -909,19 +911,19 @@ function ft(e, t) {
|
|
|
909
911
|
}, e;
|
|
910
912
|
}
|
|
911
913
|
let r = e.isEval() && e.getEvalOrigin();
|
|
912
|
-
return r ? (r =
|
|
914
|
+
return r ? (r = ft(r), e = Q(e), e.getEvalOrigin = function() {
|
|
913
915
|
return r || void 0;
|
|
914
916
|
}, e) : e;
|
|
915
917
|
}
|
|
916
|
-
function
|
|
918
|
+
function ht(e, t) {
|
|
917
919
|
let n = `${e.name || "Error"}: ${e.message || ""}`, r = {
|
|
918
920
|
nextPosition: null,
|
|
919
921
|
curPosition: null
|
|
920
922
|
}, i = [];
|
|
921
|
-
for (let e = t.length - 1; e >= 0; e--) i.push(`\n at ${
|
|
923
|
+
for (let e = t.length - 1; e >= 0; e--) i.push(`\n at ${mt(t[e], r)}`), r.nextPosition = r.curPosition;
|
|
922
924
|
return r.curPosition = r.nextPosition = null, n + i.reverse().join("");
|
|
923
925
|
}
|
|
924
|
-
function
|
|
926
|
+
function gt(e) {
|
|
925
927
|
if (e.options.sourcemapInterceptor === "node") {
|
|
926
928
|
if (typeof process > "u") throw TypeError("Cannot use \"sourcemapInterceptor: 'node'\" because global \"process\" variable is not available.");
|
|
927
929
|
if (typeof process.setSourceMapsEnabled != "function") throw TypeError("Cannot use \"sourcemapInterceptor: 'node'\" because \"process.setSourceMapsEnabled\" function is not available. Please use Node >= 16.6.0.");
|
|
@@ -930,7 +932,7 @@ function mt(e) {
|
|
|
930
932
|
}
|
|
931
933
|
return ot(e, typeof e.options.sourcemapInterceptor == "object" ? e.options.sourcemapInterceptor : void 0);
|
|
932
934
|
}
|
|
933
|
-
var
|
|
935
|
+
var _t = class {
|
|
934
936
|
options;
|
|
935
937
|
evaluator;
|
|
936
938
|
debug;
|
|
@@ -942,13 +944,13 @@ var ht = class {
|
|
|
942
944
|
isBuiltin;
|
|
943
945
|
builtinsPromise;
|
|
944
946
|
closed = !1;
|
|
945
|
-
constructor(e, t = new
|
|
947
|
+
constructor(e, t = new B(), n) {
|
|
946
948
|
if (this.options = e, this.evaluator = t, this.debug = n, this.evaluatedModules = e.evaluatedModules ?? new Le(), this.transport = Ge(e.transport), e.hmr !== !1) {
|
|
947
949
|
let t = e.hmr ?? !0, n = t === !0 || t.logger === void 0 ? tt : t.logger === !1 ? et : t.logger;
|
|
948
950
|
if (this.hmrClient = new He(n, this.transport, ({ acceptedPath: e }) => this.import(e)), !this.transport.connect) throw Error("HMR is not supported by this runner transport, but `hmr` option was set to true");
|
|
949
951
|
this.transport.connect(Ze(this));
|
|
950
952
|
} else this.transport.connect?.();
|
|
951
|
-
e.sourcemapInterceptor !== !1 && (this.resetSourceMapSupport =
|
|
953
|
+
e.sourcemapInterceptor !== !1 && (this.resetSourceMapSupport = gt(this));
|
|
952
954
|
}
|
|
953
955
|
async import(e) {
|
|
954
956
|
let t = await this.cachedModule(e);
|
|
@@ -1039,7 +1041,7 @@ var ht = class {
|
|
|
1039
1041
|
let r = t.meta, i = r.id, a = [...n, i], s = async (e, n) => {
|
|
1040
1042
|
let o = "file" in r && r.file || i, s = await this.cachedModule(e, o);
|
|
1041
1043
|
return s.importers.add(i), t.imports.add(s.id), this.cachedRequest(e, s, a, n);
|
|
1042
|
-
}, c = async (t) => (t = String(t), t[0] === "." && (t = E(
|
|
1044
|
+
}, c = async (t) => (t = String(t), t[0] === "." && (t = D(E(e), t)), s(t, { isDynamicImport: !0 }));
|
|
1043
1045
|
if ("externalize" in r) {
|
|
1044
1046
|
let { externalize: e } = r;
|
|
1045
1047
|
this.debug?.("[module runner] externalizing", e);
|
|
@@ -1051,7 +1053,7 @@ var ht = class {
|
|
|
1051
1053
|
let t = a[a.length - 2];
|
|
1052
1054
|
throw Error(`[module runner] Failed to load "${e}"${t ? ` imported from ${t}` : ""}`);
|
|
1053
1055
|
}
|
|
1054
|
-
let d = this.options.createImportMeta ?? Je, f = o(u || i), p =
|
|
1056
|
+
let d = this.options.createImportMeta ?? Je, f = o(u || i), p = O(f), m = await d(f), h = Object.create(null);
|
|
1055
1057
|
Object.defineProperty(h, Symbol.toStringTag, {
|
|
1056
1058
|
value: "Module",
|
|
1057
1059
|
enumerable: !1,
|
|
@@ -1069,21 +1071,21 @@ var ht = class {
|
|
|
1069
1071
|
}
|
|
1070
1072
|
});
|
|
1071
1073
|
let _ = {
|
|
1072
|
-
[
|
|
1073
|
-
[
|
|
1074
|
-
[
|
|
1075
|
-
[
|
|
1076
|
-
[
|
|
1074
|
+
[P]: s,
|
|
1075
|
+
[F]: c,
|
|
1076
|
+
[N]: h,
|
|
1077
|
+
[I]: (e) => vt(h, e),
|
|
1078
|
+
[L]: (e, t) => Object.defineProperty(h, e, {
|
|
1077
1079
|
enumerable: !0,
|
|
1078
1080
|
configurable: !0,
|
|
1079
1081
|
get: t
|
|
1080
1082
|
}),
|
|
1081
|
-
[
|
|
1083
|
+
[R]: m
|
|
1082
1084
|
};
|
|
1083
1085
|
return this.debug?.("[module runner] executing", p), await this.evaluator.runInlinedModule(_, l, t), h;
|
|
1084
1086
|
}
|
|
1085
1087
|
};
|
|
1086
|
-
function
|
|
1088
|
+
function vt(e, t) {
|
|
1087
1089
|
if (e !== t && !(s(t) || Array.isArray(t) || t instanceof Promise)) {
|
|
1088
1090
|
for (let n in t) if (n !== "default" && n !== "__esModule" && !(n in e)) try {
|
|
1089
1091
|
Object.defineProperty(e, n, {
|
|
@@ -1096,7 +1098,7 @@ function gt(e, t) {
|
|
|
1096
1098
|
}
|
|
1097
1099
|
//#endregion
|
|
1098
1100
|
//#region src/adapter/vite/runtime/index.mts
|
|
1099
|
-
function
|
|
1101
|
+
function $() {
|
|
1100
1102
|
return {
|
|
1101
1103
|
connect({ onMessage: e }) {
|
|
1102
1104
|
let t = globalThis.__inca_dev__;
|
|
@@ -1112,10 +1114,10 @@ function _t() {
|
|
|
1112
1114
|
}
|
|
1113
1115
|
};
|
|
1114
1116
|
}
|
|
1115
|
-
function
|
|
1116
|
-
return new
|
|
1117
|
+
function yt(e) {
|
|
1118
|
+
return new _t({
|
|
1117
1119
|
transport: {
|
|
1118
|
-
|
|
1120
|
+
...$(),
|
|
1119
1121
|
timeout: 0
|
|
1120
1122
|
},
|
|
1121
1123
|
hmr: { logger: {
|
|
@@ -1123,7 +1125,7 @@ function vt(e) {
|
|
|
1123
1125
|
error: () => {}
|
|
1124
1126
|
} },
|
|
1125
1127
|
sourcemapInterceptor: !1
|
|
1126
|
-
}, new
|
|
1128
|
+
}, new B()).import(e);
|
|
1127
1129
|
}
|
|
1128
1130
|
//#endregion
|
|
1129
|
-
export {
|
|
1131
|
+
export { $ as createIncaDevTransport, yt as start };
|
package/dist/log.d.mts
CHANGED
|
@@ -3,6 +3,10 @@ export interface LogOptions {
|
|
|
3
3
|
/** Prefixes the line with `HH:MM:SS`, the way Vite's dev server stamps its own. */
|
|
4
4
|
timestamp?: boolean;
|
|
5
5
|
}
|
|
6
|
+
/** `inca dev` stamps its lines the way Vite's dev server does. */
|
|
7
|
+
export declare const STAMPED: {
|
|
8
|
+
readonly timestamp: true;
|
|
9
|
+
};
|
|
6
10
|
/** Writes one `[inca] <message>` line to `stream`. */
|
|
7
11
|
export declare function log(stream: NodeJS.WritableStream, message: string, options?: LogOptions): void;
|
|
8
12
|
/** A failure reduced to the message and stack worth printing. */
|