@incajs/cli 0.0.2 → 0.0.3
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 +26 -0
- package/dist/adapter/vite/build.d.mts +1 -1
- package/dist/adapter/vite/config.d.mts +7 -1
- package/dist/adapter/vite/logger.d.mts +7 -0
- package/dist/adapter/vite/unsupported.d.mts +23 -0
- package/dist/adapter/vite/watch.d.mts +1 -1
- package/dist/build.d.mts +4 -0
- package/dist/chunks/{defaults-EWjAFeZ3.js → defaults-D_1rymg4.js} +95 -95
- package/dist/chunks/{dist-BVKUE9C4.js → dist-DZ5asakr.js} +1 -1
- package/dist/cli.js +368 -212
- package/dist/config.js +1 -1
- package/dist/dev-client/hostClient.d.mts +5 -0
- package/dist/dev-lock.d.mts +10 -0
- package/dist/dev.d.mts +4 -1
- package/dist/error.d.mts +11 -0
- package/dist/log.d.mts +28 -0
- package/dist/package.d.mts +3 -1
- package/package.json +4 -4
- package/dist/fault.d.mts +0 -6
package/dist/adapter/types.d.mts
CHANGED
|
@@ -17,7 +17,18 @@ export interface BundlerOptions {
|
|
|
17
17
|
onError: (error: {
|
|
18
18
|
message: string;
|
|
19
19
|
stack: string | null;
|
|
20
|
+
code?: string | null;
|
|
20
21
|
}) => void;
|
|
22
|
+
/** Where the bundler's own output goes. Defaults to `process.stdout`. */
|
|
23
|
+
stdout?: NodeJS.WritableStream;
|
|
24
|
+
/** Where the bundler's warnings and errors go. Defaults to `process.stderr`. */
|
|
25
|
+
stderr?: NodeJS.WritableStream;
|
|
26
|
+
/**
|
|
27
|
+
* Drops the bundler's progress output and size report, leaving the
|
|
28
|
+
* per-build summary. Set it when the build has to stay silent: part of
|
|
29
|
+
* that output goes to the process's own stdout, not to `stdout` above.
|
|
30
|
+
*/
|
|
31
|
+
quiet?: boolean;
|
|
21
32
|
}
|
|
22
33
|
/** Options for {@link Bundler.build}. */
|
|
23
34
|
export interface BuildOptions {
|
|
@@ -25,6 +36,16 @@ export interface BuildOptions {
|
|
|
25
36
|
entry: string;
|
|
26
37
|
/** Where the build's output is written. */
|
|
27
38
|
outDir: string;
|
|
39
|
+
/** Where the bundler's own output goes. Defaults to `process.stdout`. */
|
|
40
|
+
stdout?: NodeJS.WritableStream;
|
|
41
|
+
/** Where the bundler's warnings and errors go. Defaults to `process.stderr`. */
|
|
42
|
+
stderr?: NodeJS.WritableStream;
|
|
43
|
+
/**
|
|
44
|
+
* Drops the bundler's progress output and size report, leaving the
|
|
45
|
+
* per-build summary. Set it when the build has to stay silent: part of
|
|
46
|
+
* that output goes to the process's own stdout, not to `stdout` above.
|
|
47
|
+
*/
|
|
48
|
+
quiet?: boolean;
|
|
28
49
|
}
|
|
29
50
|
/** What a build wrote — the result of {@link Bundler.build}, and every {@link BundlerOptions.onBuild} call. */
|
|
30
51
|
export interface BuildOutput {
|
|
@@ -34,6 +55,11 @@ export interface BuildOutput {
|
|
|
34
55
|
entryFile: string;
|
|
35
56
|
/** Every file this build emitted, relative to `outDir` — may include chunks and assets besides the entry itself. */
|
|
36
57
|
files: readonly string[];
|
|
58
|
+
/** The change that triggered this rebuild. Absent from a one-shot build and a watch's first build. */
|
|
59
|
+
changed?: {
|
|
60
|
+
file: string;
|
|
61
|
+
at: number;
|
|
62
|
+
};
|
|
37
63
|
}
|
|
38
64
|
/**
|
|
39
65
|
* The contract a bundler adapter satisfies. Supporting another bundler
|
|
@@ -5,4 +5,4 @@ export type { 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({ entry, outDir }: BuildOptions): Promise<BuildOutput>;
|
|
8
|
+
export declare function build({ entry, outDir, stdout, stderr, quiet, }: BuildOptions): Promise<BuildOutput>;
|
|
@@ -12,6 +12,12 @@ export interface ResolveConfigOptions {
|
|
|
12
12
|
watch: boolean;
|
|
13
13
|
/** Called with what each successful (re)build wrote. */
|
|
14
14
|
onOutput: (output: CapturedOutput) => void;
|
|
15
|
+
/** Where Vite's own build output goes. */
|
|
16
|
+
stdout: NodeJS.WritableStream;
|
|
17
|
+
/** Where Vite's warnings and errors go. */
|
|
18
|
+
stderr: NodeJS.WritableStream;
|
|
19
|
+
/** Silences the bundler's progress output — see the `quiet` option in `../types.mts`. */
|
|
20
|
+
quiet: boolean;
|
|
15
21
|
}
|
|
16
22
|
/**
|
|
17
23
|
* Builds the Vite config shared by `watch` and `build`, compiling `.vue`
|
|
@@ -23,4 +29,4 @@ export interface ResolveConfigOptions {
|
|
|
23
29
|
* the entry, named by `chunkFileNames`/`assetFileNames` below, rather than
|
|
24
30
|
* failing the build.
|
|
25
31
|
*/
|
|
26
|
-
export declare function resolveViteConfig({ entry, outDir, mode, watch, onOutput, }: ResolveConfigOptions): InlineConfig;
|
|
32
|
+
export declare function resolveViteConfig({ entry, outDir, mode, watch, onOutput, stdout, stderr, quiet, }: ResolveConfigOptions): InlineConfig;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Logger } from 'vite';
|
|
2
|
+
/**
|
|
3
|
+
* A Vite {@link Logger} writing to the given streams: `info` to `stdout`,
|
|
4
|
+
* `warn` and `error` to `stderr`. Messages arrive fully formatted and are
|
|
5
|
+
* written as they are; Vite's own `LogOptions` are ignored.
|
|
6
|
+
*/
|
|
7
|
+
export declare function streamLogger(stdout: NodeJS.WritableStream, stderr: NodeJS.WritableStream): Logger;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Plugin } from 'vite';
|
|
2
|
+
/** Something an app can write that the engine can't run yet. */
|
|
3
|
+
export interface UnsupportedFeature {
|
|
4
|
+
/** The `ERR_INCA_*` identifier this failure is looked up by. */
|
|
5
|
+
code: string;
|
|
6
|
+
/** The feature, named as the app's author would recognise it. */
|
|
7
|
+
name: string;
|
|
8
|
+
/** Whether a module id is a use of the feature. */
|
|
9
|
+
matches: (id: string) => boolean;
|
|
10
|
+
/** What happens instead, and what to reach for — appended to the error. */
|
|
11
|
+
hint: string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Every feature a build refuses. Add an entry when the engine is found to
|
|
15
|
+
* ignore something standard, so an app hits a build error instead of a
|
|
16
|
+
* silent no-op at runtime; drop it again once the engine handles it.
|
|
17
|
+
*/
|
|
18
|
+
export declare const UNSUPPORTED: readonly UnsupportedFeature[];
|
|
19
|
+
/**
|
|
20
|
+
* Fails the build on the first module that uses an unsupported feature,
|
|
21
|
+
* naming the file that used it.
|
|
22
|
+
*/
|
|
23
|
+
export declare function rejectUnsupported(features?: readonly UnsupportedFeature[]): Plugin;
|
|
@@ -5,4 +5,4 @@ export type { Watcher } from '../types.mts';
|
|
|
5
5
|
* change, calling `onBuild` with what each rebuild wrote. Never starts,
|
|
6
6
|
* reloads, or talks to `inca-host` — that's `dev.mts`'s job.
|
|
7
7
|
*/
|
|
8
|
-
export declare function watch({ onBuild, onError, ...buildOptions }: BundlerOptions): Promise<Watcher>;
|
|
8
|
+
export declare function watch({ onBuild, onError, stdout, stderr, quiet, ...buildOptions }: BundlerOptions): Promise<Watcher>;
|
package/dist/build.d.mts
CHANGED
|
@@ -12,6 +12,10 @@ export interface BuildAppOptions {
|
|
|
12
12
|
bundler?: Bundler;
|
|
13
13
|
/** An already-resolved config — lets `packageApp` avoid loading it twice. */
|
|
14
14
|
config?: ResolvedBuildConfig;
|
|
15
|
+
/** Where the bundler's own output goes. Defaults to `process.stdout`. */
|
|
16
|
+
stdout?: NodeJS.WritableStream;
|
|
17
|
+
/** Where the bundler's warnings and errors go. Defaults to `process.stderr`. */
|
|
18
|
+
stderr?: NodeJS.WritableStream;
|
|
15
19
|
}
|
|
16
20
|
/**
|
|
17
21
|
* Builds the app once through the same bundler `dev` uses, and returns what
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import e, {
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
1
|
+
import e, { isAbsolute as t, resolve as n } from "node:path";
|
|
2
|
+
import r, { existsSync as i, lstatSync as a, readFileSync as o, realpathSync as s, statSync as c } from "node:fs";
|
|
3
|
+
import { readFile as l, rm as u } from "node:fs/promises";
|
|
4
4
|
import * as d from "node:util";
|
|
5
5
|
import { format as f, inspect as p } from "node:util";
|
|
6
6
|
import { URL as m, fileURLToPath as h, pathToFileURL as g } from "node:url";
|
|
@@ -236,17 +236,17 @@ A("ERR_INVALID_ARG_VALUE", (e, t, n = "is invalid") => {
|
|
|
236
236
|
return r.length > 128 && (r = `${r.slice(0, 128)}...`), `The ${e.includes(".") ? "property" : "argument"} '${e}' ${n}. Received ${r}`;
|
|
237
237
|
}, TypeError);
|
|
238
238
|
var I = {}.hasOwnProperty, L = /* @__PURE__ */ new Map();
|
|
239
|
-
function R(t, { base: n, specifier:
|
|
240
|
-
let
|
|
241
|
-
if (
|
|
242
|
-
let
|
|
239
|
+
function R(t, { base: n, specifier: i }) {
|
|
240
|
+
let a = L.get(t);
|
|
241
|
+
if (a) return a;
|
|
242
|
+
let o;
|
|
243
243
|
try {
|
|
244
|
-
|
|
244
|
+
o = r.readFileSync(e.toNamespacedPath(t), "utf8");
|
|
245
245
|
} catch (e) {
|
|
246
246
|
let t = e;
|
|
247
247
|
if (t.code !== "ENOENT") throw t;
|
|
248
248
|
}
|
|
249
|
-
let
|
|
249
|
+
let s = {
|
|
250
250
|
exists: !1,
|
|
251
251
|
pjsonPath: t,
|
|
252
252
|
main: void 0,
|
|
@@ -255,17 +255,17 @@ function R(t, { base: n, specifier: r }) {
|
|
|
255
255
|
exports: void 0,
|
|
256
256
|
imports: void 0
|
|
257
257
|
};
|
|
258
|
-
if (
|
|
258
|
+
if (o !== void 0) {
|
|
259
259
|
let e;
|
|
260
260
|
try {
|
|
261
|
-
e = JSON.parse(
|
|
261
|
+
e = JSON.parse(o);
|
|
262
262
|
} catch (e) {
|
|
263
|
-
let
|
|
264
|
-
throw
|
|
263
|
+
let r = new N(t, (n ? `"${i}" from ` : "") + h(n || i), e.message);
|
|
264
|
+
throw r.cause = e, r;
|
|
265
265
|
}
|
|
266
|
-
|
|
266
|
+
s.exists = !0, I.call(e, "name") && typeof e.name == "string" && (s.name = e.name), I.call(e, "main") && typeof e.main == "string" && (s.main = e.main), I.call(e, "exports") && (s.exports = e.exports), I.call(e, "imports") && (s.imports = e.imports), I.call(e, "type") && (e.type === "commonjs" || e.type === "module") && (s.type = e.type);
|
|
267
267
|
}
|
|
268
|
-
return L.set(t,
|
|
268
|
+
return L.set(t, s), s;
|
|
269
269
|
}
|
|
270
270
|
function z(e) {
|
|
271
271
|
let t = new URL("package.json", e);
|
|
@@ -340,18 +340,18 @@ function Ie(e, t, n, r, i, a, o) {
|
|
|
340
340
|
let s = h(r), c = Fe.exec(o ? e : t) !== null;
|
|
341
341
|
y.emitWarning(`Use of deprecated ${c ? "double slash" : "leading or trailing slash matching"} resolving "${e}" for module request "${t}" ${t === n ? "" : `matched to "${n}" `}in the "${i ? "imports" : "exports"}" field module resolution of the package at ${s}${a ? ` imported from ${h(a)}` : ""}.`, "DeprecationWarning", "DEP0166");
|
|
342
342
|
}
|
|
343
|
-
function Le(
|
|
344
|
-
if (y.noDeprecation || Oe(
|
|
345
|
-
let
|
|
346
|
-
|
|
343
|
+
function Le(t, n, r, i) {
|
|
344
|
+
if (y.noDeprecation || Oe(t, { parentURL: r.href }) !== "module") return;
|
|
345
|
+
let a = h(t.href), o = h(new m(".", n)), s = h(r);
|
|
346
|
+
i ? e.resolve(o, i) !== a && y.emitWarning(`Package ${o} has a "main" field set to "${i}", excluding the full filename and extension to the resolved file at "${a.slice(o.length)}", imported from ${s}.\n Automatic extension resolution of the "main" field is deprecated for ES modules.`, "DeprecationWarning", "DEP0151") : y.emitWarning(`No "main" or "exports" field defined in the package.json for ${o} resolving the main entry point "${a.slice(o.length)}", imported from ${s}.\nDefault "index" lookups for the main are deprecated for ES modules.`, "DeprecationWarning", "DEP0151");
|
|
347
347
|
}
|
|
348
348
|
function H(e) {
|
|
349
349
|
try {
|
|
350
|
-
return
|
|
350
|
+
return c(e);
|
|
351
351
|
} catch {}
|
|
352
352
|
}
|
|
353
353
|
function U(e) {
|
|
354
|
-
let t =
|
|
354
|
+
let t = c(e, { throwIfNoEntry: !1 });
|
|
355
355
|
return (t ? t.isFile() : void 0) ?? !1;
|
|
356
356
|
}
|
|
357
357
|
function Re(e, t, n) {
|
|
@@ -378,28 +378,28 @@ function Re(e, t, n) {
|
|
|
378
378
|
if (r) return Le(r, e, n, t.main), r;
|
|
379
379
|
throw new P(h(new m(".", e)), h(n));
|
|
380
380
|
}
|
|
381
|
-
function ze(
|
|
382
|
-
if (Ne.exec(
|
|
383
|
-
let
|
|
381
|
+
function ze(t, n, r) {
|
|
382
|
+
if (Ne.exec(t.pathname) !== null) throw new M(t.pathname, String.raw`must not include encoded "/" or "\" characters`, h(n));
|
|
383
|
+
let i;
|
|
384
384
|
try {
|
|
385
|
-
|
|
386
|
-
} catch (
|
|
387
|
-
throw Object.defineProperty(
|
|
385
|
+
i = h(t);
|
|
386
|
+
} catch (e) {
|
|
387
|
+
throw Object.defineProperty(e, "input", { value: String(t) }), Object.defineProperty(e, "module", { value: String(n) }), e;
|
|
388
388
|
}
|
|
389
|
-
let a = H(
|
|
389
|
+
let a = H(i.endsWith("/") ? i.slice(-1) : i);
|
|
390
390
|
if (a && a.isDirectory()) {
|
|
391
|
-
let
|
|
392
|
-
throw
|
|
391
|
+
let e = new _e(i, h(n));
|
|
392
|
+
throw e.url = String(t), e;
|
|
393
393
|
}
|
|
394
394
|
if (!a || !a.isFile()) {
|
|
395
|
-
let
|
|
396
|
-
throw
|
|
395
|
+
let e = new P(i || t.pathname, n && h(n), !0);
|
|
396
|
+
throw e.url = String(t), e;
|
|
397
397
|
}
|
|
398
|
-
if (!
|
|
399
|
-
let
|
|
400
|
-
|
|
398
|
+
if (!r) {
|
|
399
|
+
let n = s(i), { search: r, hash: a } = t;
|
|
400
|
+
t = g(n + (i.endsWith(e.sep) ? "/" : "")), t.search = r, t.hash = a;
|
|
401
401
|
}
|
|
402
|
-
return
|
|
402
|
+
return t;
|
|
403
403
|
}
|
|
404
404
|
function Be(e, t, n) {
|
|
405
405
|
return new he(e, t && h(new m(".", t)), h(n));
|
|
@@ -620,10 +620,10 @@ function $e(e, t, n, r) {
|
|
|
620
620
|
}
|
|
621
621
|
var et = /* #__PURE__ */ new Set(["node", "import"]), tt = "2:6:import4:node", nt = process.platform === "win32", rt = globalThis.__EXSOLVE_CACHE__ ||= /* @__PURE__ */ new Map();
|
|
622
622
|
function it(e, t) {
|
|
623
|
-
let
|
|
624
|
-
if ("external" in
|
|
625
|
-
let
|
|
626
|
-
if (t?.cache !== !1 && (c = ut(
|
|
623
|
+
let n = ht(e);
|
|
624
|
+
if ("external" in n) return n.external;
|
|
625
|
+
let r = n.specifier, i = n.url, o = n.absolutePath, c, l;
|
|
626
|
+
if (t?.cache !== !1 && (c = ut(o || r, t), l = t?.cache && typeof t?.cache == "object" ? t.cache : rt), l) {
|
|
627
627
|
let e = l.get(c);
|
|
628
628
|
if (typeof e == "string") return e;
|
|
629
629
|
if (e instanceof Error) {
|
|
@@ -631,13 +631,13 @@ function it(e, t) {
|
|
|
631
631
|
throw e;
|
|
632
632
|
}
|
|
633
633
|
}
|
|
634
|
-
if (
|
|
635
|
-
let e =
|
|
636
|
-
if (e.isSymbolicLink() && (
|
|
634
|
+
if (o) try {
|
|
635
|
+
let e = a(o);
|
|
636
|
+
if (e.isSymbolicLink() && (o = s(o), i = g(o)), e.isFile()) return l && l.set(c, i.href), i.href;
|
|
637
637
|
} catch (e) {
|
|
638
638
|
if (e?.code !== "ENOENT") throw l && l.set(c, e), e;
|
|
639
639
|
}
|
|
640
|
-
let u = t?.conditions ? new Set(t.conditions) : et, d =
|
|
640
|
+
let u = t?.conditions ? new Set(t.conditions) : et, d = r || i.href, f = st(t?.from), p = t?.suffixes || [""], m = t?.extensions ? ["", ...t.extensions] : [""], h;
|
|
641
641
|
for (let e of f) {
|
|
642
642
|
for (let t of p) {
|
|
643
643
|
let n = ft(d, t);
|
|
@@ -675,7 +675,7 @@ function ct(e) {
|
|
|
675
675
|
if (typeof e != "string") return [];
|
|
676
676
|
if (/^(?:node|data|http|https|file):/.test(e)) return new URL(e);
|
|
677
677
|
try {
|
|
678
|
-
return e.endsWith("/") ||
|
|
678
|
+
return e.endsWith("/") || c(e).isDirectory() ? g(e + "/") : g(e);
|
|
679
679
|
} catch {
|
|
680
680
|
return [g(e + "/"), g(e)];
|
|
681
681
|
}
|
|
@@ -721,7 +721,7 @@ function ht(e) {
|
|
|
721
721
|
absolutePath: h(t)
|
|
722
722
|
};
|
|
723
723
|
}
|
|
724
|
-
return
|
|
724
|
+
return t(e) ? {
|
|
725
725
|
url: g(e),
|
|
726
726
|
absolutePath: e
|
|
727
727
|
} : /^(?:node|data|http|https):/.test(e) ? { external: e } : D.includes(e) && !e.includes(":") ? { external: `node:${e}` } : { specifier: e };
|
|
@@ -874,14 +874,14 @@ function jt(e, t = {}) {
|
|
|
874
874
|
}
|
|
875
875
|
return t.flat ? n : yt(n, { overwrite: !0 });
|
|
876
876
|
}
|
|
877
|
-
function Mt(e,
|
|
878
|
-
return
|
|
877
|
+
function Mt(e, t) {
|
|
878
|
+
return i(e) ? jt(o(e, "utf8"), t) : {};
|
|
879
879
|
}
|
|
880
880
|
function Z(e) {
|
|
881
|
-
return e = At(e), Mt(
|
|
881
|
+
return e = At(e), Mt(n(e.dir, e.name), e);
|
|
882
882
|
}
|
|
883
883
|
function Nt() {
|
|
884
|
-
return process.env.XDG_CONFIG_HOME ||
|
|
884
|
+
return process.env.XDG_CONFIG_HOME || n(_(), ".config");
|
|
885
885
|
}
|
|
886
886
|
function Pt(e) {
|
|
887
887
|
return e = At(e), e.dir = Nt(), Z(e);
|
|
@@ -900,20 +900,20 @@ async function Ft(e) {
|
|
|
900
900
|
return n;
|
|
901
901
|
}
|
|
902
902
|
async function It(e) {
|
|
903
|
-
let t = Object.create(null), n = C(e.cwd || "."),
|
|
903
|
+
let t = Object.create(null), n = C(e.cwd || "."), r = e.fileName || ".env", i = typeof r == "string" ? [r] : r, a = zt(e.env || {});
|
|
904
904
|
Object.assign(t, e.env);
|
|
905
|
-
for (let e of
|
|
905
|
+
for (let e of i) {
|
|
906
906
|
let r = C(n, e);
|
|
907
|
-
if (!
|
|
907
|
+
if (!c(r, { throwIfNoEntry: !1 })?.isFile()) continue;
|
|
908
908
|
let i = await Lt(r);
|
|
909
|
-
for (let e in i) e in t && !
|
|
909
|
+
for (let e in i) e in t && !a.has(e) || (t[e] = i[e], a.add(e));
|
|
910
910
|
}
|
|
911
911
|
if (e.expandFileReferences) {
|
|
912
912
|
for (let e in t) if (e.endsWith("_FILE")) {
|
|
913
913
|
let n = e.slice(0, -5);
|
|
914
914
|
if (t[n] === void 0) {
|
|
915
|
-
let
|
|
916
|
-
|
|
915
|
+
let r = t[e];
|
|
916
|
+
r && c(r, { throwIfNoEntry: !1 })?.isFile() && (t[n] = o(r, "utf8").trim(), a.add(n));
|
|
917
917
|
}
|
|
918
918
|
}
|
|
919
919
|
}
|
|
@@ -921,7 +921,7 @@ async function It(e) {
|
|
|
921
921
|
}
|
|
922
922
|
var Q = d.parseEnv;
|
|
923
923
|
async function Lt(e) {
|
|
924
|
-
let t =
|
|
924
|
+
let t = o(e, "utf8");
|
|
925
925
|
if (!Q) try {
|
|
926
926
|
let e = await import("./__vite-optional-peer-dep_dotenv_c12-CxKvRg9-.js");
|
|
927
927
|
Q = (t) => e.parse(t);
|
|
@@ -1002,7 +1002,7 @@ async function Wt(e) {
|
|
|
1002
1002
|
name: e.rcFile,
|
|
1003
1003
|
dir: e.cwd
|
|
1004
1004
|
})), e.globalRc) {
|
|
1005
|
-
let { findWorkspaceDir: t } = await import("./dist-
|
|
1005
|
+
let { findWorkspaceDir: t } = await import("./dist-DZ5asakr.js"), r = await t(e.cwd).catch(() => {});
|
|
1006
1006
|
r && n.push(Z({
|
|
1007
1007
|
name: e.rcFile,
|
|
1008
1008
|
dir: r
|
|
@@ -1014,7 +1014,7 @@ async function Wt(e) {
|
|
|
1014
1014
|
r.rc = t({}, ...n);
|
|
1015
1015
|
}
|
|
1016
1016
|
if (e.packageJson) {
|
|
1017
|
-
let n = (Array.isArray(e.packageJson) ? e.packageJson : [typeof e.packageJson == "string" ? e.packageJson : e.name]).filter((e) => e && typeof e == "string"), { readPackageJSON: i } = await import("./dist-
|
|
1017
|
+
let n = (Array.isArray(e.packageJson) ? e.packageJson : [typeof e.packageJson == "string" ? e.packageJson : e.name]).filter((e) => e && typeof e == "string"), { readPackageJSON: i } = await import("./dist-DZ5asakr.js"), a = await i(e.cwd).catch(() => {});
|
|
1018
1018
|
r.packageJson = t({}, ...n.map((e) => a?.[e]));
|
|
1019
1019
|
}
|
|
1020
1020
|
let a = {};
|
|
@@ -1079,67 +1079,67 @@ var Kt = [
|
|
|
1079
1079
|
"https://",
|
|
1080
1080
|
"http://"
|
|
1081
1081
|
], qt = /^(@[\da-z~-][\d._a-z~-]*\/)?[\da-z~-][\d._a-z~-]*($|\/.*)/;
|
|
1082
|
-
async function Jt(e,
|
|
1083
|
-
if (
|
|
1084
|
-
let
|
|
1085
|
-
if (
|
|
1086
|
-
}
|
|
1087
|
-
let
|
|
1088
|
-
if (
|
|
1089
|
-
let { downloadTemplate:
|
|
1082
|
+
async function Jt(e, t, n = {}) {
|
|
1083
|
+
if (t.resolve) {
|
|
1084
|
+
let n = await t.resolve(e, t);
|
|
1085
|
+
if (n) return n;
|
|
1086
|
+
}
|
|
1087
|
+
let r = t.merger || X, a = Object.keys(n.giget?.providers || {}).map((e) => `${e}:`), o = a.length > 0 ? [.../* @__PURE__ */ new Set([...a, ...Kt])] : Kt;
|
|
1088
|
+
if (t.giget !== !1 && o.some((t) => e.startsWith(t))) {
|
|
1089
|
+
let { downloadTemplate: r } = await import("./__vite-optional-peer-dep_giget_c12-BYcrHYBM.js").catch((t) => {
|
|
1090
1090
|
throw Error(`Extending config from \`${e}\` requires \`giget\` peer dependency to be installed.\n\nInstall it with: \`npx nypm i giget\``, { cause: t });
|
|
1091
|
-
}), { digest: a } = await import("./ohash-CHaRSTtv.js").then((e) => e.dist_exports), o = e.replace(/\W+/g, "_").split("_").splice(0, 3).join("_") + "_" + a(e).slice(0, 10).replace(/[-_]/g, ""),
|
|
1092
|
-
|
|
1093
|
-
let d =
|
|
1094
|
-
|
|
1095
|
-
dir:
|
|
1091
|
+
}), { digest: a } = await import("./ohash-CHaRSTtv.js").then((e) => e.dist_exports), o = e.replace(/\W+/g, "_").split("_").splice(0, 3).join("_") + "_" + a(e).slice(0, 10).replace(/[-_]/g, ""), s, c = C(t.cwd, "node_modules"), l = T(t.cwd);
|
|
1092
|
+
s = E(l) === ".c12" ? S(l, o) : i(c) ? S(c, ".c12", o) : process.env.XDG_CACHE_HOME ? C(process.env.XDG_CACHE_HOME, "c12", o) : C(_(), ".cache/c12", o);
|
|
1093
|
+
let d = n.install ? X(n.install === !0 ? {} : n.install, { ignoreWorkspace: !0 }) : !1;
|
|
1094
|
+
i(s) && !d && await u(s, { recursive: !0 }), e = (await r(e, {
|
|
1095
|
+
dir: s,
|
|
1096
1096
|
install: d,
|
|
1097
1097
|
force: !!d,
|
|
1098
|
-
auth:
|
|
1099
|
-
...
|
|
1100
|
-
...
|
|
1098
|
+
auth: n.auth,
|
|
1099
|
+
...t.giget,
|
|
1100
|
+
...n.giget
|
|
1101
1101
|
})).dir;
|
|
1102
1102
|
}
|
|
1103
|
-
qt.test(e) && (e = $(e,
|
|
1104
|
-
let
|
|
1105
|
-
|
|
1103
|
+
qt.test(e) && (e = $(e, t) || e);
|
|
1104
|
+
let s = se(e), c = Yt(C(t.cwd, e)) ?? (!s || s === E(e)), d = C(t.cwd, c ? e : T(e));
|
|
1105
|
+
c && (e = t.configFile);
|
|
1106
1106
|
let f = {
|
|
1107
1107
|
config: void 0,
|
|
1108
1108
|
configFile: void 0,
|
|
1109
1109
|
cwd: d,
|
|
1110
1110
|
source: e,
|
|
1111
|
-
sourceOptions:
|
|
1111
|
+
sourceOptions: n
|
|
1112
1112
|
};
|
|
1113
|
-
if (f.configFile = $(C(d, e),
|
|
1113
|
+
if (f.configFile = $(C(d, e), t) || $(C(d, ".config", e.replace(/\.config$/, "")), t) || $(C(d, ".config", e), t) || e, !i(f.configFile)) return f;
|
|
1114
1114
|
f._configFile = f.configFile;
|
|
1115
1115
|
let p = se(f.configFile) || "";
|
|
1116
|
-
if (p in Ht) f.config = (await Ht[p]())(await
|
|
1116
|
+
if (p in Ht) f.config = (await Ht[p]())(await l(f.configFile, "utf8"));
|
|
1117
1117
|
else {
|
|
1118
|
-
let e =
|
|
1119
|
-
if (
|
|
1118
|
+
let e = t.resolveModule || ((e) => e.default || e);
|
|
1119
|
+
if (t.import) f.config = e(await t.import(f.configFile));
|
|
1120
1120
|
else {
|
|
1121
|
-
let
|
|
1122
|
-
|
|
1121
|
+
let n = g(f.configFile);
|
|
1122
|
+
n.search = `_${++Vt}`, f.config = await import(n.href).then(e, async (n) => {
|
|
1123
1123
|
let { createJiti: r } = await import("./__vite-optional-peer-dep_jiti_c12-DZVJNj6v.js").catch(() => {
|
|
1124
|
-
throw Error(`Failed to load config file \`${f.configFile}\`: ${
|
|
1125
|
-
}), i = r(S(
|
|
1124
|
+
throw Error(`Failed to load config file \`${f.configFile}\`: ${n?.message}. Hint install \`jiti\` for compatibility.`, { cause: n });
|
|
1125
|
+
}), i = r(S(t.cwd || ".", t.configFile || "/"), {
|
|
1126
1126
|
interopDefault: !0,
|
|
1127
1127
|
moduleCache: !1,
|
|
1128
1128
|
extensions: [...Ut],
|
|
1129
|
-
...
|
|
1129
|
+
...t.jitiOptions
|
|
1130
1130
|
});
|
|
1131
|
-
return
|
|
1131
|
+
return t.import = (e) => i.import(e), e(await t.import(f.configFile));
|
|
1132
1132
|
});
|
|
1133
1133
|
}
|
|
1134
1134
|
}
|
|
1135
|
-
if (typeof f.config == "function" && (f.config = await f.config(
|
|
1135
|
+
if (typeof f.config == "function" && (f.config = await f.config(t.context)), t.envName) {
|
|
1136
1136
|
let e = {
|
|
1137
|
-
...f.config["$" +
|
|
1138
|
-
...f.config.$env?.[
|
|
1137
|
+
...f.config["$" + t.envName],
|
|
1138
|
+
...f.config.$env?.[t.envName]
|
|
1139
1139
|
};
|
|
1140
|
-
Object.keys(e).length > 0 && (f.config =
|
|
1140
|
+
Object.keys(e).length > 0 && (f.config = r(e, f.config));
|
|
1141
1141
|
}
|
|
1142
|
-
return f.meta = X(f.sourceOptions.meta, f.config.$meta), delete f.config.$meta, f.sourceOptions.overrides && (f.config =
|
|
1142
|
+
return f.meta = X(f.sourceOptions.meta, f.config.$meta), delete f.config.$meta, f.sourceOptions.overrides && (f.config = r(f.sourceOptions.overrides, f.config)), f.configFile = Bt(f.configFile), f.source = Bt(f.source), f;
|
|
1143
1143
|
}
|
|
1144
1144
|
function $(e, t) {
|
|
1145
1145
|
let n = at(e, {
|
|
@@ -1153,7 +1153,7 @@ function $(e, t) {
|
|
|
1153
1153
|
}
|
|
1154
1154
|
function Yt(e) {
|
|
1155
1155
|
try {
|
|
1156
|
-
return
|
|
1156
|
+
return c(e).isDirectory();
|
|
1157
1157
|
} catch {
|
|
1158
1158
|
return null;
|
|
1159
1159
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as e } from "./jsonc-BdzClvC8.js";
|
|
2
|
-
import { c as t, d as n, f as r, l as i, s as a, u as o } from "./defaults-
|
|
2
|
+
import { c as t, d as n, f as r, l as i, s as a, u as o } from "./defaults-D_1rymg4.js";
|
|
3
3
|
import { n as s, t as c } from "./_format-BKs7bsc4.js";
|
|
4
4
|
import { promises as l, statSync as u } from "node:fs";
|
|
5
5
|
import "node:fs/promises";
|