@incajs/cli 0.0.2 → 0.0.4

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 CHANGED
@@ -43,7 +43,7 @@ export default defineConfig({
43
43
  productName: "Click Counter",
44
44
  // macOS's CFBundleIdentifier or equivalent
45
45
  identifier: "com.example.click-counter",
46
- // the packaged app's icon file
46
+ // the app's icon file
47
47
  icon: "assets/icon.icns",
48
48
  });
49
49
  ```
@@ -51,6 +51,10 @@ export default defineConfig({
51
51
  An `identifier` should be world-unique, so `inca package` prints a note
52
52
  when it falls back to the generated one rather than using it silently.
53
53
 
54
+ On macOS, `inca dev` launches the app under its `productName`, `icon` and
55
+ `identifier`, so the Dock and the menu bar show the same app they will
56
+ once it is packaged.
57
+
54
58
  ## Requirements
55
59
 
56
60
  `inca`'s host binary is pulled in automatically as a platform-specific
@@ -9,6 +9,11 @@ export interface BundlerOptions {
9
9
  entry: string;
10
10
  /** Where the build's output is written. */
11
11
  outDir: string;
12
+ /**
13
+ * Values the built app carries for `inca-host` to read — its name, id
14
+ * and window. Any JSON-serializable object.
15
+ */
16
+ runtimeConfig?: unknown;
12
17
  /** `"development"` keeps a framework's own warnings; `"production"` strips them. */
13
18
  mode: "development" | "production";
14
19
  /** Called after each successful (re)build, with what it wrote. */
@@ -17,7 +22,18 @@ export interface BundlerOptions {
17
22
  onError: (error: {
18
23
  message: string;
19
24
  stack: string | null;
25
+ code?: string | null;
20
26
  }) => void;
27
+ /** Where the bundler's own output goes. Defaults to `process.stdout`. */
28
+ stdout?: NodeJS.WritableStream;
29
+ /** Where the bundler's warnings and errors go. Defaults to `process.stderr`. */
30
+ stderr?: NodeJS.WritableStream;
31
+ /**
32
+ * Drops the bundler's progress output and size report, leaving the
33
+ * per-build summary. Set it when the build has to stay silent: part of
34
+ * that output goes to the process's own stdout, not to `stdout` above.
35
+ */
36
+ quiet?: boolean;
21
37
  }
22
38
  /** Options for {@link Bundler.build}. */
23
39
  export interface BuildOptions {
@@ -25,6 +41,21 @@ export interface BuildOptions {
25
41
  entry: string;
26
42
  /** Where the build's output is written. */
27
43
  outDir: string;
44
+ /**
45
+ * Values the built app carries for `inca-host` to read — its name, id
46
+ * and window. Any JSON-serializable object.
47
+ */
48
+ runtimeConfig?: unknown;
49
+ /** Where the bundler's own output goes. Defaults to `process.stdout`. */
50
+ stdout?: NodeJS.WritableStream;
51
+ /** Where the bundler's warnings and errors go. Defaults to `process.stderr`. */
52
+ stderr?: NodeJS.WritableStream;
53
+ /**
54
+ * Drops the bundler's progress output and size report, leaving the
55
+ * per-build summary. Set it when the build has to stay silent: part of
56
+ * that output goes to the process's own stdout, not to `stdout` above.
57
+ */
58
+ quiet?: boolean;
28
59
  }
29
60
  /** What a build wrote — the result of {@link Bundler.build}, and every {@link BundlerOptions.onBuild} call. */
30
61
  export interface BuildOutput {
@@ -34,6 +65,11 @@ export interface BuildOutput {
34
65
  entryFile: string;
35
66
  /** Every file this build emitted, relative to `outDir` — may include chunks and assets besides the entry itself. */
36
67
  files: readonly string[];
68
+ /** The change that triggered this rebuild. Absent from a one-shot build and a watch's first build. */
69
+ changed?: {
70
+ file: string;
71
+ at: number;
72
+ };
37
73
  }
38
74
  /**
39
75
  * 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, runtimeConfig, stdout, stderr, quiet, }: BuildOptions): Promise<BuildOutput>;
@@ -12,6 +12,14 @@ 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;
21
+ /** Written beside the entry — see the `runtimeConfig` option in `../types.mts`. */
22
+ runtimeConfig?: unknown;
15
23
  }
16
24
  /**
17
25
  * Builds the Vite config shared by `watch` and `build`, compiling `.vue`
@@ -23,4 +31,4 @@ export interface ResolveConfigOptions {
23
31
  * the entry, named by `chunkFileNames`/`assetFileNames` below, rather than
24
32
  * failing the build.
25
33
  */
26
- export declare function resolveViteConfig({ entry, outDir, mode, watch, onOutput, }: ResolveConfigOptions): InlineConfig;
34
+ export declare function resolveViteConfig({ entry, outDir, mode, watch, onOutput, stdout, stderr, quiet, runtimeConfig, }: ResolveConfigOptions): InlineConfig;
@@ -0,0 +1,11 @@
1
+ import { Plugin } from 'vite';
2
+ /** The file a build writes its app's config to, beside the entry. */
3
+ export declare const CONFIG_FILE_NAME = "inca.json";
4
+ /**
5
+ * Writes `config` to `inca.json` beside the entry, for `inca-host` to read
6
+ * when it starts the app.
7
+ *
8
+ * @param config - any JSON-serializable value; no file is written for
9
+ * `undefined` or an object with no keys
10
+ */
11
+ export declare function emitConfig(config: unknown): Plugin;
@@ -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
@@ -1,5 +1,5 @@
1
1
  import { Bundler, BuildOutput } from './adapter/types.mts';
2
- import { ResolvedBuildConfig } from './config/loader.mts';
2
+ import { ResolvedBuildConfig, RuntimeConfig } from './config/loader.mts';
3
3
  export interface BuildAppOptions {
4
4
  /** The app's root directory. Defaults to `process.cwd()`. */
5
5
  cwd?: string;
@@ -12,6 +12,12 @@ export interface BuildAppOptions {
12
12
  bundler?: Bundler;
13
13
  /** An already-resolved config — lets `packageApp` avoid loading it twice. */
14
14
  config?: ResolvedBuildConfig;
15
+ /** What the build carries for `inca-host` to read. Resolved from the app's config when absent. */
16
+ runtimeConfig?: RuntimeConfig;
17
+ /** Where the bundler's own output goes. Defaults to `process.stdout`. */
18
+ stdout?: NodeJS.WritableStream;
19
+ /** Where the bundler's warnings and errors go. Defaults to `process.stderr`. */
20
+ stderr?: NodeJS.WritableStream;
15
21
  }
16
22
  /**
17
23
  * Builds the app once through the same bundler `dev` uses, and returns what
@@ -1,6 +1,6 @@
1
- import e, { existsSync as t, lstatSync as n, readFileSync as r, realpathSync as i, statSync as a } from "node:fs";
2
- import { readFile as o, rm as s } from "node:fs/promises";
3
- import c, { isAbsolute as l, resolve as u } from "node:path";
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: r }) {
240
- let i = L.get(t);
241
- if (i) return i;
242
- let a;
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
- a = e.readFileSync(c.toNamespacedPath(t), "utf8");
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 o = {
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 (a !== void 0) {
258
+ if (o !== void 0) {
259
259
  let e;
260
260
  try {
261
- e = JSON.parse(a);
261
+ e = JSON.parse(o);
262
262
  } catch (e) {
263
- let i = new N(t, (n ? `"${r}" from ` : "") + h(n || r), e.message);
264
- throw i.cause = e, i;
263
+ let r = new N(t, (n ? `"${i}" from ` : "") + h(n || i), e.message);
264
+ throw r.cause = e, r;
265
265
  }
266
- o.exists = !0, I.call(e, "name") && typeof e.name == "string" && (o.name = e.name), I.call(e, "main") && typeof e.main == "string" && (o.main = e.main), I.call(e, "exports") && (o.exports = e.exports), I.call(e, "imports") && (o.imports = e.imports), I.call(e, "type") && (e.type === "commonjs" || e.type === "module") && (o.type = e.type);
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, o), o;
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(e, t, n, r) {
344
- if (y.noDeprecation || Oe(e, { parentURL: n.href }) !== "module") return;
345
- let i = h(e.href), a = h(new m(".", t)), o = h(n);
346
- r ? c.resolve(a, r) !== i && y.emitWarning(`Package ${a} has a "main" field set to "${r}", excluding the full filename and extension to the resolved file at "${i.slice(a.length)}", imported from ${o}.\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 ${a} resolving the main entry point "${i.slice(a.length)}", imported from ${o}.\nDefault "index" lookups for the main are deprecated for ES modules.`, "DeprecationWarning", "DEP0151");
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 a(e);
350
+ return c(e);
351
351
  } catch {}
352
352
  }
353
353
  function U(e) {
354
- let t = a(e, { throwIfNoEntry: !1 });
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(e, t, n) {
382
- if (Ne.exec(e.pathname) !== null) throw new M(e.pathname, String.raw`must not include encoded "/" or "\" characters`, h(t));
383
- let r;
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
- r = h(e);
386
- } catch (n) {
387
- throw Object.defineProperty(n, "input", { value: String(e) }), Object.defineProperty(n, "module", { value: String(t) }), n;
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(r.endsWith("/") ? r.slice(-1) : r);
389
+ let a = H(i.endsWith("/") ? i.slice(-1) : i);
390
390
  if (a && a.isDirectory()) {
391
- let n = new _e(r, h(t));
392
- throw n.url = String(e), n;
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 n = new P(r || e.pathname, t && h(t), !0);
396
- throw n.url = String(e), n;
395
+ let e = new P(i || t.pathname, n && h(n), !0);
396
+ throw e.url = String(t), e;
397
397
  }
398
- if (!n) {
399
- let t = i(r), { search: n, hash: a } = e;
400
- e = g(t + (r.endsWith(c.sep) ? "/" : "")), e.search = n, e.hash = a;
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 e;
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 r = ht(e);
624
- if ("external" in r) return r.external;
625
- let a = r.specifier, o = r.url, s = r.absolutePath, c, l;
626
- if (t?.cache !== !1 && (c = ut(s || a, t), l = t?.cache && typeof t?.cache == "object" ? t.cache : rt), l) {
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 (s) try {
635
- let e = n(s);
636
- if (e.isSymbolicLink() && (s = i(s), o = g(s)), e.isFile()) return l && l.set(c, o.href), o.href;
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 = a || o.href, f = st(t?.from), p = t?.suffixes || [""], m = t?.extensions ? ["", ...t.extensions] : [""], h;
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("/") || a(e).isDirectory() ? g(e + "/") : g(e);
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 l(e) ? {
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, n) {
878
- return t(e) ? jt(r(e, "utf8"), n) : {};
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(u(e.dir, e.name), e);
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 || u(_(), ".config");
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 || "."), i = e.fileName || ".env", o = typeof i == "string" ? [i] : i, s = zt(e.env || {});
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 o) {
905
+ for (let e of i) {
906
906
  let r = C(n, e);
907
- if (!a(r, { throwIfNoEntry: !1 })?.isFile()) continue;
907
+ if (!c(r, { throwIfNoEntry: !1 })?.isFile()) continue;
908
908
  let i = await Lt(r);
909
- for (let e in i) e in t && !s.has(e) || (t[e] = i[e], s.add(e));
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 i = t[e];
916
- i && a(i, { throwIfNoEntry: !1 })?.isFile() && (t[n] = r(i, "utf8").trim(), s.add(n));
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 = r(e, "utf8");
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-BVKUE9C4.js"), r = await t(e.cwd).catch(() => {});
1005
+ let { findWorkspaceDir: t } = await import("./dist-BvTGFq3F.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-BVKUE9C4.js"), a = await i(e.cwd).catch(() => {});
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-BvTGFq3F.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, n, r = {}) {
1083
- if (n.resolve) {
1084
- let t = await n.resolve(e, n);
1085
- if (t) return t;
1086
- }
1087
- let i = n.merger || X, a = Object.keys(r.giget?.providers || {}).map((e) => `${e}:`), c = a.length > 0 ? [.../* @__PURE__ */ new Set([...a, ...Kt])] : Kt;
1088
- if (n.giget !== !1 && c.some((t) => e.startsWith(t))) {
1089
- let { downloadTemplate: i } = await import("./__vite-optional-peer-dep_giget_c12-BYcrHYBM.js").catch((t) => {
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, ""), c, l = C(n.cwd, "node_modules"), u = T(n.cwd);
1092
- c = E(u) === ".c12" ? S(u, o) : t(l) ? S(l, ".c12", o) : process.env.XDG_CACHE_HOME ? C(process.env.XDG_CACHE_HOME, "c12", o) : C(_(), ".cache/c12", o);
1093
- let d = r.install ? X(r.install === !0 ? {} : r.install, { ignoreWorkspace: !0 }) : !1;
1094
- t(c) && !d && await s(c, { recursive: !0 }), e = (await i(e, {
1095
- dir: c,
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: r.auth,
1099
- ...n.giget,
1100
- ...r.giget
1098
+ auth: n.auth,
1099
+ ...t.giget,
1100
+ ...n.giget
1101
1101
  })).dir;
1102
1102
  }
1103
- qt.test(e) && (e = $(e, n) || e);
1104
- let l = se(e), u = Yt(C(n.cwd, e)) ?? (!l || l === E(e)), d = C(n.cwd, u ? e : T(e));
1105
- u && (e = n.configFile);
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: r
1111
+ sourceOptions: n
1112
1112
  };
1113
- if (f.configFile = $(C(d, e), n) || $(C(d, ".config", e.replace(/\.config$/, "")), n) || $(C(d, ".config", e), n) || e, !t(f.configFile)) return f;
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 o(f.configFile, "utf8"));
1116
+ if (p in Ht) f.config = (await Ht[p]())(await l(f.configFile, "utf8"));
1117
1117
  else {
1118
- let e = n.resolveModule || ((e) => e.default || e);
1119
- if (n.import) f.config = e(await n.import(f.configFile));
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 t = g(f.configFile);
1122
- t.search = `_${++Vt}`, f.config = await import(t.href).then(e, async (t) => {
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}\`: ${t?.message}. Hint install \`jiti\` for compatibility.`, { cause: t });
1125
- }), i = r(S(n.cwd || ".", n.configFile || "/"), {
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
- ...n.jitiOptions
1129
+ ...t.jitiOptions
1130
1130
  });
1131
- return n.import = (e) => i.import(e), e(await n.import(f.configFile));
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(n.context)), n.envName) {
1135
+ if (typeof f.config == "function" && (f.config = await f.config(t.context)), t.envName) {
1136
1136
  let e = {
1137
- ...f.config["$" + n.envName],
1138
- ...f.config.$env?.[n.envName]
1137
+ ...f.config["$" + t.envName],
1138
+ ...f.config.$env?.[t.envName]
1139
1139
  };
1140
- Object.keys(e).length > 0 && (f.config = i(e, 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 = i(f.sourceOptions.overrides, f.config)), f.configFile = Bt(f.configFile), f.source = Bt(f.source), f;
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 a(e).isDirectory();
1156
+ return c(e).isDirectory();
1157
1157
  } catch {
1158
1158
  return null;
1159
1159
  }
@@ -1171,14 +1171,16 @@ function Qt(e) {
1171
1171
  let t = e.indexOf("/");
1172
1172
  return e.startsWith("@") && t !== -1 ? e.slice(t + 1) : e;
1173
1173
  }
1174
- function $t(e) {
1175
- return e.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "");
1176
- }
1174
+ var $t = "app";
1177
1175
  function en(e) {
1178
- return e ? Qt(e) : void 0;
1176
+ let t = e.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "");
1177
+ return t === "" ? $t : t;
1179
1178
  }
1180
1179
  function tn(e) {
1181
- return `org.inca.${$t(e)}`;
1180
+ return e ? Qt(e) : void 0;
1181
+ }
1182
+ function nn(e) {
1183
+ return `org.inca.${en(e)}`;
1182
1184
  }
1183
1185
  //#endregion
1184
- export { Xt as a, T as c, x as d, C as f, $t as i, w as l, tn as n, Wt as o, en as r, at as s, Zt as t, S as u };
1186
+ export { Xt as a, T as c, x as d, C as f, en as i, w as l, nn as n, Wt as o, tn as r, at as s, Zt as t, S as u };
@@ -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-EWjAFeZ3.js";
2
+ import { c as t, d as n, f as r, l as i, s as a, u as o } from "./defaults-DNvHueCI.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";