@vltpkg/cli-js 1.3.8 → 1.4.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 (87) hide show
  1. package/{access-WLKANIOE.js → access-422UGEWN.js} +8 -8
  2. package/{bugs-5Q3QSTWP.js → bugs-RED7Y33Q.js} +17 -17
  3. package/{build-XSFR63AW.js → build-IHMPBWRO.js} +9 -9
  4. package/{cache-UVPK5J5A.js → cache-FJP2RZJX.js} +31 -19
  5. package/cache-unzip-src-unzip.js +21 -1
  6. package/{chunk-IUL6MPP6.js → chunk-2AMOC4DN.js} +4 -4
  7. package/{chunk-BGA3WB7H.js → chunk-4UCADW6S.js} +5 -5
  8. package/{chunk-GZ5MYMBT.js → chunk-5IJTPZXP.js} +1 -1
  9. package/{chunk-43HNQWPQ.js → chunk-5RHABCYI.js} +76 -11
  10. package/{chunk-XCDLOQZZ.js → chunk-5TNXLRW2.js} +33 -20
  11. package/{chunk-IHXJVKAE.js → chunk-5Y4SYLJ2.js} +2 -1
  12. package/chunk-6IF3RJND.js +81 -0
  13. package/{chunk-3U6QWN62.js → chunk-7T3XAYP4.js} +1 -1
  14. package/{chunk-WHLYMMI2.js → chunk-ASLX43R3.js} +3 -3
  15. package/{chunk-OAP2ROTL.js → chunk-C23TDXRG.js} +1 -1
  16. package/{chunk-H77JYU7F.js → chunk-DNRR3XMG.js} +12 -3
  17. package/{chunk-IBGFQR23.js → chunk-FLH4YC6W.js} +21 -0
  18. package/{chunk-XDSZO74H.js → chunk-FZUYGJZU.js} +7 -7
  19. package/{chunk-PJJCFMLW.js → chunk-GIIAODRI.js} +4 -4
  20. package/{chunk-QNDM4DVO.js → chunk-HZXJ423P.js} +1 -1
  21. package/{chunk-CB65DPZ2.js → chunk-I7UMHYZX.js} +151 -27
  22. package/{chunk-6P5CFJR7.js → chunk-ISE4IRHF.js} +4 -4
  23. package/{chunk-TLY4VGMH.js → chunk-LHPEBLOU.js} +1 -1
  24. package/{chunk-EL4GVZK5.js → chunk-MKWPTN3C.js} +2 -2
  25. package/{chunk-5KOLUYXH.js → chunk-OAJ3PO3Z.js} +57 -11
  26. package/{chunk-NWHKSRO3.js → chunk-OVPHE4O7.js} +93 -10
  27. package/{chunk-WKA5UYNA.js → chunk-PHJJPY5G.js} +3 -3
  28. package/{chunk-SV4WK3KX.js → chunk-PLG3OYCX.js} +2 -2
  29. package/{chunk-KMOOTBHM.js → chunk-QCSUWACA.js} +1 -1
  30. package/{chunk-6D54UN4T.js → chunk-SR2VOY5J.js} +1 -1
  31. package/chunk-T6FBP4OU.js +76 -0
  32. package/{chunk-A2TSRXZD.js → chunk-THSYN5EK.js} +1 -1
  33. package/{chunk-DL3H4EMY.js → chunk-TO23PR7J.js} +22 -15
  34. package/{chunk-OWMR2EDW.js → chunk-TPRK6IDA.js} +1 -1
  35. package/chunk-UGCKF5ZE.js +57 -0
  36. package/{chunk-SE2FSMBR.js → chunk-WF6KLKRN.js} +26 -10
  37. package/{chunk-FIUUAQGC.js → chunk-X4FVR4R5.js} +23 -18
  38. package/{chunk-6BQKR2FM.js → chunk-ZJMJ7MCT.js} +1 -1
  39. package/{ci-EDRETPUF.js → ci-YSKNNO5M.js} +10 -10
  40. package/cli-package.json +1 -1
  41. package/{config-MVNXGEOQ.js → config-CSPCDMR3.js} +9 -8
  42. package/{config-OKBXU7TU.js → config-HO7GY3QT.js} +11 -10
  43. package/{create-R7BXYJSU.js → create-2TJT3AHJ.js} +19 -18
  44. package/{deprecate-YSUKBKQM.js → deprecate-7FRJI2RL.js} +11 -11
  45. package/{dist-tag-MIGYSR4F.js → dist-tag-WCFF5OEG.js} +8 -8
  46. package/{docs-4WVIN75H.js → docs-JMBPTU23.js} +17 -17
  47. package/{exec-IXHDQLAM.js → exec-FBOUKZZ2.js} +19 -18
  48. package/{exec-cache-EA7GHIK7.js → exec-cache-X3ZWM5S3.js} +16 -16
  49. package/{exec-local-GM4LH56M.js → exec-local-Y3KQC22N.js} +16 -15
  50. package/{help-TCXGBICU.js → help-PUKVH5X7.js} +4 -4
  51. package/{init-MWZDWQHM.js → init-GOKAQXXZ.js} +10 -10
  52. package/{install-HPI5HU3C.js → install-XFN4UFOC.js} +116 -16
  53. package/{list-2CX6REPJ.js → list-43JFFG5D.js} +19 -19
  54. package/{login-RAY23CVG.js → login-RSTZKNKN.js} +13 -12
  55. package/{logout-ICB5OMGY.js → logout-4576FFXZ.js} +8 -8
  56. package/{outdated-FYHPXRMT.js → outdated-ACQ5A2Y7.js} +15 -15
  57. package/{pack-E5MNPQXK.js → pack-QQVJ3G25.js} +15 -12
  58. package/package.json +1 -1
  59. package/{ping-REQ2KSAR.js → ping-QCDQQRO5.js} +8 -8
  60. package/{pkg-YB4GSRII.js → pkg-CSOJV7UC.js} +17 -12
  61. package/{profile-GKBW6GRI.js → profile-VL4HPW3N.js} +8 -8
  62. package/{publish-4ZQJYYLF.js → publish-2YBO6ZXE.js} +23 -18
  63. package/{query-SKXBF3MJ.js → query-IHHFMJRT.js} +19 -19
  64. package/{registry-MQJJCWJY.js → registry-W7BRZZZ2.js} +5 -5
  65. package/registry-client-src-revalidate.js +75 -9
  66. package/{repo-ACPTZI2C.js → repo-L3BXAAWS.js} +17 -17
  67. package/{reporter-4KK2JNGO.js → reporter-5NYOHBO7.js} +11 -10
  68. package/{run-YW3ITX2A.js → run-AMUUVLTI.js} +16 -15
  69. package/{run-exec-7VQX3OFG.js → run-exec-5W3XWQZA.js} +16 -15
  70. package/security-archive-src-update-expired.js +46 -12
  71. package/{setup-PLEKCMXN.js → setup-TFM4GJF7.js} +16 -15
  72. package/{src-XQ7KVUVN.js → src-4CYCUWZL.js} +29 -24
  73. package/{src-PXDFMQ6W.js → src-I3GMULFP.js} +4 -4
  74. package/{src-GP7VLT7P.js → src-LUTN2ODD.js} +58 -9
  75. package/{token-GB7RPE5J.js → token-OANOBE3G.js} +8 -8
  76. package/{uninstall-RLCECX37.js → uninstall-YXTQ4AIZ.js} +12 -12
  77. package/{unpublish-3ZXEAVHF.js → unpublish-SZXYMYIU.js} +8 -8
  78. package/{update-VDZP6EZN.js → update-FHLMWGIM.js} +16 -15
  79. package/{version-MRELJPOK.js → version-ZWFCTU5V.js} +16 -11
  80. package/{view-LCXMTGCJ.js → view-NFNJXMLV.js} +11 -11
  81. package/vlr.js +1 -1
  82. package/vlrx.js +1 -1
  83. package/vlt.js +1 -1
  84. package/vlx.js +1 -1
  85. package/vlxl.js +1 -1
  86. package/{whoami-PNRDBS45.js → whoami-O7GOSGCI.js} +8 -8
  87. package/chunk-4JAZZRKR.js +0 -76
@@ -11,25 +11,25 @@ import {createRequire as _vlt_createRequire} from "node:module";
11
11
  var require = _vlt_createRequire(import.meta.filename);
12
12
  import {
13
13
  resolveRegistry
14
- } from "./chunk-A2TSRXZD.js";
14
+ } from "./chunk-THSYN5EK.js";
15
15
  import {
16
16
  commandUsage
17
- } from "./chunk-TLY4VGMH.js";
18
- import "./chunk-GZ5MYMBT.js";
19
- import "./chunk-SE2FSMBR.js";
17
+ } from "./chunk-LHPEBLOU.js";
18
+ import "./chunk-5IJTPZXP.js";
19
+ import "./chunk-WF6KLKRN.js";
20
20
  import {
21
21
  RegistryClient
22
- } from "./chunk-5KOLUYXH.js";
22
+ } from "./chunk-OAJ3PO3Z.js";
23
23
  import "./chunk-APMYKJI2.js";
24
24
  import {
25
25
  assertOk
26
- } from "./chunk-6D54UN4T.js";
27
- import "./chunk-6BQKR2FM.js";
26
+ } from "./chunk-SR2VOY5J.js";
27
+ import "./chunk-ZJMJ7MCT.js";
28
28
  import "./chunk-U7TEQCBN.js";
29
29
  import "./chunk-XNLSTHDK.js";
30
30
  import "./chunk-PDWPFR5T.js";
31
31
  import "./chunk-Y5PA7DVK.js";
32
- import "./chunk-IBGFQR23.js";
32
+ import "./chunk-FLH4YC6W.js";
33
33
  import {
34
34
  error
35
35
  } from "./chunk-WZWDS3W4.js";
@@ -14,46 +14,46 @@ import {
14
14
  } from "./chunk-CLVRCGOZ.js";
15
15
  import {
16
16
  openUrl
17
- } from "./chunk-OWMR2EDW.js";
17
+ } from "./chunk-TPRK6IDA.js";
18
18
  import {
19
19
  createHostContextsMap
20
- } from "./chunk-WHLYMMI2.js";
21
- import "./chunk-XDSZO74H.js";
22
- import "./chunk-KMOOTBHM.js";
20
+ } from "./chunk-ASLX43R3.js";
21
+ import "./chunk-FZUYGJZU.js";
22
+ import "./chunk-QCSUWACA.js";
23
23
  import "./chunk-G2YT2GWF.js";
24
- import "./chunk-IHXJVKAE.js";
24
+ import "./chunk-5Y4SYLJ2.js";
25
25
  import {
26
26
  PackageInfoClient
27
- } from "./chunk-DL3H4EMY.js";
27
+ } from "./chunk-TO23PR7J.js";
28
28
  import "./chunk-SRWDPPLX.js";
29
29
  import "./chunk-WGDTG44V.js";
30
- import "./chunk-A2TSRXZD.js";
30
+ import "./chunk-THSYN5EK.js";
31
31
  import {
32
32
  Query,
33
33
  actual
34
- } from "./chunk-NWHKSRO3.js";
34
+ } from "./chunk-OVPHE4O7.js";
35
35
  import {
36
36
  SecurityArchive
37
- } from "./chunk-XCDLOQZZ.js";
37
+ } from "./chunk-5TNXLRW2.js";
38
38
  import {
39
39
  commandUsage
40
- } from "./chunk-TLY4VGMH.js";
41
- import "./chunk-CB65DPZ2.js";
40
+ } from "./chunk-LHPEBLOU.js";
41
+ import "./chunk-I7UMHYZX.js";
42
42
  import "./chunk-4KCU2KZL.js";
43
- import "./chunk-SV4WK3KX.js";
43
+ import "./chunk-PLG3OYCX.js";
44
44
  import {
45
45
  Spec
46
- } from "./chunk-GZ5MYMBT.js";
47
- import "./chunk-SE2FSMBR.js";
46
+ } from "./chunk-5IJTPZXP.js";
47
+ import "./chunk-WF6KLKRN.js";
48
48
  import "./chunk-HTOTG4TS.js";
49
49
  import "./chunk-APMYKJI2.js";
50
- import "./chunk-6D54UN4T.js";
51
- import "./chunk-6BQKR2FM.js";
50
+ import "./chunk-SR2VOY5J.js";
51
+ import "./chunk-ZJMJ7MCT.js";
52
52
  import "./chunk-U7TEQCBN.js";
53
53
  import "./chunk-XNLSTHDK.js";
54
54
  import "./chunk-PDWPFR5T.js";
55
55
  import "./chunk-Y5PA7DVK.js";
56
- import "./chunk-IBGFQR23.js";
56
+ import "./chunk-FLH4YC6W.js";
57
57
  import {
58
58
  error
59
59
  } from "./chunk-WZWDS3W4.js";
@@ -11,24 +11,24 @@ import {createRequire as _vlt_createRequire} from "node:module";
11
11
  var require = _vlt_createRequire(import.meta.filename);
12
12
  import {
13
13
  build
14
- } from "./chunk-NWHKSRO3.js";
15
- import "./chunk-XCDLOQZZ.js";
14
+ } from "./chunk-OVPHE4O7.js";
15
+ import "./chunk-5TNXLRW2.js";
16
16
  import {
17
17
  commandUsage
18
- } from "./chunk-TLY4VGMH.js";
19
- import "./chunk-CB65DPZ2.js";
20
- import "./chunk-SV4WK3KX.js";
21
- import "./chunk-GZ5MYMBT.js";
22
- import "./chunk-SE2FSMBR.js";
18
+ } from "./chunk-LHPEBLOU.js";
19
+ import "./chunk-I7UMHYZX.js";
20
+ import "./chunk-PLG3OYCX.js";
21
+ import "./chunk-5IJTPZXP.js";
22
+ import "./chunk-WF6KLKRN.js";
23
23
  import "./chunk-HTOTG4TS.js";
24
- import "./chunk-6BQKR2FM.js";
24
+ import "./chunk-ZJMJ7MCT.js";
25
25
  import "./chunk-U7TEQCBN.js";
26
26
  import "./chunk-XNLSTHDK.js";
27
27
  import "./chunk-PDWPFR5T.js";
28
28
  import "./chunk-Y5PA7DVK.js";
29
29
  import {
30
30
  isErrorWithCause
31
- } from "./chunk-IBGFQR23.js";
31
+ } from "./chunk-FLH4YC6W.js";
32
32
  import {
33
33
  error
34
34
  } from "./chunk-WZWDS3W4.js";
@@ -15,47 +15,48 @@ import {
15
15
  import {
16
16
  stderr,
17
17
  stdout
18
- } from "./chunk-XDSZO74H.js";
19
- import "./chunk-KMOOTBHM.js";
18
+ } from "./chunk-FZUYGJZU.js";
19
+ import "./chunk-QCSUWACA.js";
20
20
  import "./chunk-G2YT2GWF.js";
21
- import "./chunk-IHXJVKAE.js";
21
+ import "./chunk-5Y4SYLJ2.js";
22
22
  import "./chunk-WGDTG44V.js";
23
- import "./chunk-A2TSRXZD.js";
23
+ import "./chunk-THSYN5EK.js";
24
24
  import {
25
25
  commandUsage
26
- } from "./chunk-TLY4VGMH.js";
26
+ } from "./chunk-LHPEBLOU.js";
27
27
  import {
28
28
  ViewClass
29
29
  } from "./chunk-4KCU2KZL.js";
30
- import "./chunk-SV4WK3KX.js";
30
+ import "./chunk-PLG3OYCX.js";
31
31
  import {
32
32
  Spec
33
- } from "./chunk-GZ5MYMBT.js";
34
- import "./chunk-SE2FSMBR.js";
33
+ } from "./chunk-5IJTPZXP.js";
34
+ import "./chunk-WF6KLKRN.js";
35
35
  import {
36
36
  CacheEntry
37
- } from "./chunk-5KOLUYXH.js";
37
+ } from "./chunk-OAJ3PO3Z.js";
38
38
  import "./chunk-APMYKJI2.js";
39
39
  import {
40
40
  assertOk
41
- } from "./chunk-6D54UN4T.js";
42
- import "./chunk-6BQKR2FM.js";
41
+ } from "./chunk-SR2VOY5J.js";
42
+ import "./chunk-ZJMJ7MCT.js";
43
43
  import "./chunk-U7TEQCBN.js";
44
44
  import "./chunk-XNLSTHDK.js";
45
45
  import {
46
46
  readStoreIndex,
47
47
  removeStoreEntry,
48
48
  storeEntryCopied,
49
+ storeEntryLastCopied,
49
50
  storeEntryLinked,
50
51
  storeEntryNames,
51
52
  storeEntryTime,
52
53
  verifyStoreEntry
53
- } from "./chunk-H77JYU7F.js";
54
+ } from "./chunk-DNRR3XMG.js";
54
55
  import "./chunk-PDWPFR5T.js";
55
56
  import "./chunk-Y5PA7DVK.js";
56
57
  import {
57
58
  integrityHex
58
- } from "./chunk-IBGFQR23.js";
59
+ } from "./chunk-FLH4YC6W.js";
59
60
  import {
60
61
  error
61
62
  } from "./chunk-WZWDS3W4.js";
@@ -78,6 +79,7 @@ var CacheView = class extends ViewClass {
78
79
  var views = {
79
80
  human: CacheView
80
81
  };
82
+ var pruneDays = 30;
81
83
  var usageDef = {
82
84
  command: "cache",
83
85
  usage: "<command> [flags]",
@@ -130,11 +132,14 @@ var usageDef = {
130
132
  a file in \`node_modules\` was edited in place.`
131
133
  },
132
134
  "prune-store": {
133
- usage: "",
135
+ usage: "[<date>]",
134
136
  description: `Remove global store entries that no \`node_modules\`
135
- folder links to. Entries ever copied from (install
136
- scripts, \`store-linker=copy\`, a cache on another
137
- drive) stay: copies do not show use.`
137
+ folder links to. Copies do not show use: an entry
138
+ copied or cloned from (install scripts,
139
+ \`store-linker=copy\`, macOS, a cache on another
140
+ drive) stays if that last happened after
141
+ \`<date>\`, or in the last ${pruneDays} days
142
+ without one.`
138
143
  }
139
144
  },
140
145
  examples: {
@@ -398,14 +403,21 @@ var verify = async (conf, specs, view2) => {
398
403
  ...!all && { missing }
399
404
  };
400
405
  };
401
- var pruneStore = async (conf, _, view2) => {
406
+ var pruneStore = async (conf, args, view2) => {
407
+ const since = args.length ? new Date(args.join(" ")).getTime() : Date.now() - pruneDays * 24 * 60 * 60 * 1e3;
408
+ if (Number.isNaN(since)) {
409
+ throw error("Invalid date", {
410
+ code: "EUSAGE",
411
+ found: args.join(" ")
412
+ });
413
+ }
402
414
  const { storeRoot } = conf.options;
403
415
  const names = storeEntryNames(storeRoot);
404
416
  const removed = {};
405
417
  for (const hex of names) {
406
418
  const entry = resolve(storeRoot, hex);
407
419
  const index = readStoreIndex(entry);
408
- if (storeEntryCopied(entry, index) || storeEntryLinked(entry, index)) {
420
+ if (storeEntryCopied(entry, index) && storeEntryLastCopied(entry) >= since || storeEntryLinked(entry, index)) {
409
421
  continue;
410
422
  }
411
423
  removeStoreEntry(entry);
@@ -34,7 +34,27 @@ function syntaxError(message, cause, from) {
34
34
  }
35
35
 
36
36
  // ../../src/fast-split/src/index.ts
37
+ var splitTwo = (str, delim) => {
38
+ const a = str.indexOf(delim);
39
+ return a === -1 ? [str] : [str.substring(0, a), str.substring(a + delim.length)];
40
+ };
41
+ var splitThree = (str, delim) => {
42
+ const a = str.indexOf(delim);
43
+ if (a === -1) return [str];
44
+ const l = delim.length;
45
+ const b = str.indexOf(delim, a + l);
46
+ return b === -1 ? [str.substring(0, a), str.substring(a + l)] : [
47
+ str.substring(0, a),
48
+ str.substring(a + l, b),
49
+ str.substring(b + l)
50
+ ];
51
+ };
37
52
  function fastSplit(str, delim, limit = -1, onPart) {
53
+ if (onPart === void 0) {
54
+ if (limit === 2) return splitTwo(str, delim);
55
+ if (limit === 3)
56
+ return splitThree(str, delim);
57
+ }
38
58
  let i = 0;
39
59
  let p = 0;
40
60
  const l = delim.length;
@@ -7182,7 +7202,7 @@ import { join as join2 } from "node:path";
7182
7202
  import { performance as performance2 } from "node:perf_hooks";
7183
7203
  import { debuglog as debuglog3 } from "node:util";
7184
7204
  var debug3 = debuglog3("vlt");
7185
- var linkers = /* @__PURE__ */ new Set(["auto", "hardlink", "copy"]);
7205
+ var linkers = /* @__PURE__ */ new Set(["auto", "hardlink", "clone", "copy"]);
7186
7206
  var storeEnabled = () => linkers.has(process.env.VLT_STORE_LINKER ?? "");
7187
7207
  var STALE_MS = 60 * 60 * 1e3;
7188
7208
  var parseConcurrency = (raw) => {
@@ -15,14 +15,14 @@ import {
15
15
  pairsToRecords,
16
16
  registrySelectionFields,
17
17
  registrySelectors
18
- } from "./chunk-43HNQWPQ.js";
18
+ } from "./chunk-5RHABCYI.js";
19
19
  import {
20
20
  normalizeRegistryURL
21
- } from "./chunk-A2TSRXZD.js";
21
+ } from "./chunk-THSYN5EK.js";
22
22
  import {
23
23
  getCommand,
24
24
  isRecordField
25
- } from "./chunk-SE2FSMBR.js";
25
+ } from "./chunk-WF6KLKRN.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-IBGFQR23.js";
36
+ } from "./chunk-FLH4YC6W.js";
37
37
  import {
38
38
  error
39
39
  } from "./chunk-WZWDS3W4.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
  PackageInfoClient
14
- } from "./chunk-DL3H4EMY.js";
14
+ } from "./chunk-TO23PR7J.js";
15
15
  import {
16
16
  RollbackRemove,
17
17
  cmdShim,
18
18
  findCmdShimIfExists,
19
19
  install
20
- } from "./chunk-NWHKSRO3.js";
20
+ } from "./chunk-OVPHE4O7.js";
21
21
  import {
22
22
  PathScurry
23
- } from "./chunk-CB65DPZ2.js";
23
+ } from "./chunk-I7UMHYZX.js";
24
24
  import {
25
25
  Spec
26
- } from "./chunk-GZ5MYMBT.js";
26
+ } from "./chunk-5IJTPZXP.js";
27
27
  import {
28
28
  walkUp
29
29
  } from "./chunk-HTOTG4TS.js";
@@ -32,7 +32,7 @@ import {
32
32
  } from "./chunk-XNLSTHDK.js";
33
33
  import {
34
34
  parseScope
35
- } from "./chunk-IBGFQR23.js";
35
+ } from "./chunk-FLH4YC6W.js";
36
36
  import {
37
37
  error
38
38
  } 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-IBGFQR23.js";
15
+ } from "./chunk-FLH4YC6W.js";
16
16
 
17
17
  // ../../src/spec/src/index.ts
18
18
  import { homedir } from "node:os";
@@ -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
  PackageInfoClient
14
- } from "./chunk-DL3H4EMY.js";
14
+ } from "./chunk-TO23PR7J.js";
15
15
  import {
16
16
  Monorepo,
17
17
  PackageJson,
18
18
  PathScurry
19
- } from "./chunk-CB65DPZ2.js";
19
+ } from "./chunk-I7UMHYZX.js";
20
20
  import {
21
21
  resetCaches
22
- } from "./chunk-SV4WK3KX.js";
22
+ } from "./chunk-PLG3OYCX.js";
23
23
  import {
24
24
  commands,
25
25
  defaultValues,
@@ -28,7 +28,7 @@ import {
28
28
  isRecordField,
29
29
  recordFields,
30
30
  storeLinkers
31
- } from "./chunk-SE2FSMBR.js";
31
+ } from "./chunk-WF6KLKRN.js";
32
32
  import {
33
33
  find,
34
34
  load,
@@ -37,14 +37,21 @@ import {
37
37
  } from "./chunk-HTOTG4TS.js";
38
38
  import {
39
39
  storeRoot
40
- } from "./chunk-6D54UN4T.js";
40
+ } from "./chunk-SR2VOY5J.js";
41
+ import {
42
+ cloneAvailable
43
+ } from "./chunk-6IF3RJND.js";
41
44
  import {
42
45
  assertRecordStringString,
43
46
  assertRecordStringT,
47
+ builtinProtocols,
48
+ defaultGitHosts,
49
+ defaultJsrRegistries,
50
+ defaultRegistries,
44
51
  getOptions,
45
52
  isObject,
46
53
  isRecordStringString
47
- } from "./chunk-IBGFQR23.js";
54
+ } from "./chunk-FLH4YC6W.js";
48
55
  import {
49
56
  error
50
57
  } from "./chunk-WZWDS3W4.js";
@@ -133,6 +140,54 @@ var mergeLayers = (layers) => {
133
140
  return result;
134
141
  };
135
142
 
143
+ // ../../src/cli-sdk/src/config/spec-aliases.ts
144
+ var builtins = {
145
+ registries: defaultRegistries,
146
+ "jsr-registries": defaultJsrRegistries,
147
+ "git-hosts": defaultGitHosts
148
+ };
149
+ var fields = Object.keys(builtins);
150
+ var assertSpecAliases = (values) => {
151
+ const owners = /* @__PURE__ */ new Map();
152
+ for (const field of fields) {
153
+ for (const key of Object.keys(builtins[field])) {
154
+ if (values[field]?.[key] === void 0) {
155
+ owners.set(key, { field, builtin: true });
156
+ }
157
+ }
158
+ }
159
+ for (const field of fields) {
160
+ for (const key of Object.keys(values[field] ?? {})) {
161
+ const name = `${field}.${key}`;
162
+ if (builtinProtocols.has(key)) {
163
+ throw error(
164
+ `${name} shadows the built-in \`${key}:\` protocol`,
165
+ {
166
+ code: "ECONFIG",
167
+ name,
168
+ found: key,
169
+ wanted: "a name that is not a built-in protocol"
170
+ }
171
+ );
172
+ }
173
+ const owner = owners.get(key);
174
+ if (owner) {
175
+ const where = `${owner.field}.${key}${owner.builtin ? " (built-in)" : ""}`;
176
+ throw error(
177
+ `\`${key}:\` spec prefix defined in both ${where} and ${name}`,
178
+ {
179
+ code: "ECONFIG",
180
+ name,
181
+ found: key,
182
+ wanted: `a ${field} name not used by ${owner.field}`
183
+ }
184
+ );
185
+ }
186
+ owners.set(key, { field, builtin: false });
187
+ }
188
+ }
189
+ };
190
+
136
191
  // ../../src/cli-sdk/src/config/index.ts
137
192
  var kCustomInspect = /* @__PURE__ */ Symbol.for("nodejs.util.inspect.custom");
138
193
  var reducePairs = (pairs) => {
@@ -240,6 +295,7 @@ var Config = class _Config {
240
295
  const asRecords = pairsToRecords(this.parse().values);
241
296
  const extras = {
242
297
  projectRoot: this.projectRoot,
298
+ signal: this.#abort.signal,
243
299
  storeRoot: storeRoot(asRecords.cache),
244
300
  scurry,
245
301
  packageJson,
@@ -279,7 +335,7 @@ var Config = class _Config {
279
335
  [kCustomInspect]() {
280
336
  return Object.fromEntries(
281
337
  Object.entries(options).filter(
282
- ([k]) => k !== "monorepo" && k !== "scurry" && k !== "packageJson" && k !== "packageInfo"
338
+ ([k]) => k !== "monorepo" && k !== "scurry" && k !== "packageJson" && k !== "packageInfo" && k !== "signal"
283
339
  )
284
340
  );
285
341
  }
@@ -297,6 +353,11 @@ var Config = class _Config {
297
353
  }
298
354
  // memoized options() getter value
299
355
  #options;
356
+ #abort = new AbortController();
357
+ /** Abort requests still in flight */
358
+ abort() {
359
+ this.#abort.abort();
360
+ }
300
361
  /**
301
362
  * positional arguments to the vlt process
302
363
  */
@@ -355,8 +416,9 @@ var Config = class _Config {
355
416
  if (cmdSpecific) this.jack.setConfigValues(cmdPairs);
356
417
  this.jack.applyDefaults(p);
357
418
  if (p.values["store-linker"] === "auto" && process.platform !== "linux") {
358
- p.values["store-linker"] = "unpack";
359
- envValues["store-linker"] = "unpack";
419
+ const linker = cloneAvailable() ? "clone" : "unpack";
420
+ p.values["store-linker"] = linker;
421
+ envValues["store-linker"] = linker;
360
422
  }
361
423
  const values = p.values;
362
424
  const explicit = {};
@@ -382,6 +444,9 @@ var Config = class _Config {
382
444
  const base = (k in cmdPairs ? cmdPairs[k] : fileValues[k]) ?? [];
383
445
  values[k] = dedupePairs([...base, ...pairs]);
384
446
  }
447
+ if (cmdOrFallback !== "config") {
448
+ assertSpecAliases(pairsToRecords(p.values));
449
+ }
385
450
  this.jack.writeEnv(p);
386
451
  process.env[kParentEnv] = JSON.stringify({
387
452
  explicit,
@@ -585,11 +650,11 @@ var Config = class _Config {
585
650
  * Deletes the specified config fields from the named file
586
651
  * Returns `true` if anything was changed.
587
652
  */
588
- async deleteConfigKeys(which, fields) {
653
+ async deleteConfigKeys(which, fields2) {
589
654
  const data = await this.#maybeLoadConfigFile(which);
590
655
  if (!data) return false;
591
656
  let didSomething = false;
592
- for (const f of fields) {
657
+ for (const f of fields2) {
593
658
  const [key, ...sk] = f.split(".");
594
659
  const subs = sk.join(".");
595
660
  const k = key;
@@ -13,10 +13,10 @@ import {
13
13
  asDepID,
14
14
  baseDepID,
15
15
  splitDepID
16
- } from "./chunk-SV4WK3KX.js";
16
+ } from "./chunk-PLG3OYCX.js";
17
17
  import {
18
18
  userAgent
19
- } from "./chunk-6BQKR2FM.js";
19
+ } from "./chunk-ZJMJ7MCT.js";
20
20
  import {
21
21
  I
22
22
  } from "./chunk-U7TEQCBN.js";
@@ -25,7 +25,7 @@ import {
25
25
  } from "./chunk-XNLSTHDK.js";
26
26
  import {
27
27
  defaultRegistryName
28
- } from "./chunk-IBGFQR23.js";
28
+ } from "./chunk-FLH4YC6W.js";
29
29
  import {
30
30
  error
31
31
  } from "./chunk-WZWDS3W4.js";
@@ -245,6 +245,27 @@ var asPackageReportData = (o) => {
245
245
  }
246
246
  return o;
247
247
  };
248
+ var getItemScore = (data) => {
249
+ if (data._type || !data.score) return void 0;
250
+ const {
251
+ license,
252
+ maintenance,
253
+ quality,
254
+ supplyChain,
255
+ vulnerability
256
+ } = data.score;
257
+ const scoreComponents = [
258
+ license,
259
+ maintenance,
260
+ quality,
261
+ supplyChain,
262
+ vulnerability
263
+ ];
264
+ const overall = Number(
265
+ (scoreComponents.reduce((sum, score) => sum + score, 0) / scoreComponents.length).toFixed(2)
266
+ );
267
+ return { ...data.score, overall };
268
+ };
248
269
 
249
270
  // ../../src/security-archive/src/update-expired.ts
250
271
  import { resolve } from "node:path";
@@ -483,31 +504,23 @@ var SecurityArchive = class _SecurityArchive extends I {
483
504
  for (const line of json) {
484
505
  if (!line.trim()) continue;
485
506
  const data = JSON.parse(line + "}");
507
+ if (data._type) continue;
486
508
  const scope = data.namespace ? `${data.namespace}/` : "";
487
509
  const name = `${scope}${data.name}`;
488
- const node = this.#retrieveNodeByNameVersion(name, data.version);
510
+ const node = this.#retrieveNodeByNameVersion(
511
+ name,
512
+ String(data.version)
513
+ );
489
514
  if (node) {
515
+ const score = getItemScore(data);
516
+ if (!score) continue;
490
517
  const normalizedId = baseDepID(node.id);
491
- fetchedDepIDs.add(baseDepID(node.id));
492
- const scoreComponents = [
493
- data.score.license,
494
- data.score.maintenance,
495
- data.score.quality,
496
- data.score.supplyChain,
497
- data.score.vulnerability
498
- ];
499
- const newAverageScore = Number(
500
- (scoreComponents.reduce((sum, score) => sum + score, 0) / scoreComponents.length).toFixed(2)
501
- );
502
- const scoreWithNewAverage = {
503
- ...data.score,
504
- overall: newAverageScore
505
- };
518
+ fetchedDepIDs.add(normalizedId);
506
519
  this.set(
507
520
  normalizedId,
508
521
  asPackageReportData({
509
522
  ...data,
510
- score: scoreWithNewAverage
523
+ score
511
524
  })
512
525
  );
513
526
  } else {
@@ -12,7 +12,7 @@ var require = _vlt_createRequire(import.meta.filename);
12
12
  import {
13
13
  isError,
14
14
  isObject
15
- } from "./chunk-IBGFQR23.js";
15
+ } from "./chunk-FLH4YC6W.js";
16
16
 
17
17
  // ../../src/output/src/error.ts
18
18
  var parseError = (err) => {
@@ -46,5 +46,6 @@ var asRootError = (v, match) => {
46
46
 
47
47
  export {
48
48
  parseError,
49
+ findRootError,
49
50
  asRootError
50
51
  };