@incajs/cli 0.0.12 → 0.0.14

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.
@@ -1,5 +1,5 @@
1
- import e, { isAbsolute as t } from "node:path";
2
- import n, { lstatSync as r, realpathSync as i, statSync as a } from "node:fs";
1
+ import e, { lstatSync as t, realpathSync as n, statSync as r } from "node:fs";
2
+ import i, { isAbsolute as a } from "node:path";
3
3
  import { format as o, inspect as s } from "node:util";
4
4
  import { URL as c, fileURLToPath as l, pathToFileURL as u } from "node:url";
5
5
  import d from "node:assert";
@@ -233,12 +233,12 @@ T("ERR_INVALID_ARG_VALUE", (e, t, n = "is invalid") => {
233
233
  return r.length > 128 && (r = `${r.slice(0, 128)}...`), `The ${e.includes(".") ? "property" : "argument"} '${e}' ${n}. Received ${r}`;
234
234
  }, TypeError);
235
235
  var j = {}.hasOwnProperty, M = /* @__PURE__ */ new Map();
236
- function N(t, { base: r, specifier: i }) {
236
+ function N(t, { base: n, specifier: r }) {
237
237
  let a = M.get(t);
238
238
  if (a) return a;
239
239
  let o;
240
240
  try {
241
- o = n.readFileSync(e.toNamespacedPath(t), "utf8");
241
+ o = e.readFileSync(i.toNamespacedPath(t), "utf8");
242
242
  } catch (e) {
243
243
  let t = e;
244
244
  if (t.code !== "ENOENT") throw t;
@@ -257,8 +257,8 @@ function N(t, { base: r, specifier: i }) {
257
257
  try {
258
258
  e = JSON.parse(o);
259
259
  } catch (e) {
260
- let n = new O(t, (r ? `"${i}" from ` : "") + l(r || i), e.message);
261
- throw n.cause = e, n;
260
+ let i = new O(t, (n ? `"${r}" from ` : "") + l(n || r), e.message);
261
+ throw i.cause = e, i;
262
262
  }
263
263
  s.exists = !0, j.call(e, "name") && typeof e.name == "string" && (s.name = e.name), j.call(e, "main") && typeof e.main == "string" && (s.main = e.main), j.call(e, "exports") && (s.exports = e.exports), j.call(e, "imports") && (s.imports = e.imports), j.call(e, "type") && (e.type === "commonjs" || e.type === "module") && (s.type = e.type);
264
264
  }
@@ -337,18 +337,18 @@ function U(e, t, n, r, i, a, o) {
337
337
  let s = l(r), c = De.exec(o ? e : t) !== null;
338
338
  f.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 ${l(a)}` : ""}.`, "DeprecationWarning", "DEP0166");
339
339
  }
340
- function W(t, n, r, i) {
341
- if (f.noDeprecation || we(t, { parentURL: r.href }) !== "module") return;
342
- let a = l(t.href), o = l(new c(".", n)), s = l(r);
343
- i ? e.resolve(o, i) !== a && f.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") : f.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");
340
+ function W(e, t, n, r) {
341
+ if (f.noDeprecation || we(e, { parentURL: n.href }) !== "module") return;
342
+ let a = l(e.href), o = l(new c(".", t)), s = l(n);
343
+ r ? i.resolve(o, r) !== a && f.emitWarning(`Package ${o} has a "main" field set to "${r}", 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") : f.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");
344
344
  }
345
345
  function G(e) {
346
346
  try {
347
- return a(e);
347
+ return r(e);
348
348
  } catch {}
349
349
  }
350
350
  function K(e) {
351
- let t = a(e, { throwIfNoEntry: !1 });
351
+ let t = r(e, { throwIfNoEntry: !1 });
352
352
  return (t ? t.isFile() : void 0) ?? !1;
353
353
  }
354
354
  function Oe(e, t, n) {
@@ -375,28 +375,28 @@ function Oe(e, t, n) {
375
375
  if (r) return W(r, e, n, t.main), r;
376
376
  throw new k(l(new c(".", e)), l(n));
377
377
  }
378
- function ke(t, n, r) {
379
- if (Ee.exec(t.pathname) !== null) throw new D(t.pathname, String.raw`must not include encoded "/" or "\" characters`, l(n));
378
+ function ke(e, t, r) {
379
+ if (Ee.exec(e.pathname) !== null) throw new D(e.pathname, String.raw`must not include encoded "/" or "\" characters`, l(t));
380
380
  let a;
381
381
  try {
382
- a = l(t);
383
- } catch (e) {
384
- throw Object.defineProperty(e, "input", { value: String(t) }), Object.defineProperty(e, "module", { value: String(n) }), e;
382
+ a = l(e);
383
+ } catch (n) {
384
+ throw Object.defineProperty(n, "input", { value: String(e) }), Object.defineProperty(n, "module", { value: String(t) }), n;
385
385
  }
386
386
  let o = G(a.endsWith("/") ? a.slice(-1) : a);
387
387
  if (o && o.isDirectory()) {
388
- let e = new he(a, l(n));
389
- throw e.url = String(t), e;
388
+ let n = new he(a, l(t));
389
+ throw n.url = String(e), n;
390
390
  }
391
391
  if (!o || !o.isFile()) {
392
- let e = new k(a || t.pathname, n && l(n), !0);
393
- throw e.url = String(t), e;
392
+ let n = new k(a || e.pathname, t && l(t), !0);
393
+ throw n.url = String(e), n;
394
394
  }
395
395
  if (!r) {
396
- let n = i(a), { search: r, hash: o } = t;
397
- t = u(n + (a.endsWith(e.sep) ? "/" : "")), t.search = r, t.hash = o;
396
+ let t = n(a), { search: r, hash: o } = e;
397
+ e = u(t + (a.endsWith(i.sep) ? "/" : "")), e.search = r, e.hash = o;
398
398
  }
399
- return t;
399
+ return e;
400
400
  }
401
401
  function Ae(e, t, n) {
402
402
  return new pe(e, t && l(new c(".", t)), l(n));
@@ -459,11 +459,8 @@ function Y(e, t, n, r, i, a, o, s, c) {
459
459
  throw e;
460
460
  }
461
461
  if (f !== void 0) {
462
- if (f === null) {
463
- u = null;
464
- continue;
465
- }
466
- return f;
462
+ if (f === null) u = null;
463
+ else return f;
467
464
  }
468
465
  }
469
466
  if (u == null) return u;
@@ -483,10 +480,10 @@ function Y(e, t, n, r, i, a, o, s, c) {
483
480
  return d;
484
481
  }
485
482
  }
486
- return;
483
+ } else {
484
+ if (t === null) return null;
485
+ throw J(r, t, e, o, i);
487
486
  }
488
- if (t === null) return null;
489
- throw J(r, t, e, o, i);
490
487
  }
491
488
  function Pe(e, t, n) {
492
489
  if (typeof e == "string" || Array.isArray(e)) return !0;
@@ -616,25 +613,25 @@ function Be(e, t, n, r) {
616
613
  return d.ok(o !== void 0, "expected to be defined"), o.protocol === "file:" ? ke(o, t, r) : o;
617
614
  }
618
615
  var Ve = /* #__PURE__ */ new Set(["node", "import"]), He = "2:6:import4:node", Ue = process.platform === "win32", We = globalThis.__EXSOLVE_CACHE__ ||= /* @__PURE__ */ new Map();
619
- function Ge(e, t) {
620
- let n = nt(e);
621
- if ("external" in n) return n.external;
622
- let a = n.specifier, o = n.url, s = n.absolutePath, c, l;
623
- if (t?.cache !== !1 && (c = Ze(s || a, t), l = t?.cache && typeof t?.cache == "object" ? t.cache : We), l) {
616
+ function Ge(e, r) {
617
+ let i = nt(e);
618
+ if ("external" in i) return i.external;
619
+ let a = i.specifier, o = i.url, s = i.absolutePath, c, l;
620
+ if (r?.cache !== !1 && (c = Ze(s || a, r), l = r?.cache && typeof r?.cache == "object" ? r.cache : We), l) {
624
621
  let e = l.get(c);
625
622
  if (typeof e == "string") return e;
626
623
  if (e instanceof Error) {
627
- if (t?.try) return;
624
+ if (r?.try) return;
628
625
  throw e;
629
626
  }
630
627
  }
631
628
  if (s) try {
632
- let e = r(s);
633
- if (e.isSymbolicLink() && (s = i(s), o = u(s)), e.isFile()) return l && l.set(c, o.href), o.href;
629
+ let e = t(s);
630
+ if (e.isSymbolicLink() && (s = n(s), o = u(s)), e.isFile()) return l && l.set(c, o.href), o.href;
634
631
  } catch (e) {
635
632
  if (e?.code !== "ENOENT") throw l && l.set(c, e), e;
636
633
  }
637
- let d = t?.conditions ? new Set(t.conditions) : Ve, f = a || o.href, p = Je(t?.from), m = t?.suffixes || [""], h = t?.extensions ? ["", ...t.extensions] : [""], g;
634
+ let d = r?.conditions ? new Set(r.conditions) : Ve, f = a || o.href, p = Je(r?.from), m = r?.suffixes || [""], h = r?.extensions ? ["", ...r.extensions] : [""], g;
638
635
  for (let e of p) {
639
636
  for (let t of m) {
640
637
  let n = $e(f, t);
@@ -645,9 +642,9 @@ function Ge(e, t) {
645
642
  if (g) break;
646
643
  }
647
644
  if (!g) {
648
- let n = /* @__PURE__ */ Error(`Cannot resolve module "${e}" (from: ${p.map((e) => Xe(e)).join(", ")})`);
649
- if (n.code = "ERR_MODULE_NOT_FOUND", l && l.set(c, n), t?.try) return;
650
- throw n;
645
+ let t = /* @__PURE__ */ Error(`Cannot resolve module "${e}" (from: ${p.map((e) => Xe(e)).join(", ")})`);
646
+ if (t.code = "ERR_MODULE_NOT_FOUND", l && l.set(c, t), r?.try) return;
647
+ throw t;
651
648
  }
652
649
  return l && l.set(c, g.href), g.href;
653
650
  }
@@ -672,7 +669,7 @@ function Ye(e) {
672
669
  if (typeof e != "string") return [];
673
670
  if (/^(?:node|data|http|https|file):/.test(e)) return new URL(e);
674
671
  try {
675
- return e.endsWith("/") || a(e).isDirectory() ? u(e + "/") : u(e);
672
+ return e.endsWith("/") || r(e).isDirectory() ? u(e + "/") : u(e);
676
673
  } catch {
677
674
  return [u(e + "/"), u(e)];
678
675
  }
@@ -718,7 +715,7 @@ function nt(e) {
718
715
  absolutePath: l(t)
719
716
  };
720
717
  }
721
- return t(e) ? {
718
+ return a(e) ? {
722
719
  url: u(e),
723
720
  absolutePath: e
724
721
  } : /^(?:node|data|http|https):/.test(e) ? { external: e } : x.includes(e) && !e.includes(":") ? { external: `node:${e}` } : { specifier: e };
@@ -1,4 +1,4 @@
1
- import { a as e, c as t, o as n, r, s as i, t as a } from "./dist-Bc5Uk6dY.js";
1
+ import { a as e, c as t, o as n, r, s as i, t as a } from "./dist-C64iuQVW.js";
2
2
  import { n as o, t as s } from "./_format-BKs7bsc4.js";
3
3
  import { t as c } from "./jsonc-BDHXk_1o.js";
4
4
  import { promises as l, statSync as u } from "node:fs";
@@ -98,11 +98,8 @@ var r = Object.create, i = Object.defineProperty, a = Object.getOwnPropertyDescr
98
98
  return;
99
99
  case void 0: return x(), C("eof");
100
100
  }
101
- if (n.isSpaceSeparator(v)) {
102
- x();
103
- return;
104
- }
105
- return S[i]();
101
+ if (n.isSpaceSeparator(v)) x();
102
+ else return S[i]();
106
103
  },
107
104
  comment() {
108
105
  switch (v) {
@@ -208,11 +205,8 @@ var r = Object.create, i = Object.defineProperty, a = Object.getOwnPropertyDescr
208
205
  x(), m = "identifierNameEscape";
209
206
  return;
210
207
  }
211
- if (n.isIdContinueChar(v)) {
212
- h += x();
213
- return;
214
- }
215
- return C("identifier", h);
208
+ if (n.isIdContinueChar(v)) h += x();
209
+ else return C("identifier", h);
216
210
  },
217
211
  identifierNameEscape() {
218
212
  if (v !== "u") throw j(x());
@@ -277,18 +271,12 @@ var r = Object.create, i = Object.defineProperty, a = Object.getOwnPropertyDescr
277
271
  h += x(), m = "decimalExponent";
278
272
  return;
279
273
  }
280
- if (n.isDigit(v)) {
281
- h += x();
282
- return;
283
- }
284
- return C("numeric", _ * Number(h));
274
+ if (n.isDigit(v)) h += x();
275
+ else return C("numeric", _ * Number(h));
285
276
  },
286
277
  decimalPointLeading() {
287
- if (n.isDigit(v)) {
288
- h += x(), m = "decimalFraction";
289
- return;
290
- }
291
- throw j(x());
278
+ if (n.isDigit(v)) h += x(), m = "decimalFraction";
279
+ else throw j(x());
292
280
  },
293
281
  decimalPoint() {
294
282
  switch (v) {
@@ -297,11 +285,8 @@ var r = Object.create, i = Object.defineProperty, a = Object.getOwnPropertyDescr
297
285
  h += x(), m = "decimalExponent";
298
286
  return;
299
287
  }
300
- if (n.isDigit(v)) {
301
- h += x(), m = "decimalFraction";
302
- return;
303
- }
304
- return C("numeric", _ * Number(h));
288
+ if (n.isDigit(v)) h += x(), m = "decimalFraction";
289
+ else return C("numeric", _ * Number(h));
305
290
  },
306
291
  decimalFraction() {
307
292
  switch (v) {
@@ -310,11 +295,8 @@ var r = Object.create, i = Object.defineProperty, a = Object.getOwnPropertyDescr
310
295
  h += x(), m = "decimalExponent";
311
296
  return;
312
297
  }
313
- if (n.isDigit(v)) {
314
- h += x();
315
- return;
316
- }
317
- return C("numeric", _ * Number(h));
298
+ if (n.isDigit(v)) h += x();
299
+ else return C("numeric", _ * Number(h));
318
300
  },
319
301
  decimalExponent() {
320
302
  switch (v) {
@@ -323,39 +305,24 @@ var r = Object.create, i = Object.defineProperty, a = Object.getOwnPropertyDescr
323
305
  h += x(), m = "decimalExponentSign";
324
306
  return;
325
307
  }
326
- if (n.isDigit(v)) {
327
- h += x(), m = "decimalExponentInteger";
328
- return;
329
- }
330
- throw j(x());
308
+ if (n.isDigit(v)) h += x(), m = "decimalExponentInteger";
309
+ else throw j(x());
331
310
  },
332
311
  decimalExponentSign() {
333
- if (n.isDigit(v)) {
334
- h += x(), m = "decimalExponentInteger";
335
- return;
336
- }
337
- throw j(x());
312
+ if (n.isDigit(v)) h += x(), m = "decimalExponentInteger";
313
+ else throw j(x());
338
314
  },
339
315
  decimalExponentInteger() {
340
- if (n.isDigit(v)) {
341
- h += x();
342
- return;
343
- }
344
- return C("numeric", _ * Number(h));
316
+ if (n.isDigit(v)) h += x();
317
+ else return C("numeric", _ * Number(h));
345
318
  },
346
319
  hexadecimal() {
347
- if (n.isHexDigit(v)) {
348
- h += x(), m = "hexadecimalInteger";
349
- return;
350
- }
351
- throw j(x());
320
+ if (n.isHexDigit(v)) h += x(), m = "hexadecimalInteger";
321
+ else throw j(x());
352
322
  },
353
323
  hexadecimalInteger() {
354
- if (n.isHexDigit(v)) {
355
- h += x();
356
- return;
357
- }
358
- return C("numeric", _ * Number(h));
324
+ if (n.isHexDigit(v)) h += x();
325
+ else return C("numeric", _ * Number(h));
359
326
  },
360
327
  string() {
361
328
  switch (v) {
@@ -402,11 +369,8 @@ var r = Object.create, i = Object.defineProperty, a = Object.getOwnPropertyDescr
402
369
  g = x() === "\"", m = "string";
403
370
  return;
404
371
  }
405
- if (n.isIdStartChar(v)) {
406
- h += x(), m = "identifierName";
407
- return;
408
- }
409
- throw j(x());
372
+ if (n.isIdStartChar(v)) h += x(), m = "identifierName";
373
+ else throw j(x());
410
374
  },
411
375
  afterPropertyName() {
412
376
  if (v === ":") return C("punctuator", x());
@@ -522,11 +486,7 @@ var r = Object.create, i = Object.defineProperty, a = Object.getOwnPropertyDescr
522
486
  },
523
487
  beforeArrayValue() {
524
488
  if (l.type === "eof") throw M();
525
- if (l.type === "punctuator" && l.value === "]") {
526
- A();
527
- return;
528
- }
529
- k();
489
+ l.type === "punctuator" && l.value === "]" ? A() : k();
530
490
  },
531
491
  afterPropertyValue() {
532
492
  if (l.type === "eof") throw M();
@@ -677,16 +637,11 @@ var r = Object.create, i = Object.defineProperty, a = Object.getOwnPropertyDescr
677
637
  continue;
678
638
  }
679
639
  }
680
- if (r[o]) {
681
- i += r[o];
682
- continue;
683
- }
684
- if (o < " ") {
640
+ if (r[o]) i += r[o];
641
+ else if (o < " ") {
685
642
  let e = o.charCodeAt(0).toString(16);
686
643
  i += "\\x" + ("00" + e).substring(e.length);
687
- continue;
688
- }
689
- i += o;
644
+ } else i += o;
690
645
  }
691
646
  let a = l || Object.keys(t).reduce((e, n) => t[e] < t[n] ? e : n);
692
647
  return i = i.replace(new RegExp(a, "g"), r[a]), a + i + a;
@@ -102,19 +102,18 @@ function l(e, t, n) {
102
102
  }
103
103
  function u(e, t, n) {
104
104
  let r = e.p;
105
- if (!n) {
106
- r = s(e.s, r), e.p = r < 0 ? e.s.length : r;
107
- return;
108
- }
109
- for (; e.p < e.s.length; e.p++) {
110
- let r = e.s.charCodeAt(e.p);
111
- if (r === 35) c(e);
112
- else if (r === n || r === t) return;
105
+ if (!n) r = s(e.s, r), e.p = r < 0 ? e.s.length : r;
106
+ else {
107
+ for (; e.p < e.s.length; e.p++) {
108
+ let r = e.s.charCodeAt(e.p);
109
+ if (r === 35) c(e);
110
+ else if (r === n || r === t) return;
111
+ }
112
+ throw new o("cannot find end of structure", {
113
+ toml: e.s,
114
+ ptr: r
115
+ });
113
116
  }
114
- throw new o("cannot find end of structure", {
115
- toml: e.s,
116
- ptr: r
117
- });
118
117
  }
119
118
  var d = /^((0x[0-9a-fA-F](_?[0-9a-fA-F])*)|(([+-]|0[ob])?\d(_?\d)*))$/, f = /^[+-]?\d(_?\d)*(\.\d(_?\d)*)?([eE][+-]?\d(_?\d)*)?$/, p = /^[+-]?0[0-9_]/;
120
119
  function m(e) {
@@ -1424,7 +1424,7 @@ function W(e, t, n, r) {
1424
1424
  for (; c !== 0;) {
1425
1425
  !i && e.firstTabInLine !== -1 && (e.position = e.firstTabInLine, P(e, "tab characters must not be used in indentation"));
1426
1426
  let l = e.input.charCodeAt(e.position + 1), u = e.line;
1427
- if ((c === 63 || c === 58) && R(l)) o ||= (en(e, e.position, r.anchorStart, r.anchorEnd, r.tagStart, r.tagEnd, x.BLOCK), !0), c === 63 ? (i && j(e), a = !0, i = !0) : i ? i = !1 : (j(e), a = !0, i = !1), e.position += 1, s = !0;
1427
+ if ((c === 63 || c === 58) && R(l)) o ||= (en(e, e.position, r.anchorStart, r.anchorEnd, r.tagStart, r.tagEnd, x.BLOCK), !0), c === 63 ? (i && j(e), a = !0, i = !0) : (i || (j(e), a = !0), i = !1), e.position += 1, s = !0;
1428
1428
  else {
1429
1429
  i &&= (j(e), !1);
1430
1430
  let t = M(e);