@vltpkg/cli-js 1.1.0 → 1.2.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 (84) hide show
  1. package/{access-GLWBGQLN.js → access-FTHPFPUJ.js} +8 -8
  2. package/{bugs-OCQYFWFE.js → bugs-QS6HQUO2.js} +17 -17
  3. package/{build-CPWGNTCM.js → build-H27SXMAS.js} +11 -11
  4. package/{cache-SL7DQMY2.js → cache-IB4HMFDT.js} +143 -14
  5. package/cache-unzip-src-unzip.js +2934 -164
  6. package/{chunk-TXTK2PKN.js → chunk-3CUFJPBK.js} +1 -1
  7. package/{chunk-CBASIDQH.js → chunk-55DYW2MP.js} +1 -1
  8. package/{chunk-J2XWQVDK.js → chunk-5BD4QGW2.js} +25 -7
  9. package/{chunk-WE2TQN32.js → chunk-5PP77V44.js} +2 -2
  10. package/{chunk-CTQSUNNE.js → chunk-5YB6UIC3.js} +247 -37
  11. package/{chunk-CEHPRPGQ.js → chunk-6A3XS52F.js} +33 -0
  12. package/{chunk-X2AWQGYG.js → chunk-6G7MTZGS.js} +6 -6
  13. package/{chunk-YKCGWKUE.js → chunk-7KFMQ3BR.js} +16 -8
  14. package/{chunk-47M7IZ5P.js → chunk-B2FK2HHL.js} +88 -60
  15. package/{chunk-ZDQJWRCU.js → chunk-FOJCK57G.js} +9 -13
  16. package/{chunk-S6Y57MUS.js → chunk-FSZF2RSQ.js} +4 -4
  17. package/{chunk-VFBCWAOC.js → chunk-G5BSQ6DP.js} +7 -0
  18. package/{chunk-XKVU23NC.js → chunk-G5NJ7CYI.js} +1 -1
  19. package/{chunk-HYCYL4RX.js → chunk-GUATFMMU.js} +37 -5
  20. package/chunk-JTUZP2OD.js +91 -0
  21. package/{chunk-2IMBYPYC.js → chunk-LD4BQJBG.js} +4 -4
  22. package/{chunk-BUXPKRYB.js → chunk-LEGPLJWK.js} +5 -5
  23. package/{chunk-CF5EGH4W.js → chunk-LKQ5R4VX.js} +4 -4
  24. package/{chunk-JSQUYHU7.js → chunk-NJZSCUD4.js} +3 -3
  25. package/{chunk-2PWSMJD7.js → chunk-O44Z6MAV.js} +1 -1
  26. package/{chunk-GJGQTRAT.js → chunk-OE6VHHN4.js} +220 -141
  27. package/{src-MOKZQTH2.js → chunk-QA6RE2GS.js} +249 -28
  28. package/chunk-SPRVRSEL.js +75 -0
  29. package/{chunk-YOE3VZFX.js → chunk-SYGF27W7.js} +2 -2
  30. package/{chunk-TNEMFBP5.js → chunk-UNWQVOLY.js} +14 -12
  31. package/{chunk-SNOBGFNM.js → chunk-UQUIO7LW.js} +47 -6
  32. package/{chunk-TUXWDPCQ.js → chunk-VHHLO5L6.js} +1 -1
  33. package/{chunk-6LEMBT22.js → chunk-YFNQ6HZ3.js} +3 -3
  34. package/{chunk-GDJ7JT2R.js → chunk-YTT3UHUB.js} +1 -1
  35. package/{ci-O2RSLTBX.js → ci-XJBYXFFJ.js} +10 -10
  36. package/cli-package.json +2 -1
  37. package/{config-ZPH7V77F.js → config-4Y46SH5K.js} +8 -8
  38. package/{config-ZBIF32GS.js → config-H2Q4ABSS.js} +12 -12
  39. package/{create-2JX4RV5U.js → create-LUYL2QI4.js} +18 -18
  40. package/{deprecate-XJLP2TUW.js → deprecate-5ANCI2L6.js} +13 -13
  41. package/{dist-tag-F6ZFWGQU.js → dist-tag-SD2CRWIL.js} +8 -8
  42. package/{docs-IJCZZ4V6.js → docs-B6LVNWTP.js} +17 -17
  43. package/{exec-IWSS2LUA.js → exec-CJ5KQA72.js} +18 -18
  44. package/{exec-cache-AG77OOEE.js → exec-cache-EE7DAOW2.js} +16 -16
  45. package/{exec-local-QXPWC4QG.js → exec-local-HT3VBN6S.js} +15 -15
  46. package/{help-TGNDNWLP.js → help-GZ44WYDS.js} +4 -5
  47. package/{init-WU7BRPKR.js → init-HVXRXFVY.js} +10 -10
  48. package/{install-74XKB5N7.js → install-E2C7EE6P.js} +16 -16
  49. package/{list-TOEC6Q3A.js → list-V4V6SHJP.js} +18 -18
  50. package/{login-WJYMAFSL.js → login-VRFV7MCE.js} +12 -12
  51. package/{logout-MTRQWI3L.js → logout-SU75R7BN.js} +8 -8
  52. package/{pack-FFWGLSNC.js → pack-IVGKUXTL.js} +11 -11
  53. package/package.json +1 -1
  54. package/{ping-DWUVTCJB.js → ping-WB222SDT.js} +8 -8
  55. package/{pkg-KNZW5FIA.js → pkg-LAAFNONA.js} +11 -11
  56. package/{profile-6W2ABNXL.js → profile-P3AVHRDI.js} +8 -8
  57. package/{publish-HGNUONU3.js → publish-IUNB3KH5.js} +17 -17
  58. package/{query-FSCYPETX.js → query-XCN55INS.js} +18 -18
  59. package/{registry-YTJZ3AQD.js → registry-QQLWJHJI.js} +5 -5
  60. package/registry-client-src-revalidate.js +5971 -5817
  61. package/{repo-OVIKYYWA.js → repo-BQDWUCX5.js} +17 -17
  62. package/{reporter-ZW7OMRZT.js → reporter-5BVUNWQ6.js} +13 -13
  63. package/{run-UPV3RPQJ.js → run-QT7DX243.js} +15 -15
  64. package/{run-exec-YJSMWMMP.js → run-exec-XYUI7GLN.js} +15 -15
  65. package/security-archive-src-update-expired.js +97 -63
  66. package/{setup-7DPMAPUY.js → setup-CXDJXRAG.js} +40 -22
  67. package/{src-XJT4IJSV.js → src-2BUT4WYP.js} +10 -7
  68. package/src-OKMGXMAD.js +212 -0
  69. package/{src-BNCFK4FH.js → src-UBAERP25.js} +16 -17
  70. package/{token-GA73ER5V.js → token-CBOK6DMT.js} +8 -8
  71. package/{uninstall-E3VKSC3B.js → uninstall-27VP46KJ.js} +12 -12
  72. package/{unpublish-Q6MQHBPQ.js → unpublish-F4637OQX.js} +8 -8
  73. package/{update-4CC44TR5.js → update-NGWLJJ22.js} +15 -15
  74. package/{version-CRZBXNDG.js → version-WPD2KNVC.js} +13 -13
  75. package/{view-ILUULGSO.js → view-YKFTRRPD.js} +11 -11
  76. package/vlr.js +1 -1
  77. package/vlrx.js +1 -1
  78. package/vlt.js +1 -1
  79. package/vlx.js +1 -1
  80. package/vlxl.js +1 -1
  81. package/{whoami-Z4TSLYTR.js → whoami-I5Q6RTAP.js} +8 -8
  82. package/chunk-A75UYRJC.js +0 -75
  83. package/chunk-E74WGW5C.js +0 -49
  84. package/registry-client-package.json +0 -80
@@ -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-CTQSUNNE.js";
14
+ } from "./chunk-5YB6UIC3.js";
15
15
  import {
16
16
  findCmdShimIfExists,
17
17
  install
18
- } from "./chunk-47M7IZ5P.js";
18
+ } from "./chunk-B2FK2HHL.js";
19
19
  import {
20
20
  PathScurry
21
- } from "./chunk-X2AWQGYG.js";
21
+ } from "./chunk-6G7MTZGS.js";
22
22
  import {
23
23
  Spec
24
- } from "./chunk-XKVU23NC.js";
24
+ } from "./chunk-G5NJ7CYI.js";
25
25
  import {
26
26
  walkUp
27
27
  } from "./chunk-HTOTG4TS.js";
28
- import {
29
- parseScope
30
- } from "./chunk-VFBCWAOC.js";
31
28
  import {
32
29
  XDG
33
30
  } from "./chunk-XNLSTHDK.js";
31
+ import {
32
+ parseScope
33
+ } from "./chunk-G5BSQ6DP.js";
34
34
  import {
35
35
  error
36
36
  } from "./chunk-WZWDS3W4.js";
@@ -200,7 +200,7 @@ var vlxInstall = async (spec, options, promptFn) => {
200
200
  resolve3(dir, "package.json"),
201
201
  JSON.stringify(manifest, null, 2) + "\n"
202
202
  );
203
- await install({
203
+ const { graph } = await install({
204
204
  ...options,
205
205
  packageInfo,
206
206
  projectRoot: dir,
@@ -209,6 +209,14 @@ var vlxInstall = async (spec, options, promptFn) => {
209
209
  // allow lifecycle scripts but filter out malware via security archive
210
210
  allowScripts: ":scripts:not(:malware)"
211
211
  });
212
+ const installed = graph.mainImporter.edgesOut.get(pkgSpec.name)?.to;
213
+ if (!manifest.vlx.integrity && installed?.integrity) {
214
+ manifest.vlx.integrity = installed.integrity;
215
+ await writeFile(
216
+ resolve3(dir, "package.json"),
217
+ JSON.stringify(manifest, null, 2) + "\n"
218
+ );
219
+ }
212
220
  return vlxInfo(dir, options, manifest);
213
221
  };
214
222
 
@@ -13,14 +13,14 @@ import {
13
13
  AbortError,
14
14
  SecurityArchive,
15
15
  pRetry
16
- } from "./chunk-ZDQJWRCU.js";
16
+ } from "./chunk-FOJCK57G.js";
17
17
  import {
18
18
  Monorepo,
19
19
  PackageJson,
20
20
  getUser,
21
21
  minimatch,
22
22
  platformCheck
23
- } from "./chunk-X2AWQGYG.js";
23
+ } from "./chunk-6G7MTZGS.js";
24
24
  import {
25
25
  asDepID,
26
26
  baseDepID,
@@ -35,18 +35,28 @@ import {
35
35
  joinExtra,
36
36
  splitDepID,
37
37
  splitExtra
38
- } from "./chunk-YOE3VZFX.js";
38
+ } from "./chunk-SYGF27W7.js";
39
39
  import {
40
40
  Spec as Spec2
41
- } from "./chunk-XKVU23NC.js";
41
+ } from "./chunk-G5NJ7CYI.js";
42
42
  import {
43
43
  load,
44
44
  walkUp
45
45
  } from "./chunk-HTOTG4TS.js";
46
+ import {
47
+ userAgent,
48
+ userAgentHeaders
49
+ } from "./chunk-JTUZP2OD.js";
46
50
  import {
47
51
  graphStep,
48
52
  promiseSpawn
49
53
  } from "./chunk-U7TEQCBN.js";
54
+ import {
55
+ XDG
56
+ } from "./chunk-XNLSTHDK.js";
57
+ import {
58
+ rimraf
59
+ } from "./chunk-BHJT53TP.js";
50
60
  import {
51
61
  Spec,
52
62
  Version,
@@ -86,13 +96,7 @@ import {
86
96
  satisfies,
87
97
  shortDependencyTypes,
88
98
  subset
89
- } from "./chunk-VFBCWAOC.js";
90
- import {
91
- XDG
92
- } from "./chunk-XNLSTHDK.js";
93
- import {
94
- rimraf
95
- } from "./chunk-BHJT53TP.js";
99
+ } from "./chunk-G5BSQ6DP.js";
96
100
  import {
97
101
  error,
98
102
  typeError
@@ -4619,6 +4623,11 @@ var Node = class _Node {
4619
4623
  * Record of binary names to their paths in the package, if any.
4620
4624
  */
4621
4625
  bins;
4626
+ /**
4627
+ * True if the package has a root binding.gyp, when known without a
4628
+ * disk check (placed from the global store). Not persisted.
4629
+ */
4630
+ bindingGyp;
4622
4631
  /**
4623
4632
  * True if this node has been built as part of the reify step.
4624
4633
  */
@@ -5331,7 +5340,7 @@ function hasNodeGypBinding(cwd) {
5331
5340
  }
5332
5341
 
5333
5342
  // ../../src/run/src/index.ts
5334
- var npmConfigUserAgent = `vlt/${process.version.slice(1)} node/${process.version} ${process.platform} ${process.arch}`;
5343
+ var npmConfigUserAgent = userAgent;
5335
5344
  var dotBins = /* @__PURE__ */ new Map();
5336
5345
  var dirExists = (p) => {
5337
5346
  const cached = dotBins.get(p);
@@ -6380,7 +6389,8 @@ var retrieveDistTags = async (node, signal) => {
6380
6389
  url.pathname = `/${node.name}`;
6381
6390
  const response = await fetch(String(url), {
6382
6391
  headers: {
6383
- Accept: "application/vnd.npm.install-v1+json"
6392
+ Accept: "application/vnd.npm.install-v1+json",
6393
+ ...userAgentHeaders
6384
6394
  },
6385
6395
  signal
6386
6396
  });
@@ -6845,7 +6855,8 @@ var retrieveRemoteVersions = async (node, signal, getAuthHeader) => {
6845
6855
  const base = spec2.registry.endsWith("/") ? spec2.registry : `${spec2.registry}/`;
6846
6856
  const url = new URL(node.name, base);
6847
6857
  const headers = {
6848
- Accept: "application/vnd.npm.install-v1+json"
6858
+ Accept: "application/vnd.npm.install-v1+json",
6859
+ ...userAgentHeaders
6849
6860
  };
6850
6861
  const auth = await getAuthHeader?.(String(url));
6851
6862
  if (auth) {
@@ -7153,6 +7164,7 @@ var retrieveRemoteDate = async (node, signal) => {
7153
7164
  const url = new URL(spec2.registry);
7154
7165
  url.pathname = `/${node.name}`;
7155
7166
  const response = await fetch(String(url), {
7167
+ headers: { ...userAgentHeaders },
7156
7168
  signal
7157
7169
  });
7158
7170
  if (response.status === 404) {
@@ -7475,6 +7487,7 @@ var score = async (state) => {
7475
7487
 
7476
7488
  // ../../src/query/src/pseudo/scripts.ts
7477
7489
  var nodeNeedsBuild = (node) => {
7490
+ if (node.buildState === "needed") return true;
7478
7491
  const { manifest } = node;
7479
7492
  if (!manifest) return false;
7480
7493
  if (manifest.hasInstallScript) return true;
@@ -10496,9 +10509,6 @@ var load4 = (options) => {
10496
10509
  return graph;
10497
10510
  };
10498
10511
 
10499
- // ../../src/graph/src/reify/build.ts
10500
- import { join as join2 } from "node:path";
10501
-
10502
10512
  // ../../src/graph/src/non-empty-list.ts
10503
10513
  var isNonEmptyList = (list) => !!list.length;
10504
10514
  var nonEmptyList = (nodes) => isNonEmptyList(nodes) ? nodes : void 0;
@@ -10538,7 +10548,7 @@ var del = (diff2, node) => {
10538
10548
  };
10539
10549
 
10540
10550
  // ../../src/graph/src/reify/bin-chmod.ts
10541
- import { statSync as statSync3, existsSync as existsSync2 } from "node:fs";
10551
+ import { statSync as statSync3 } from "node:fs";
10542
10552
  import { chmod as chmod2 } from "node:fs/promises";
10543
10553
  var binChmodAll = async (nodes, scurry) => {
10544
10554
  const chmods = [];
@@ -10554,19 +10564,31 @@ var binChmod = async (node, scurry) => {
10554
10564
  const path2 = scurry.resolve(
10555
10565
  `${node.resolvedLocation(scurry)}/${bin}`
10556
10566
  );
10557
- if (existsSync2(path2)) {
10558
- chmods.push(makeExecutable(path2));
10567
+ let mode;
10568
+ try {
10569
+ mode = statSync3(path2).mode;
10570
+ } catch {
10571
+ continue;
10559
10572
  }
10573
+ if ((mode & 73) === 73) continue;
10574
+ chmods.push(chmod2(path2, mode & 511 | 73));
10560
10575
  }
10561
10576
  await Promise.all(chmods);
10562
10577
  };
10563
- var execMode = 0;
10564
- var makeExecutable = async (path2) => {
10565
- if (!execMode) {
10566
- execMode = statSync3(path2).mode & 511 | 73;
10578
+
10579
+ // ../../src/graph/src/reify/binding-gyp.ts
10580
+ import { lstatSync } from "node:fs";
10581
+ import { join as join2 } from "node:path";
10582
+ var onDisk = (dir) => {
10583
+ try {
10584
+ return !!lstatSync(join2(dir, "binding.gyp"), {
10585
+ throwIfNoEntry: false
10586
+ })?.isFile();
10587
+ } catch {
10588
+ return false;
10567
10589
  }
10568
- await chmod2(path2, execMode);
10569
10590
  };
10591
+ var hasBindingGyp = (node, scurry) => node.bindingGyp ?? onDisk(node.resolvedLocation(scurry));
10570
10592
 
10571
10593
  // ../../src/graph/src/reify/scripts-manifest.ts
10572
10594
  var scriptsManifest = (manifest, dir, packageJson) => manifest.hasInstallScript && !manifest.scripts ? packageJson.read(dir) : manifest;
@@ -10622,8 +10644,7 @@ var visit = async (packageJson, scurry, node, signal, _path) => {
10622
10644
  preprepare,
10623
10645
  postprepare
10624
10646
  } = scripts2;
10625
- const hasBindingGyp = scurry.lstatSync(join2(node.resolvedLocation(scurry), "binding.gyp"))?.isFile() ?? false;
10626
- const hasImplicitInstall = hasBindingGyp && !install2 && !preinstall;
10647
+ const hasImplicitInstall = hasBindingGyp(node, scurry) && !install2 && !preinstall;
10627
10648
  const runInstall = !!(install2 || preinstall || postinstall) || hasImplicitInstall;
10628
10649
  if (runInstall) {
10629
10650
  await run({
@@ -11761,7 +11782,7 @@ var GraphModifier = class _GraphModifier {
11761
11782
  // ../../src/init/src/index.ts
11762
11783
  import {
11763
11784
  appendFileSync,
11764
- existsSync as existsSync3,
11785
+ existsSync as existsSync2,
11765
11786
  readFileSync as readFileSync3,
11766
11787
  writeFileSync as writeFileSync2
11767
11788
  } from "node:fs";
@@ -11793,7 +11814,7 @@ var GITIGNORE_ENTRY = "node_modules";
11793
11814
  var NPMIGNORE_ENTRY = "vlt.json";
11794
11815
  var ensureGitignore = (cwd) => {
11795
11816
  const gitignorePath = resolve7(cwd, ".gitignore");
11796
- if (!existsSync3(gitignorePath)) {
11817
+ if (!existsSync2(gitignorePath)) {
11797
11818
  writeFileSync2(gitignorePath, `${GITIGNORE_ENTRY}
11798
11819
  `, "utf8");
11799
11820
  return { path: gitignorePath };
@@ -11814,7 +11835,7 @@ var ensureGitignore = (cwd) => {
11814
11835
  };
11815
11836
  var ensureNpmignore = (cwd) => {
11816
11837
  const npmignorePath = resolve7(cwd, ".npmignore");
11817
- if (!existsSync3(npmignorePath)) {
11838
+ if (!existsSync2(npmignorePath)) {
11818
11839
  writeFileSync2(npmignorePath, `${NPMIGNORE_ENTRY}
11819
11840
  `, "utf8");
11820
11841
  return { path: npmignorePath };
@@ -12412,7 +12433,7 @@ var canonicalizePeerIds = (graph, options = {}) => {
12412
12433
  };
12413
12434
 
12414
12435
  // ../../src/graph/src/ideal/move-peer-store-dirs.ts
12415
- import { existsSync as existsSync4 } from "node:fs";
12436
+ import { existsSync as existsSync3 } from "node:fs";
12416
12437
  import { rename as rename2 } from "node:fs/promises";
12417
12438
  var movePeerStoreDirs = async (moves, {
12418
12439
  scurry,
@@ -12456,7 +12477,7 @@ var movePeerStoreDirs = async (moves, {
12456
12477
  }
12457
12478
  return;
12458
12479
  }
12459
- if (!existsSync4(node.resolvedLocation(scurry))) {
12480
+ if (!existsSync3(node.resolvedLocation(scurry))) {
12460
12481
  node.extracted = false;
12461
12482
  }
12462
12483
  })
@@ -12579,39 +12600,42 @@ var extractNode = async (node, scurry, remover, options, packageInfo, diff2) =>
12579
12600
  error: new Error("Platform check failed or package deprecated")
12580
12601
  };
12581
12602
  }
12603
+ const { scripts: scripts2, hasInstallScript } = manifest;
12582
12604
  const extractOptions = {
12583
12605
  from,
12584
12606
  integrity,
12585
12607
  resolved,
12586
- fromLockfile: node.resolvedFromLockfile
12608
+ fromLockfile: node.resolvedFromLockfile,
12609
+ installScripts: !!(hasInstallScript || scripts2?.install || scripts2?.preinstall || scripts2?.postinstall)
12610
+ };
12611
+ const extracted = (r) => {
12612
+ if (r.integrity && !node.integrity) node.integrity = r.integrity;
12613
+ if (r.manifest && !node.manifest) {
12614
+ try {
12615
+ node.manifest = normalizeManifest(
12616
+ asManifest(JSON.parse(r.manifest))
12617
+ );
12618
+ } catch {
12619
+ }
12620
+ }
12621
+ if (r.bindingGyp !== void 0) node.bindingGyp = r.bindingGyp;
12622
+ return { success: true, node };
12587
12623
  };
12588
12624
  try {
12589
12625
  await remover.rm(target);
12590
12626
  if (removeOptionalFailedNode) {
12591
12627
  try {
12592
- const result = await packageInfo.extract(
12593
- spec2,
12594
- target,
12595
- extractOptions
12628
+ return extracted(
12629
+ await packageInfo.extract(spec2, target, extractOptions)
12596
12630
  );
12597
- if (result.integrity && !node.integrity) {
12598
- node.integrity = result.integrity;
12599
- }
12600
- return { success: true, node };
12601
12631
  } catch (error2) {
12602
12632
  removeOptionalFailedNode();
12603
12633
  return { success: false, node, error: error2 };
12604
12634
  }
12605
12635
  } else {
12606
- const result = await packageInfo.extract(
12607
- spec2,
12608
- target,
12609
- extractOptions
12636
+ return extracted(
12637
+ await packageInfo.extract(spec2, target, extractOptions)
12610
12638
  );
12611
- if (result.integrity && !node.integrity) {
12612
- node.integrity = result.integrity;
12613
- }
12614
- return { success: true, node };
12615
12639
  }
12616
12640
  } catch (error2) {
12617
12641
  if (removeOptionalFailedNode) {
@@ -14457,7 +14481,6 @@ var deleteEdges = (diff2, scurry, remover) => {
14457
14481
  };
14458
14482
 
14459
14483
  // ../../src/graph/src/reify/check-needed-build.ts
14460
- import { join as join3 } from "node:path";
14461
14484
  var nodeNeedsBuild2 = (node, scurry, packageJson) => {
14462
14485
  if (node.built) return false;
14463
14486
  let manifest;
@@ -14471,8 +14494,7 @@ var nodeNeedsBuild2 = (node, scurry, packageJson) => {
14471
14494
  const { scripts: scripts2 = {} } = manifest;
14472
14495
  const runInstall = !!(scripts2.install || scripts2.preinstall || scripts2.postinstall);
14473
14496
  if (runInstall) return true;
14474
- const hasBindingGyp = scurry.lstatSync(join3(node.resolvedLocation(scurry), "binding.gyp"))?.isFile() ?? false;
14475
- if (hasBindingGyp && !scripts2.install && !scripts2.preinstall)
14497
+ if (hasBindingGyp(node, scurry) && !scripts2.install && !scripts2.preinstall)
14476
14498
  return true;
14477
14499
  const prepable = node.id.startsWith("git") || node.importer || !node.inVltStore();
14478
14500
  const runPrepare = !!(scripts2.prepare || scripts2.preprepare || scripts2.postprepare) && prepable;
@@ -14913,6 +14935,12 @@ var reify_ = async (options, diff2, remover, saveImportersPackageJson) => {
14913
14935
  );
14914
14936
  if (rmActions.length) await Promise.all(rmActions);
14915
14937
  saveImportersPackageJson?.();
14938
+ for (const node of diff2.nodes.add) {
14939
+ const lfNode = lfData.nodes[node.id];
14940
+ if (lfNode && node.integrity && !lfNode[2]) {
14941
+ lfNode[2] = node.integrity;
14942
+ }
14943
+ }
14916
14944
  saveData(lfData, scurry.resolve("vlt-lock.json"), false);
14917
14945
  if (scurry.lstatSync("vlt.json")) {
14918
14946
  copyFileSync(
@@ -14924,7 +14952,7 @@ var reify_ = async (options, diff2, remover, saveImportersPackageJson) => {
14924
14952
  };
14925
14953
 
14926
14954
  // ../../src/graph/src/install.ts
14927
- import { existsSync as existsSync7, rmSync as rmSync3 } from "node:fs";
14955
+ import { existsSync as existsSync6, rmSync as rmSync3 } from "node:fs";
14928
14956
  import { resolve as resolve12 } from "node:path";
14929
14957
 
14930
14958
  // ../../src/graph/src/lockfile/format-options-change.ts
@@ -14944,7 +14972,7 @@ var formatOptionsChange = ({
14944
14972
  }) => `${section}:${key === void 0 ? "" : ` ${key}`} ` + (from === void 0 ? "(missing)" : `"${redactUserinfo(from)}"`) + ` -> ${to === void 0 ? "(removed)" : `"${redactUserinfo(to)}"`}`;
14945
14973
 
14946
14974
  // ../../src/graph/src/uninstall.ts
14947
- import { existsSync as existsSync5, rmSync } from "node:fs";
14975
+ import { existsSync as existsSync4, rmSync } from "node:fs";
14948
14976
  import { resolve as resolve10 } from "node:path";
14949
14977
  var uninstall = async (options, remove) => {
14950
14978
  const mainManifest = options.packageJson.read(options.projectRoot);
@@ -14996,7 +15024,7 @@ var uninstall = async (options, remove) => {
14996
15024
  options.projectRoot,
14997
15025
  "node_modules/.vlt-lock.json"
14998
15026
  );
14999
- if (existsSync5(hiddenLockfile)) {
15027
+ if (existsSync4(hiddenLockfile)) {
15000
15028
  rmSync(hiddenLockfile, { force: true });
15001
15029
  }
15002
15030
  } catch {
@@ -15006,7 +15034,7 @@ var uninstall = async (options, remove) => {
15006
15034
  };
15007
15035
 
15008
15036
  // ../../src/graph/src/update.ts
15009
- import { existsSync as existsSync6, rmSync as rmSync2 } from "node:fs";
15037
+ import { existsSync as existsSync5, rmSync as rmSync2 } from "node:fs";
15010
15038
  import { resolve as resolve11 } from "node:path";
15011
15039
  var update = async (options) => {
15012
15040
  let mainManifest = void 0;
@@ -15060,7 +15088,7 @@ var update = async (options) => {
15060
15088
  options.projectRoot,
15061
15089
  "node_modules/.vlt-lock.json"
15062
15090
  );
15063
- if (existsSync6(hiddenLockfile)) {
15091
+ if (existsSync5(hiddenLockfile)) {
15064
15092
  rmSync2(hiddenLockfile, { force: true });
15065
15093
  }
15066
15094
  } catch {
@@ -15156,7 +15184,7 @@ var install = async (options, add) => {
15156
15184
  }
15157
15185
  if (options.expectLockfile || options.frozenLockfile) {
15158
15186
  const lockfilePath = resolve12(options.projectRoot, "vlt-lock.json");
15159
- if (!existsSync7(lockfilePath)) {
15187
+ if (!existsSync6(lockfilePath)) {
15160
15188
  throw error(
15161
15189
  "vlt-lock.json file is required when using --expect-lockfile, --frozen-lockfile, or ci command",
15162
15190
  {
@@ -15292,7 +15320,7 @@ var install = async (options, add) => {
15292
15320
  options.projectRoot,
15293
15321
  "node_modules"
15294
15322
  );
15295
- if (existsSync7(nodeModulesPath)) {
15323
+ if (existsSync6(nodeModulesPath)) {
15296
15324
  await remover.rm(nodeModulesPath);
15297
15325
  remover.confirm();
15298
15326
  }
@@ -15360,7 +15388,7 @@ var install = async (options, add) => {
15360
15388
  options.projectRoot,
15361
15389
  "node_modules/.vlt-lock.json"
15362
15390
  );
15363
- if (existsSync7(hiddenLockfile)) {
15391
+ if (existsSync6(hiddenLockfile)) {
15364
15392
  rmSync3(hiddenLockfile, { force: true });
15365
15393
  }
15366
15394
  } catch {
@@ -13,19 +13,19 @@ import {
13
13
  asDepID,
14
14
  baseDepID,
15
15
  splitDepID
16
- } from "./chunk-YOE3VZFX.js";
16
+ } from "./chunk-SYGF27W7.js";
17
17
  import {
18
- loadPackageJson
19
- } from "./chunk-E74WGW5C.js";
18
+ userAgent
19
+ } from "./chunk-JTUZP2OD.js";
20
20
  import {
21
21
  I
22
22
  } from "./chunk-U7TEQCBN.js";
23
- import {
24
- defaultRegistryName
25
- } from "./chunk-VFBCWAOC.js";
26
23
  import {
27
24
  XDG
28
25
  } from "./chunk-XNLSTHDK.js";
26
+ import {
27
+ defaultRegistryName
28
+ } from "./chunk-G5BSQ6DP.js";
29
29
  import {
30
30
  error
31
31
  } from "./chunk-WZWDS3W4.js";
@@ -270,10 +270,6 @@ var usesNpmRegistry = (node) => {
270
270
  // ../../src/security-archive/src/index.ts
271
271
  var SOCKET_API_V0_URL = "https://api.socket.dev/v0/purl?alerts=true";
272
272
  var SOCKET_PUBLIC_API_TOKEN = "sktsec_t_--RAN5U4ivauy4w37-6aoKyYPDt5ZbaT5JBVMqiwKo_api";
273
- var { version } = loadPackageJson(
274
- import.meta.filename,
275
- "cli-package.json"
276
- );
277
273
  var SecurityArchive = class _SecurityArchive extends I {
278
274
  #expired = /* @__PURE__ */ new Set();
279
275
  #path;
@@ -343,9 +339,9 @@ var SecurityArchive = class _SecurityArchive extends I {
343
339
  /**
344
340
  * Retrieves a node using its name and version.
345
341
  */
346
- #retrieveNodeByNameVersion(name, version2) {
342
+ #retrieveNodeByNameVersion(name, version) {
347
343
  for (const node of this.#nodesByName.get(name) ?? []) {
348
- if (node.version === version2) {
344
+ if (node.version === version) {
349
345
  return node;
350
346
  }
351
347
  }
@@ -462,7 +458,7 @@ var SecurityArchive = class _SecurityArchive extends I {
462
458
  method: "POST",
463
459
  headers: {
464
460
  Authorization: `Basic ${Buffer.from(`${SOCKET_PUBLIC_API_TOKEN}:`).toString("base64url")}`,
465
- "User-Agent": `@vltpkg/security-archive/${version}`
461
+ "User-Agent": userAgent
466
462
  },
467
463
  body: JSON.stringify({
468
464
  components: Array.from(queue)
@@ -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-TXTK2PKN.js";
14
+ } from "./chunk-3CUFJPBK.js";
15
15
  import {
16
16
  stderr
17
- } from "./chunk-TNEMFBP5.js";
17
+ } from "./chunk-UNWQVOLY.js";
18
18
  import {
19
19
  mermaidOutput
20
- } from "./chunk-47M7IZ5P.js";
20
+ } from "./chunk-B2FK2HHL.js";
21
21
  import {
22
22
  ViewClass
23
23
  } from "./chunk-4KCU2KZL.js";
24
24
  import {
25
25
  getTokenByURL
26
- } from "./chunk-GJGQTRAT.js";
26
+ } from "./chunk-OE6VHHN4.js";
27
27
 
28
28
  // ../../src/cli-sdk/src/query-auth.ts
29
29
  var createGetAuthHeader = (conf) => async (url) => getTokenByURL(url, conf.options.identity);
@@ -1946,6 +1946,9 @@ var normalizeBinPaths = (manifest) => {
1946
1946
  }
1947
1947
  };
1948
1948
  var isBoolean = (value) => typeof value === "boolean";
1949
+ var integrityRE = /^sha512-[a-zA-Z0-9/+]{86}==$/;
1950
+ var isIntegrity = (i) => typeof i === "string" && integrityRE.test(i);
1951
+ var integrityHex = (i) => isIntegrity(i) ? Buffer.from(i.slice(7), "base64").toString("hex") : void 0;
1949
1952
  var asError = (er, fallbackMessage = "Unknown error") => er instanceof Error ? er : new Error(String(er) || fallbackMessage);
1950
1953
  var isError = (er) => er instanceof Error;
1951
1954
  var isErrorWithCause = (er) => isError(er) && "cause" in er;
@@ -2508,6 +2511,9 @@ export {
2508
2511
  isSpec,
2509
2512
  currentDefaultRegistryName,
2510
2513
  Spec,
2514
+ normalizeBinPaths,
2515
+ integrityRE,
2516
+ integrityHex,
2511
2517
  asError,
2512
2518
  isError,
2513
2519
  isErrorWithCause,
@@ -2515,6 +2521,7 @@ export {
2515
2521
  isRecordStringString,
2516
2522
  assertRecordStringString,
2517
2523
  assertRecordStringT,
2524
+ isManifest,
2518
2525
  asManifest,
2519
2526
  normalizeManifest,
2520
2527
  asNormalizedManifest,
@@ -12,7 +12,7 @@ var require = _vlt_createRequire(import.meta.filename);
12
12
  import {
13
13
  Spec,
14
14
  kCustomInspect
15
- } from "./chunk-VFBCWAOC.js";
15
+ } from "./chunk-G5BSQ6DP.js";
16
16
 
17
17
  // ../../src/spec/src/index.ts
18
18
  import { homedir } from "node:os";
@@ -14,10 +14,41 @@ import {
14
14
  } from "./chunk-WGDTG44V.js";
15
15
  import {
16
16
  commandAliases
17
- } from "./chunk-CEHPRPGQ.js";
18
- import {
19
- loadPackageJson
20
- } from "./chunk-E74WGW5C.js";
17
+ } from "./chunk-6A3XS52F.js";
18
+
19
+ // ../../node_modules/.vlt/~npm~package-json-from-dist@1.0.1/node_modules/package-json-from-dist/dist/esm/index.js
20
+ import { readFileSync } from "node:fs";
21
+ import { dirname, resolve, sep } from "node:path";
22
+ import { fileURLToPath } from "node:url";
23
+ var NM = `${sep}node_modules${sep}`;
24
+ var STORE = `.store${sep}`;
25
+ var PKG = `${sep}package${sep}`;
26
+ var DIST = `${sep}dist${sep}`;
27
+ var findPackageJson = (from, pathFromSrc = "../package.json") => {
28
+ const f = typeof from === "object" || from.startsWith("file://") ? fileURLToPath(from) : from;
29
+ const __dirname = dirname(f);
30
+ const nms = __dirname.lastIndexOf(NM);
31
+ if (nms !== -1) {
32
+ const nm = __dirname.substring(0, nms + NM.length);
33
+ const pkgDir = __dirname.substring(nms + NM.length);
34
+ if (pkgDir.startsWith(STORE)) {
35
+ const pkg = pkgDir.indexOf(PKG, STORE.length);
36
+ if (pkg) {
37
+ return resolve(nm, pkgDir.substring(0, pkg + PKG.length), "package.json");
38
+ }
39
+ }
40
+ const pkgName = pkgDir.startsWith("@") ? pkgDir.split(sep, 2).join(sep) : String(pkgDir.split(sep)[0]);
41
+ return resolve(nm, pkgName, "package.json");
42
+ } else {
43
+ const d = __dirname.lastIndexOf(DIST);
44
+ if (d !== -1) {
45
+ return resolve(__dirname.substring(0, d), "package.json");
46
+ } else {
47
+ return resolve(__dirname, pathFromSrc);
48
+ }
49
+ }
50
+ };
51
+ var loadPackageJson = (from, pathFromSrc = "../package.json") => JSON.parse(readFileSync(findPackageJson(from, pathFromSrc), "utf8"));
21
52
 
22
53
  // ../../src/cli-sdk/src/custom-help.ts
23
54
  var { version } = loadPackageJson(
@@ -76,7 +107,7 @@ var commandHelp = {
76
107
  defaultOrder: 4
77
108
  },
78
109
  cache: {
79
- args: "[add|ls|info|clean|delete|delete-before|delete-all]",
110
+ args: "[add|ls|info|clean|delete|delete-before|delete-all|verify|prune-store]",
80
111
  desc: "Manage the package cache"
81
112
  },
82
113
  ci: {
@@ -368,6 +399,7 @@ ${s("dim", `Run \`vlt help <command>\` for detailed information about a specific
368
399
  };
369
400
 
370
401
  export {
402
+ loadPackageJson,
371
403
  generateDefaultHelp,
372
404
  generateFullHelp
373
405
  };