@vltpkg/cli-js 1.5.0 → 1.6.1

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 (99) hide show
  1. package/{access-QPX4QXV4.js → access-YSLEWR2C.js} +8 -8
  2. package/{bugs-TLOECXEM.js → bugs-S6CRUEA2.js} +23 -19
  3. package/{build-IQOS3LKO.js → build-SG3KPX3W.js} +49 -14
  4. package/{cache-O5IBYYSB.js → cache-HA77ROM7.js} +16 -13
  5. package/cache-unzip-src-unzip.js +23 -4
  6. package/{chunk-3S3W7QEM.js → chunk-3E3ISOYM.js} +10 -5
  7. package/{chunk-43EJ4Q42.js → chunk-3JIN46K5.js} +1 -1
  8. package/{chunk-5KW6AOTT.js → chunk-4GMNWW4C.js} +1 -1
  9. package/{chunk-6W5XMVIZ.js → chunk-4UAIPIAV.js} +7 -7
  10. package/{chunk-7UWRR6EE.js → chunk-5Q2HSLVV.js} +1 -1
  11. package/{chunk-LUVDMEW4.js → chunk-6D3QAFNZ.js} +1 -1
  12. package/{chunk-LH7J5BDU.js → chunk-6XVW7CWJ.js} +3 -3
  13. package/{chunk-UZ6ICZE3.js → chunk-7M2VTFLP.js} +12 -1
  14. package/{chunk-XCQCYB6G.js → chunk-AEVT3CHK.js} +142 -16
  15. package/{chunk-SMXXFQPI.js → chunk-AHLBPSGQ.js} +3 -3
  16. package/{chunk-6LZM3I4Q.js → chunk-BF5DRGRZ.js} +25 -4
  17. package/chunk-BH5CVXNY.js +115 -0
  18. package/{chunk-CS6AYPY5.js → chunk-BQMHDAYL.js} +6 -13
  19. package/{chunk-2U4PVHP4.js → chunk-C4RJ4NNS.js} +137 -47
  20. package/{chunk-F7NPYSI2.js → chunk-CAV7FKWQ.js} +2 -2
  21. package/chunk-DXED4ARV.js +436 -0
  22. package/chunk-E74WGW5C.js +49 -0
  23. package/{chunk-CMLDLZZ3.js → chunk-EFHOWRKU.js} +56 -0
  24. package/{chunk-IFEZ6BFV.js → chunk-EMTGRCSE.js} +2 -2
  25. package/{chunk-4TSHLSRK.js → chunk-EYGOEAJM.js} +1 -1
  26. package/{chunk-DBANBIL2.js → chunk-FZCPQWCJ.js} +1 -0
  27. package/chunk-GCTREKA4.js +115 -0
  28. package/{chunk-CW56EJIL.js → chunk-HT6FS4VB.js} +1 -1
  29. package/{chunk-VR7NRWAD.js → chunk-IHERL3TA.js} +17 -16
  30. package/chunk-JV5XR5JQ.js +349 -0
  31. package/{chunk-T5EP7QEF.js → chunk-JZXNHIQE.js} +28 -28
  32. package/{chunk-IJUVVD7E.js → chunk-KD5ZK72K.js} +1 -1
  33. package/{chunk-C6ZVVEFV.js → chunk-KURQHX54.js} +5 -3
  34. package/{chunk-GUP55DM6.js → chunk-L3ZF7OYM.js} +2 -2
  35. package/{chunk-X6JKMIOU.js → chunk-LGQVZTYR.js} +4 -36
  36. package/{chunk-G3FZ2ZJK.js → chunk-M242QVJS.js} +1 -1
  37. package/chunk-MCDLJZXT.js +82 -0
  38. package/{chunk-WHWPAYZY.js → chunk-MSWOR3FV.js} +35 -7
  39. package/chunk-N3V6EK5I.js +77 -0
  40. package/{chunk-ISAMD2FE.js → chunk-N6HV7JWC.js} +1 -1
  41. package/{chunk-MYX4JCIJ.js → chunk-NO53Y3QO.js} +1 -1
  42. package/chunk-O6MQ7NN6.js +1155 -0
  43. package/{chunk-XCSNI6AO.js → chunk-OWL5G4K4.js} +4 -4
  44. package/{chunk-35EG6T3J.js → chunk-Q2UEILN6.js} +21 -9
  45. package/{chunk-Z5D5KODU.js → chunk-VGPLFOJO.js} +4 -2
  46. package/{chunk-ARE7FKDG.js → chunk-W24SBFY5.js} +5 -5
  47. package/{chunk-XD5KUDXX.js → chunk-WMMKUVAT.js} +10 -8
  48. package/{chunk-4UH3KMTD.js → chunk-ZJE3OTP3.js} +258 -451
  49. package/{ci-ESVUMOZO.js → ci-GVLL72SS.js} +21 -17
  50. package/cli-package.json +3 -1
  51. package/{config-ZVVLFKR7.js → config-KH6AEMHI.js} +13 -12
  52. package/{config-TMB2X6DW.js → config-TIPKOPYS.js} +10 -9
  53. package/{create-BLTNKSBQ.js → create-SKNEZEZY.js} +28 -24
  54. package/{deprecate-VA6PGHYL.js → deprecate-RFRLJZVL.js} +12 -12
  55. package/{dist-tag-OYJREFO2.js → dist-tag-LVYOTJHJ.js} +8 -8
  56. package/{docs-6OC3OQNM.js → docs-INXRFEGY.js} +23 -19
  57. package/{exec-AZPGFVRY.js → exec-5MA5XRPZ.js} +28 -24
  58. package/{exec-cache-D75UY2WI.js → exec-cache-7GS4KLWJ.js} +24 -20
  59. package/{exec-local-E2JKB4X4.js → exec-local-RE4KVTMN.js} +22 -18
  60. package/{help-UPW77X5N.js → help-JHLP565L.js} +5 -4
  61. package/{init-SNO6QL7C.js → init-4UFHO67B.js} +13 -12
  62. package/{install-TEJM2YVX.js → install-Z33YVCDK.js} +108 -52
  63. package/{list-NHCC2RNB.js → list-XAMKR6TL.js} +29 -22
  64. package/{login-XNZXCGFD.js → login-6NXUO5FF.js} +14 -13
  65. package/{logout-YCM7O36Q.js → logout-6P7LWTAY.js} +8 -8
  66. package/{outdated-4LA7N63W.js → outdated-YNUSWZJD.js} +18 -17
  67. package/{pack-RC4CZSWF.js → pack-LMQYH75V.js} +15 -14
  68. package/package.json +1 -1
  69. package/{ping-RLVAZGDL.js → ping-VLFZ3WCY.js} +8 -8
  70. package/{pkg-FED5C6TP.js → pkg-JMPBHKSW.js} +16 -15
  71. package/{profile-DJZNLQPG.js → profile-PJJAA2YM.js} +8 -8
  72. package/{publish-54AMVMTQ.js → publish-33RFJ2HJ.js} +24 -20
  73. package/{query-ZQLMSJ7O.js → query-LUUOK57K.js} +29 -22
  74. package/{registry-6HKQYSZX.js → registry-ZGGWVLBM.js} +5 -5
  75. package/registry-client-src-revalidate.js +41 -11
  76. package/{repo-ITA4BLZ4.js → repo-VLHLQP2S.js} +23 -19
  77. package/{reporter-UYVR2WMB.js → reporter-SNSM2TDC.js} +61 -15
  78. package/{run-TP2HTJRN.js → run-USWK7R3N.js} +22 -18
  79. package/{run-exec-UGCC53DV.js → run-exec-PHE44AWW.js} +22 -18
  80. package/security-archive-src-update-expired.js +24 -5
  81. package/{setup-XPAM5U3Z.js → setup-JMY47ERY.js} +206 -27
  82. package/{skills-YD2TB2VD.js → skills-7PYMTDER.js} +41 -56
  83. package/{skills-LR6GXW3X.js → skills-YMMV6TMN.js} +24 -21
  84. package/{src-34D4DOOH.js → src-2ZS4VHJP.js} +25 -19
  85. package/{src-H6DFCAPH.js → src-A5ZJNOHN.js} +6 -4
  86. package/{src-LHDC4NJO.js → src-W2VQULRG.js} +2 -2
  87. package/{token-OF63PFTQ.js → token-YKHELNVQ.js} +10 -9
  88. package/{uninstall-B54FQ5KQ.js → uninstall-Q46HWR5S.js} +53 -17
  89. package/{unpublish-CSHIGMDQ.js → unpublish-LBANPSJ5.js} +8 -8
  90. package/{update-HS4VJ5ZG.js → update-B2EGLZHI.js} +19 -17
  91. package/{version-L7S3DHUS.js → version-IEOBL3NN.js} +14 -13
  92. package/{view-NWKKWFVA.js → view-JCA5VT6F.js} +13 -13
  93. package/vlr.js +1 -1
  94. package/vlrx.js +1 -1
  95. package/vlt.js +1 -1
  96. package/vlx.js +1 -1
  97. package/vlxl.js +1 -1
  98. package/{whoami-65K35VGW.js → whoami-OWJUPO3X.js} +8 -8
  99. package/chunk-T2VBCUF5.js +0 -77
@@ -15,14 +15,14 @@ import {
15
15
  pairsToRecords,
16
16
  registrySelectionFields,
17
17
  registrySelectors
18
- } from "./chunk-XCQCYB6G.js";
18
+ } from "./chunk-AEVT3CHK.js";
19
19
  import {
20
20
  normalizeRegistryURL
21
- } from "./chunk-UZ6ICZE3.js";
21
+ } from "./chunk-7M2VTFLP.js";
22
22
  import {
23
23
  getCommand,
24
24
  isRecordField
25
- } from "./chunk-CMLDLZZ3.js";
25
+ } from "./chunk-EFHOWRKU.js";
26
26
  import {
27
27
  find
28
28
  } from "./chunk-HTOTG4TS.js";
@@ -33,7 +33,7 @@ import {
33
33
  defaultRegistries,
34
34
  defaultRegistryName,
35
35
  isObject
36
- } from "./chunk-6LZM3I4Q.js";
36
+ } from "./chunk-BF5DRGRZ.js";
37
37
  import {
38
38
  error
39
39
  } from "./chunk-WZWDS3W4.js";
@@ -14,14 +14,14 @@ import {
14
14
  } from "./chunk-QNHBAGXQ.js";
15
15
  import {
16
16
  userAgent
17
- } from "./chunk-G3FZ2ZJK.js";
17
+ } from "./chunk-M242QVJS.js";
18
18
  import {
19
19
  assertOk,
20
20
  registryErrorMessage,
21
21
  statusText,
22
22
  storeRoot,
23
23
  tokenRefusal
24
- } from "./chunk-5KW6AOTT.js";
24
+ } from "./chunk-4GMNWW4C.js";
25
25
  import {
26
26
  I,
27
27
  logRequest
@@ -36,7 +36,7 @@ import {
36
36
  asError,
37
37
  integrityHex,
38
38
  integrityRE
39
- } from "./chunk-6LZM3I4Q.js";
39
+ } from "./chunk-BF5DRGRZ.js";
40
40
  import {
41
41
  error
42
42
  } from "./chunk-WZWDS3W4.js";
@@ -26338,13 +26338,14 @@ var setToken = async (registry, token, identity) => {
26338
26338
  kc.set(normalizeRegistryKey(registry), token);
26339
26339
  await kc.save();
26340
26340
  };
26341
- var getToken = async (registry, identity) => {
26341
+ var getToken = async (registry, identity, defaultKey) => {
26342
26342
  const kc = getKC(identity);
26343
26343
  const key = normalizeRegistryKey(registry);
26344
26344
  const rt = runtimeTokens.get(key);
26345
26345
  if (rt) return rt;
26346
26346
  const envReg = process.env.VLT_REGISTRY;
26347
- if (envReg && key === normalizeRegistryKey(envReg)) {
26347
+ const tokKey = envReg ? normalizeRegistryKey(envReg) : defaultKey;
26348
+ if (key === tokKey) {
26348
26349
  const envTok = process.env.VLT_TOKEN;
26349
26350
  if (envTok) return `Bearer ${envTok}`;
26350
26351
  }
@@ -26352,6 +26353,10 @@ var getToken = async (registry, identity) => {
26352
26353
  if (tok) return `Bearer ${tok}`;
26353
26354
  return kc.get(key);
26354
26355
  };
26356
+ var defaultRegistryKey = (o) => {
26357
+ const u = o.registries?.[o["default-registry-alias"] ?? "npm"];
26358
+ return u && URL.canParse(u) ? normalizeRegistryKey(u) : void 0;
26359
+ };
26355
26360
  var registryKeys = (o) => [
26356
26361
  ...new Set(
26357
26362
  [
@@ -26362,20 +26367,21 @@ var registryKeys = (o) => [
26362
26367
  ].filter((u) => !!u && URL.canParse(u)).map(normalizeRegistryKey)
26363
26368
  )
26364
26369
  ];
26365
- var getTokenByURL = async (requestUrl, identity, keys = []) => {
26370
+ var getTokenByURL = async (requestUrl, identity, keys = [], defaultKey) => {
26366
26371
  const normalized = normalizeRegistryKey(requestUrl);
26367
26372
  const candidates = [...runtimeTokens.keys(), ...keys];
26368
26373
  const envReg = process.env.VLT_REGISTRY;
26369
26374
  if (envReg) {
26370
26375
  candidates.push(normalizeRegistryKey(envReg));
26371
26376
  }
26377
+ if (defaultKey) candidates.push(defaultKey);
26372
26378
  const kc = getKC(identity);
26373
26379
  for (const k of await kc.keys()) {
26374
26380
  candidates.push(k);
26375
26381
  }
26376
26382
  const matches = candidates.filter((c) => normalized === c || normalized.startsWith(c + "/")).sort((a, b) => b.length - a.length);
26377
26383
  for (const key of matches) {
26378
- const tok = await getToken(key, identity);
26384
+ const tok = await getToken(key, identity, defaultKey);
26379
26385
  if (tok) return tok;
26380
26386
  }
26381
26387
  };
@@ -27625,6 +27631,8 @@ var RegistryClient = class {
27625
27631
  identity;
27626
27632
  /** configured registry keys; `VLT_TOKEN_<key>` applies under each */
27627
27633
  registryKeys;
27634
+ /** default registry key: gets `VLT_TOKEN` if no `VLT_REGISTRY` */
27635
+ defaultRegistryKey;
27628
27636
  staleWhileRevalidateFactor;
27629
27637
  #session = randomUUID();
27630
27638
  #decoded = /* @__PURE__ */ new WeakMap();
@@ -27651,6 +27659,7 @@ var RegistryClient = class {
27651
27659
  } = options;
27652
27660
  this.identity = identity;
27653
27661
  this.registryKeys = registryKeys(options);
27662
+ this.defaultRegistryKey = defaultRegistryKey(options);
27654
27663
  this.staleWhileRevalidateFactor = staleWhileRevalidateFactor;
27655
27664
  const path = resolve4(cache, "registry-client");
27656
27665
  const store = options.storeRoot ?? storeRoot(cache);
@@ -28039,7 +28048,8 @@ var RegistryClient = class {
28039
28048
  await getTokenByURL(
28040
28049
  String(u),
28041
28050
  this.identity,
28042
- this.registryKeys
28051
+ this.registryKeys,
28052
+ this.defaultRegistryKey
28043
28053
  )
28044
28054
  );
28045
28055
  logRequest(url, "start", { method: o.method });
@@ -28164,7 +28174,8 @@ var RegistryClient = class {
28164
28174
  await getTokenByURL(
28165
28175
  String(u),
28166
28176
  this.identity,
28167
- this.registryKeys
28177
+ this.registryKeys,
28178
+ this.defaultRegistryKey
28168
28179
  )
28169
28180
  );
28170
28181
  }
@@ -28283,6 +28294,7 @@ export {
28283
28294
  deleteToken,
28284
28295
  setToken,
28285
28296
  getToken,
28297
+ defaultRegistryKey,
28286
28298
  registryKeys,
28287
28299
  getTokenByURL,
28288
28300
  CacheEntry,
@@ -10,14 +10,16 @@ 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
+ defaultRegistryKey,
13
14
  getTokenByURL,
14
15
  registryKeys
15
- } from "./chunk-35EG6T3J.js";
16
+ } from "./chunk-Q2UEILN6.js";
16
17
 
17
18
  // ../../src/cli-sdk/src/query-auth.ts
18
19
  var createGetAuthHeader = (conf) => {
19
20
  const keys = registryKeys(conf.options);
20
- return async (url) => getTokenByURL(url, conf.options.identity, keys);
21
+ const def = defaultRegistryKey(conf.options);
22
+ return async (url) => getTokenByURL(url, conf.options.identity, keys, def);
21
23
  };
22
24
 
23
25
  export {
@@ -12,13 +12,13 @@ var require = _vlt_createRequire(import.meta.filename);
12
12
  import {
13
13
  actual,
14
14
  createVirtualRoot
15
- } from "./chunk-4UH3KMTD.js";
15
+ } from "./chunk-ZJE3OTP3.js";
16
16
  import {
17
17
  callLimit
18
- } from "./chunk-2U4PVHP4.js";
18
+ } from "./chunk-C4RJ4NNS.js";
19
19
  import {
20
20
  SecurityArchive
21
- } from "./chunk-SMXXFQPI.js";
21
+ } from "./chunk-AHLBPSGQ.js";
22
22
  import {
23
23
  error
24
24
  } from "./chunk-WZWDS3W4.js";
@@ -142,8 +142,8 @@ var reloadConfig = async (folder) => {
142
142
  unload("project");
143
143
  } catch {
144
144
  }
145
- const { Config } = await import("./config-TMB2X6DW.js");
146
- return Config.load(folder, process.argv, true);
145
+ const { Config } = await import("./config-TIPKOPYS.js");
146
+ return Config.load(folder, process.argv, true, false);
147
147
  };
148
148
 
149
149
  // ../../src/cli-sdk/src/query-host-contexts.ts
@@ -10,20 +10,22 @@ 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
- RollbackRemove,
14
- cmdShim,
15
- findCmdShimIfExists,
16
13
  install
17
- } from "./chunk-4UH3KMTD.js";
14
+ } from "./chunk-ZJE3OTP3.js";
18
15
  import {
19
16
  PackageInfoClient
20
- } from "./chunk-VR7NRWAD.js";
17
+ } from "./chunk-IHERL3TA.js";
18
+ import {
19
+ RollbackRemove,
20
+ cmdShim,
21
+ findCmdShimIfExists
22
+ } from "./chunk-JV5XR5JQ.js";
21
23
  import {
22
24
  PathScurry
23
- } from "./chunk-C6ZVVEFV.js";
25
+ } from "./chunk-KURQHX54.js";
24
26
  import {
25
27
  Spec
26
- } from "./chunk-LUVDMEW4.js";
28
+ } from "./chunk-6D3QAFNZ.js";
27
29
  import {
28
30
  walkUp
29
31
  } from "./chunk-HTOTG4TS.js";
@@ -32,7 +34,7 @@ import {
32
34
  } from "./chunk-XNLSTHDK.js";
33
35
  import {
34
36
  parseScope
35
- } from "./chunk-6LZM3I4Q.js";
37
+ } from "./chunk-BF5DRGRZ.js";
36
38
  import {
37
39
  error
38
40
  } from "./chunk-WZWDS3W4.js";