@vltpkg/cli-js 1.5.0 → 1.6.0

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 (98) hide show
  1. package/{access-QPX4QXV4.js → access-AJ654YKY.js} +8 -8
  2. package/{bugs-TLOECXEM.js → bugs-N73DVYHD.js} +23 -19
  3. package/{build-IQOS3LKO.js → build-VZ3EZKMM.js} +49 -14
  4. package/{cache-O5IBYYSB.js → cache-VROEWG2C.js} +16 -13
  5. package/cache-unzip-src-unzip.js +23 -4
  6. package/{chunk-7UWRR6EE.js → chunk-22LZBDEC.js} +1 -1
  7. package/{chunk-4UH3KMTD.js → chunk-36UIE654.js} +252 -448
  8. package/{chunk-43EJ4Q42.js → chunk-3JIN46K5.js} +1 -1
  9. package/{chunk-35EG6T3J.js → chunk-44AWMA4F.js} +21 -9
  10. package/chunk-4E65BBTM.js +77 -0
  11. package/{chunk-5KW6AOTT.js → chunk-4GMNWW4C.js} +1 -1
  12. package/{chunk-LUVDMEW4.js → chunk-6D3QAFNZ.js} +1 -1
  13. package/{chunk-6W5XMVIZ.js → chunk-75HGJVNG.js} +7 -7
  14. package/{chunk-UZ6ICZE3.js → chunk-7M2VTFLP.js} +12 -1
  15. package/{chunk-XCSNI6AO.js → chunk-ANW36H4T.js} +4 -4
  16. package/{chunk-6LZM3I4Q.js → chunk-BF5DRGRZ.js} +25 -4
  17. package/chunk-BH5CVXNY.js +115 -0
  18. package/{chunk-F7NPYSI2.js → chunk-CAV7FKWQ.js} +2 -2
  19. package/{chunk-MYX4JCIJ.js → chunk-CYK6I4M6.js} +1 -1
  20. package/chunk-DXED4ARV.js +436 -0
  21. package/chunk-E74WGW5C.js +49 -0
  22. package/{chunk-CMLDLZZ3.js → chunk-EFHOWRKU.js} +56 -0
  23. package/{chunk-IFEZ6BFV.js → chunk-EMTGRCSE.js} +2 -2
  24. package/{chunk-4TSHLSRK.js → chunk-EYGOEAJM.js} +1 -1
  25. package/{chunk-2U4PVHP4.js → chunk-F5LZMLAQ.js} +123 -40
  26. package/{chunk-Z5D5KODU.js → chunk-FXD3IV2S.js} +4 -2
  27. package/chunk-GCTREKA4.js +115 -0
  28. package/{chunk-G3FZ2ZJK.js → chunk-GEQFMH5M.js} +1 -1
  29. package/{chunk-CS6AYPY5.js → chunk-GZVI75KX.js} +6 -13
  30. package/{chunk-CW56EJIL.js → chunk-HT6FS4VB.js} +1 -1
  31. package/{chunk-LH7J5BDU.js → chunk-IXAMCWIT.js} +3 -3
  32. package/{chunk-ARE7FKDG.js → chunk-JCNI6ZHH.js} +5 -5
  33. package/chunk-JV5XR5JQ.js +349 -0
  34. package/{chunk-IJUVVD7E.js → chunk-KD5ZK72K.js} +1 -1
  35. package/{chunk-WHWPAYZY.js → chunk-KVWGMSPW.js} +26 -6
  36. package/{chunk-VR7NRWAD.js → chunk-LCLRP64K.js} +8 -8
  37. package/{chunk-X6JKMIOU.js → chunk-LGQVZTYR.js} +4 -36
  38. package/{chunk-XCQCYB6G.js → chunk-LP3ORD3D.js} +142 -16
  39. package/chunk-MCDLJZXT.js +82 -0
  40. package/{chunk-ISAMD2FE.js → chunk-N6HV7JWC.js} +1 -1
  41. package/chunk-O6MQ7NN6.js +1155 -0
  42. package/{chunk-3S3W7QEM.js → chunk-PC2HOBAQ.js} +3 -3
  43. package/{chunk-GUP55DM6.js → chunk-RBQO54TG.js} +2 -2
  44. package/{chunk-C6ZVVEFV.js → chunk-TQQO2F56.js} +4 -3
  45. package/{chunk-XD5KUDXX.js → chunk-TWDSXQPN.js} +10 -8
  46. package/{chunk-T5EP7QEF.js → chunk-VLVMLSIF.js} +2 -2
  47. package/{chunk-SMXXFQPI.js → chunk-YTDABXPD.js} +3 -3
  48. package/{ci-ESVUMOZO.js → ci-3BVMVQIT.js} +21 -17
  49. package/cli-package.json +3 -1
  50. package/{config-ZVVLFKR7.js → config-2KQV7N5A.js} +12 -11
  51. package/{config-TMB2X6DW.js → config-EKHBW6I5.js} +10 -9
  52. package/{create-BLTNKSBQ.js → create-QVHNOIV3.js} +28 -24
  53. package/{deprecate-VA6PGHYL.js → deprecate-E254QBH6.js} +12 -12
  54. package/{dist-tag-OYJREFO2.js → dist-tag-SITRFD7O.js} +8 -8
  55. package/{docs-6OC3OQNM.js → docs-IDL2P7CA.js} +23 -19
  56. package/{exec-AZPGFVRY.js → exec-7BK2W2WL.js} +28 -24
  57. package/{exec-cache-D75UY2WI.js → exec-cache-VY46L7DR.js} +24 -20
  58. package/{exec-local-E2JKB4X4.js → exec-local-D7R5T3DF.js} +22 -18
  59. package/{help-UPW77X5N.js → help-RMRIEJQL.js} +5 -4
  60. package/{init-SNO6QL7C.js → init-BGW4HJ6V.js} +13 -12
  61. package/{install-TEJM2YVX.js → install-U5GATZ2N.js} +108 -52
  62. package/{list-NHCC2RNB.js → list-3VG4M2XL.js} +29 -22
  63. package/{login-XNZXCGFD.js → login-PHQWI6S6.js} +14 -13
  64. package/{logout-YCM7O36Q.js → logout-DJCOGRFF.js} +8 -8
  65. package/{outdated-4LA7N63W.js → outdated-JH3O6R3Y.js} +18 -17
  66. package/{pack-RC4CZSWF.js → pack-U5W5YWHK.js} +15 -14
  67. package/package.json +1 -1
  68. package/{ping-RLVAZGDL.js → ping-EKX43AOW.js} +8 -8
  69. package/{pkg-FED5C6TP.js → pkg-SW5GMERT.js} +15 -14
  70. package/{profile-DJZNLQPG.js → profile-UGDRDMQ6.js} +8 -8
  71. package/{publish-54AMVMTQ.js → publish-HTWKK3NN.js} +24 -20
  72. package/{query-ZQLMSJ7O.js → query-YE3FUVGG.js} +29 -22
  73. package/{registry-6HKQYSZX.js → registry-ZGGWVLBM.js} +5 -5
  74. package/registry-client-src-revalidate.js +41 -11
  75. package/{repo-ITA4BLZ4.js → repo-WDOCU6SE.js} +23 -19
  76. package/{reporter-UYVR2WMB.js → reporter-N5PAXB26.js} +61 -15
  77. package/{run-TP2HTJRN.js → run-IPARVIIQ.js} +22 -18
  78. package/{run-exec-UGCC53DV.js → run-exec-C4RTREEW.js} +22 -18
  79. package/security-archive-src-update-expired.js +24 -5
  80. package/{setup-XPAM5U3Z.js → setup-SYYUEHZL.js} +206 -27
  81. package/{skills-YD2TB2VD.js → skills-KA2VR5Q5.js} +41 -56
  82. package/{skills-LR6GXW3X.js → skills-UBBMSBDQ.js} +24 -21
  83. package/{src-34D4DOOH.js → src-FUSTSM4J.js} +25 -19
  84. package/{src-H6DFCAPH.js → src-QO5G2S4O.js} +6 -4
  85. package/{src-LHDC4NJO.js → src-W2VQULRG.js} +2 -2
  86. package/{token-OF63PFTQ.js → token-UQNABECH.js} +10 -9
  87. package/{uninstall-B54FQ5KQ.js → uninstall-FHBJ3OUV.js} +53 -17
  88. package/{unpublish-CSHIGMDQ.js → unpublish-APJTEUBA.js} +8 -8
  89. package/{update-HS4VJ5ZG.js → update-NWZTL4S7.js} +19 -17
  90. package/{version-L7S3DHUS.js → version-EMKKTL77.js} +14 -13
  91. package/{view-NWKKWFVA.js → view-BUUI33RV.js} +12 -12
  92. package/vlr.js +1 -1
  93. package/vlrx.js +1 -1
  94. package/vlt.js +1 -1
  95. package/vlx.js +1 -1
  96. package/vlxl.js +1 -1
  97. package/{whoami-65K35VGW.js → whoami-F6BSXGQ2.js} +8 -8
  98. package/chunk-T2VBCUF5.js +0 -77
@@ -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
  graphRunSync
14
- } from "./chunk-F7NPYSI2.js";
14
+ } from "./chunk-CAV7FKWQ.js";
15
15
 
16
16
  // ../../src/cli-sdk/src/sort-scope-locations.ts
17
17
  import { resolve } from "node:path";
@@ -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-GEQFMH5M.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,
@@ -0,0 +1,77 @@
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-AJ654YKY.js"),
22
+ "./commands/bugs.ts": () => import("./bugs-N73DVYHD.js"),
23
+ "./commands/build.ts": () => import("./build-VZ3EZKMM.js"),
24
+ "./commands/cache.ts": () => import("./cache-VROEWG2C.js"),
25
+ "./commands/ci.ts": () => import("./ci-3BVMVQIT.js"),
26
+ "./commands/config.ts": () => import("./config-2KQV7N5A.js"),
27
+ "./commands/create.ts": () => import("./create-QVHNOIV3.js"),
28
+ "./commands/deprecate.ts": () => import("./deprecate-E254QBH6.js"),
29
+ "./commands/dist-tag.ts": () => import("./dist-tag-SITRFD7O.js"),
30
+ "./commands/docs.ts": () => import("./docs-IDL2P7CA.js"),
31
+ "./commands/exec-cache.ts": () => import("./exec-cache-VY46L7DR.js"),
32
+ "./commands/exec-local.ts": () => import("./exec-local-D7R5T3DF.js"),
33
+ "./commands/exec.ts": () => import("./exec-7BK2W2WL.js"),
34
+ "./commands/help.ts": () => import("./help-RMRIEJQL.js"),
35
+ "./commands/init.ts": () => import("./init-BGW4HJ6V.js"),
36
+ "./commands/install.ts": () => import("./install-U5GATZ2N.js"),
37
+ "./commands/install/reporter.ts": () => import("./reporter-N5PAXB26.js"),
38
+ "./commands/list.ts": () => import("./list-3VG4M2XL.js"),
39
+ "./commands/login.ts": () => import("./login-PHQWI6S6.js"),
40
+ "./commands/logout.ts": () => import("./logout-DJCOGRFF.js"),
41
+ "./commands/outdated.ts": () => import("./outdated-JH3O6R3Y.js"),
42
+ "./commands/pack.ts": () => import("./pack-U5W5YWHK.js"),
43
+ "./commands/ping.ts": () => import("./ping-EKX43AOW.js"),
44
+ "./commands/pkg.ts": () => import("./pkg-SW5GMERT.js"),
45
+ "./commands/profile.ts": () => import("./profile-UGDRDMQ6.js"),
46
+ "./commands/publish.ts": () => import("./publish-HTWKK3NN.js"),
47
+ "./commands/query.ts": () => import("./query-YE3FUVGG.js"),
48
+ "./commands/registry.ts": () => import("./registry-ZGGWVLBM.js"),
49
+ "./commands/repo.ts": () => import("./repo-WDOCU6SE.js"),
50
+ "./commands/run-exec.ts": () => import("./run-exec-C4RTREEW.js"),
51
+ "./commands/run.ts": () => import("./run-IPARVIIQ.js"),
52
+ "./commands/setup.ts": () => import("./setup-SYYUEHZL.js"),
53
+ "./commands/skills.ts": () => import("./skills-UBBMSBDQ.js"),
54
+ "./commands/token.ts": () => import("./token-UQNABECH.js"),
55
+ "./commands/uninstall.ts": () => import("./uninstall-FHBJ3OUV.js"),
56
+ "./commands/unpublish.ts": () => import("./unpublish-APJTEUBA.js"),
57
+ "./commands/update.ts": () => import("./update-NWZTL4S7.js"),
58
+ "./commands/version.ts": () => import("./version-EMKKTL77.js"),
59
+ "./commands/view.ts": () => import("./view-BUUI33RV.js"),
60
+ "./commands/whoami.ts": () => import("./whoami-F6BSXGQ2.js")
61
+ });
62
+
63
+ // ../../src/cli-sdk/src/load-command.ts
64
+ var loadCommand = async (command) => {
65
+ try {
66
+ return await globImport_commands_ts(`./commands/${command}.ts`);
67
+ } catch (e) {
68
+ throw error("Could not load command", {
69
+ found: command,
70
+ cause: e
71
+ });
72
+ }
73
+ };
74
+
75
+ export {
76
+ loadCommand
77
+ };
@@ -12,7 +12,7 @@ var require = _vlt_createRequire(import.meta.filename);
12
12
  import {
13
13
  asError,
14
14
  isObject
15
- } from "./chunk-6LZM3I4Q.js";
15
+ } from "./chunk-BF5DRGRZ.js";
16
16
  import {
17
17
  error
18
18
  } from "./chunk-WZWDS3W4.js";
@@ -12,7 +12,7 @@ var require = _vlt_createRequire(import.meta.filename);
12
12
  import {
13
13
  Spec,
14
14
  kCustomInspect
15
- } from "./chunk-6LZM3I4Q.js";
15
+ } from "./chunk-BF5DRGRZ.js";
16
16
 
17
17
  // ../../src/spec/src/index.ts
18
18
  import { homedir } from "node:os";
@@ -11,34 +11,34 @@ import {createRequire as _vlt_createRequire} from "node:module";
11
11
  var require = _vlt_createRequire(import.meta.filename);
12
12
  import {
13
13
  sortScopeLocations
14
- } from "./chunk-43EJ4Q42.js";
14
+ } from "./chunk-3JIN46K5.js";
15
15
  import {
16
16
  createDiffFilesProvider
17
17
  } from "./chunk-RIYFGX27.js";
18
18
  import {
19
19
  createHostContextsMap
20
- } from "./chunk-ARE7FKDG.js";
20
+ } from "./chunk-JCNI6ZHH.js";
21
21
  import {
22
22
  actual,
23
23
  isRunResult
24
- } from "./chunk-4UH3KMTD.js";
24
+ } from "./chunk-36UIE654.js";
25
25
  import {
26
26
  Query
27
- } from "./chunk-2U4PVHP4.js";
27
+ } from "./chunk-F5LZMLAQ.js";
28
28
  import {
29
29
  stderr,
30
30
  stdout,
31
31
  styleTextStdout
32
- } from "./chunk-WHWPAYZY.js";
32
+ } from "./chunk-KVWGMSPW.js";
33
33
  import {
34
34
  require_emoji_regex
35
35
  } from "./chunk-VTEFO2FT.js";
36
36
  import {
37
37
  Monorepo
38
- } from "./chunk-C6ZVVEFV.js";
38
+ } from "./chunk-TQQO2F56.js";
39
39
  import {
40
40
  isErrorWithCause
41
- } from "./chunk-6LZM3I4Q.js";
41
+ } from "./chunk-BF5DRGRZ.js";
42
42
  import {
43
43
  error
44
44
  } from "./chunk-WZWDS3W4.js";
@@ -9,12 +9,15 @@ globalThis.setInterval = _vlt_setInterval;
9
9
  globalThis.clearInterval = _vlt_clearInterval;
10
10
  import {createRequire as _vlt_createRequire} from "node:module";
11
11
  var require = _vlt_createRequire(import.meta.filename);
12
+ import {
13
+ Spec
14
+ } from "./chunk-6D3QAFNZ.js";
12
15
  import {
13
16
  defaultRegistries,
14
17
  defaultRegistryName,
15
18
  isErrorWithCause,
16
19
  isObject
17
- } from "./chunk-6LZM3I4Q.js";
20
+ } from "./chunk-BF5DRGRZ.js";
18
21
  import {
19
22
  error
20
23
  } from "./chunk-WZWDS3W4.js";
@@ -85,6 +88,13 @@ var asUnknownSpecPrefix = (er) => {
85
88
  const { found, spec, validOptions } = isErrorWithCause(er) && isObject(er.cause) ? er.cause : {};
86
89
  return typeof found === "string" && /^[^:]+:$/.test(found) && typeof spec === "string" && er.message.startsWith("Protocol ") ? unknownSpecPrefixError(found.slice(0, -1), spec, validOptions) : er;
87
90
  };
91
+ var parseSpecArg = (item, options) => {
92
+ try {
93
+ return Spec.parseArgs(item, options);
94
+ } catch (er) {
95
+ throw asUnknownSpecPrefix(er);
96
+ }
97
+ };
88
98
  var missingNpmRegistryError = (alias = defaultRegistryName) => error(
89
99
  [
90
100
  `Missing ${alias} registry configuration.`,
@@ -163,6 +173,7 @@ export {
163
173
  missingRegistryError,
164
174
  normalizeRegistryURL,
165
175
  asUnknownSpecPrefix,
176
+ parseSpecArg,
166
177
  missingNpmRegistryError,
167
178
  hasConfiguredRegistry,
168
179
  hasNpmRegistry,
@@ -15,14 +15,14 @@ import {
15
15
  pairsToRecords,
16
16
  registrySelectionFields,
17
17
  registrySelectors
18
- } from "./chunk-XCQCYB6G.js";
18
+ } from "./chunk-LP3ORD3D.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";
@@ -802,12 +802,31 @@ var Comparator = class {
802
802
  );
803
803
  }
804
804
  #parseCaret(comp) {
805
- const min = this.#xInclusiveMin(comp);
806
- if (isAny(min)) {
807
- this.tuples.push(min);
805
+ const parsed = this.#parseX(comp);
806
+ if (isXMajor(parsed)) {
807
+ this.tuples.push(this.#getComparatorAny());
808
808
  return;
809
809
  }
810
- const minv = min[1];
810
+ const z = this.includePrerelease ? "0" : void 0;
811
+ if (isXMinor(parsed)) {
812
+ const [M2] = parsed;
813
+ this.tuples.push(
814
+ [">=", new Version(comp, M2, 0, 0, z, void 0)],
815
+ ["<", new Version(comp, M2 + 1, 0, 0, "0", void 0)]
816
+ );
817
+ return;
818
+ }
819
+ if (isXPatch(parsed)) {
820
+ const [M2, m2] = parsed;
821
+ this.tuples.push(
822
+ [">=", new Version(comp, M2, m2, 0, z, void 0)],
823
+ M2 !== 0 ? ["<", new Version(comp, M2 + 1, 0, 0, "0", void 0)] : ["<", new Version(comp, 0, m2 + 1, 0, "0", void 0)]
824
+ );
825
+ return;
826
+ }
827
+ const [M, m, p, pr = z, build] = parsed;
828
+ const minv = new Version(comp, M, m, p, pr, build);
829
+ const min = [">=", minv];
811
830
  if (minv.major !== 0) {
812
831
  this.tuples.push(min, [
813
832
  "<",
@@ -2323,6 +2342,7 @@ var parseRange = (range, includePrerelease = false) => {
2323
2342
  rangeCache.set(key, parsed);
2324
2343
  return parsed;
2325
2344
  };
2345
+ var valid = (version) => !!parse(version);
2326
2346
  var satisfies = (version, range, includePrerelease = false) => {
2327
2347
  if (typeof version === "string") {
2328
2348
  const parsed = parse(version);
@@ -2569,6 +2589,7 @@ export {
2569
2589
  Range,
2570
2590
  parse,
2571
2591
  parseRange,
2592
+ valid,
2572
2593
  satisfies,
2573
2594
  inc,
2574
2595
  rsort,
@@ -0,0 +1,115 @@
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
+
13
+ // ../../src/cli-sdk/src/shell.ts
14
+ import { existsSync } from "node:fs";
15
+ import { homedir } from "node:os";
16
+ var shells = /* @__PURE__ */ new Map([
17
+ ["bash", "bash"],
18
+ ["zsh", "zsh"],
19
+ ["fish", "fish"],
20
+ ["nu", "nu"],
21
+ ["pwsh", "pwsh"],
22
+ ["powershell", "pwsh"],
23
+ ["sh", "sh"],
24
+ ["dash", "sh"],
25
+ ["ksh", "sh"],
26
+ ["mksh", "sh"],
27
+ ["ash", "sh"]
28
+ ]);
29
+ var isSep = (c, win32) => c === "/" || win32 && c === "\\";
30
+ var homeRest = (path, home, win32) => !home ? void 0 : path === home ? "" : path.startsWith(home) && isSep(path[home.length], win32) ? path.slice(home.length) : void 0;
31
+ var prettyPath = (path, home = homedir(), win32 = process.platform === "win32") => {
32
+ const rest = homeRest(path, home, win32);
33
+ return rest === void 0 ? path : `~${rest}`;
34
+ };
35
+ var detectShell = (env = process.env, platform = process.platform) => {
36
+ const { SHELL } = env;
37
+ if (SHELL) {
38
+ const name = SHELL.replace(/^.*[\\/]/, "").replace(/\.exe$/i, "").toLowerCase();
39
+ return shells.get(name) ?? "unknown";
40
+ }
41
+ if (platform !== "win32") return "unknown";
42
+ const mods = (env.PSModulePath ?? "").split(";").filter(Boolean);
43
+ return mods.length >= 3 ? "pwsh" : "cmd";
44
+ };
45
+ var opts = ({
46
+ env = process.env,
47
+ platform = process.platform,
48
+ home = homedir()
49
+ }) => ({
50
+ env,
51
+ platform,
52
+ home,
53
+ win32: platform === "win32"
54
+ });
55
+ var escape = (s, chars, esc = "\\") => s.replace(chars, (c) => esc + c);
56
+ var posixInner = (dir, o, chars) => {
57
+ const { home, win32 } = opts(o);
58
+ const slash = (p2) => win32 ? p2.replace(/\\/g, "/") : p2;
59
+ const rest = homeRest(dir, home, win32);
60
+ if (rest !== void 0) return "$HOME" + escape(slash(rest), chars);
61
+ const p = win32 ? slash(dir).replace(
62
+ /^([a-z]):/i,
63
+ (_, d) => `/${d.toLowerCase()}`
64
+ ) : dir;
65
+ return escape(p, chars);
66
+ };
67
+ var shChars = /[\\"$`]/g;
68
+ var posixPath = (dir, o = {}) => `"${posixInner(dir, o, shChars)}"`;
69
+ var fishPath = (dir, o = {}) => `"${posixInner(dir, o, /[\\"$]/g)}"`;
70
+ var shellPathCommand = (shell, dir, o = {}) => {
71
+ const { home, win32 } = opts(o);
72
+ const rest = homeRest(dir, home, win32);
73
+ switch (shell) {
74
+ case "fish":
75
+ return `fish_add_path ${fishPath(dir, o)}`;
76
+ case "nu":
77
+ return `$env.PATH = ($env.PATH | prepend "${escape(dir, /[\\"]/g)}")`;
78
+ case "pwsh": {
79
+ const p = rest === void 0 ? escape(dir, /[`"$]/g, "`") : "$HOME" + escape(rest, /[`"$]/g, "`");
80
+ return `$env:PATH += "${win32 ? ";" : ":"}${p}"`;
81
+ }
82
+ case "cmd":
83
+ return `set "PATH=%PATH%;${rest === void 0 ? dir : "%USERPROFILE%" + rest}"`;
84
+ default:
85
+ return `export PATH="${posixInner(dir, o, shChars)}:$PATH"`;
86
+ }
87
+ };
88
+ var shellRcFile = (shell, o = {}) => {
89
+ const { env, platform, home, win32 } = opts(o);
90
+ switch (shell) {
91
+ case "zsh":
92
+ return prettyPath(`${env.ZDOTDIR || home}/.zshrc`, home, win32);
93
+ case "bash": {
94
+ const has = (f2) => existsSync(`${home}/${f2}`);
95
+ if (platform !== "darwin" && has(".bashrc")) return "~/.bashrc";
96
+ const f = [".bash_profile", ".bash_login"].find(has);
97
+ return `~/${f ?? ".profile"}`;
98
+ }
99
+ case "sh":
100
+ return env.ENV ? prettyPath(env.ENV, home, win32) : "~/.profile";
101
+ case "pwsh":
102
+ return "$PROFILE";
103
+ default:
104
+ return void 0;
105
+ }
106
+ };
107
+
108
+ export {
109
+ prettyPath,
110
+ detectShell,
111
+ posixPath,
112
+ fishPath,
113
+ shellPathCommand,
114
+ shellRcFile
115
+ };
@@ -11,12 +11,12 @@ import {createRequire as _vlt_createRequire} from "node:module";
11
11
  var require = _vlt_createRequire(import.meta.filename);
12
12
  import {
13
13
  Spec as Spec2
14
- } from "./chunk-LUVDMEW4.js";
14
+ } from "./chunk-6D3QAFNZ.js";
15
15
  import {
16
16
  Spec,
17
17
  currentDefaultRegistryName,
18
18
  defaultRegistryName
19
- } from "./chunk-6LZM3I4Q.js";
19
+ } from "./chunk-BF5DRGRZ.js";
20
20
  import {
21
21
  error
22
22
  } from "./chunk-WZWDS3W4.js";
@@ -34,7 +34,7 @@ var run = async (command) => {
34
34
  if (command) {
35
35
  process.argv.splice(2, 0, command);
36
36
  }
37
- const vlt = await import("./src-34D4DOOH.js");
37
+ const vlt = await import("./src-FUSTSM4J.js");
38
38
  await vlt.default();
39
39
  };
40
40