@vltpkg/cli-js 1.0.8 → 1.0.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) hide show
  1. package/{access-FOYRQGJC.js → access-4RPC3X5N.js} +5 -5
  2. package/{bugs-ORVU4I5O.js → bugs-K6QLQLL4.js} +12 -12
  3. package/{build-JLVAGEEU.js → build-VD4L5IED.js} +8 -8
  4. package/{cache-RIOSSQD3.js → cache-Q6FUUEQF.js} +7 -7
  5. package/{chunk-5CNTLC2U.js → chunk-3564IL5W.js} +1 -1
  6. package/{chunk-YAIKXFLN.js → chunk-5HBKYSTX.js} +1 -1
  7. package/{chunk-PTR5IGFQ.js → chunk-5HPGL5WS.js} +1 -1
  8. package/{chunk-UYIA44HE.js → chunk-B5IILBX7.js} +4 -4
  9. package/{chunk-BJBFEQRR.js → chunk-BHJT53TP.js} +1 -0
  10. package/{chunk-ADLHAQRA.js → chunk-BSPUKIWY.js} +1 -1
  11. package/{chunk-3L2ERW54.js → chunk-DAS7TVRN.js} +3 -3
  12. package/{chunk-7D7SNVBV.js → chunk-FUCQ7ARR.js} +76 -25
  13. package/{chunk-XISRK3R5.js → chunk-MNK55XSE.js} +17 -0
  14. package/{chunk-WY4PAM6D.js → chunk-NA732FNL.js} +3 -3
  15. package/{chunk-AGHW2E24.js → chunk-NWLS3VOQ.js} +79 -15
  16. package/{chunk-YCVPEZRM.js → chunk-P5S2TFCF.js} +50 -16
  17. package/{chunk-5QAFAGO5.js → chunk-TYRKIWGF.js} +6 -6
  18. package/{chunk-JXVDCQZF.js → chunk-VL7RJVNN.js} +27 -5
  19. package/{chunk-NC3QYZPW.js → chunk-WAYVHANF.js} +3 -3
  20. package/{chunk-MUG5K6X2.js → chunk-XFI4THXZ.js} +1 -1
  21. package/{chunk-ZXIF4PVX.js → chunk-XUP35M5Q.js} +4 -4
  22. package/chunk-Y3QEV76Q.js +75 -0
  23. package/{chunk-OB73T23B.js → chunk-ZNCVQQDT.js} +1 -1
  24. package/{ci-2666LKEC.js → ci-G4PJWJQE.js} +7 -7
  25. package/cli-package.json +1 -1
  26. package/{config-3N7PBEXH.js → config-66ARNESN.js} +6 -5
  27. package/{config-WMYY5J37.js → config-WTIWWXRD.js} +8 -7
  28. package/{create-AEQSO6KX.js → create-DF6RQTHC.js} +13 -13
  29. package/{deprecate-MW76DAZ5.js → deprecate-2KTC2HKH.js} +8 -8
  30. package/{dist-tag-XGQLYA6C.js → dist-tag-QKJQIOGN.js} +5 -5
  31. package/{docs-7CCTL3OY.js → docs-YSWJTGYX.js} +12 -12
  32. package/{exec-GWCIDNOH.js → exec-5XIMPSBI.js} +13 -13
  33. package/{exec-cache-AML2HUTJ.js → exec-cache-OGX7WR5P.js} +11 -11
  34. package/{exec-local-JRTO2XG4.js → exec-local-SB7EPYED.js} +11 -11
  35. package/{help-4KSCV7GN.js → help-GMCQHGVN.js} +4 -4
  36. package/{init-OHVBHXB7.js → init-KXIIWHBA.js} +8 -8
  37. package/{install-TFDEHY5J.js → install-ODTEMAMS.js} +8 -8
  38. package/{list-UD4SDHVE.js → list-QS4FLJSU.js} +13 -13
  39. package/{login-B6TIQW62.js → login-6TGYRY43.js} +8 -8
  40. package/{logout-H3CXGLDN.js → logout-GOAB7KHJ.js} +5 -5
  41. package/{pack-YYK4LKBQ.js → pack-PJDH6PKP.js} +9 -9
  42. package/package.json +1 -1
  43. package/{ping-G765RWLM.js → ping-ANBW2IRW.js} +5 -5
  44. package/{pkg-D4S3SPUH.js → pkg-GZWUXU65.js} +9 -9
  45. package/{profile-YDQGMWYP.js → profile-BLY74CMB.js} +5 -5
  46. package/{publish-ANHSZPIM.js → publish-W2KOTNMB.js} +25 -13
  47. package/{query-PZ6C6AZJ.js → query-3PUMU5ON.js} +13 -13
  48. package/{registry-BMWXMQS4.js → registry-ONSDWNPV.js} +3 -3
  49. package/registry-client-package.json +1 -1
  50. package/registry-client-src-revalidate.js +75 -11
  51. package/{repo-ZA3TMERE.js → repo-LZ6STH4C.js} +12 -12
  52. package/{run-N4NK35UT.js → run-JMIBADHE.js} +11 -11
  53. package/{run-exec-N5FT4QO7.js → run-exec-JEKM2O53.js} +11 -11
  54. package/{setup-MWWDSKQZ.js → setup-BTBU3NAI.js} +35 -17
  55. package/{src-6UF5YTTL.js → src-23VBKASP.js} +9 -9
  56. package/{src-6PISL6QX.js → src-J4BAYOBO.js} +3 -3
  57. package/{src-U4EBFPPT.js → src-MOKZQTH2.js} +163 -205
  58. package/{token-FFUAFL43.js → token-PUJ7QN6D.js} +5 -5
  59. package/{uninstall-A4PUG6RI.js → uninstall-OTISP2T7.js} +8 -8
  60. package/{unpublish-OJEGZDGQ.js → unpublish-X75EEQAN.js} +6 -6
  61. package/{update-ENR6ICMR.js → update-CKXX5POE.js} +7 -7
  62. package/{version-K3BUGG7X.js → version-24B2X7M7.js} +23 -17
  63. package/{view-SWVQLQCB.js → view-Q7MAQ6R3.js} +7 -6
  64. package/vlr.js +1 -1
  65. package/vlrx.js +1 -1
  66. package/vlt.js +1 -1
  67. package/vlx.js +1 -1
  68. package/vlxl.js +1 -1
  69. package/{whoami-MA733O2T.js → whoami-S6CQZFE3.js} +5 -5
  70. package/chunk-AQ3XJJUP.js +0 -75
  71. package/{chunk-FG633ZKS.js → chunk-2YJ5MESP.js} +3 -3
  72. package/{chunk-OWML62W5.js → chunk-USTJECVS.js} +3 -3
@@ -21,15 +21,15 @@ import {
21
21
  import {
22
22
  logRequest
23
23
  } from "./chunk-UBLFPJHV.js";
24
+ import {
25
+ asError
26
+ } from "./chunk-VFBCWAOC.js";
24
27
  import {
25
28
  XDG
26
29
  } from "./chunk-XNLSTHDK.js";
27
30
  import {
28
31
  rimraf
29
- } from "./chunk-BJBFEQRR.js";
30
- import {
31
- asError
32
- } from "./chunk-VFBCWAOC.js";
32
+ } from "./chunk-BHJT53TP.js";
33
33
  import {
34
34
  error
35
35
  } from "./chunk-WZWDS3W4.js";
@@ -12597,7 +12597,7 @@ var require_mock_utils = __commonJS({
12597
12597
  kTotalDispatchCount
12598
12598
  } = require_mock_symbols();
12599
12599
  var { serializePathWithQuery } = require_util();
12600
- var { STATUS_CODES } = __require("node:http");
12600
+ var { STATUS_CODES: STATUS_CODES2 } = __require("node:http");
12601
12601
  var {
12602
12602
  types: {
12603
12603
  isPromise
@@ -12805,7 +12805,7 @@ var require_mock_utils = __commonJS({
12805
12805
  return result;
12806
12806
  }
12807
12807
  function getStatusText(statusCode) {
12808
- return STATUS_CODES[statusCode] || "unknown";
12808
+ return STATUS_CODES2[statusCode] || "unknown";
12809
12809
  }
12810
12810
  async function getResponse(body) {
12811
12811
  const buffers = [];
@@ -20411,7 +20411,7 @@ var require_fetch = __commonJS({
20411
20411
  var { dataURLProcessor, serializeAMimeType, minimizeSupportedMimeType } = require_data_url();
20412
20412
  var { getGlobalDispatcher } = require_global2();
20413
20413
  var { webidl } = require_webidl();
20414
- var { STATUS_CODES } = __require("node:http");
20414
+ var { STATUS_CODES: STATUS_CODES2 } = __require("node:http");
20415
20415
  var { bytesMatch } = require_subresource_integrity();
20416
20416
  var { createDeferredPromise } = require_promise();
20417
20417
  var { isomorphicEncode } = require_infra();
@@ -21448,7 +21448,7 @@ var require_fetch = __commonJS({
21448
21448
  }
21449
21449
  resolve5({
21450
21450
  status,
21451
- statusText: STATUS_CODES[status],
21451
+ statusText: STATUS_CODES2[status],
21452
21452
  headersList,
21453
21453
  socket
21454
21454
  });
@@ -21472,7 +21472,7 @@ var require_fetch = __commonJS({
21472
21472
  }
21473
21473
  resolve5({
21474
21474
  status,
21475
- statusText: STATUS_CODES[status],
21475
+ statusText: STATUS_CODES2[status],
21476
21476
  headersList,
21477
21477
  socket
21478
21478
  });
@@ -26130,6 +26130,8 @@ var handleBeforeExit = () => {
26130
26130
 
26131
26131
  // ../../src/registry-client/src/index.ts
26132
26132
  import { randomUUID } from "node:crypto";
26133
+ import { readFileSync as readFileSync2 } from "node:fs";
26134
+ import { STATUS_CODES } from "node:http";
26133
26135
  import { availableParallelism } from "node:os";
26134
26136
  import { dirname as dirname3, resolve as resolve4 } from "node:path";
26135
26137
  import { setTimeout as setTimeout2 } from "node:timers/promises";
@@ -27513,9 +27515,18 @@ var RegistryClient = class {
27513
27515
  return;
27514
27516
  }
27515
27517
  }
27516
- throw error("Failed to perform web login", { response });
27518
+ const { statusCode } = response;
27519
+ const status = STATUS_CODES[statusCode];
27520
+ throw error(
27521
+ `Failed to perform web login: ${statusCode}${status ? ` ${status}` : ""}`,
27522
+ {
27523
+ code: "EREQUEST",
27524
+ url: webLoginURL,
27525
+ status: statusCode,
27526
+ response
27527
+ }
27528
+ );
27517
27529
  }
27518
- /* c8 ignore stop */
27519
27530
  /**
27520
27531
  * Given a {@link WebAuthChallenge}, open the `authUrl` in a browser and
27521
27532
  * hang on the `doneUrl` until it returns a {@link TokenResponse} object.
@@ -27576,6 +27587,52 @@ var RegistryClient = class {
27576
27587
  response
27577
27588
  });
27578
27589
  }
27590
+ /**
27591
+ * Read a valid cached non-JSON body straight off disk, bypassing the
27592
+ * in-memory cache LRU so that a tarball is never held in it.
27593
+ *
27594
+ * One read: the head is decoded from the same bytes the body comes
27595
+ * from, so `cache-unzip` rewriting the head cannot land between the
27596
+ * two and hand back a body at a stale offset.
27597
+ *
27598
+ * Does not log a cache hit -- the caller may still reject the body
27599
+ * and fall back to {@link request}, which logs its own.
27600
+ *
27601
+ * Returns undefined on anything unexpected; callers fall back to
27602
+ * {@link request}.
27603
+ */
27604
+ cachedBody(url, options = {}) {
27605
+ const { integrity, method = "GET" } = options;
27606
+ try {
27607
+ const key = cacheKey(
27608
+ method,
27609
+ typeof url === "string" ? new URL(url) : url
27610
+ );
27611
+ if (this.cache.peek(key)) return void 0;
27612
+ const paths = /* @__PURE__ */ new Set();
27613
+ try {
27614
+ const i = this.cache.integrityPath(integrity);
27615
+ if (i) paths.add(i);
27616
+ } catch {
27617
+ }
27618
+ paths.add(this.cache.path(key));
27619
+ for (const path of paths) {
27620
+ let buf;
27621
+ try {
27622
+ buf = readFileSync2(path);
27623
+ } catch {
27624
+ continue;
27625
+ }
27626
+ const entry = CacheEntry.decode(buf);
27627
+ if (entry.statusCode !== 200 || !entry.valid || entry.isJSON) {
27628
+ continue;
27629
+ }
27630
+ return { path, body: entry.buffer() };
27631
+ }
27632
+ } catch {
27633
+ }
27634
+ return void 0;
27635
+ }
27579
27636
  async request(url, options = {}) {
27580
27637
  const u = typeof url === "string" ? new URL(url) : url;
27581
27638
  const {
@@ -27584,7 +27641,8 @@ var RegistryClient = class {
27584
27641
  redirections = /* @__PURE__ */ new Set(),
27585
27642
  signal,
27586
27643
  otp = (process.env.VLT_OTP ?? "").trim(),
27587
- staleWhileRevalidate = true
27644
+ staleWhileRevalidate = true,
27645
+ forceRevalidate = false
27588
27646
  } = options;
27589
27647
  let { trustIntegrity } = options;
27590
27648
  const m = isCacheableMethod(method) ? method : void 0;
@@ -27593,11 +27651,12 @@ var RegistryClient = class {
27593
27651
  const key = cacheKey(method, u);
27594
27652
  const buffer = useCache ? await this.cache.fetch(key, { context: { integrity } }) : void 0;
27595
27653
  const entry = buffer ? this.#decodeCached(buffer) : void 0;
27596
- if (entry?.valid) {
27654
+ if (entry?.valid && !forceRevalidate) {
27597
27655
  logRequest(url, "cache", { method });
27598
27656
  return entry;
27599
27657
  }
27600
- if (staleWhileRevalidate && entry?.staleWhileRevalidate && m) {
27658
+ const forcedFallback = forceRevalidate && entry?.staleWhileRevalidate ? entry : void 0;
27659
+ if (!forceRevalidate && staleWhileRevalidate && entry?.staleWhileRevalidate && m) {
27601
27660
  register2(dirname3(this.cache.path()), m, url);
27602
27661
  logRequest(url, "stale", { method });
27603
27662
  return entry;
@@ -27643,6 +27702,10 @@ var RegistryClient = class {
27643
27702
  options
27644
27703
  );
27645
27704
  } catch (er) {
27705
+ if (forcedFallback && !signal?.aborted) {
27706
+ logRequest(url, "stale", { method });
27707
+ return forcedFallback;
27708
+ }
27646
27709
  throw error("Request failed", {
27647
27710
  code: "EREQUEST",
27648
27711
  cause: er,
@@ -27671,7 +27734,8 @@ var RegistryClient = class {
27671
27734
  if (result.isGzip && !trustIntegrity) {
27672
27735
  result.checkIntegrity({ url });
27673
27736
  }
27674
- if (useCache) {
27737
+ const clobbersCachedEntry = forceRevalidate && !!entry && result.statusCode !== 200;
27738
+ if (useCache && !clobbersCachedEntry) {
27675
27739
  const buffer2 = result.encode();
27676
27740
  this.cache.set(
27677
27741
  key,
@@ -20,16 +20,19 @@ import {
20
20
  pickManifest,
21
21
  resolve,
22
22
  revs
23
- } from "./chunk-OWML62W5.js";
23
+ } from "./chunk-USTJECVS.js";
24
24
  import {
25
25
  Spec
26
26
  } from "./chunk-XKVU23NC.js";
27
27
  import {
28
- XDG
29
- } from "./chunk-XNLSTHDK.js";
28
+ logRequest
29
+ } from "./chunk-UBLFPJHV.js";
30
30
  import {
31
31
  asPackument
32
32
  } from "./chunk-VFBCWAOC.js";
33
+ import {
34
+ XDG
35
+ } from "./chunk-XNLSTHDK.js";
33
36
  import {
34
37
  error
35
38
  } from "./chunk-WZWDS3W4.js";
@@ -55,6 +58,7 @@ import {
55
58
  resolve as pathResolve,
56
59
  relative
57
60
  } from "node:path";
61
+ import { debuglog } from "node:util";
58
62
 
59
63
  // ../../src/package-info/src/rename.ts
60
64
  import { rename as fsRename, rm } from "node:fs/promises";
@@ -76,6 +80,7 @@ var rename = platform !== "win32" ? fsRename : (async function(oldPath, newPath)
76
80
  });
77
81
 
78
82
  // ../../src/package-info/src/index.ts
83
+ var debug = debuglog("vlt");
79
84
  var xdg = new XDG("vlt");
80
85
  var delimiter = "~";
81
86
  var manifestCacheMaxAge = 5 * 60 * 1e3;
@@ -83,6 +88,7 @@ var noRegistryError = (spec) => error(
83
88
  'No registry configured to resolve this spec. Set "registry" in vlt.json, pass --registry, or run `vlt login --registry=<url>`. See https://docs.vlt.sh/cli',
84
89
  { code: "ECONFIG", spec }
85
90
  );
91
+ var isMovingSelector = (f) => !!(f.distTag || f.range?.isAny);
86
92
  var PackageInfoClient = class {
87
93
  #registryClient;
88
94
  #projectRoot;
@@ -96,7 +102,9 @@ var PackageInfoClient = class {
96
102
  #cachePath;
97
103
  // In-flight coalescing key is `${registry}${name}` — no representation
98
104
  // component. Safe only because every caller requests the same full
99
- // packument (see #fetchPackument).
105
+ // packument (see #fetchPackument). The one thing that does vary per
106
+ // caller is forceRevalidate, so record it and let a moving selector
107
+ // reuse a forced promise but never a non-forced one (see packument()).
100
108
  #packumentPromises = /* @__PURE__ */ new Map();
101
109
  // unique temp file names for atomic manifest cache writes
102
110
  #manifestWriteRandom = randomBytes(6).toString("hex");
@@ -111,7 +119,7 @@ var PackageInfoClient = class {
111
119
  #tarPoolPromise;
112
120
  async getRegistryClient() {
113
121
  if (this.#registryClient) return this.#registryClient;
114
- this.#registryClientPromise ??= import("./src-6PISL6QX.js").then(({ RegistryClient }) => {
122
+ this.#registryClientPromise ??= import("./src-J4BAYOBO.js").then(({ RegistryClient }) => {
115
123
  this.#registryClient = new RegistryClient(this.options);
116
124
  return this.#registryClient;
117
125
  });
@@ -119,7 +127,7 @@ var PackageInfoClient = class {
119
127
  }
120
128
  async getTarPool() {
121
129
  if (this.#tarPool) return this.#tarPool;
122
- this.#tarPoolPromise ??= import("./src-U4EBFPPT.js").then(
130
+ this.#tarPoolPromise ??= import("./src-MOKZQTH2.js").then(
123
131
  ({ Pool }) => {
124
132
  this.#tarPool = new Pool();
125
133
  return this.#tarPool;
@@ -192,6 +200,23 @@ var PackageInfoClient = class {
192
200
  }
193
201
  }
194
202
  case "registry": {
203
+ const cached = (await this.getRegistryClient()).cachedBody(
204
+ r.resolved,
205
+ { integrity: r.integrity }
206
+ );
207
+ if (cached) {
208
+ try {
209
+ await (await this.getTarPool()).unpack(cached.body, target);
210
+ logRequest(r.resolved, "cache");
211
+ return r;
212
+ } catch (er) {
213
+ debug(
214
+ "cached tarball unpack failed: %s: %s",
215
+ cached.path,
216
+ er
217
+ );
218
+ }
219
+ }
195
220
  const fetchTarball = async (useCache) => {
196
221
  const trustIntegrity = this.#trustedIntegrities.get(r.resolved) === r.integrity;
197
222
  const response = await (await this.getRegistryClient()).request(r.resolved, {
@@ -300,7 +325,7 @@ var PackageInfoClient = class {
300
325
  const st = await stat(path);
301
326
  if (st.isFile()) {
302
327
  try {
303
- await (await this.getTarPool()).unpack(await this.tarball(spec, options), target);
328
+ await (await this.getTarPool()).unpackFile(path, target);
304
329
  } catch (er) {
305
330
  throw this.#resolveError(
306
331
  spec,
@@ -376,7 +401,7 @@ var PackageInfoClient = class {
376
401
  return;
377
402
  }
378
403
  const f = spec.final;
379
- if (f.distTag || f.range?.isAny) {
404
+ if (isMovingSelector(f)) {
380
405
  return;
381
406
  }
382
407
  const key = this.#manifestCacheKey(f, options);
@@ -653,7 +678,7 @@ var PackageInfoClient = class {
653
678
  const s = spec;
654
679
  return await this.#tmpdir(async (dir) => {
655
680
  try {
656
- await (await this.getTarPool()).unpack(await readFile(path), dir);
681
+ await (await this.getTarPool()).unpackFile(path, dir);
657
682
  } catch (er) {
658
683
  throw this.#resolveError(
659
684
  s,
@@ -710,15 +735,20 @@ var PackageInfoClient = class {
710
735
  const { registry, name } = f;
711
736
  if (!registry) throw noRegistryError(spec);
712
737
  const packumentKey = `${registry}${name}`;
738
+ const forced = isMovingSelector(f);
713
739
  const inflight = this.#packumentPromises.get(packumentKey);
714
- if (inflight) return inflight;
740
+ if (inflight && (!forced || inflight.forced))
741
+ return inflight.promise;
715
742
  const pakuURL = new URL(name, registry);
716
743
  const promise = this.#fetchPackument(spec, options, pakuURL);
717
- this.#packumentPromises.set(packumentKey, promise);
718
- promise.then(
719
- () => this.#packumentPromises.delete(packumentKey),
720
- () => this.#packumentPromises.delete(packumentKey)
721
- );
744
+ const record = { promise, forced };
745
+ this.#packumentPromises.set(packumentKey, record);
746
+ const clear = () => {
747
+ if (this.#packumentPromises.get(packumentKey) === record) {
748
+ this.#packumentPromises.delete(packumentKey);
749
+ }
750
+ };
751
+ promise.then(clear, clear);
722
752
  return promise;
723
753
  }
724
754
  }
@@ -726,7 +756,11 @@ var PackageInfoClient = class {
726
756
  async #fetchPackument(spec, options, pakuURL, useCache) {
727
757
  const response = await (await this.getRegistryClient()).request(pakuURL, {
728
758
  headers: { accept: "application/json" },
729
- ...useCache === false ? { useCache } : {}
759
+ ...useCache === false ? { useCache } : {},
760
+ // costs a conditional GET per moving selector on an otherwise warm
761
+ // cache, install included. 304s are cheap but not free; the
762
+ // alternative is serving a dist tag that moved (#1656).
763
+ ...isMovingSelector(spec.final) ? { forceRevalidate: true } : {}
730
764
  });
731
765
  if (response.statusCode !== 200) {
732
766
  throw this.#resolveError(
@@ -11,26 +11,26 @@ import {createRequire as _vlt_createRequire} from "node:module";
11
11
  var require = _vlt_createRequire(import.meta.filename);
12
12
  import {
13
13
  PackageInfoClient
14
- } from "./chunk-YCVPEZRM.js";
14
+ } from "./chunk-P5S2TFCF.js";
15
15
  import {
16
16
  findCmdShimIfExists,
17
17
  install
18
- } from "./chunk-7D7SNVBV.js";
18
+ } from "./chunk-FUCQ7ARR.js";
19
19
  import {
20
20
  PathScurry
21
- } from "./chunk-OWML62W5.js";
21
+ } from "./chunk-USTJECVS.js";
22
22
  import {
23
23
  Spec
24
24
  } from "./chunk-XKVU23NC.js";
25
25
  import {
26
26
  walkUp
27
27
  } from "./chunk-HTOTG4TS.js";
28
- import {
29
- XDG
30
- } from "./chunk-XNLSTHDK.js";
31
28
  import {
32
29
  parseScope
33
30
  } from "./chunk-VFBCWAOC.js";
31
+ import {
32
+ XDG
33
+ } from "./chunk-XNLSTHDK.js";
34
34
  import {
35
35
  error
36
36
  } from "./chunk-WZWDS3W4.js";
@@ -12,7 +12,7 @@ var require = _vlt_createRequire(import.meta.filename);
12
12
  import {
13
13
  generateDefaultHelp,
14
14
  generateFullHelp
15
- } from "./chunk-YAIKXFLN.js";
15
+ } from "./chunk-5HBKYSTX.js";
16
16
  import {
17
17
  flush,
18
18
  trackCommand,
@@ -33,7 +33,7 @@ import {
33
33
  } from "./chunk-YOE3VZFX.js";
34
34
  import {
35
35
  defaultView
36
- } from "./chunk-XISRK3R5.js";
36
+ } from "./chunk-MNK55XSE.js";
37
37
  import {
38
38
  isLazyView,
39
39
  isViewClass,
@@ -42,13 +42,13 @@ import {
42
42
  import {
43
43
  emitter
44
44
  } from "./chunk-UBLFPJHV.js";
45
- import {
46
- XDG
47
- } from "./chunk-XNLSTHDK.js";
48
45
  import {
49
46
  isErrorWithCause,
50
47
  isObject
51
48
  } from "./chunk-VFBCWAOC.js";
49
+ import {
50
+ XDG
51
+ } from "./chunk-XNLSTHDK.js";
52
52
 
53
53
  // ../../src/cli-sdk/src/print-err.ts
54
54
  import { mkdirSync, readFileSync, writeFileSync } from "node:fs";
@@ -214,6 +214,14 @@ var printCode = (err, usage, stderr2, format) => {
214
214
  }
215
215
  return { file: true };
216
216
  }
217
+ case "ENEEDAUTH": {
218
+ const { url } = err.cause;
219
+ stderr2(`Authentication Error: ${err.message}`);
220
+ if (url) {
221
+ stderr2(indent(`URL: ${formatURL(url, format)}`));
222
+ }
223
+ return {};
224
+ }
217
225
  case "EREQUEST": {
218
226
  const { url, method } = err.cause;
219
227
  const { code, syscall } = err.cause.cause ?? {};
@@ -232,6 +240,20 @@ var printCode = (err, usage, stderr2, format) => {
232
240
  }
233
241
  return { file: true };
234
242
  }
243
+ case "EQUERY": {
244
+ const { found, wanted, validOptions } = err.cause;
245
+ stderr2(`Query Error: ${err.message}`);
246
+ if (found) {
247
+ stderr2(indent(`Found: ${format(found)}`));
248
+ }
249
+ if (wanted) {
250
+ stderr2(indent(`Did you mean: ${format(wanted)}`));
251
+ }
252
+ if (validOptions) {
253
+ stderr2(indent(`Valid Options: ${format(validOptions)}`));
254
+ }
255
+ return {};
256
+ }
235
257
  case "ECONFIG": {
236
258
  const { found, wanted, validOptions } = err.cause;
237
259
  stderr2(`Config Error: ${err.message}`);
@@ -13,10 +13,10 @@ import {
13
13
  actual,
14
14
  callLimit,
15
15
  createVirtualRoot
16
- } from "./chunk-7D7SNVBV.js";
16
+ } from "./chunk-FUCQ7ARR.js";
17
17
  import {
18
18
  SecurityArchive
19
- } from "./chunk-FG633ZKS.js";
19
+ } from "./chunk-2YJ5MESP.js";
20
20
  import {
21
21
  error
22
22
  } from "./chunk-WZWDS3W4.js";
@@ -115,7 +115,7 @@ var reloadConfig = async (folder) => {
115
115
  unload("project");
116
116
  } catch {
117
117
  }
118
- const { Config } = await import("./config-3N7PBEXH.js");
118
+ const { Config } = await import("./config-66ARNESN.js");
119
119
  return Config.load(folder, process.argv, true);
120
120
  };
121
121
 
@@ -16,7 +16,7 @@ import {
16
16
  } from "./chunk-ZWKI5OSF.js";
17
17
  import {
18
18
  minimatch
19
- } from "./chunk-OWML62W5.js";
19
+ } from "./chunk-USTJECVS.js";
20
20
  import {
21
21
  Spec
22
22
  } from "./chunk-XKVU23NC.js";
@@ -11,19 +11,19 @@ import {createRequire as _vlt_createRequire} from "node:module";
11
11
  var require = _vlt_createRequire(import.meta.filename);
12
12
  import {
13
13
  openUrl
14
- } from "./chunk-OB73T23B.js";
14
+ } from "./chunk-ZNCVQQDT.js";
15
15
  import {
16
16
  stderr
17
- } from "./chunk-JXVDCQZF.js";
17
+ } from "./chunk-VL7RJVNN.js";
18
18
  import {
19
19
  mermaidOutput
20
- } from "./chunk-7D7SNVBV.js";
20
+ } from "./chunk-FUCQ7ARR.js";
21
21
  import {
22
22
  ViewClass
23
23
  } from "./chunk-4KCU2KZL.js";
24
24
  import {
25
25
  getTokenByURL
26
- } from "./chunk-AGHW2E24.js";
26
+ } from "./chunk-NWLS3VOQ.js";
27
27
 
28
28
  // ../../src/cli-sdk/src/query-auth.ts
29
29
  var createGetAuthHeader = (conf) => async (url) => getTokenByURL(url, conf.options.identity);
@@ -0,0 +1,75 @@
1
+ var global = globalThis;
2
+ import {Buffer} from "node:buffer";
3
+ import {setTimeout as _vlt_setTimeout,clearTimeout as _vlt_clearTimeout,setImmediate as _vlt_setImmediate,clearImmediate as _vlt_clearImmediate,setInterval as _vlt_setInterval,clearInterval as _vlt_clearInterval} from "node:timers";
4
+ globalThis.setTimeout = _vlt_setTimeout;
5
+ globalThis.clearTimeout = _vlt_clearTimeout;
6
+ globalThis.setImmediate = _vlt_setImmediate;
7
+ globalThis.clearImmediate = _vlt_clearImmediate;
8
+ globalThis.setInterval = _vlt_setInterval;
9
+ globalThis.clearInterval = _vlt_clearInterval;
10
+ import {createRequire as _vlt_createRequire} from "node:module";
11
+ var require = _vlt_createRequire(import.meta.filename);
12
+ import {
13
+ error
14
+ } from "./chunk-WZWDS3W4.js";
15
+ import {
16
+ __glob
17
+ } from "./chunk-PZLD7RTK.js";
18
+
19
+ // import("./commands/**/*.ts") in ../../src/cli-sdk/src/load-command.ts
20
+ var globImport_commands_ts = __glob({
21
+ "./commands/access.ts": () => import("./access-4RPC3X5N.js"),
22
+ "./commands/bugs.ts": () => import("./bugs-K6QLQLL4.js"),
23
+ "./commands/build.ts": () => import("./build-VD4L5IED.js"),
24
+ "./commands/cache.ts": () => import("./cache-Q6FUUEQF.js"),
25
+ "./commands/ci.ts": () => import("./ci-G4PJWJQE.js"),
26
+ "./commands/config.ts": () => import("./config-WTIWWXRD.js"),
27
+ "./commands/create.ts": () => import("./create-DF6RQTHC.js"),
28
+ "./commands/deprecate.ts": () => import("./deprecate-2KTC2HKH.js"),
29
+ "./commands/dist-tag.ts": () => import("./dist-tag-QKJQIOGN.js"),
30
+ "./commands/docs.ts": () => import("./docs-YSWJTGYX.js"),
31
+ "./commands/exec-cache.ts": () => import("./exec-cache-OGX7WR5P.js"),
32
+ "./commands/exec-local.ts": () => import("./exec-local-SB7EPYED.js"),
33
+ "./commands/exec.ts": () => import("./exec-5XIMPSBI.js"),
34
+ "./commands/help.ts": () => import("./help-GMCQHGVN.js"),
35
+ "./commands/init.ts": () => import("./init-KXIIWHBA.js"),
36
+ "./commands/install.ts": () => import("./install-ODTEMAMS.js"),
37
+ "./commands/install/reporter.ts": () => import("./reporter-SDMDYYMJ.js"),
38
+ "./commands/list.ts": () => import("./list-QS4FLJSU.js"),
39
+ "./commands/login.ts": () => import("./login-6TGYRY43.js"),
40
+ "./commands/logout.ts": () => import("./logout-GOAB7KHJ.js"),
41
+ "./commands/pack.ts": () => import("./pack-PJDH6PKP.js"),
42
+ "./commands/ping.ts": () => import("./ping-ANBW2IRW.js"),
43
+ "./commands/pkg.ts": () => import("./pkg-GZWUXU65.js"),
44
+ "./commands/profile.ts": () => import("./profile-BLY74CMB.js"),
45
+ "./commands/publish.ts": () => import("./publish-W2KOTNMB.js"),
46
+ "./commands/query.ts": () => import("./query-3PUMU5ON.js"),
47
+ "./commands/registry.ts": () => import("./registry-ONSDWNPV.js"),
48
+ "./commands/repo.ts": () => import("./repo-LZ6STH4C.js"),
49
+ "./commands/run-exec.ts": () => import("./run-exec-JEKM2O53.js"),
50
+ "./commands/run.ts": () => import("./run-JMIBADHE.js"),
51
+ "./commands/setup.ts": () => import("./setup-BTBU3NAI.js"),
52
+ "./commands/token.ts": () => import("./token-PUJ7QN6D.js"),
53
+ "./commands/uninstall.ts": () => import("./uninstall-OTISP2T7.js"),
54
+ "./commands/unpublish.ts": () => import("./unpublish-X75EEQAN.js"),
55
+ "./commands/update.ts": () => import("./update-CKXX5POE.js"),
56
+ "./commands/version.ts": () => import("./version-24B2X7M7.js"),
57
+ "./commands/view.ts": () => import("./view-Q7MAQ6R3.js"),
58
+ "./commands/whoami.ts": () => import("./whoami-S6CQZFE3.js")
59
+ });
60
+
61
+ // ../../src/cli-sdk/src/load-command.ts
62
+ var loadCommand = async (command) => {
63
+ try {
64
+ return await globImport_commands_ts(`./commands/${command}.ts`);
65
+ } catch (e) {
66
+ throw error("Could not load command", {
67
+ found: command,
68
+ cause: e
69
+ });
70
+ }
71
+ };
72
+
73
+ export {
74
+ loadCommand
75
+ };
@@ -11,7 +11,7 @@ import {createRequire as _vlt_createRequire} from "node:module";
11
11
  var require = _vlt_createRequire(import.meta.filename);
12
12
  import {
13
13
  stderr
14
- } from "./chunk-JXVDCQZF.js";
14
+ } from "./chunk-VL7RJVNN.js";
15
15
  import {
16
16
  urlOpen
17
17
  } from "./chunk-HAYXR3MW.js";
@@ -11,15 +11,15 @@ import {createRequire as _vlt_createRequire} from "node:module";
11
11
  var require = _vlt_createRequire(import.meta.filename);
12
12
  import {
13
13
  install
14
- } from "./chunk-7D7SNVBV.js";
15
- import "./chunk-FG633ZKS.js";
16
- import "./chunk-OWML62W5.js";
14
+ } from "./chunk-FUCQ7ARR.js";
15
+ import "./chunk-2YJ5MESP.js";
16
+ import "./chunk-USTJECVS.js";
17
17
  import "./chunk-YOE3VZFX.js";
18
18
  import {
19
19
  commandUsage
20
- } from "./chunk-PTR5IGFQ.js";
20
+ } from "./chunk-5HPGL5WS.js";
21
21
  import "./chunk-XKVU23NC.js";
22
- import "./chunk-XISRK3R5.js";
22
+ import "./chunk-MNK55XSE.js";
23
23
  import {
24
24
  lazyView
25
25
  } from "./chunk-4KCU2KZL.js";
@@ -27,10 +27,10 @@ import "./chunk-HTOTG4TS.js";
27
27
  import "./chunk-E74WGW5C.js";
28
28
  import "./chunk-LPIBYUMT.js";
29
29
  import "./chunk-UBLFPJHV.js";
30
+ import "./chunk-VFBCWAOC.js";
30
31
  import "./chunk-XNLSTHDK.js";
31
- import "./chunk-BJBFEQRR.js";
32
+ import "./chunk-BHJT53TP.js";
32
33
  import "./chunk-VE6CCH33.js";
33
- import "./chunk-VFBCWAOC.js";
34
34
  import "./chunk-WZWDS3W4.js";
35
35
  import "./chunk-PZLD7RTK.js";
36
36
 
package/cli-package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vltpkg/cli-sdk",
3
3
  "description": "The source for the vlt CLI",
4
- "version": "1.0.8",
4
+ "version": "1.0.10",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "git+https://github.com/vltpkg/vltpkg.git",
@@ -15,10 +15,10 @@ import {
15
15
  kCustomInspect,
16
16
  pairsToRecords,
17
17
  recordsToPairs
18
- } from "./chunk-WY4PAM6D.js";
19
- import "./chunk-YCVPEZRM.js";
18
+ } from "./chunk-NA732FNL.js";
19
+ import "./chunk-P5S2TFCF.js";
20
20
  import "./chunk-ZWKI5OSF.js";
21
- import "./chunk-OWML62W5.js";
21
+ import "./chunk-USTJECVS.js";
22
22
  import "./chunk-YOE3VZFX.js";
23
23
  import "./chunk-XKVU23NC.js";
24
24
  import {
@@ -26,12 +26,13 @@ import {
26
26
  definition,
27
27
  isRecordField,
28
28
  recordFields
29
- } from "./chunk-XISRK3R5.js";
29
+ } from "./chunk-MNK55XSE.js";
30
30
  import "./chunk-HTOTG4TS.js";
31
31
  import "./chunk-LPIBYUMT.js";
32
+ import "./chunk-UBLFPJHV.js";
33
+ import "./chunk-VFBCWAOC.js";
32
34
  import "./chunk-XNLSTHDK.js";
33
35
  import "./chunk-VE6CCH33.js";
34
- import "./chunk-VFBCWAOC.js";
35
36
  import "./chunk-WZWDS3W4.js";
36
37
  import "./chunk-PZLD7RTK.js";
37
38
  export {