@incajs/cli 0.0.13 → 0.0.15
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/adapter/types.d.mts +2 -0
- package/dist/adapter/vite/build.d.mts +1 -1
- package/dist/adapter/vite/config.d.mts +3 -1
- package/dist/build.d.mts +2 -0
- package/dist/chunks/{defaults-TOBTBbDy.js → defaults-Ct95BSBl.js} +1 -0
- package/dist/cli.js +40 -27
- package/dist/config/defaults.d.mts +1 -1
- package/dist/config/loader.d.mts +2 -0
- package/dist/config/types.d.mts +6 -0
- package/dist/config.js +1 -1
- package/dist/hmr-runtime.js +218 -195
- package/dist/package.d.mts +2 -0
- package/package.json +6 -6
package/dist/adapter/types.d.mts
CHANGED
|
@@ -9,6 +9,8 @@ export interface BuildOptions {
|
|
|
9
9
|
entry: string;
|
|
10
10
|
/** Where the build's output is written. */
|
|
11
11
|
outDir: string;
|
|
12
|
+
/** Writes `bundle.js.map` beside the bundle. Defaults to `false`. */
|
|
13
|
+
sourcemap?: boolean;
|
|
12
14
|
/**
|
|
13
15
|
* Values the built app carries for `inca-host` to read — its name, id
|
|
14
16
|
* and window. Any JSON-serializable object.
|
|
@@ -5,4 +5,4 @@ import { BuildOptions, BuildOutput } from '../types.mts';
|
|
|
5
5
|
* rejects on failure rather than reporting it through a callback. Never
|
|
6
6
|
* starts or talks to `inca-host` — that's `dev.mts`'s job.
|
|
7
7
|
*/
|
|
8
|
-
export declare function build(core: AdapterCore, runtimeModuleName: string, { entry, outDir, runtimeConfig, stdout, stderr, quiet, }: BuildOptions): Promise<BuildOutput>;
|
|
8
|
+
export declare function build(core: AdapterCore, runtimeModuleName: string, { entry, outDir, sourcemap, runtimeConfig, stdout, stderr, quiet, }: BuildOptions): Promise<BuildOutput>;
|
|
@@ -12,6 +12,8 @@ export interface ResolveConfigOptions {
|
|
|
12
12
|
outDir: string;
|
|
13
13
|
/** `"development"` keeps `@vue/runtime-core`'s own warnings; `"production"` strips them. */
|
|
14
14
|
mode: "development" | "production";
|
|
15
|
+
/** Writes the map in a production build too. Development always writes it. */
|
|
16
|
+
sourcemap?: boolean;
|
|
15
17
|
/** Whether Vite should keep rebuilding on file changes. */
|
|
16
18
|
watch: boolean;
|
|
17
19
|
/** Called with what each successful (re)build wrote. */
|
|
@@ -35,4 +37,4 @@ export interface ResolveConfigOptions {
|
|
|
35
37
|
* the entry, named by `chunkFileNames`/`assetFileNames` below, rather than
|
|
36
38
|
* failing the build.
|
|
37
39
|
*/
|
|
38
|
-
export declare function resolveViteConfig({ core, runtimeModuleName, entry, outDir, mode, watch, onOutput, stdout, stderr, quiet, runtimeConfig, }: ResolveConfigOptions): InlineConfig;
|
|
40
|
+
export declare function resolveViteConfig({ core, runtimeModuleName, entry, outDir, mode, sourcemap, watch, onOutput, stdout, stderr, quiet, runtimeConfig, }: ResolveConfigOptions): InlineConfig;
|
package/dist/build.d.mts
CHANGED
|
@@ -12,6 +12,8 @@ export interface BuildAppOptions {
|
|
|
12
12
|
bundler?: Bundler;
|
|
13
13
|
/** An already-resolved config — lets `packageApp` avoid loading it twice. */
|
|
14
14
|
config?: ResolvedBuildConfig;
|
|
15
|
+
/** Writes `bundle.js.map` beside the bundle. Overrides the config's `sourcemap` when set. */
|
|
16
|
+
sourcemap?: boolean;
|
|
15
17
|
/** What the build carries for `inca-host` to read. Resolved from the app's config when absent. */
|
|
16
18
|
runtimeConfig?: RuntimeConfig;
|
|
17
19
|
/** Where the bundler's own output goes. Defaults to `process.stdout`. */
|
package/dist/cli.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as e } from "./chunks/rolldown-runtime-Dy4uBu1J.js";
|
|
2
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-C64iuQVW.js";
|
|
3
|
-
import { i as c, n as l, r as u, t as d } from "./chunks/defaults-
|
|
3
|
+
import { i as c, n as l, r as u, t as d } from "./chunks/defaults-Ct95BSBl.js";
|
|
4
4
|
import f, { existsSync as p, lstatSync as m, readFileSync as h, realpathSync as g, statSync as _, watch as v } from "node:fs";
|
|
5
5
|
import y, { resolve as b } from "node:path";
|
|
6
6
|
import { chmod as x, cp as S, link as C, mkdir as w, readFile as T, readdir as ee, rm as E, writeFile as D } from "node:fs/promises";
|
|
@@ -578,7 +578,8 @@ async function nt(e) {
|
|
|
578
578
|
let { config: t } = await G(e), n = t.entry ? y.resolve(e, t.entry) : void 0;
|
|
579
579
|
return {
|
|
580
580
|
entry: n,
|
|
581
|
-
outDir: et(e, t.outDir, n)
|
|
581
|
+
outDir: et(e, t.outDir, n),
|
|
582
|
+
sourcemap: t.sourcemap ?? d.sourcemap
|
|
582
583
|
};
|
|
583
584
|
}
|
|
584
585
|
async function rt(e) {
|
|
@@ -603,6 +604,7 @@ async function rt(e) {
|
|
|
603
604
|
window: i.window,
|
|
604
605
|
entry: m,
|
|
605
606
|
outDir: h,
|
|
607
|
+
sourcemap: i.sourcemap ?? d.sourcemap,
|
|
606
608
|
usedPackageJsonKey: a
|
|
607
609
|
};
|
|
608
610
|
}
|
|
@@ -719,14 +721,15 @@ function gt(e, t = ht) {
|
|
|
719
721
|
//#endregion
|
|
720
722
|
//#region src/adapter/vite/config.mts
|
|
721
723
|
var _t = "bundle.js";
|
|
722
|
-
function vt({ core: e, runtimeModuleName: t, entry: n, outDir: r, mode: i,
|
|
724
|
+
function vt({ core: e, runtimeModuleName: t, entry: n, outDir: r, mode: i, sourcemap: a = !1, watch: o, onOutput: s, stdout: c, stderr: l, quiet: u, runtimeConfig: d }) {
|
|
725
|
+
let f = i === "development" || a;
|
|
723
726
|
return {
|
|
724
727
|
configFile: !1,
|
|
725
728
|
root: y.dirname(n),
|
|
726
729
|
mode: i,
|
|
727
730
|
clearScreen: !1,
|
|
728
|
-
logLevel:
|
|
729
|
-
customLogger: pt(
|
|
731
|
+
logLevel: u ? "silent" : "info",
|
|
732
|
+
customLogger: pt(c, l),
|
|
730
733
|
define: { "process.env.NODE_ENV": JSON.stringify(i) },
|
|
731
734
|
plugins: [
|
|
732
735
|
se({ template: { compilerOptions: {
|
|
@@ -734,8 +737,8 @@ function vt({ core: e, runtimeModuleName: t, entry: n, outDir: r, mode: i, watch
|
|
|
734
737
|
hoistStatic: !1
|
|
735
738
|
} } }),
|
|
736
739
|
gt(e),
|
|
737
|
-
ut(
|
|
738
|
-
st(e,
|
|
740
|
+
ut(d),
|
|
741
|
+
st(e, s)
|
|
739
742
|
],
|
|
740
743
|
build: {
|
|
741
744
|
lib: {
|
|
@@ -746,34 +749,37 @@ function vt({ core: e, runtimeModuleName: t, entry: n, outDir: r, mode: i, watch
|
|
|
746
749
|
outDir: r,
|
|
747
750
|
emptyOutDir: i === "production",
|
|
748
751
|
minify: i === "production",
|
|
749
|
-
|
|
752
|
+
sourcemap: f,
|
|
753
|
+
watch: o ? { buildDelay: 30 } : void 0,
|
|
750
754
|
rolldownOptions: { output: {
|
|
751
755
|
chunkFileNames: "chunks/[name]-[hash].js",
|
|
752
|
-
assetFileNames: "assets/[name]-[hash][extname]"
|
|
756
|
+
assetFileNames: "assets/[name]-[hash][extname]",
|
|
757
|
+
sourcemapExcludeSources: f
|
|
753
758
|
} }
|
|
754
759
|
}
|
|
755
760
|
};
|
|
756
761
|
}
|
|
757
762
|
//#endregion
|
|
758
763
|
//#region src/adapter/vite/build.mts
|
|
759
|
-
async function yt(e, t, { entry: n, outDir: r,
|
|
760
|
-
let
|
|
764
|
+
async function yt(e, t, { entry: n, outDir: r, sourcemap: i, runtimeConfig: a, stdout: o = process.stdout, stderr: s = process.stderr, quiet: c = !1 }) {
|
|
765
|
+
let l;
|
|
761
766
|
if (await A(vt({
|
|
762
767
|
core: e,
|
|
763
768
|
runtimeModuleName: t,
|
|
764
769
|
entry: n,
|
|
765
770
|
outDir: r,
|
|
766
|
-
runtimeConfig:
|
|
771
|
+
runtimeConfig: a,
|
|
767
772
|
mode: "production",
|
|
773
|
+
sourcemap: i,
|
|
768
774
|
watch: !1,
|
|
769
|
-
stdout:
|
|
770
|
-
stderr:
|
|
771
|
-
quiet:
|
|
775
|
+
stdout: o,
|
|
776
|
+
stderr: s,
|
|
777
|
+
quiet: c,
|
|
772
778
|
onOutput: (e) => {
|
|
773
|
-
|
|
779
|
+
l = ot(r, e);
|
|
774
780
|
}
|
|
775
|
-
})), !
|
|
776
|
-
return
|
|
781
|
+
})), !l) throw new e.IncaError("ERR_INCA_BUILD_NO_OUTPUT", "build produced no output");
|
|
782
|
+
return l;
|
|
777
783
|
}
|
|
778
784
|
//#endregion
|
|
779
785
|
//#region src/adapter/vite/hmr.mts
|
|
@@ -1218,6 +1224,7 @@ async function Qt(e = {}) {
|
|
|
1218
1224
|
return i.build({
|
|
1219
1225
|
entry: a,
|
|
1220
1226
|
outDir: r,
|
|
1227
|
+
sourcemap: e.sourcemap ?? n.sourcemap,
|
|
1221
1228
|
runtimeConfig: o,
|
|
1222
1229
|
stdout: e.stdout,
|
|
1223
1230
|
stderr: e.stderr
|
|
@@ -1588,6 +1595,7 @@ async function En(e = {}) {
|
|
|
1588
1595
|
cwd: t,
|
|
1589
1596
|
entry: e.entry,
|
|
1590
1597
|
config: i,
|
|
1598
|
+
sourcemap: e.sourcemap,
|
|
1591
1599
|
runtimeConfig: it(i),
|
|
1592
1600
|
bundler: e.bundler,
|
|
1593
1601
|
stdout: n,
|
|
@@ -1603,11 +1611,16 @@ async function En(e = {}) {
|
|
|
1603
1611
|
}
|
|
1604
1612
|
//#endregion
|
|
1605
1613
|
//#region src/cli.mts
|
|
1606
|
-
var Dn = "Usage: inca <dev|build|package>";
|
|
1614
|
+
var Dn = "Usage: inca <dev|build|package> [--sourcemap|--no-sourcemap]";
|
|
1607
1615
|
function On(e) {
|
|
1608
1616
|
return y.relative(process.cwd(), e);
|
|
1609
1617
|
}
|
|
1610
|
-
function kn() {
|
|
1618
|
+
function kn(e) {
|
|
1619
|
+
let t;
|
|
1620
|
+
for (let n of e) n === "--sourcemap" ? t = !0 : n === "--no-sourcemap" && (t = !1);
|
|
1621
|
+
return t;
|
|
1622
|
+
}
|
|
1623
|
+
function An() {
|
|
1611
1624
|
for (let e of [
|
|
1612
1625
|
0,
|
|
1613
1626
|
1,
|
|
@@ -1616,12 +1629,12 @@ function kn() {
|
|
|
1616
1629
|
f.closeSync(e);
|
|
1617
1630
|
} catch {}
|
|
1618
1631
|
}
|
|
1619
|
-
async function
|
|
1632
|
+
async function jn(e = process.argv) {
|
|
1620
1633
|
let t = e[2];
|
|
1621
1634
|
if (t === "build") {
|
|
1622
1635
|
try {
|
|
1623
|
-
let
|
|
1624
|
-
Y(process.stdout, `built ${On(
|
|
1636
|
+
let t = await Qt({ sourcemap: kn(e) });
|
|
1637
|
+
Y(process.stdout, `built ${On(t.entryFile)}`);
|
|
1625
1638
|
} catch (e) {
|
|
1626
1639
|
Z(process.stderr, "build failed", X(e)), process.exitCode = 1;
|
|
1627
1640
|
}
|
|
@@ -1629,8 +1642,8 @@ async function An(e = process.argv) {
|
|
|
1629
1642
|
}
|
|
1630
1643
|
if (t === "package") {
|
|
1631
1644
|
try {
|
|
1632
|
-
let { appPath:
|
|
1633
|
-
Y(process.stdout, `packaged ${On(
|
|
1645
|
+
let { appPath: t } = await En({ sourcemap: kn(e) });
|
|
1646
|
+
Y(process.stdout, `packaged ${On(t)}`);
|
|
1634
1647
|
} catch (e) {
|
|
1635
1648
|
Z(process.stderr, "package failed", X(e)), process.exitCode = 1;
|
|
1636
1649
|
}
|
|
@@ -1654,10 +1667,10 @@ async function An(e = process.argv) {
|
|
|
1654
1667
|
await bn({
|
|
1655
1668
|
signal: n.signal,
|
|
1656
1669
|
experimentalHmr: i
|
|
1657
|
-
}), n.signal.aborted &&
|
|
1670
|
+
}), n.signal.aborted && An();
|
|
1658
1671
|
} catch (e) {
|
|
1659
1672
|
Z(process.stderr, "dev failed", X(e), { timestamp: !0 }), process.exitCode = 1;
|
|
1660
1673
|
}
|
|
1661
1674
|
}
|
|
1662
1675
|
//#endregion
|
|
1663
|
-
export {
|
|
1676
|
+
export { jn as run };
|
|
@@ -14,7 +14,7 @@ import { IncaConfig } from './types.mts';
|
|
|
14
14
|
* });
|
|
15
15
|
* ```
|
|
16
16
|
*/
|
|
17
|
-
export declare const defaultConfig: Required<Pick<IncaConfig, "outDir" | "version">>;
|
|
17
|
+
export declare const defaultConfig: Required<Pick<IncaConfig, "outDir" | "sourcemap" | "version">>;
|
|
18
18
|
/**
|
|
19
19
|
* Strips an npm scope off a package name.
|
|
20
20
|
*
|
package/dist/config/loader.d.mts
CHANGED
|
@@ -5,6 +5,8 @@ export interface ResolvedBuildConfig {
|
|
|
5
5
|
entry?: string;
|
|
6
6
|
/** Absolute path. */
|
|
7
7
|
outDir: string;
|
|
8
|
+
/** Whether `build`/`package` write `bundle.js.map`. */
|
|
9
|
+
sourcemap: boolean;
|
|
8
10
|
}
|
|
9
11
|
/** An app's full config, as `inca package` needs it. */
|
|
10
12
|
export interface ResolvedAppConfig extends ResolvedBuildConfig {
|
package/dist/config/types.d.mts
CHANGED
|
@@ -33,6 +33,12 @@ export interface IncaConfig {
|
|
|
33
33
|
* @default "dist"
|
|
34
34
|
*/
|
|
35
35
|
outDir?: string;
|
|
36
|
+
/**
|
|
37
|
+
* Whether `inca build` and `inca package` write `bundle.js.map` beside
|
|
38
|
+
* the bundle. `inca dev` always writes it.
|
|
39
|
+
* @default false
|
|
40
|
+
*/
|
|
41
|
+
sourcemap?: boolean;
|
|
36
42
|
/** The window the app opens in. */
|
|
37
43
|
window?: WindowConfig;
|
|
38
44
|
}
|
package/dist/config.js
CHANGED
package/dist/hmr-runtime.js
CHANGED
|
@@ -37,7 +37,7 @@ function u() {
|
|
|
37
37
|
}
|
|
38
38
|
return l;
|
|
39
39
|
}
|
|
40
|
-
function
|
|
40
|
+
function ee() {
|
|
41
41
|
let e, t;
|
|
42
42
|
return {
|
|
43
43
|
promise: new Promise((n, r) => {
|
|
@@ -47,37 +47,37 @@ function d() {
|
|
|
47
47
|
reject: t
|
|
48
48
|
};
|
|
49
49
|
}
|
|
50
|
-
var
|
|
51
|
-
function
|
|
52
|
-
return e.replace(
|
|
50
|
+
var d = /(?:%[0-9a-f]{2})+/gi, f = /^\s+$/;
|
|
51
|
+
function p(e) {
|
|
52
|
+
return e.replace(d, (e) => {
|
|
53
53
|
let t;
|
|
54
54
|
try {
|
|
55
55
|
t = decodeURIComponent(e);
|
|
56
56
|
} catch {
|
|
57
57
|
return e;
|
|
58
58
|
}
|
|
59
|
-
return
|
|
59
|
+
return f.test(t) ? t : e;
|
|
60
60
|
});
|
|
61
61
|
}
|
|
62
|
-
var
|
|
63
|
-
for (let e = 0; e <
|
|
64
|
-
let t =
|
|
65
|
-
|
|
62
|
+
var m = 44, h = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", g = /* @__PURE__ */ new Uint8Array(64), _ = /* @__PURE__ */ new Uint8Array(128);
|
|
63
|
+
for (let e = 0; e < h.length; e++) {
|
|
64
|
+
let t = h.charCodeAt(e);
|
|
65
|
+
g[e] = t, _[t] = e;
|
|
66
66
|
}
|
|
67
|
-
function
|
|
67
|
+
function v(e) {
|
|
68
68
|
let t = 0, n = 0, r = 0;
|
|
69
69
|
do
|
|
70
|
-
r =
|
|
70
|
+
r = _[e.next()], t |= (r & 31) << n, n += 5;
|
|
71
71
|
while (r & 32);
|
|
72
72
|
return t;
|
|
73
73
|
}
|
|
74
|
-
function
|
|
74
|
+
function y(e) {
|
|
75
75
|
return e & 1 ? -2147483648 | -(e >>> 1) : e >>> 1;
|
|
76
76
|
}
|
|
77
|
-
function
|
|
78
|
-
return e.pos >= t ? !1 : e.peek() !==
|
|
77
|
+
function b(e, t) {
|
|
78
|
+
return e.pos >= t ? !1 : e.peek() !== m;
|
|
79
79
|
}
|
|
80
|
-
var
|
|
80
|
+
var te = class {
|
|
81
81
|
constructor(e) {
|
|
82
82
|
this.pos = 0, this.buffer = e;
|
|
83
83
|
}
|
|
@@ -92,13 +92,13 @@ var ee = class {
|
|
|
92
92
|
return r === -1 ? t.length : r;
|
|
93
93
|
}
|
|
94
94
|
};
|
|
95
|
-
function
|
|
96
|
-
let { length: t } = e, n = new
|
|
95
|
+
function ne(e) {
|
|
96
|
+
let { length: t } = e, n = new te(e), r = [], i = 0, a = 0, o = 0, s = 0, c = 0;
|
|
97
97
|
do {
|
|
98
98
|
let e = n.indexOf(";"), t = [], l = !0, u = 0;
|
|
99
99
|
for (i = 0; n.pos < e;) {
|
|
100
100
|
let r;
|
|
101
|
-
i +=
|
|
101
|
+
i += y(v(n)), i < u && (l = !1), u = i, b(n, e) ? (a += y(v(n)), o += y(v(n)), s += y(v(n)), b(n, e) ? (c += y(v(n)), r = [
|
|
102
102
|
i,
|
|
103
103
|
a,
|
|
104
104
|
o,
|
|
@@ -111,63 +111,63 @@ function te(e) {
|
|
|
111
111
|
s
|
|
112
112
|
]) : r = [i], t.push(r), n.pos++;
|
|
113
113
|
}
|
|
114
|
-
l ||
|
|
114
|
+
l || re(t), r.push(t), n.pos = e + 1;
|
|
115
115
|
} while (n.pos <= t);
|
|
116
116
|
return r;
|
|
117
117
|
}
|
|
118
|
-
function
|
|
119
|
-
e.sort(
|
|
118
|
+
function re(e) {
|
|
119
|
+
e.sort(ie);
|
|
120
120
|
}
|
|
121
|
-
function
|
|
121
|
+
function ie(e, t) {
|
|
122
122
|
return e[0] - t[0];
|
|
123
123
|
}
|
|
124
|
-
var
|
|
125
|
-
function
|
|
124
|
+
var x = 0, ae = 1, oe = 2, se = 3, ce = 4, S = !1;
|
|
125
|
+
function le(e, t, n, r) {
|
|
126
126
|
for (; n <= r;) {
|
|
127
|
-
let i = n + (r - n >> 1), a = e[i][
|
|
128
|
-
if (a === 0) return
|
|
127
|
+
let i = n + (r - n >> 1), a = e[i][x] - t;
|
|
128
|
+
if (a === 0) return S = !0, i;
|
|
129
129
|
a < 0 ? n = i + 1 : r = i - 1;
|
|
130
130
|
}
|
|
131
|
-
return
|
|
131
|
+
return S = !1, n - 1;
|
|
132
132
|
}
|
|
133
|
-
function
|
|
134
|
-
for (let r = n + 1; r < e.length && e[r][
|
|
133
|
+
function ue(e, t, n) {
|
|
134
|
+
for (let r = n + 1; r < e.length && e[r][x] === t; n = r++);
|
|
135
135
|
return n;
|
|
136
136
|
}
|
|
137
|
-
function
|
|
138
|
-
for (let r = n - 1; r >= 0 && e[r][
|
|
137
|
+
function de(e, t, n) {
|
|
138
|
+
for (let r = n - 1; r >= 0 && e[r][x] === t; n = r--);
|
|
139
139
|
return n;
|
|
140
140
|
}
|
|
141
|
-
function
|
|
141
|
+
function fe(e, t, n, r) {
|
|
142
142
|
let { lastKey: i, lastNeedle: a, lastIndex: o } = n, s = 0, c = e.length - 1;
|
|
143
143
|
if (r === i) {
|
|
144
|
-
if (t === a) return
|
|
144
|
+
if (t === a) return S = o !== -1 && e[o][x] === t, o;
|
|
145
145
|
t >= a ? s = o === -1 ? 0 : o : c = o;
|
|
146
146
|
}
|
|
147
|
-
return n.lastKey = r, n.lastNeedle = t, n.lastIndex =
|
|
147
|
+
return n.lastKey = r, n.lastNeedle = t, n.lastIndex = le(e, t, s, c);
|
|
148
148
|
}
|
|
149
|
-
var
|
|
150
|
-
function
|
|
149
|
+
var pe = "`line` must be greater than 0 (lines start at line 1)", me = "`column` must be greater than or equal to 0 (columns start at column 0)";
|
|
150
|
+
function C(e) {
|
|
151
151
|
return e;
|
|
152
152
|
}
|
|
153
|
-
function
|
|
153
|
+
function he(e) {
|
|
154
154
|
var t;
|
|
155
|
-
return (t =
|
|
155
|
+
return (t = C(e))._decoded || (t._decoded = ne(C(e)._encoded));
|
|
156
156
|
}
|
|
157
|
-
function
|
|
157
|
+
function ge(e, t) {
|
|
158
158
|
let { line: n, column: r, bias: i } = t;
|
|
159
|
-
if (n--, n < 0) throw Error(
|
|
160
|
-
if (r < 0) throw Error(
|
|
161
|
-
let a =
|
|
162
|
-
if (n >= a.length) return
|
|
163
|
-
let o = a[n], s =
|
|
164
|
-
if (s === -1) return
|
|
159
|
+
if (n--, n < 0) throw Error(pe);
|
|
160
|
+
if (r < 0) throw Error(me);
|
|
161
|
+
let a = he(e);
|
|
162
|
+
if (n >= a.length) return w(null, null, null, null);
|
|
163
|
+
let o = a[n], s = _e(o, C(e)._decodedMemo, n, r, i || 1);
|
|
164
|
+
if (s === -1) return w(null, null, null, null);
|
|
165
165
|
let c = o[s];
|
|
166
|
-
if (c.length === 1) return
|
|
166
|
+
if (c.length === 1) return w(null, null, null, null);
|
|
167
167
|
let { names: l, resolvedSources: u } = e;
|
|
168
|
-
return
|
|
168
|
+
return w(u[c[ae]], c[oe] + 1, c[se], c.length === 5 ? l[c[ce]] : null);
|
|
169
169
|
}
|
|
170
|
-
function
|
|
170
|
+
function w(e, t, n, r) {
|
|
171
171
|
return {
|
|
172
172
|
source: e,
|
|
173
173
|
line: t,
|
|
@@ -175,28 +175,28 @@ function T(e, t, n, r) {
|
|
|
175
175
|
name: r
|
|
176
176
|
};
|
|
177
177
|
}
|
|
178
|
-
function
|
|
179
|
-
let a =
|
|
180
|
-
return
|
|
178
|
+
function _e(e, t, n, r, i) {
|
|
179
|
+
let a = fe(e, r, t, n);
|
|
180
|
+
return S ? a = (i === -1 ? ue : de)(e, r, a) : i === -1 && a++, a === -1 || a === e.length ? -1 : a;
|
|
181
181
|
}
|
|
182
|
-
var
|
|
183
|
-
function
|
|
184
|
-
return e && e.replace(/\\/g, "/").replace(
|
|
182
|
+
var ve = /^[A-Za-z]:\//;
|
|
183
|
+
function T(e = "") {
|
|
184
|
+
return e && e.replace(/\\/g, "/").replace(ve, (e) => e.toUpperCase());
|
|
185
185
|
}
|
|
186
|
-
var
|
|
187
|
-
function
|
|
186
|
+
var ye = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/, be = /^[A-Za-z]:$/;
|
|
187
|
+
function xe() {
|
|
188
188
|
return typeof process < "u" && typeof process.cwd == "function" ? process.cwd().replace(/\\/g, "/") : "/";
|
|
189
189
|
}
|
|
190
|
-
var
|
|
191
|
-
e = e.map((e) =>
|
|
190
|
+
var Se = function(...e) {
|
|
191
|
+
e = e.map((e) => T(e));
|
|
192
192
|
let t = "", n = !1;
|
|
193
193
|
for (let r = e.length - 1; r >= -1 && !n; r--) {
|
|
194
|
-
let i = r >= 0 ? e[r] :
|
|
195
|
-
i && i.length !== 0 && (t = `${i}/${t}`, n =
|
|
194
|
+
let i = r >= 0 ? e[r] : xe();
|
|
195
|
+
i && i.length !== 0 && (t = `${i}/${t}`, n = E(i));
|
|
196
196
|
}
|
|
197
|
-
return t =
|
|
197
|
+
return t = Ce(t, !n), n && !E(t) ? `/${t}` : t.length > 0 ? t : ".";
|
|
198
198
|
};
|
|
199
|
-
function
|
|
199
|
+
function Ce(e, t) {
|
|
200
200
|
let n = "", r = 0, i = -1, a = 0, o = null;
|
|
201
201
|
for (let s = 0; s <= e.length; ++s) {
|
|
202
202
|
if (s < e.length) o = e[s];
|
|
@@ -224,27 +224,27 @@ function Se(e, t) {
|
|
|
224
224
|
}
|
|
225
225
|
return n;
|
|
226
226
|
}
|
|
227
|
-
var
|
|
228
|
-
return
|
|
229
|
-
},
|
|
230
|
-
let t =
|
|
231
|
-
return t.length === 1 &&
|
|
232
|
-
},
|
|
227
|
+
var E = function(e) {
|
|
228
|
+
return ye.test(e);
|
|
229
|
+
}, we = function(e) {
|
|
230
|
+
let t = T(e).replace(/\/$/, "").split("/").slice(0, -1);
|
|
231
|
+
return t.length === 1 && be.test(t[0]) && (t[0] += "/"), t.join("/") || (E(e) ? "/" : ".");
|
|
232
|
+
}, Te = new TextDecoder(), D = (() => {
|
|
233
233
|
let e = typeof Buffer == "function" ? Buffer : void 0;
|
|
234
|
-
return e && typeof e.from == "function" ? (t) => e.from(t, "base64").toString("utf-8") : (e) =>
|
|
235
|
-
})(),
|
|
236
|
-
function
|
|
237
|
-
return e.includes("%") && (e = e.replace(
|
|
234
|
+
return e && typeof e.from == "function" ? (t) => e.from(t, "base64").toString("utf-8") : (e) => Te.decode(Uint8Array.from(atob(e), (e) => e.charCodeAt(0)));
|
|
235
|
+
})(), Ee = /%/g, De = /\\/g, Oe = /\n/g, ke = /\r/g, Ae = /\t/g, je = /\?/g, Me = /#/g;
|
|
236
|
+
function Ne(e) {
|
|
237
|
+
return e.includes("%") && (e = e.replace(Ee, "%25")), !t && e.includes("\\") && (e = e.replace(De, "%5C")), e.includes("\n") && (e = e.replace(Oe, "%0A")), e.includes("\r") && (e = e.replace(ke, "%0D")), e.includes(" ") && (e = e.replace(Ae, "%09")), e;
|
|
238
238
|
}
|
|
239
|
-
var
|
|
240
|
-
function
|
|
241
|
-
let n =
|
|
242
|
-
return (r === 47 || t && r === 92) && n.at(-1) !== "/" && (n += "/"), n =
|
|
239
|
+
var O = we, k = Se;
|
|
240
|
+
function A(e) {
|
|
241
|
+
let n = k(e), r = e.charCodeAt(e.length - 1);
|
|
242
|
+
return (r === 47 || t && r === 92) && n.at(-1) !== "/" && (n += "/"), n = Ne(n), n.includes("?") && (n = n.replace(je, "%3F")), n.includes("#") && (n = n.replace(Me, "%23")), new URL(`file://${n}`).href;
|
|
243
243
|
}
|
|
244
|
-
function
|
|
244
|
+
function j(e) {
|
|
245
245
|
return e.replace(/\//g, "\\");
|
|
246
246
|
}
|
|
247
|
-
var
|
|
247
|
+
var M = class {
|
|
248
248
|
map;
|
|
249
249
|
_encoded;
|
|
250
250
|
_decoded;
|
|
@@ -257,23 +257,23 @@ var N = class {
|
|
|
257
257
|
constructor(e, t) {
|
|
258
258
|
this.map = e;
|
|
259
259
|
let { mappings: n, names: r, sources: i } = e;
|
|
260
|
-
this.version = e.version, this.names = r || [], this._encoded = n || "", this._decodedMemo =
|
|
261
|
-
let a =
|
|
262
|
-
this.resolvedSources = (i || []).map((e) =>
|
|
260
|
+
this.version = e.version, this.names = r || [], this._encoded = n || "", this._decodedMemo = Pe(), this.url = t, this.file = t;
|
|
261
|
+
let a = O(t);
|
|
262
|
+
this.resolvedSources = (i || []).map((e) => k(a, e || ""));
|
|
263
263
|
}
|
|
264
264
|
};
|
|
265
|
-
function
|
|
265
|
+
function Pe() {
|
|
266
266
|
return {
|
|
267
267
|
lastKey: -1,
|
|
268
268
|
lastNeedle: -1,
|
|
269
269
|
lastIndex: -1
|
|
270
270
|
};
|
|
271
271
|
}
|
|
272
|
-
function
|
|
273
|
-
let n =
|
|
272
|
+
function Fe(e, t) {
|
|
273
|
+
let n = ge(e, t);
|
|
274
274
|
return n.column == null ? null : n;
|
|
275
275
|
}
|
|
276
|
-
var
|
|
276
|
+
var Ie = RegExp(`//# ${e}=data:application/json;base64,(.+)`), Le = class {
|
|
277
277
|
id;
|
|
278
278
|
url;
|
|
279
279
|
importers = /* @__PURE__ */ new Set();
|
|
@@ -287,7 +287,7 @@ var Fe = RegExp(`//# ${e}=data:application/json;base64,(.+)`), Ie = class {
|
|
|
287
287
|
constructor(e, t) {
|
|
288
288
|
this.id = e, this.url = t, this.file = o(e);
|
|
289
289
|
}
|
|
290
|
-
},
|
|
290
|
+
}, Re = class {
|
|
291
291
|
idToModuleMap = /* @__PURE__ */ new Map();
|
|
292
292
|
fileToModulesMap = /* @__PURE__ */ new Map();
|
|
293
293
|
urlToIdModuleMap = /* @__PURE__ */ new Map();
|
|
@@ -301,11 +301,11 @@ var Fe = RegExp(`//# ${e}=data:application/json;base64,(.+)`), Ie = class {
|
|
|
301
301
|
return this.urlToIdModuleMap.get(n(e));
|
|
302
302
|
}
|
|
303
303
|
ensureModule(e, t) {
|
|
304
|
-
if (e =
|
|
304
|
+
if (e = Be(e), this.idToModuleMap.has(e)) {
|
|
305
305
|
let n = this.idToModuleMap.get(e);
|
|
306
306
|
return this.urlToIdModuleMap.set(t, n), n;
|
|
307
307
|
}
|
|
308
|
-
let n = new
|
|
308
|
+
let n = new Le(e, t);
|
|
309
309
|
this.idToModuleMap.set(e, n), this.urlToIdModuleMap.set(t, n);
|
|
310
310
|
let r = this.fileToModulesMap.get(n.file) || /* @__PURE__ */ new Set();
|
|
311
311
|
return r.add(n), this.fileToModulesMap.set(n.file, r), n;
|
|
@@ -320,26 +320,26 @@ var Fe = RegExp(`//# ${e}=data:application/json;base64,(.+)`), Ie = class {
|
|
|
320
320
|
if (!n.meta || !("code" in n.meta)) return null;
|
|
321
321
|
let r = `//# ${e}=data:application/json;base64,`, i = n.meta.code.lastIndexOf(r);
|
|
322
322
|
if (i === -1) return null;
|
|
323
|
-
let a =
|
|
324
|
-
return a ? (n.map = new
|
|
323
|
+
let a = Ie.exec(n.meta.code.slice(i))?.[1];
|
|
324
|
+
return a ? (n.map = new M(JSON.parse(D(a)), n.file), n.map) : null;
|
|
325
325
|
}
|
|
326
326
|
clear() {
|
|
327
327
|
this.idToModuleMap.clear(), this.fileToModulesMap.clear(), this.urlToIdModuleMap.clear();
|
|
328
328
|
}
|
|
329
|
-
},
|
|
329
|
+
}, ze = /* @__PURE__ */ new Set([
|
|
330
330
|
"node:sea",
|
|
331
331
|
"node:sqlite",
|
|
332
332
|
"node:test",
|
|
333
333
|
"node:test/reporters"
|
|
334
334
|
]);
|
|
335
|
-
function ze(e) {
|
|
336
|
-
return Re.has(e) ? e : i(e).replace(/^\/@fs\//, t ? "" : "/").replace(/^node:/, "").replace(/^\/+/, "/").replace(/^file:\/+/, t ? "" : "/");
|
|
337
|
-
}
|
|
338
335
|
function Be(e) {
|
|
336
|
+
return ze.has(e) ? e : i(e).replace(/^\/@fs\//, t ? "" : "/").replace(/^node:/, "").replace(/^\/+/, "/").replace(/^file:\/+/, t ? "" : "/");
|
|
337
|
+
}
|
|
338
|
+
function Ve(e) {
|
|
339
339
|
let t = new Set(e.filter((e) => typeof e == "string")), n = e.filter((e) => typeof e != "string");
|
|
340
340
|
return (e) => t.has(e) || n.some((t) => t.test(e));
|
|
341
341
|
}
|
|
342
|
-
var
|
|
342
|
+
var He = class {
|
|
343
343
|
hmrClient;
|
|
344
344
|
ownerPath;
|
|
345
345
|
newListeners;
|
|
@@ -419,7 +419,7 @@ var Ve = class {
|
|
|
419
419
|
exports: n
|
|
420
420
|
}), this.hmrClient.hotModulesMap.set(this.ownerPath, r);
|
|
421
421
|
}
|
|
422
|
-
},
|
|
422
|
+
}, Ue = class {
|
|
423
423
|
logger;
|
|
424
424
|
transport;
|
|
425
425
|
importUpdatedModule;
|
|
@@ -494,16 +494,16 @@ var Ve = class {
|
|
|
494
494
|
}
|
|
495
495
|
};
|
|
496
496
|
}
|
|
497
|
-
},
|
|
497
|
+
}, We = (e = 21) => {
|
|
498
498
|
let t = "", n = e | 0;
|
|
499
499
|
for (; n-- > 0;) t += "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[Math.random() * 64 | 0];
|
|
500
500
|
return t;
|
|
501
501
|
};
|
|
502
|
-
function
|
|
502
|
+
function N(e) {
|
|
503
503
|
let t = Error(e.message || "Unknown invoke error");
|
|
504
504
|
return Object.assign(t, e, { runnerError: /* @__PURE__ */ Error("RunnerError") }), t;
|
|
505
505
|
}
|
|
506
|
-
var
|
|
506
|
+
var Ge = (e) => {
|
|
507
507
|
if (e.invoke) return {
|
|
508
508
|
...e,
|
|
509
509
|
async invoke(t, n) {
|
|
@@ -516,7 +516,7 @@ var We = (e) => {
|
|
|
516
516
|
data: n
|
|
517
517
|
}
|
|
518
518
|
});
|
|
519
|
-
if ("error" in r) throw
|
|
519
|
+
if ("error" in r) throw N(r.error);
|
|
520
520
|
return r.result;
|
|
521
521
|
}
|
|
522
522
|
};
|
|
@@ -552,7 +552,7 @@ var We = (e) => {
|
|
|
552
552
|
return e.send(t);
|
|
553
553
|
},
|
|
554
554
|
async invoke(n, r) {
|
|
555
|
-
let i =
|
|
555
|
+
let i = We(), a = {
|
|
556
556
|
type: "custom",
|
|
557
557
|
event: "vite:invoke",
|
|
558
558
|
data: {
|
|
@@ -560,26 +560,26 @@ var We = (e) => {
|
|
|
560
560
|
id: `send:${i}`,
|
|
561
561
|
data: r
|
|
562
562
|
}
|
|
563
|
-
}, o = e.send(a), { promise: s, resolve: c, reject: l } =
|
|
564
|
-
u > 0 && (
|
|
563
|
+
}, o = e.send(a), { promise: s, resolve: c, reject: l } = ee(), u = e.timeout ?? 6e4, d;
|
|
564
|
+
u > 0 && (d = setTimeout(() => {
|
|
565
565
|
t.delete(i), l(/* @__PURE__ */ Error(`transport invoke timed out after ${u}ms (data: ${JSON.stringify(a)})`));
|
|
566
|
-
}, u),
|
|
566
|
+
}, u), d?.unref?.()), t.set(i, {
|
|
567
567
|
resolve: c,
|
|
568
568
|
reject: l,
|
|
569
569
|
name: n,
|
|
570
|
-
timeoutId:
|
|
570
|
+
timeoutId: d
|
|
571
571
|
}), o && o.catch((e) => {
|
|
572
|
-
clearTimeout(
|
|
572
|
+
clearTimeout(d), t.delete(i), l(e);
|
|
573
573
|
});
|
|
574
574
|
try {
|
|
575
575
|
return await s;
|
|
576
576
|
} catch (e) {
|
|
577
|
-
throw
|
|
577
|
+
throw N(e);
|
|
578
578
|
}
|
|
579
579
|
}
|
|
580
580
|
};
|
|
581
|
-
},
|
|
582
|
-
let t =
|
|
581
|
+
}, Ke = (e) => {
|
|
582
|
+
let t = Ge(e), n = !t.connect, r;
|
|
583
583
|
return {
|
|
584
584
|
...e,
|
|
585
585
|
...t.connect ? { async connect(e) {
|
|
@@ -603,7 +603,7 @@ var We = (e) => {
|
|
|
603
603
|
if (t.send) {
|
|
604
604
|
if (!n) {
|
|
605
605
|
if (r) await r;
|
|
606
|
-
else throw new
|
|
606
|
+
else throw new P("send was called before connect");
|
|
607
607
|
}
|
|
608
608
|
await t.send(e);
|
|
609
609
|
}
|
|
@@ -611,17 +611,17 @@ var We = (e) => {
|
|
|
611
611
|
async invoke(e, i) {
|
|
612
612
|
if (!n) {
|
|
613
613
|
if (r) await r;
|
|
614
|
-
else throw new
|
|
614
|
+
else throw new P("invoke was called before connect");
|
|
615
615
|
}
|
|
616
616
|
return t.invoke(e, i);
|
|
617
617
|
}
|
|
618
618
|
};
|
|
619
|
-
},
|
|
619
|
+
}, P = class extends Error {
|
|
620
620
|
constructor(e) {
|
|
621
621
|
super(e), this.name = "SendBeforeConnectError";
|
|
622
622
|
}
|
|
623
623
|
};
|
|
624
|
-
function
|
|
624
|
+
function qe(e, t, n, r) {
|
|
625
625
|
if (!r?.isDynamicImport && r?.importedNames?.length) {
|
|
626
626
|
let i = r.importedNames.filter((t) => !(t in e));
|
|
627
627
|
if (i.length) {
|
|
@@ -636,18 +636,18 @@ const {${i.join(", ")}} = pkg;
|
|
|
636
636
|
}
|
|
637
637
|
}
|
|
638
638
|
}
|
|
639
|
-
var
|
|
640
|
-
`${JSON.stringify(
|
|
641
|
-
var
|
|
639
|
+
var F = "__vite_ssr_exports__", I = "__vite_ssr_import__", L = "__vite_ssr_dynamic_import__", R = "__vite_ssr_exportAll__", z = "__vite_ssr_exportName__", B = "__vite_ssr_import_meta__", V = "vite-module-runner:import-meta-resolve/v1/";
|
|
640
|
+
`${JSON.stringify(V)}${JSON.stringify(V)}`;
|
|
641
|
+
var Je = new Proxy({}, { get(e, t) {
|
|
642
642
|
throw Error(`[module runner] Dynamic access of "import.meta.env" is not supported. Please, use "import.meta.env.${String(t)}" instead.`);
|
|
643
643
|
} });
|
|
644
|
-
function
|
|
645
|
-
let n =
|
|
644
|
+
function Ye(e) {
|
|
645
|
+
let n = A(e), r = e, i = O(e);
|
|
646
646
|
return {
|
|
647
|
-
filename: t ?
|
|
648
|
-
dirname: t ?
|
|
647
|
+
filename: t ? j(r) : r,
|
|
648
|
+
dirname: t ? j(i) : i,
|
|
649
649
|
url: n,
|
|
650
|
-
env:
|
|
650
|
+
env: Je,
|
|
651
651
|
resolve(e, t) {
|
|
652
652
|
throw Error("[module runner] \"import.meta.resolve\" is not supported.");
|
|
653
653
|
},
|
|
@@ -656,20 +656,20 @@ function Je(e) {
|
|
|
656
656
|
}
|
|
657
657
|
};
|
|
658
658
|
}
|
|
659
|
-
var
|
|
659
|
+
var H = class {
|
|
660
660
|
startOffset = u() + 1;
|
|
661
661
|
async runInlinedModule(e, t) {
|
|
662
|
-
await new c(
|
|
662
|
+
await new c(F, B, I, L, R, z, "\"use strict\";\n" + t)(e[F], e[B], e[I], e[L], e[R], e[z]), Object.seal(e[F]);
|
|
663
663
|
}
|
|
664
664
|
runExternalModule(e) {
|
|
665
665
|
return import(e);
|
|
666
666
|
}
|
|
667
667
|
};
|
|
668
|
-
function
|
|
669
|
-
let t = new
|
|
668
|
+
function Xe(e) {
|
|
669
|
+
let t = new Ze();
|
|
670
670
|
return (n) => t.enqueue(() => e(n));
|
|
671
671
|
}
|
|
672
|
-
var
|
|
672
|
+
var Ze = class {
|
|
673
673
|
queue = [];
|
|
674
674
|
pending = !1;
|
|
675
675
|
enqueue(e) {
|
|
@@ -689,8 +689,8 @@ var Xe = class {
|
|
|
689
689
|
}), !0) : !1;
|
|
690
690
|
}
|
|
691
691
|
};
|
|
692
|
-
function
|
|
693
|
-
return
|
|
692
|
+
function Qe(e) {
|
|
693
|
+
return Xe(async (t) => {
|
|
694
694
|
let n = e.hmrClient;
|
|
695
695
|
if (n && !e.isClosed()) switch (t.type) {
|
|
696
696
|
case "connected":
|
|
@@ -706,7 +706,7 @@ function Ze(e) {
|
|
|
706
706
|
await n.notifyListeners(t.event, t.data);
|
|
707
707
|
break;
|
|
708
708
|
case "full-reload": {
|
|
709
|
-
let { triggeredBy: r } = t, a = r ?
|
|
709
|
+
let { triggeredBy: r } = t, a = r ? U(e, $e(e, i(r))) : et(e);
|
|
710
710
|
if (!a.size) break;
|
|
711
711
|
n.logger.debug("program reload"), await n.notifyListeners("vite:beforeFullReload", t), e.evaluatedModules.clear();
|
|
712
712
|
for (let t of a) {
|
|
@@ -735,11 +735,11 @@ function Ze(e) {
|
|
|
735
735
|
}
|
|
736
736
|
});
|
|
737
737
|
}
|
|
738
|
-
function
|
|
738
|
+
function $e(e, t) {
|
|
739
739
|
let n = e.evaluatedModules.getModulesByFile(t);
|
|
740
740
|
return n ? [...n].map((e) => e.id) : [];
|
|
741
741
|
}
|
|
742
|
-
function
|
|
742
|
+
function U(e, t, n = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set()) {
|
|
743
743
|
for (let i of t) {
|
|
744
744
|
if (n.has(i)) continue;
|
|
745
745
|
n.add(i);
|
|
@@ -749,42 +749,42 @@ function W(e, t, n = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set()) {
|
|
|
749
749
|
r.add(t.url);
|
|
750
750
|
continue;
|
|
751
751
|
}
|
|
752
|
-
for (let i of t.importers)
|
|
752
|
+
for (let i of t.importers) U(e, [i], n, r);
|
|
753
753
|
}
|
|
754
754
|
}
|
|
755
755
|
return r;
|
|
756
756
|
}
|
|
757
|
-
function
|
|
757
|
+
function et(e, t = /* @__PURE__ */ new Set()) {
|
|
758
758
|
for (let n of e.evaluatedModules.idToModuleMap.values()) n.importers.size || t.add(n.url);
|
|
759
759
|
return t;
|
|
760
760
|
}
|
|
761
|
-
var
|
|
762
|
-
debug:
|
|
763
|
-
error:
|
|
764
|
-
},
|
|
761
|
+
var W = () => {}, tt = {
|
|
762
|
+
debug: W,
|
|
763
|
+
error: W
|
|
764
|
+
}, nt = {
|
|
765
765
|
debug: (...e) => console.log("[vite]", ...e),
|
|
766
766
|
error: (e) => console.log("[vite]", e)
|
|
767
|
-
},
|
|
767
|
+
}, G = {}, K = {}, q = /* @__PURE__ */ new Set(), J = /* @__PURE__ */ new Set(), Y = /* @__PURE__ */ new Set(), X = (e) => ((...t) => {
|
|
768
768
|
for (let n of e) {
|
|
769
769
|
let e = n(...t);
|
|
770
770
|
if (e) return e;
|
|
771
771
|
}
|
|
772
772
|
return null;
|
|
773
|
-
}),
|
|
774
|
-
function
|
|
775
|
-
|
|
773
|
+
}), rt = X(J), it = X(Y), Z = !1, at = Error.prepareStackTrace;
|
|
774
|
+
function ot(e, t) {
|
|
775
|
+
q.delete(e.evaluatedModules), t.retrieveFile && J.delete(t.retrieveFile), t.retrieveSourceMap && Y.delete(t.retrieveSourceMap), q.size === 0 && (Error.prepareStackTrace = at, Z = !1);
|
|
776
776
|
}
|
|
777
|
-
function
|
|
778
|
-
return
|
|
777
|
+
function st(e, t = {}) {
|
|
778
|
+
return Z ||= (Error.prepareStackTrace = _t, !0), q.add(e.evaluatedModules), t.retrieveFile && J.add(t.retrieveFile), t.retrieveSourceMap && Y.add(t.retrieveSourceMap), () => ot(e, t);
|
|
779
779
|
}
|
|
780
|
-
function
|
|
780
|
+
function Q(e, t) {
|
|
781
781
|
if (!e) return t;
|
|
782
|
-
let n =
|
|
783
|
-
return a && /^\/\w:/.test(o) ? (a += "/", a + i(
|
|
782
|
+
let n = O(i(e)), r = /^\w+:\/\/[^/]*/.exec(n), a = r ? r[0] : "", o = n.slice(a.length);
|
|
783
|
+
return a && /^\/\w:/.test(o) ? (a += "/", a + i(k(o, t))) : a + k(o, t);
|
|
784
784
|
}
|
|
785
|
-
function
|
|
786
|
-
let t =
|
|
787
|
-
for (let e of
|
|
785
|
+
function ct(e) {
|
|
786
|
+
let t = p(e.source);
|
|
787
|
+
for (let e of q) {
|
|
788
788
|
let n = e.getModuleSourceMapById(t);
|
|
789
789
|
if (n) return {
|
|
790
790
|
url: t,
|
|
@@ -794,13 +794,13 @@ function st(e) {
|
|
|
794
794
|
}
|
|
795
795
|
return null;
|
|
796
796
|
}
|
|
797
|
-
function
|
|
798
|
-
if (e in
|
|
799
|
-
let t =
|
|
800
|
-
return typeof t == "string" ? (
|
|
797
|
+
function $(e) {
|
|
798
|
+
if (e in K) return K[e];
|
|
799
|
+
let t = rt(e);
|
|
800
|
+
return typeof t == "string" ? (K[e] = t, t) : null;
|
|
801
801
|
}
|
|
802
802
|
function lt(e) {
|
|
803
|
-
let t =
|
|
803
|
+
let t = $(e);
|
|
804
804
|
if (!t) return null;
|
|
805
805
|
let n = /\/\/[@#]\s*sourceMappingURL=([^\s'"]+)\s*$|\/\*[@#]\s*sourceMappingURL=[^\s*'"]+\s*\*\/\s*$/gm, r, i;
|
|
806
806
|
for (; i = n.exec(t);) r = i;
|
|
@@ -808,43 +808,43 @@ function lt(e) {
|
|
|
808
808
|
}
|
|
809
809
|
var ut = /^data:application\/json[^,]+base64,/;
|
|
810
810
|
function dt(e) {
|
|
811
|
-
let t =
|
|
811
|
+
let t = it(e);
|
|
812
812
|
if (t) return t;
|
|
813
813
|
let n = lt(e);
|
|
814
814
|
if (!n) return null;
|
|
815
815
|
let r;
|
|
816
|
-
return ut.test(n) ? (r =
|
|
816
|
+
return ut.test(n) ? (r = D(n.slice(n.indexOf(",") + 1)), n = e) : (n = Q(e, n), r = $(n)), r ? {
|
|
817
817
|
url: n,
|
|
818
818
|
map: r
|
|
819
819
|
} : null;
|
|
820
820
|
}
|
|
821
821
|
function ft(e) {
|
|
822
822
|
if (!e.source) return e;
|
|
823
|
-
let t =
|
|
824
|
-
if (t ||=
|
|
823
|
+
let t = ct(e);
|
|
824
|
+
if (t ||= G[e.source], !t) {
|
|
825
825
|
let n = dt(e.source);
|
|
826
826
|
if (n && n.map) {
|
|
827
827
|
let r = n.url;
|
|
828
|
-
t =
|
|
828
|
+
t = G[e.source] = {
|
|
829
829
|
url: r,
|
|
830
|
-
map: new
|
|
830
|
+
map: new M(typeof n.map == "string" ? JSON.parse(n.map) : n.map, r)
|
|
831
831
|
};
|
|
832
832
|
let i = t.map?.map.sourcesContent;
|
|
833
833
|
t.map && i && t.map.resolvedSources.forEach((e, t) => {
|
|
834
834
|
let n = i[t];
|
|
835
835
|
if (n && e && r) {
|
|
836
|
-
let t =
|
|
837
|
-
|
|
836
|
+
let t = Q(r, e);
|
|
837
|
+
K[t] = n;
|
|
838
838
|
}
|
|
839
839
|
});
|
|
840
|
-
} else t =
|
|
840
|
+
} else t = G[e.source] = {
|
|
841
841
|
url: null,
|
|
842
842
|
map: null
|
|
843
843
|
};
|
|
844
844
|
}
|
|
845
845
|
if (t.map && t.url) {
|
|
846
|
-
let n =
|
|
847
|
-
if (n && n.source != null) return n.source =
|
|
846
|
+
let n = Fe(t.map, e);
|
|
847
|
+
if (n && n.source != null) return n.source = Q(t.url, n.source), t.vite && (n._vite = !0), n;
|
|
848
848
|
}
|
|
849
849
|
return e;
|
|
850
850
|
}
|
|
@@ -941,7 +941,7 @@ function vt(e) {
|
|
|
941
941
|
let e = process.sourceMapsEnabled ?? !1;
|
|
942
942
|
return process.setSourceMapsEnabled(!0), () => !e && process.setSourceMapsEnabled(!1);
|
|
943
943
|
}
|
|
944
|
-
return
|
|
944
|
+
return st(e, typeof e.options.sourcemapInterceptor == "object" ? e.options.sourcemapInterceptor : void 0);
|
|
945
945
|
}
|
|
946
946
|
var yt = class {
|
|
947
947
|
options;
|
|
@@ -955,11 +955,11 @@ var yt = class {
|
|
|
955
955
|
isBuiltin;
|
|
956
956
|
builtinsPromise;
|
|
957
957
|
closed = !1;
|
|
958
|
-
constructor(e, t = new
|
|
959
|
-
if (this.options = e, this.evaluator = t, this.debug = n, this.evaluatedModules = e.evaluatedModules ?? new
|
|
960
|
-
let t = e.hmr ?? !0, n = t === !0 || t.logger === void 0 ?
|
|
961
|
-
if (this.hmrClient = new
|
|
962
|
-
this.transport.connect(
|
|
958
|
+
constructor(e, t = new H(), n) {
|
|
959
|
+
if (this.options = e, this.evaluator = t, this.debug = n, this.evaluatedModules = e.evaluatedModules ?? new Re(), this.transport = Ke(e.transport), e.hmr !== !1) {
|
|
960
|
+
let t = e.hmr ?? !0, n = t === !0 || t.logger === void 0 ? nt : t.logger === !1 ? tt : t.logger;
|
|
961
|
+
if (this.hmrClient = new Ue(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");
|
|
962
|
+
this.transport.connect(Qe(this));
|
|
963
963
|
} else this.transport.connect?.();
|
|
964
964
|
e.sourcemapInterceptor !== !1 && (this.resetSourceMapSupport = vt(this));
|
|
965
965
|
}
|
|
@@ -979,7 +979,7 @@ var yt = class {
|
|
|
979
979
|
processImport(e, t, n) {
|
|
980
980
|
if (!("externalize" in t)) return e;
|
|
981
981
|
let { url: r, type: i } = t;
|
|
982
|
-
return i !== "module" && i !== "commonjs" ||
|
|
982
|
+
return i !== "module" && i !== "commonjs" || qe(e, r, i, n), e;
|
|
983
983
|
}
|
|
984
984
|
isCircularRequest(e, t, n = /* @__PURE__ */ new Set()) {
|
|
985
985
|
if (n.has(e.id)) return !1;
|
|
@@ -1021,7 +1021,7 @@ var yt = class {
|
|
|
1021
1021
|
try {
|
|
1022
1022
|
this.debug?.("[module runner] fetching builtins from server");
|
|
1023
1023
|
let e = (await this.transport.invoke("getBuiltins", [])).map((e) => typeof e == "object" && e && "type" in e ? e.type === "string" ? e.value : new RegExp(e.source, e.flags) : e);
|
|
1024
|
-
this.isBuiltin =
|
|
1024
|
+
this.isBuiltin = Ve(e), this.debug?.("[module runner] builtins loaded:", e);
|
|
1025
1025
|
} finally {
|
|
1026
1026
|
this.builtinsPromise = void 0;
|
|
1027
1027
|
}
|
|
@@ -1052,7 +1052,7 @@ var yt = class {
|
|
|
1052
1052
|
let r = t.meta, i = r.id, a = [...n, i], s = async (e, n) => {
|
|
1053
1053
|
let o = "file" in r && r.file || i, s = await this.cachedModule(e, o);
|
|
1054
1054
|
return s.importers.add(i), t.imports.add(s.id), this.cachedRequest(e, s, a, n);
|
|
1055
|
-
}, c = async (t) => (t = String(t), t[0] === "." && (t =
|
|
1055
|
+
}, c = async (t) => (t = String(t), t[0] === "." && (t = k(O(e), t)), s(t, { isDynamicImport: !0 }));
|
|
1056
1056
|
if ("externalize" in r) {
|
|
1057
1057
|
let { externalize: e } = r;
|
|
1058
1058
|
this.debug?.("[module runner] externalizing", e);
|
|
@@ -1064,36 +1064,36 @@ var yt = class {
|
|
|
1064
1064
|
let t = a[a.length - 2];
|
|
1065
1065
|
throw Error(`[module runner] Failed to load "${e}"${t ? ` imported from ${t}` : ""}`);
|
|
1066
1066
|
}
|
|
1067
|
-
let
|
|
1068
|
-
Object.defineProperty(
|
|
1067
|
+
let ee = this.options.createImportMeta ?? Ye, d = o(u || i), f = A(d), p = await ee(d), m = Object.create(null);
|
|
1068
|
+
Object.defineProperty(m, Symbol.toStringTag, {
|
|
1069
1069
|
value: "Module",
|
|
1070
1070
|
enumerable: !1,
|
|
1071
1071
|
configurable: !1
|
|
1072
|
-
}), t.exports =
|
|
1073
|
-
let
|
|
1074
|
-
this.hmrClient && Object.defineProperty(
|
|
1072
|
+
}), t.exports = m;
|
|
1073
|
+
let h;
|
|
1074
|
+
this.hmrClient && Object.defineProperty(p, "hot", {
|
|
1075
1075
|
enumerable: !0,
|
|
1076
1076
|
get: () => {
|
|
1077
1077
|
if (!this.hmrClient) throw Error("[module runner] HMR client was closed.");
|
|
1078
|
-
return this.debug?.("[module runner] creating hmr context for", t.url),
|
|
1078
|
+
return this.debug?.("[module runner] creating hmr context for", t.url), h ||= new He(this.hmrClient, t.url), h;
|
|
1079
1079
|
},
|
|
1080
1080
|
set: (e) => {
|
|
1081
|
-
|
|
1081
|
+
h = e;
|
|
1082
1082
|
}
|
|
1083
1083
|
});
|
|
1084
|
-
let
|
|
1085
|
-
[
|
|
1086
|
-
[
|
|
1087
|
-
[
|
|
1088
|
-
[
|
|
1089
|
-
[
|
|
1084
|
+
let g = {
|
|
1085
|
+
[I]: s,
|
|
1086
|
+
[L]: c,
|
|
1087
|
+
[F]: m,
|
|
1088
|
+
[R]: (e) => bt(m, e),
|
|
1089
|
+
[z]: (e, t) => Object.defineProperty(m, e, {
|
|
1090
1090
|
enumerable: !0,
|
|
1091
1091
|
configurable: !0,
|
|
1092
1092
|
get: t
|
|
1093
1093
|
}),
|
|
1094
|
-
[
|
|
1094
|
+
[B]: p
|
|
1095
1095
|
};
|
|
1096
|
-
return this.debug?.("[module runner] executing",
|
|
1096
|
+
return this.debug?.("[module runner] executing", f), await this.evaluator.runInlinedModule(g, l, t), m;
|
|
1097
1097
|
}
|
|
1098
1098
|
};
|
|
1099
1099
|
function bt(e, t) {
|
|
@@ -1108,7 +1108,7 @@ function bt(e, t) {
|
|
|
1108
1108
|
}
|
|
1109
1109
|
}
|
|
1110
1110
|
//#endregion
|
|
1111
|
-
//#region src/adapter/vite/runtime/
|
|
1111
|
+
//#region src/adapter/vite/runtime/createIncaDevTransport.mts
|
|
1112
1112
|
function xt(e) {
|
|
1113
1113
|
return {
|
|
1114
1114
|
connect({ onMessage: t }) {
|
|
@@ -1127,10 +1127,33 @@ function xt(e) {
|
|
|
1127
1127
|
}
|
|
1128
1128
|
};
|
|
1129
1129
|
}
|
|
1130
|
-
|
|
1130
|
+
//#endregion
|
|
1131
|
+
//#region src/adapter/vite/runtime/createIncaEvaluator.mts
|
|
1132
|
+
var St = class extends H {
|
|
1133
|
+
startOffset = 1;
|
|
1134
|
+
async runInlinedModule(e, t, n) {
|
|
1135
|
+
let r = globalThis.__inca_dev__;
|
|
1136
|
+
if (!r?.compile) throw Error("__inca_dev__.compile is not installed");
|
|
1137
|
+
let i = [
|
|
1138
|
+
F,
|
|
1139
|
+
B,
|
|
1140
|
+
I,
|
|
1141
|
+
L,
|
|
1142
|
+
R,
|
|
1143
|
+
z
|
|
1144
|
+
];
|
|
1145
|
+
await r.compile(i, t.replaceAll("\0", "\\u0000"), n.id.replaceAll("\0", "\\u0000"))(...i.map((t) => e[t])), Object.seal(e[F]);
|
|
1146
|
+
}
|
|
1147
|
+
};
|
|
1148
|
+
function Ct() {
|
|
1149
|
+
return new St();
|
|
1150
|
+
}
|
|
1151
|
+
//#endregion
|
|
1152
|
+
//#region src/adapter/vite/runtime/start.mts
|
|
1153
|
+
function wt(e) {
|
|
1131
1154
|
return typeof e == "object" && !!e && "runnerError" in e;
|
|
1132
1155
|
}
|
|
1133
|
-
async function
|
|
1156
|
+
async function Tt(e) {
|
|
1134
1157
|
let t = () => {}, n = new yt({
|
|
1135
1158
|
transport: {
|
|
1136
1159
|
...xt(() => t()),
|
|
@@ -1141,7 +1164,7 @@ async function Ct(e) {
|
|
|
1141
1164
|
error: () => {}
|
|
1142
1165
|
} },
|
|
1143
1166
|
sourcemapInterceptor: !1
|
|
1144
|
-
},
|
|
1167
|
+
}, Ct());
|
|
1145
1168
|
for (;;) {
|
|
1146
1169
|
let r = new Promise((e) => {
|
|
1147
1170
|
t = e;
|
|
@@ -1149,10 +1172,10 @@ async function Ct(e) {
|
|
|
1149
1172
|
try {
|
|
1150
1173
|
return await n.import(e);
|
|
1151
1174
|
} catch (e) {
|
|
1152
|
-
|
|
1175
|
+
wt(e) || Promise.reject(e), globalThis.__inca_dev__?.setLoadFailed?.(!0);
|
|
1153
1176
|
}
|
|
1154
1177
|
await r, n.clearCache(), globalThis.__inca_dev__?.setLoadFailed?.(!1);
|
|
1155
1178
|
}
|
|
1156
1179
|
}
|
|
1157
1180
|
//#endregion
|
|
1158
|
-
export {
|
|
1181
|
+
export { Tt as start };
|
package/dist/package.d.mts
CHANGED
|
@@ -19,6 +19,8 @@ export interface PackageAppOptions {
|
|
|
19
19
|
* per-platform `@incajs/host-*` package — see {@link resolveHostBin}).
|
|
20
20
|
*/
|
|
21
21
|
hostBin?: string;
|
|
22
|
+
/** Writes `bundle.js.map` beside the bundle. Overrides the config's `sourcemap` when set. */
|
|
23
|
+
sourcemap?: boolean;
|
|
22
24
|
/**
|
|
23
25
|
* The platform to package for. Defaults to whichever one the current
|
|
24
26
|
* process is running on.
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@incajs/cli",
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.0.15",
|
|
4
|
+
"description": "Commands to develop, bundle, and package Incarnative.js apps.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"bundler",
|
|
7
7
|
"cli",
|
|
@@ -70,10 +70,10 @@
|
|
|
70
70
|
}
|
|
71
71
|
},
|
|
72
72
|
"optionalDependencies": {
|
|
73
|
-
"@incajs/host-darwin-arm64": "0.0.
|
|
74
|
-
"@incajs/host-darwin-x64": "0.0.
|
|
75
|
-
"@incajs/host-linux-arm64": "0.0.
|
|
76
|
-
"@incajs/host-linux-x64": "0.0.
|
|
73
|
+
"@incajs/host-darwin-arm64": "0.0.15",
|
|
74
|
+
"@incajs/host-darwin-x64": "0.0.15",
|
|
75
|
+
"@incajs/host-linux-arm64": "0.0.15",
|
|
76
|
+
"@incajs/host-linux-x64": "0.0.15"
|
|
77
77
|
},
|
|
78
78
|
"engines": {
|
|
79
79
|
"node": ">=22.18"
|