@vltpkg/cli-js 1.0.7 → 1.0.9

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 (73) hide show
  1. package/{access-OKO4MXDT.js → access-5DJJIIGD.js} +3 -3
  2. package/{bugs-J56QQ3CP.js → bugs-NRHU4ENC.js} +21 -13
  3. package/{build-CQ2E2XRO.js → build-5VZJTEBD.js} +7 -7
  4. package/{cache-PPEXAQT7.js → cache-QZ5XII4U.js} +5 -5
  5. package/chunk-2HDWM6AD.js +30 -0
  6. package/{chunk-ED2DDTQT.js → chunk-2YJ5MESP.js} +34 -7
  7. package/{chunk-CHHGSDAP.js → chunk-6NQBG3ZR.js} +3 -3
  8. package/{chunk-SVO3HI2G.js → chunk-6WMR7BLF.js} +6 -6
  9. package/{chunk-JLKFIX2H.js → chunk-A6TBJ4AB.js} +4 -4
  10. package/{chunk-JWWDJYSU.js → chunk-ATYE2HQV.js} +85 -25
  11. package/{chunk-BJBFEQRR.js → chunk-BHJT53TP.js} +1 -0
  12. package/{chunk-GVZRKITF.js → chunk-EBXBZ2Y5.js} +3 -3
  13. package/{chunk-ADYHZTEI.js → chunk-GKCU7R4B.js} +13 -6
  14. package/{chunk-A4EKZ32F.js → chunk-HRY5MJCA.js} +29 -7
  15. package/{chunk-34VLICEH.js → chunk-KCXN2GTX.js} +5 -5
  16. package/{chunk-3NGV7EC6.js → chunk-LHMEJF6J.js} +1183 -220
  17. package/{chunk-OUF2P2OD.js → chunk-MXCWH7WC.js} +17 -5
  18. package/{chunk-CIKUT62L.js → chunk-SBEZ7RUC.js} +2 -2
  19. package/{chunk-RKXQ66T4.js → chunk-USRMYD4F.js} +1 -1
  20. package/{chunk-SVBEF5PK.js → chunk-USTJECVS.js} +4 -4
  21. package/chunk-XEPCV7DP.js +75 -0
  22. package/{chunk-QWTGTFHN.js → chunk-XFI4THXZ.js} +1 -1
  23. package/{chunk-3OPNZI6G.js → chunk-YOE3VZFX.js} +8 -7
  24. package/{ci-WDQ4SQN6.js → ci-MBYD4AGJ.js} +7 -7
  25. package/cli-package.json +1 -1
  26. package/{config-JMARDHLW.js → config-DTZ7EWQF.js} +7 -6
  27. package/{config-XY5CDGTD.js → config-RQKPUW5B.js} +6 -5
  28. package/{create-C24ZGR6S.js → create-CYTNZ66Z.js} +11 -11
  29. package/{deprecate-HYHD5WQC.js → deprecate-H3L4MPZS.js} +7 -7
  30. package/{devtools-66MVSNF5.js → devtools-UEMPW5GG.js} +29 -29
  31. package/{dist-tag-RPQ5LZWM.js → dist-tag-CZHTW7C6.js} +3 -3
  32. package/{docs-UKQNAVM3.js → docs-Z76UCNLH.js} +21 -13
  33. package/{exec-FNZEVDGU.js → exec-PGPFYCAM.js} +11 -11
  34. package/{exec-cache-GRHS57DV.js → exec-cache-HPILZWUY.js} +9 -9
  35. package/{exec-local-AHDW7CKQ.js → exec-local-VKDC6XAQ.js} +9 -9
  36. package/{help-VDBXIWF3.js → help-QPZESL4Y.js} +1 -1
  37. package/{init-2ICZBLI2.js → init-MMQV6UC5.js} +7 -7
  38. package/{install-IFSVVRU5.js → install-KZPDV66V.js} +8 -8
  39. package/{list-RCAPA3OE.js → list-PJ2U4FE7.js} +18 -12
  40. package/{login-T42R75OV.js → login-L3D5FQGT.js} +7 -7
  41. package/{logout-PVR6J2AK.js → logout-SRZ574SQ.js} +3 -3
  42. package/{pack-HPLDE4RB.js → pack-OI5JLA3R.js} +8 -8
  43. package/package.json +1 -1
  44. package/{ping-N5U4XHUU.js → ping-VQ662NAP.js} +3 -3
  45. package/{pkg-VNKZX5JC.js → pkg-HNPRMTWV.js} +8 -8
  46. package/{profile-N7UOXZ2X.js → profile-Z7IOODZ4.js} +3 -3
  47. package/{publish-CRSF7NZP.js → publish-KTUUX25U.js} +11 -11
  48. package/{query-MEAXXYOE.js → query-MV5HKRIT.js} +18 -12
  49. package/registry-BMWXMQS4.js +1 -1
  50. package/registry-client-package.json +1 -1
  51. package/registry-client-src-revalidate.js +81 -21
  52. package/{repo-IRTGGLIC.js → repo-ZBCD65WE.js} +21 -13
  53. package/{reporter-Y7RMSVN4.js → reporter-SDMDYYMJ.js} +72 -72
  54. package/{run-I6HWURSB.js → run-QJK5LA6Q.js} +9 -9
  55. package/{run-exec-BV3RUWQM.js → run-exec-EAASMT5O.js} +9 -9
  56. package/security-archive-src-update-expired.js +6 -7
  57. package/{setup-U6DWTZBA.js → setup-Q7NTAV26.js} +33 -15
  58. package/{src-44BBCHST.js → src-MEEFRFWA.js} +3 -3
  59. package/{src-U4EBFPPT.js → src-MOKZQTH2.js} +163 -205
  60. package/{src-SXMLUOLI.js → src-YVODDQYK.js} +10 -9
  61. package/{token-CTUMLTQP.js → token-NQRHTTKG.js} +3 -3
  62. package/{uninstall-UUFXE47B.js → uninstall-E2SVGYI3.js} +16 -9
  63. package/{unpublish-G4NALOC6.js → unpublish-IE4KYVM4.js} +4 -4
  64. package/{update-BGMQQNYE.js → update-KZOWARII.js} +7 -7
  65. package/{version-QVFPFL6M.js → version-T6PTPZPR.js} +8 -8
  66. package/{view-QFYMJVBE.js → view-MVYV7YZ2.js} +6 -5
  67. package/vlr.js +1 -1
  68. package/vlrx.js +1 -1
  69. package/vlt.js +1 -1
  70. package/vlx.js +1 -1
  71. package/vlxl.js +1 -1
  72. package/{whoami-5D4XUOSP.js → whoami-A5RM2Z7Z.js} +3 -3
  73. package/chunk-NEFV2B5V.js +0 -75
@@ -10,17 +10,19 @@ globalThis.clearInterval = _vlt_clearInterval;
10
10
  import {createRequire as _vlt_createRequire} from "node:module";
11
11
  var require = _vlt_createRequire(import.meta.filename);
12
12
  import {
13
- MermaidImageView
14
- } from "./chunk-ADYHZTEI.js";
13
+ MermaidImageView,
14
+ createGetAuthHeader
15
+ } from "./chunk-GKCU7R4B.js";
15
16
  import {
16
17
  createDiffFilesProvider
17
18
  } from "./chunk-RIYFGX27.js";
19
+ import "./chunk-2HDWM6AD.js";
18
20
  import {
19
21
  createHostContextsMap
20
- } from "./chunk-CHHGSDAP.js";
22
+ } from "./chunk-6NQBG3ZR.js";
21
23
  import {
22
24
  stdout
23
- } from "./chunk-OUF2P2OD.js";
25
+ } from "./chunk-MXCWH7WC.js";
24
26
  import "./chunk-YAIKXFLN.js";
25
27
  import "./chunk-G2YT2GWF.js";
26
28
  import "./chunk-GDJ7JT2R.js";
@@ -34,12 +36,12 @@ import {
34
36
  humanReadableOutput,
35
37
  jsonOutput,
36
38
  mermaidOutput
37
- } from "./chunk-3NGV7EC6.js";
39
+ } from "./chunk-LHMEJF6J.js";
38
40
  import {
39
41
  SecurityArchive
40
- } from "./chunk-ED2DDTQT.js";
41
- import "./chunk-SVBEF5PK.js";
42
- import "./chunk-3OPNZI6G.js";
42
+ } from "./chunk-2YJ5MESP.js";
43
+ import "./chunk-USTJECVS.js";
44
+ import "./chunk-YOE3VZFX.js";
43
45
  import {
44
46
  commandUsage
45
47
  } from "./chunk-PTR5IGFQ.js";
@@ -47,14 +49,15 @@ import "./chunk-XKVU23NC.js";
47
49
  import "./chunk-XISRK3R5.js";
48
50
  import "./chunk-4KCU2KZL.js";
49
51
  import "./chunk-HTOTG4TS.js";
52
+ import "./chunk-ATYE2HQV.js";
50
53
  import "./chunk-HAYXR3MW.js";
51
54
  import "./chunk-E74WGW5C.js";
52
55
  import "./chunk-LPIBYUMT.js";
53
56
  import "./chunk-UBLFPJHV.js";
57
+ import "./chunk-VFBCWAOC.js";
54
58
  import "./chunk-XNLSTHDK.js";
55
- import "./chunk-BJBFEQRR.js";
59
+ import "./chunk-BHJT53TP.js";
56
60
  import "./chunk-VE6CCH33.js";
57
- import "./chunk-VFBCWAOC.js";
58
61
  import {
59
62
  error
60
63
  } from "./chunk-WZWDS3W4.js";
@@ -180,6 +183,7 @@ var command = async (conf) => {
180
183
  const queryString = targetQueryString || positionalQueryString;
181
184
  const hostContexts = await createHostContextsMap(conf);
182
185
  const diffFiles = createDiffFilesProvider(conf.options.projectRoot);
186
+ const getAuthHeader = createGetAuthHeader(conf);
183
187
  const importers = /* @__PURE__ */ new Set();
184
188
  const scopeIDs = [];
185
189
  let scopeNodes;
@@ -193,7 +197,8 @@ var command = async (conf) => {
193
197
  importers: importers2,
194
198
  securityArchive,
195
199
  hostContexts,
196
- diffFiles
200
+ diffFiles,
201
+ getAuthHeader
197
202
  });
198
203
  const { nodes: resultNodes } = await scopeQuery.search(
199
204
  scopeQueryString,
@@ -254,7 +259,8 @@ var command = async (conf) => {
254
259
  importers: importers_,
255
260
  securityArchive,
256
261
  hostContexts,
257
- diffFiles
262
+ diffFiles,
263
+ getAuthHeader
258
264
  });
259
265
  const query = queryString || (graph ? defaultProjectQueryString : defaultLocalScopeQueryString);
260
266
  const {
@@ -19,8 +19,8 @@ import "./chunk-XKVU23NC.js";
19
19
  import {
20
20
  getCommand
21
21
  } from "./chunk-XISRK3R5.js";
22
- import "./chunk-XNLSTHDK.js";
23
22
  import "./chunk-VFBCWAOC.js";
23
+ import "./chunk-XNLSTHDK.js";
24
24
  import {
25
25
  error
26
26
  } from "./chunk-WZWDS3W4.js";
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vltpkg/registry-client",
3
3
  "description": "Fetch package artifacts and metadata from registries",
4
- "version": "1.0.7",
4
+ "version": "1.0.9",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "git+https://github.com/vltpkg/vltpkg.git",
@@ -12599,7 +12599,7 @@ var require_mock_utils = __commonJS({
12599
12599
  kTotalDispatchCount
12600
12600
  } = require_mock_symbols();
12601
12601
  var { serializePathWithQuery } = require_util();
12602
- var { STATUS_CODES } = __require("node:http");
12602
+ var { STATUS_CODES: STATUS_CODES2 } = __require("node:http");
12603
12603
  var {
12604
12604
  types: {
12605
12605
  isPromise
@@ -12807,7 +12807,7 @@ var require_mock_utils = __commonJS({
12807
12807
  return result;
12808
12808
  }
12809
12809
  function getStatusText(statusCode) {
12810
- return STATUS_CODES[statusCode] || "unknown";
12810
+ return STATUS_CODES2[statusCode] || "unknown";
12811
12811
  }
12812
12812
  async function getResponse(body) {
12813
12813
  const buffers = [];
@@ -13220,13 +13220,13 @@ var require_mock_call_history = __commonJS({
13220
13220
  function makeFilterCalls(parameterName) {
13221
13221
  return (parameterValue, logs) => {
13222
13222
  if (typeof parameterValue === "string" || parameterValue == null) {
13223
- return logs.filter((log3) => {
13224
- return log3[parameterName] === parameterValue;
13223
+ return logs.filter((log4) => {
13224
+ return log4[parameterName] === parameterValue;
13225
13225
  });
13226
13226
  }
13227
13227
  if (parameterValue instanceof RegExp) {
13228
- return logs.filter((log3) => {
13229
- return parameterValue.test(log3[parameterName]);
13228
+ return logs.filter((log4) => {
13229
+ return parameterValue.test(log4[parameterName]);
13230
13230
  });
13231
13231
  }
13232
13232
  throw new InvalidArgumentError(`${parameterName} parameter should be one of string, regexp, undefined or null`);
@@ -13321,8 +13321,8 @@ var require_mock_call_history = __commonJS({
13321
13321
  return this.logs.filter(criteria);
13322
13322
  }
13323
13323
  if (criteria instanceof RegExp) {
13324
- return this.logs.filter((log3) => {
13325
- return criteria.test(log3.toString());
13324
+ return this.logs.filter((log4) => {
13325
+ return criteria.test(log4.toString());
13326
13326
  });
13327
13327
  }
13328
13328
  if (typeof criteria === "object" && criteria !== null) {
@@ -13372,13 +13372,13 @@ var require_mock_call_history = __commonJS({
13372
13372
  this.logs = [];
13373
13373
  }
13374
13374
  [kMockCallHistoryAddLog](requestInit) {
13375
- const log3 = new MockCallHistoryLog(requestInit);
13376
- this.logs.push(log3);
13377
- return log3;
13375
+ const log4 = new MockCallHistoryLog(requestInit);
13376
+ this.logs.push(log4);
13377
+ return log4;
13378
13378
  }
13379
13379
  *[Symbol.iterator]() {
13380
- for (const log3 of this.calls()) {
13381
- yield log3;
13380
+ for (const log4 of this.calls()) {
13381
+ yield log4;
13382
13382
  }
13383
13383
  }
13384
13384
  };
@@ -20413,7 +20413,7 @@ var require_fetch = __commonJS({
20413
20413
  var { dataURLProcessor, serializeAMimeType, minimizeSupportedMimeType } = require_data_url();
20414
20414
  var { getGlobalDispatcher } = require_global2();
20415
20415
  var { webidl } = require_webidl();
20416
- var { STATUS_CODES } = __require("node:http");
20416
+ var { STATUS_CODES: STATUS_CODES2 } = __require("node:http");
20417
20417
  var { bytesMatch } = require_subresource_integrity();
20418
20418
  var { createDeferredPromise } = require_promise();
20419
20419
  var { isomorphicEncode } = require_infra();
@@ -21450,7 +21450,7 @@ var require_fetch = __commonJS({
21450
21450
  }
21451
21451
  resolve11({
21452
21452
  status,
21453
- statusText: STATUS_CODES[status],
21453
+ statusText: STATUS_CODES2[status],
21454
21454
  headersList,
21455
21455
  socket
21456
21456
  });
@@ -21474,7 +21474,7 @@ var require_fetch = __commonJS({
21474
21474
  }
21475
21475
  resolve11({
21476
21476
  status,
21477
- statusText: STATUS_CODES[status],
21477
+ statusText: STATUS_CODES2[status],
21478
21478
  headersList,
21479
21479
  socket
21480
21480
  });
@@ -32441,6 +32441,8 @@ var XDG = class {
32441
32441
 
32442
32442
  // ../../src/registry-client/src/index.ts
32443
32443
  import { randomUUID } from "node:crypto";
32444
+ import { readFileSync as readFileSync3 } from "node:fs";
32445
+ import { STATUS_CODES } from "node:http";
32444
32446
  import { availableParallelism } from "node:os";
32445
32447
  import { dirname as dirname4, resolve as resolve10 } from "node:path";
32446
32448
  import { setTimeout as setTimeout3 } from "node:timers/promises";
@@ -33405,7 +33407,8 @@ var otplease = async (client, options, response) => {
33405
33407
  const notice = String(npmNotice);
33406
33408
  const match = otpChallengeNotice.exec(notice);
33407
33409
  if (match?.[1]) {
33408
- await urlOpen(match[1]);
33410
+ await urlOpen(match[1]).catch(() => {
33411
+ });
33409
33412
  log2(notice);
33410
33413
  return {
33411
33414
  retry: {
@@ -33545,6 +33548,7 @@ var readBody = async (response, entry) => {
33545
33548
  var import_undici2 = __toESM(require_undici(), 1);
33546
33549
 
33547
33550
  // ../../src/registry-client/src/index.ts
33551
+ var log3 = (msg) => console.error(msg);
33548
33552
  var isCacheableMethod = (m2) => m2 === "GET" || m2 === "HEAD";
33549
33553
  var cacheKey = (method, url) => `${method !== "GET" ? method + " " : ""}${url}`;
33550
33554
  var { version } = loadPackageJson(
@@ -33700,9 +33704,18 @@ var RegistryClient = class {
33700
33704
  return;
33701
33705
  }
33702
33706
  }
33703
- throw error("Failed to perform web login", { response });
33707
+ const { statusCode } = response;
33708
+ const status = STATUS_CODES[statusCode];
33709
+ throw error(
33710
+ `Failed to perform web login: ${statusCode}${status ? ` ${status}` : ""}`,
33711
+ {
33712
+ code: "EREQUEST",
33713
+ url: webLoginURL,
33714
+ status: statusCode,
33715
+ response
33716
+ }
33717
+ );
33704
33718
  }
33705
- /* c8 ignore stop */
33706
33719
  /**
33707
33720
  * Given a {@link WebAuthChallenge}, open the `authUrl` in a browser and
33708
33721
  * hang on the `doneUrl` until it returns a {@link TokenResponse} object.
@@ -33717,8 +33730,9 @@ var RegistryClient = class {
33717
33730
  }),
33718
33731
  urlOpen(authUrl, { signal }).catch((er) => {
33719
33732
  if (asError(er).name === "AbortError") return;
33720
- ac.abort();
33721
- throw er;
33733
+ log3(
33734
+ `Could not open a browser. Please open ${authUrl} manually.`
33735
+ );
33722
33736
  })
33723
33737
  ]);
33724
33738
  return result;
@@ -33762,6 +33776,52 @@ var RegistryClient = class {
33762
33776
  response
33763
33777
  });
33764
33778
  }
33779
+ /**
33780
+ * Read a valid cached non-JSON body straight off disk, bypassing the
33781
+ * in-memory cache LRU so that a tarball is never held in it.
33782
+ *
33783
+ * One read: the head is decoded from the same bytes the body comes
33784
+ * from, so `cache-unzip` rewriting the head cannot land between the
33785
+ * two and hand back a body at a stale offset.
33786
+ *
33787
+ * Does not log a cache hit -- the caller may still reject the body
33788
+ * and fall back to {@link request}, which logs its own.
33789
+ *
33790
+ * Returns undefined on anything unexpected; callers fall back to
33791
+ * {@link request}.
33792
+ */
33793
+ cachedBody(url, options = {}) {
33794
+ const { integrity, method = "GET" } = options;
33795
+ try {
33796
+ const key = cacheKey(
33797
+ method,
33798
+ typeof url === "string" ? new URL(url) : url
33799
+ );
33800
+ if (this.cache.peek(key)) return void 0;
33801
+ const paths = /* @__PURE__ */ new Set();
33802
+ try {
33803
+ const i2 = this.cache.integrityPath(integrity);
33804
+ if (i2) paths.add(i2);
33805
+ } catch {
33806
+ }
33807
+ paths.add(this.cache.path(key));
33808
+ for (const path2 of paths) {
33809
+ let buf;
33810
+ try {
33811
+ buf = readFileSync3(path2);
33812
+ } catch {
33813
+ continue;
33814
+ }
33815
+ const entry = CacheEntry.decode(buf);
33816
+ if (entry.statusCode !== 200 || !entry.valid || entry.isJSON) {
33817
+ continue;
33818
+ }
33819
+ return { path: path2, body: entry.buffer() };
33820
+ }
33821
+ } catch {
33822
+ }
33823
+ return void 0;
33824
+ }
33765
33825
  async request(url, options = {}) {
33766
33826
  const u2 = typeof url === "string" ? new URL(url) : url;
33767
33827
  const {
@@ -12,22 +12,31 @@ var require = _vlt_createRequire(import.meta.filename);
12
12
  import {
13
13
  require_lib
14
14
  } from "./chunk-CLVRCGOZ.js";
15
+ import {
16
+ openUrl
17
+ } from "./chunk-2HDWM6AD.js";
15
18
  import {
16
19
  createHostContextsMap
17
- } from "./chunk-CHHGSDAP.js";
20
+ } from "./chunk-6NQBG3ZR.js";
18
21
  import {
19
22
  PackageInfoClient
20
- } from "./chunk-A4EKZ32F.js";
23
+ } from "./chunk-HRY5MJCA.js";
21
24
  import "./chunk-ZWKI5OSF.js";
25
+ import "./chunk-MXCWH7WC.js";
26
+ import "./chunk-YAIKXFLN.js";
27
+ import "./chunk-G2YT2GWF.js";
28
+ import "./chunk-GDJ7JT2R.js";
29
+ import "./chunk-5JFRXIK2.js";
30
+ import "./chunk-WGDTG44V.js";
22
31
  import {
23
32
  Query,
24
33
  actual
25
- } from "./chunk-3NGV7EC6.js";
34
+ } from "./chunk-LHMEJF6J.js";
26
35
  import {
27
36
  SecurityArchive
28
- } from "./chunk-ED2DDTQT.js";
29
- import "./chunk-SVBEF5PK.js";
30
- import "./chunk-3OPNZI6G.js";
37
+ } from "./chunk-2YJ5MESP.js";
38
+ import "./chunk-USTJECVS.js";
39
+ import "./chunk-YOE3VZFX.js";
31
40
  import {
32
41
  commandUsage
33
42
  } from "./chunk-PTR5IGFQ.js";
@@ -35,17 +44,16 @@ import {
35
44
  Spec
36
45
  } from "./chunk-XKVU23NC.js";
37
46
  import "./chunk-XISRK3R5.js";
47
+ import "./chunk-4KCU2KZL.js";
38
48
  import "./chunk-HTOTG4TS.js";
39
- import {
40
- urlOpen
41
- } from "./chunk-HAYXR3MW.js";
49
+ import "./chunk-HAYXR3MW.js";
42
50
  import "./chunk-E74WGW5C.js";
43
51
  import "./chunk-LPIBYUMT.js";
44
52
  import "./chunk-UBLFPJHV.js";
53
+ import "./chunk-VFBCWAOC.js";
45
54
  import "./chunk-XNLSTHDK.js";
46
- import "./chunk-BJBFEQRR.js";
55
+ import "./chunk-BHJT53TP.js";
47
56
  import "./chunk-VE6CCH33.js";
48
- import "./chunk-VFBCWAOC.js";
49
57
  import {
50
58
  error
51
59
  } from "./chunk-WZWDS3W4.js";
@@ -168,7 +176,7 @@ var command = async (conf) => {
168
176
  if (!result) {
169
177
  throw error("Unexpected empty result");
170
178
  }
171
- await urlOpen(result.url);
179
+ await openUrl(result.url);
172
180
  return result;
173
181
  }
174
182
  return results;
@@ -185,7 +193,7 @@ var command = async (conf) => {
185
193
  if (!name) {
186
194
  throw error("No package name found");
187
195
  }
188
- await urlOpen(url);
196
+ await openUrl(url);
189
197
  return { url, name };
190
198
  };
191
199
  export {