@vltpkg/cli-js 1.0.0-rc.25 → 1.0.0-rc.27

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 (63) hide show
  1. package/{bugs-KSVA7QNG.js → bugs-CS34LDPD.js} +9 -9
  2. package/{build-6QS3HGOJ.js → build-XHEFAWMN.js} +6 -6
  3. package/{cache-PFWAIDXW.js → cache-LII2V5IM.js} +5 -5
  4. package/{chunk-VVTZN4QQ.js → chunk-52LBC3AX.js} +2 -2
  5. package/{chunk-2MGFDD5I.js → chunk-6YTJVEK2.js} +6 -5
  6. package/{chunk-5QLMU4PR.js → chunk-BIUCOMBH.js} +1 -1
  7. package/{chunk-HPK6ZLUY.js → chunk-DJBBJDHI.js} +18 -6
  8. package/{chunk-P2KTSGDO.js → chunk-DJBVQKBB.js} +2 -2
  9. package/{chunk-37DCI4KG.js → chunk-DYL7AFY7.js} +2 -2
  10. package/{chunk-QFA4L7SI.js → chunk-INXSTZAX.js} +110 -53
  11. package/{chunk-XBN4TEBD.js → chunk-JQHMLTO5.js} +1 -1
  12. package/{chunk-GQUU7WYA.js → chunk-LAG2R3YJ.js} +2 -2
  13. package/{chunk-QRBXNJDL.js → chunk-LKFTVDWS.js} +2 -2
  14. package/{chunk-56TWRLHO.js → chunk-P2HZ4ISK.js} +3 -3
  15. package/{chunk-FEV5BCW7.js → chunk-QDGZZ5FZ.js} +1 -1
  16. package/{chunk-NGEVYSHM.js → chunk-QWWYZ3TT.js} +1 -1
  17. package/{chunk-L2RQA7D5.js → chunk-S5I2UOBT.js} +5 -5
  18. package/{chunk-M562AXMZ.js → chunk-SR66HWMM.js} +1 -1
  19. package/{chunk-5WHVV7CQ.js → chunk-TRXTSZFT.js} +1 -1
  20. package/{chunk-62UYVR5K.js → chunk-VTZZIXYW.js} +3 -3
  21. package/{chunk-WL7XN6ON.js → chunk-XSUIV5NF.js} +4 -4
  22. package/{chunk-KXBF4HVG.js → chunk-XWF3GJKE.js} +8 -6
  23. package/chunk-YP4YNE5Y.js +68 -0
  24. package/{chunk-Z76BQOEV.js → chunk-YR47M5L7.js} +2 -2
  25. package/{ci-LQC3DAMB.js → ci-EEXNEPKP.js} +7 -7
  26. package/cli-package.json +1 -1
  27. package/{config-ECUAC3VA.js → config-4ZFJD5AY.js} +6 -6
  28. package/{config-GQHPERU5.js → config-6MUU2TRJ.js} +7 -7
  29. package/{create-5ZYDNLD2.js → create-DEKJKPYX.js} +13 -13
  30. package/{docs-QHVT3CAA.js → docs-5EKPZANX.js} +9 -9
  31. package/{exec-HH5RPTA6.js → exec-I4YPE6YW.js} +13 -13
  32. package/{exec-cache-Y4VLW2SQ.js → exec-cache-XEWPABLK.js} +11 -11
  33. package/{exec-local-EQXYGOZN.js → exec-local-OQXG2VPW.js} +10 -10
  34. package/{help-43YDKGLI.js → help-OG655SE5.js} +1 -1
  35. package/{init-32T4YJZ5.js → init-LJH2YTBM.js} +5 -5
  36. package/{install-XWI7ASPS.js → install-KP2FGWOR.js} +53 -17
  37. package/{list-VYD4KGKR.js → list-ACZ3ZSIZ.js} +10 -10
  38. package/{login-LFHU3GCN.js → login-VFTRKZE2.js} +2 -2
  39. package/{logout-HRFY65WG.js → logout-Z4AVG64D.js} +2 -2
  40. package/{pack-OW6LLMYZ.js → pack-GPJNX7RP.js} +8 -8
  41. package/package.json +3 -2
  42. package/{ping-ABWRUAWQ.js → ping-B2YS4SR3.js} +2 -2
  43. package/{pkg-W6TK2OA4.js → pkg-WUYJDFSH.js} +8 -8
  44. package/{publish-HP67RLBR.js → publish-WTMGC4ET.js} +9 -9
  45. package/{query-XNLBIVQK.js → query-UCM35VVC.js} +10 -10
  46. package/registry-client-package.json +1 -1
  47. package/{repo-V6IHCGHG.js → repo-MZCPTQZU.js} +9 -9
  48. package/{reporter-L7KNFUVD.js → reporter-XRZ37LFK.js} +2 -2
  49. package/{run-CZSTEZDA.js → run-CAX4Z2SC.js} +10 -10
  50. package/{run-exec-MNR3H4EF.js → run-exec-SM42FE7W.js} +10 -10
  51. package/{src-DYCHGTG4.js → src-SDJWTPCU.js} +9 -9
  52. package/{token-NTSPC4UL.js → token-YCURCCNR.js} +2 -2
  53. package/{uninstall-L7JZBHKY.js → uninstall-YYPPXM2O.js} +8 -8
  54. package/{update-5VNZX4RF.js → update-YFUTH33A.js} +7 -7
  55. package/{version-BG6EEYI7.js → version-SK256WED.js} +7 -7
  56. package/{view-CWHRAR2S.js → view-CBYGJ76J.js} +6 -6
  57. package/vlr.js +1 -1
  58. package/vlrx.js +1 -1
  59. package/vlt.js +1 -1
  60. package/vlx.js +1 -1
  61. package/vlxl.js +1 -1
  62. package/{whoami-ITPWALIQ.js → whoami-ZT4ZEN2C.js} +2 -2
  63. package/chunk-LU3AIHGI.js +0 -68
@@ -14,36 +14,36 @@ import {
14
14
  } from "./chunk-AZLX27EM.js";
15
15
  import {
16
16
  createHostContextsMap
17
- } from "./chunk-62UYVR5K.js";
17
+ } from "./chunk-VTZZIXYW.js";
18
18
  import {
19
19
  Query,
20
20
  actual
21
- } from "./chunk-HPK6ZLUY.js";
21
+ } from "./chunk-DJBBJDHI.js";
22
22
  import {
23
23
  SecurityArchive
24
- } from "./chunk-5QLMU4PR.js";
25
- import "./chunk-VVTZN4QQ.js";
24
+ } from "./chunk-BIUCOMBH.js";
25
+ import "./chunk-52LBC3AX.js";
26
26
  import {
27
27
  commandUsage
28
28
  } from "./chunk-5E5GX4G6.js";
29
29
  import {
30
30
  PackageInfoClient
31
- } from "./chunk-QFA4L7SI.js";
31
+ } from "./chunk-INXSTZAX.js";
32
32
  import "./chunk-FI5TUER7.js";
33
- import "./chunk-XBN4TEBD.js";
33
+ import "./chunk-JQHMLTO5.js";
34
34
  import {
35
35
  urlOpen
36
36
  } from "./chunk-D7U7KDEM.js";
37
- import "./chunk-Z76BQOEV.js";
37
+ import "./chunk-YR47M5L7.js";
38
38
  import "./chunk-BGQCUUCA.js";
39
39
  import "./chunk-E74WGW5C.js";
40
40
  import {
41
41
  Spec2 as Spec
42
- } from "./chunk-FEV5BCW7.js";
42
+ } from "./chunk-QDGZZ5FZ.js";
43
43
  import "./chunk-VCSVHRCS.js";
44
44
  import "./chunk-D27QPHKI.js";
45
45
  import "./chunk-JLJKOF75.js";
46
- import "./chunk-KXBF4HVG.js";
46
+ import "./chunk-XWF3GJKE.js";
47
47
  import "./chunk-HTOTG4TS.js";
48
48
  import "./chunk-XNLSTHDK.js";
49
49
  import {
@@ -11,22 +11,22 @@ 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-HPK6ZLUY.js";
15
- import "./chunk-5QLMU4PR.js";
16
- import "./chunk-VVTZN4QQ.js";
14
+ } from "./chunk-DJBBJDHI.js";
15
+ import "./chunk-BIUCOMBH.js";
16
+ import "./chunk-52LBC3AX.js";
17
17
  import {
18
18
  commandUsage
19
19
  } from "./chunk-5E5GX4G6.js";
20
- import "./chunk-Z76BQOEV.js";
20
+ import "./chunk-YR47M5L7.js";
21
21
  import "./chunk-BGQCUUCA.js";
22
22
  import "./chunk-E74WGW5C.js";
23
- import "./chunk-FEV5BCW7.js";
23
+ import "./chunk-QDGZZ5FZ.js";
24
24
  import "./chunk-VCSVHRCS.js";
25
25
  import "./chunk-D27QPHKI.js";
26
26
  import "./chunk-JLJKOF75.js";
27
27
  import {
28
28
  isErrorWithCause
29
- } from "./chunk-KXBF4HVG.js";
29
+ } from "./chunk-XWF3GJKE.js";
30
30
  import "./chunk-HTOTG4TS.js";
31
31
  import "./chunk-XNLSTHDK.js";
32
32
  import {
@@ -15,29 +15,29 @@ import {
15
15
  import {
16
16
  stderr,
17
17
  stdout
18
- } from "./chunk-56TWRLHO.js";
18
+ } from "./chunk-P2HZ4ISK.js";
19
19
  import "./chunk-TDTJOKF2.js";
20
20
  import {
21
21
  ViewClass
22
22
  } from "./chunk-RXNA2XCX.js";
23
23
  import "./chunk-WGDTG44V.js";
24
- import "./chunk-5WHVV7CQ.js";
24
+ import "./chunk-TRXTSZFT.js";
25
25
  import {
26
26
  commandUsage
27
27
  } from "./chunk-5E5GX4G6.js";
28
28
  import {
29
29
  CacheEntry
30
- } from "./chunk-XBN4TEBD.js";
30
+ } from "./chunk-JQHMLTO5.js";
31
31
  import "./chunk-D7U7KDEM.js";
32
32
  import "./chunk-BGQCUUCA.js";
33
33
  import "./chunk-E74WGW5C.js";
34
34
  import {
35
35
  Spec2 as Spec
36
- } from "./chunk-FEV5BCW7.js";
36
+ } from "./chunk-QDGZZ5FZ.js";
37
37
  import "./chunk-VCSVHRCS.js";
38
38
  import "./chunk-D27QPHKI.js";
39
39
  import "./chunk-JLJKOF75.js";
40
- import "./chunk-KXBF4HVG.js";
40
+ import "./chunk-XWF3GJKE.js";
41
41
  import "./chunk-XNLSTHDK.js";
42
42
  import {
43
43
  error
@@ -12,11 +12,11 @@ var require = _vlt_createRequire(import.meta.filename);
12
12
  import {
13
13
  PackageJson,
14
14
  getUser
15
- } from "./chunk-Z76BQOEV.js";
15
+ } from "./chunk-YR47M5L7.js";
16
16
  import {
17
17
  asError,
18
18
  normalizeManifest
19
- } from "./chunk-KXBF4HVG.js";
19
+ } from "./chunk-XWF3GJKE.js";
20
20
 
21
21
  // ../../src/init/src/index.ts
22
22
  import { basename, resolve } from "node:path";
@@ -16,24 +16,24 @@ import {
16
16
  stderr,
17
17
  stdout,
18
18
  styleTextStdout
19
- } from "./chunk-56TWRLHO.js";
19
+ } from "./chunk-P2HZ4ISK.js";
20
20
  import {
21
21
  require_emoji_regex
22
22
  } from "./chunk-VTEFO2FT.js";
23
23
  import {
24
24
  createHostContextsMap
25
- } from "./chunk-62UYVR5K.js";
25
+ } from "./chunk-VTZZIXYW.js";
26
26
  import {
27
27
  Query,
28
28
  actual,
29
29
  isRunResult
30
- } from "./chunk-HPK6ZLUY.js";
30
+ } from "./chunk-DJBBJDHI.js";
31
31
  import {
32
32
  Monorepo
33
- } from "./chunk-Z76BQOEV.js";
33
+ } from "./chunk-YR47M5L7.js";
34
34
  import {
35
35
  isErrorWithCause
36
- } from "./chunk-KXBF4HVG.js";
36
+ } from "./chunk-XWF3GJKE.js";
37
37
  import {
38
38
  error
39
39
  } from "./chunk-WZWDS3W4.js";
@@ -1192,6 +1192,7 @@ var ExecCommand = class {
1192
1192
  arg0,
1193
1193
  args: this.args,
1194
1194
  env: this.env,
1195
+ ignoreMissing: this.conf.get("if-present") ?? this.#defaultIgnoreMissing,
1195
1196
  projectRoot: this.projectRoot,
1196
1197
  packageJson: this.conf.options.packageJson,
1197
1198
  "script-shell": this.arg0 ? this.conf.get("script-shell") : false
@@ -16,7 +16,7 @@ import {
16
16
  asDepID,
17
17
  baseDepID,
18
18
  splitDepID
19
- } from "./chunk-FEV5BCW7.js";
19
+ } from "./chunk-QDGZZ5FZ.js";
20
20
  import {
21
21
  L
22
22
  } from "./chunk-VCSVHRCS.js";
@@ -13,16 +13,16 @@ import {
13
13
  AbortError,
14
14
  SecurityArchive,
15
15
  pRetry
16
- } from "./chunk-5QLMU4PR.js";
16
+ } from "./chunk-BIUCOMBH.js";
17
17
  import {
18
18
  init
19
- } from "./chunk-VVTZN4QQ.js";
19
+ } from "./chunk-52LBC3AX.js";
20
20
  import {
21
21
  Monorepo,
22
22
  PackageJson,
23
23
  minimatch,
24
24
  platformCheck
25
- } from "./chunk-Z76BQOEV.js";
25
+ } from "./chunk-YR47M5L7.js";
26
26
  import {
27
27
  rimraf
28
28
  } from "./chunk-BGQCUUCA.js";
@@ -49,7 +49,7 @@ import {
49
49
  joinExtra,
50
50
  splitDepID,
51
51
  splitExtra
52
- } from "./chunk-FEV5BCW7.js";
52
+ } from "./chunk-QDGZZ5FZ.js";
53
53
  import {
54
54
  promiseSpawn
55
55
  } from "./chunk-VCSVHRCS.js";
@@ -84,7 +84,7 @@ import {
84
84
  patch,
85
85
  satisfies,
86
86
  shortDependencyTypes
87
- } from "./chunk-KXBF4HVG.js";
87
+ } from "./chunk-XWF3GJKE.js";
88
88
  import {
89
89
  load,
90
90
  walkUp
@@ -5376,7 +5376,7 @@ var exec = async (options) => {
5376
5376
  {
5377
5377
  ...process.env,
5378
5378
  ...env2,
5379
- FORCE_COLOR: color ? "1" : "0"
5379
+ FORCE_COLOR: color && process.stdout.isTTY ? "1" : "0"
5380
5380
  },
5381
5381
  arg0
5382
5382
  ),
@@ -7865,6 +7865,8 @@ var has = async (state) => {
7865
7865
  edges: new Set(state.partial.edges),
7866
7866
  nodes: new Set(state.partial.nodes)
7867
7867
  },
7868
+ diffFiles: state.diffFiles,
7869
+ loose: state.loose,
7868
7870
  hostContexts: state.hostContexts,
7869
7871
  importers: state.importers,
7870
7872
  retries: state.retries,
@@ -7924,6 +7926,7 @@ var is = async (state) => {
7924
7926
  nodes: /* @__PURE__ */ new Set()
7925
7927
  },
7926
7928
  current: node,
7929
+ diffFiles: state.diffFiles,
7927
7930
  initial: state.initial,
7928
7931
  loose: true,
7929
7932
  partial: {
@@ -7964,7 +7967,9 @@ var not = async (state) => {
7964
7967
  nodes: /* @__PURE__ */ new Set()
7965
7968
  },
7966
7969
  current: node,
7970
+ diffFiles: state.diffFiles,
7967
7971
  initial: state.initial,
7972
+ loose: state.loose,
7968
7973
  partial: {
7969
7974
  nodes: new Set(state.partial.nodes),
7970
7975
  edges: new Set(state.partial.edges)
@@ -9163,6 +9168,13 @@ var Graph = class {
9163
9168
  toFoundNode.detached = false;
9164
9169
  toFoundNode.dev &&= flags.dev;
9165
9170
  toFoundNode.optional &&= flags.optional;
9171
+ if (manifest) {
9172
+ if (!toFoundNode.manifest) {
9173
+ toFoundNode.manifest = manifest;
9174
+ this.manifests.set(toFoundNode.id, manifest);
9175
+ }
9176
+ toFoundNode.integrity ??= manifest.dist?.integrity;
9177
+ }
9166
9178
  return toFoundNode;
9167
9179
  }
9168
9180
  const toNode = this.addNode(depId, manifest, spec2);
@@ -11,13 +11,13 @@ import {createRequire as _vlt_createRequire} from "node:module";
11
11
  var require = _vlt_createRequire(import.meta.filename);
12
12
  import {
13
13
  stderr
14
- } from "./chunk-56TWRLHO.js";
14
+ } from "./chunk-P2HZ4ISK.js";
15
15
  import {
16
16
  ViewClass
17
17
  } from "./chunk-RXNA2XCX.js";
18
18
  import {
19
19
  mermaidOutput
20
- } from "./chunk-HPK6ZLUY.js";
20
+ } from "./chunk-DJBBJDHI.js";
21
21
  import {
22
22
  urlOpen
23
23
  } from "./chunk-D7U7KDEM.js";
@@ -11,11 +11,11 @@ import {createRequire as _vlt_createRequire} from "node:module";
11
11
  var require = _vlt_createRequire(import.meta.filename);
12
12
  import {
13
13
  asDependency
14
- } from "./chunk-HPK6ZLUY.js";
14
+ } from "./chunk-DJBBJDHI.js";
15
15
  import {
16
16
  Spec2 as Spec,
17
17
  joinDepIDTuple
18
- } from "./chunk-FEV5BCW7.js";
18
+ } from "./chunk-QDGZZ5FZ.js";
19
19
 
20
20
  // ../../src/cli-sdk/src/parse-add-remove-args.ts
21
21
  var rootDepID = joinDepIDTuple(["file", "."]);
@@ -15,7 +15,7 @@ import {
15
15
  } from "./chunk-FI5TUER7.js";
16
16
  import {
17
17
  RegistryClient
18
- } from "./chunk-XBN4TEBD.js";
18
+ } from "./chunk-JQHMLTO5.js";
19
19
  import {
20
20
  Monorepo,
21
21
  PackageJson,
@@ -23,18 +23,17 @@ import {
23
23
  pickManifest,
24
24
  resolve,
25
25
  revs
26
- } from "./chunk-Z76BQOEV.js";
26
+ } from "./chunk-YR47M5L7.js";
27
27
  import {
28
28
  rimraf
29
29
  } from "./chunk-BGQCUUCA.js";
30
30
  import {
31
31
  Spec2 as Spec
32
- } from "./chunk-FEV5BCW7.js";
32
+ } from "./chunk-QDGZZ5FZ.js";
33
33
  import {
34
34
  asError,
35
- asPackument,
36
- isIntegrity
37
- } from "./chunk-KXBF4HVG.js";
35
+ asPackument
36
+ } from "./chunk-XWF3GJKE.js";
38
37
  import {
39
38
  XDG
40
39
  } from "./chunk-XNLSTHDK.js";
@@ -783,7 +782,7 @@ var Pool = class {
783
782
 
784
783
  // ../../src/package-info/src/index.ts
785
784
  var import_ssri = __toESM(require_lib(), 1);
786
- import { randomBytes as randomBytes2 } from "node:crypto";
785
+ import { createHash, randomBytes as randomBytes2 } from "node:crypto";
787
786
  import {
788
787
  mkdir as mkdir2,
789
788
  readFile,
@@ -867,9 +866,15 @@ var PackageInfoClient = class {
867
866
  async extract(spec, target, options = {}) {
868
867
  if (typeof spec === "string")
869
868
  spec = Spec.parse(spec, this.options);
870
- const { from = this.#projectRoot, integrity, resolved } = options;
869
+ const {
870
+ from = this.#projectRoot,
871
+ integrity,
872
+ resolved,
873
+ fromLockfile = false
874
+ } = options;
871
875
  const f = spec.final;
872
- const r = integrity && resolved ? { resolved, integrity, spec } : await this.resolve(spec, options);
876
+ const alreadyResolved = !!(integrity && resolved);
877
+ const r = alreadyResolved ? { resolved, integrity, spec } : await this.resolve(spec, options);
873
878
  switch (f.type) {
874
879
  case "git": {
875
880
  const {
@@ -903,30 +908,62 @@ var PackageInfoClient = class {
903
908
  }
904
909
  }
905
910
  case "registry": {
906
- const trustIntegrity = this.#trustedIntegrities.get(r.resolved) === r.integrity;
907
- const response = await this.registryClient.request(
908
- r.resolved,
909
- {
910
- integrity: r.integrity,
911
- trustIntegrity
912
- }
913
- );
914
- if (response.statusCode !== 200) {
915
- throw this.#resolveError(
916
- spec,
917
- options,
918
- "failed to fetch tarball",
911
+ const fetchTarball = async (useCache) => {
912
+ const trustIntegrity = this.#trustedIntegrities.get(r.resolved) === r.integrity;
913
+ const response = await this.registryClient.request(
914
+ r.resolved,
919
915
  {
920
- url: r.resolved,
921
- response
916
+ integrity: r.integrity,
917
+ trustIntegrity,
918
+ ...useCache === false ? { useCache } : {}
922
919
  }
923
920
  );
924
- }
925
- if (!trustIntegrity && response.checkIntegrity({ spec, url: resolved })) {
926
- this.#trustedIntegrities.set(r.resolved, response.integrity);
921
+ if (response.statusCode !== 200) {
922
+ throw this.#resolveError(
923
+ spec,
924
+ options,
925
+ "failed to fetch tarball",
926
+ {
927
+ url: r.resolved,
928
+ response
929
+ }
930
+ );
931
+ }
932
+ if (!trustIntegrity && response.checkIntegrity({ spec, url: resolved })) {
933
+ this.#trustedIntegrities.set(
934
+ r.resolved,
935
+ response.integrity
936
+ );
937
+ }
938
+ const buf2 = response.buffer();
939
+ if (r.integrity && !fromLockfile) {
940
+ const hash = createHash("sha512");
941
+ hash.update(buf2);
942
+ const computed = `sha512-${hash.digest("base64")}`;
943
+ if (computed !== r.integrity) {
944
+ throw error("Tarball integrity check failed", {
945
+ code: "EINTEGRITY",
946
+ spec,
947
+ url: r.resolved,
948
+ wanted: r.integrity,
949
+ found: computed
950
+ });
951
+ }
952
+ }
953
+ return buf2;
954
+ };
955
+ let buf;
956
+ try {
957
+ buf = await fetchTarball();
958
+ } catch (er) {
959
+ if (er instanceof Error && "cause" in er && er.cause?.code === "EINTEGRITY") {
960
+ buf = await fetchTarball(false);
961
+ } else {
962
+ throw er;
963
+ }
927
964
  }
928
965
  try {
929
- await this.tarPool.unpack(response.buffer(), target);
966
+ await this.tarPool.unpack(buf, target);
930
967
  } catch (er) {
931
968
  throw this.#resolveError(
932
969
  spec,
@@ -1122,24 +1159,53 @@ var PackageInfoClient = class {
1122
1159
  "no tarball found in manifest.dist"
1123
1160
  );
1124
1161
  }
1125
- const trustIntegrity = this.#trustedIntegrities.get(tarball) === integrity;
1126
- const response = await this.registryClient.request(tarball, {
1127
- ...options,
1128
- integrity,
1129
- trustIntegrity
1130
- });
1131
- if (response.statusCode !== 200) {
1132
- throw this.#resolveError(
1133
- spec,
1134
- options,
1135
- "failed to fetch tarball",
1136
- { response, url: tarball }
1162
+ const fetchTarball = async (useCache) => {
1163
+ const trustIntegrity = this.#trustedIntegrities.get(tarball) === integrity;
1164
+ const response = await this.registryClient.request(
1165
+ tarball,
1166
+ {
1167
+ ...options,
1168
+ integrity,
1169
+ trustIntegrity,
1170
+ ...useCache === false ? { useCache } : {}
1171
+ }
1137
1172
  );
1173
+ if (response.statusCode !== 200) {
1174
+ throw this.#resolveError(
1175
+ spec,
1176
+ options,
1177
+ "failed to fetch tarball",
1178
+ { response, url: tarball }
1179
+ );
1180
+ }
1181
+ if (!trustIntegrity && response.checkIntegrity({ spec, url: tarball })) {
1182
+ this.#trustedIntegrities.set(tarball, response.integrity);
1183
+ }
1184
+ const buf = response.buffer();
1185
+ if (integrity) {
1186
+ const hash = createHash("sha512");
1187
+ hash.update(buf);
1188
+ const computed = `sha512-${hash.digest("base64")}`;
1189
+ if (computed !== integrity) {
1190
+ throw error("Tarball integrity check failed", {
1191
+ code: "EINTEGRITY",
1192
+ spec,
1193
+ url: tarball,
1194
+ wanted: integrity,
1195
+ found: computed
1196
+ });
1197
+ }
1198
+ }
1199
+ return buf;
1200
+ };
1201
+ try {
1202
+ return await fetchTarball();
1203
+ } catch (er) {
1204
+ if (er instanceof Error && "cause" in er && er.cause?.code === "EINTEGRITY") {
1205
+ return await fetchTarball(false);
1206
+ }
1207
+ throw er;
1138
1208
  }
1139
- if (!trustIntegrity && response.checkIntegrity({ spec, url: tarball })) {
1140
- this.#trustedIntegrities.set(tarball, response.integrity);
1141
- }
1142
- return response.buffer();
1143
1209
  }
1144
1210
  case "git": {
1145
1211
  const {
@@ -1245,15 +1311,6 @@ var PackageInfoClient = class {
1245
1311
  options
1246
1312
  );
1247
1313
  if (!mani) throw this.#resolveError(spec, options);
1248
- const { integrity, tarball } = mani.dist ?? /* c8 ignore next */
1249
- {};
1250
- if (isIntegrity(integrity) && tarball) {
1251
- const registryOrigin = new URL(String(f.registry)).origin;
1252
- const tgzOrigin = new URL(tarball).origin;
1253
- if (tgzOrigin === registryOrigin) {
1254
- this.#trustedIntegrities.set(tarball, integrity);
1255
- }
1256
- }
1257
1314
  if (cachePath) {
1258
1315
  const json = JSON.stringify({
1259
1316
  ...mani,
@@ -26,7 +26,7 @@ import {
26
26
  } from "./chunk-JLJKOF75.js";
27
27
  import {
28
28
  asError
29
- } from "./chunk-KXBF4HVG.js";
29
+ } from "./chunk-XWF3GJKE.js";
30
30
  import {
31
31
  XDG
32
32
  } from "./chunk-XNLSTHDK.js";
@@ -16,10 +16,10 @@ import {
16
16
  } from "./chunk-FI5TUER7.js";
17
17
  import {
18
18
  minimatch
19
- } from "./chunk-Z76BQOEV.js";
19
+ } from "./chunk-YR47M5L7.js";
20
20
  import {
21
21
  Spec2 as Spec
22
- } from "./chunk-FEV5BCW7.js";
22
+ } from "./chunk-QDGZZ5FZ.js";
23
23
  import {
24
24
  parse,
25
25
  stringify
@@ -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
  init
14
- } from "./chunk-VVTZN4QQ.js";
14
+ } from "./chunk-52LBC3AX.js";
15
15
  import {
16
16
  commandUsage
17
17
  } from "./chunk-5E5GX4G6.js";
@@ -19,7 +19,7 @@ import {
19
19
  asWSConfig,
20
20
  assertWSConfig,
21
21
  minimatch
22
- } from "./chunk-Z76BQOEV.js";
22
+ } from "./chunk-YR47M5L7.js";
23
23
  import {
24
24
  load,
25
25
  save
@@ -18,18 +18,18 @@ import {
18
18
  } from "./chunk-RXNA2XCX.js";
19
19
  import {
20
20
  parseError
21
- } from "./chunk-5WHVV7CQ.js";
21
+ } from "./chunk-TRXTSZFT.js";
22
22
  import {
23
23
  isGraphRunError,
24
24
  splitDepID
25
- } from "./chunk-FEV5BCW7.js";
25
+ } from "./chunk-QDGZZ5FZ.js";
26
26
  import {
27
27
  defaultView
28
28
  } from "./chunk-D27QPHKI.js";
29
29
  import {
30
30
  isErrorWithCause,
31
31
  isObject
32
- } from "./chunk-KXBF4HVG.js";
32
+ } from "./chunk-XWF3GJKE.js";
33
33
  import {
34
34
  XDG
35
35
  } from "./chunk-XNLSTHDK.js";
@@ -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
  parseRange
14
- } from "./chunk-KXBF4HVG.js";
14
+ } from "./chunk-XWF3GJKE.js";
15
15
  import {
16
16
  error,
17
17
  typeError
@@ -17,7 +17,7 @@ var run = async (command) => {
17
17
  if (command) {
18
18
  process.argv.splice(2, 0, command);
19
19
  }
20
- const vlt = await import("./src-DYCHGTG4.js");
20
+ const vlt = await import("./src-SDJWTPCU.js");
21
21
  await vlt.default();
22
22
  };
23
23
 
@@ -12,19 +12,19 @@ var require = _vlt_createRequire(import.meta.filename);
12
12
  import {
13
13
  findCmdShimIfExists,
14
14
  install
15
- } from "./chunk-HPK6ZLUY.js";
15
+ } from "./chunk-DJBBJDHI.js";
16
16
  import {
17
17
  PackageInfoClient
18
- } from "./chunk-QFA4L7SI.js";
18
+ } from "./chunk-INXSTZAX.js";
19
19
  import {
20
20
  PathScurry
21
- } from "./chunk-Z76BQOEV.js";
21
+ } from "./chunk-YR47M5L7.js";
22
22
  import {
23
23
  Spec2 as Spec
24
- } from "./chunk-FEV5BCW7.js";
24
+ } from "./chunk-QDGZZ5FZ.js";
25
25
  import {
26
26
  parseScope
27
- } from "./chunk-KXBF4HVG.js";
27
+ } from "./chunk-XWF3GJKE.js";
28
28
  import {
29
29
  walkUp
30
30
  } from "./chunk-HTOTG4TS.js";
@@ -23,7 +23,7 @@ import {
23
23
  } from "./chunk-JLJKOF75.js";
24
24
  import {
25
25
  asError
26
- } from "./chunk-KXBF4HVG.js";
26
+ } from "./chunk-XWF3GJKE.js";
27
27
  import {
28
28
  __commonJS,
29
29
  __export,
@@ -12,7 +12,7 @@ var require = _vlt_createRequire(import.meta.filename);
12
12
  import {
13
13
  isError,
14
14
  isObject
15
- } from "./chunk-KXBF4HVG.js";
15
+ } from "./chunk-XWF3GJKE.js";
16
16
 
17
17
  // ../../src/output/src/error.ts
18
18
  var parseError = (err) => {
@@ -13,10 +13,10 @@ import {
13
13
  actual,
14
14
  callLimit,
15
15
  createVirtualRoot
16
- } from "./chunk-HPK6ZLUY.js";
16
+ } from "./chunk-DJBBJDHI.js";
17
17
  import {
18
18
  SecurityArchive
19
- } from "./chunk-5QLMU4PR.js";
19
+ } from "./chunk-BIUCOMBH.js";
20
20
  import {
21
21
  error
22
22
  } from "./chunk-WZWDS3W4.js";
@@ -115,7 +115,7 @@ var reloadConfig = async (folder) => {
115
115
  unload("project");
116
116
  } catch {
117
117
  }
118
- const { Config } = await import("./config-ECUAC3VA.js");
118
+ const { Config } = await import("./config-4ZFJD5AY.js");
119
119
  return Config.load(folder, process.argv, true);
120
120
  };
121
121