@vltpkg/cli-js 1.2.0 → 1.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (85) hide show
  1. package/{access-FTHPFPUJ.js → access-ATF2FQHI.js} +10 -10
  2. package/{bugs-QS6HQUO2.js → bugs-P26XZBIE.js} +19 -19
  3. package/{build-H27SXMAS.js → build-UABOHT3O.js} +11 -11
  4. package/{cache-IB4HMFDT.js → cache-R2SEGAZJ.js} +15 -15
  5. package/cache-unzip-src-unzip.js +31 -12
  6. package/{chunk-LD4BQJBG.js → chunk-2QA7DUYM.js} +4 -4
  7. package/{chunk-B2FK2HHL.js → chunk-3WBHQEWL.js} +57 -17
  8. package/{chunk-G5NJ7CYI.js → chunk-64VFL4WI.js} +1 -1
  9. package/{chunk-LKQ5R4VX.js → chunk-73YPXX6C.js} +4 -4
  10. package/{chunk-7KFMQ3BR.js → chunk-7AYULBUY.js} +5 -5
  11. package/{chunk-LEGPLJWK.js → chunk-B7YWFGLB.js} +5 -5
  12. package/{chunk-G5BSQ6DP.js → chunk-BP3PQ67D.js} +30 -0
  13. package/{chunk-6G7MTZGS.js → chunk-BUKZHMMK.js} +110 -21
  14. package/{chunk-YTT3UHUB.js → chunk-CRGWLUGC.js} +1 -1
  15. package/{chunk-UNWQVOLY.js → chunk-CSZTT7QN.js} +6 -6
  16. package/{chunk-GUATFMMU.js → chunk-CU752KW7.js} +1 -1
  17. package/{chunk-6A3XS52F.js → chunk-ENSGPOLR.js} +13 -0
  18. package/chunk-GVQDUMNW.js +75 -0
  19. package/{chunk-55DYW2MP.js → chunk-I6QGYSB4.js} +1 -1
  20. package/{chunk-O44Z6MAV.js → chunk-J4NHRZX6.js} +1 -1
  21. package/{chunk-SYGF27W7.js → chunk-JIQBZ2UT.js} +2 -2
  22. package/{chunk-5PP77V44.js → chunk-KH3ERNCA.js} +4 -3
  23. package/{chunk-FSZF2RSQ.js → chunk-KPMPYRBZ.js} +4 -4
  24. package/{chunk-JTUZP2OD.js → chunk-LCAH3OGR.js} +1 -1
  25. package/{chunk-3CUFJPBK.js → chunk-MC6CESRA.js} +1 -1
  26. package/{chunk-VHHLO5L6.js → chunk-OKJ4U3PP.js} +1 -1
  27. package/{chunk-NJZSCUD4.js → chunk-OOYLF23O.js} +14 -11
  28. package/{chunk-OE6VHHN4.js → chunk-P6LBJWJN.js} +78 -31
  29. package/{chunk-UQUIO7LW.js → chunk-PBBULTAG.js} +4 -3
  30. package/{chunk-BHJT53TP.js → chunk-PDWPFR5T.js} +1 -1
  31. package/{chunk-5YB6UIC3.js → chunk-QXKWSPKX.js} +58 -25
  32. package/{chunk-FOJCK57G.js → chunk-U3WCCLFD.js} +3 -3
  33. package/{chunk-QA6RE2GS.js → chunk-X2WYIUFQ.js} +57 -22
  34. package/{chunk-VE6CCH33.js → chunk-Y5PA7DVK.js} +1 -0
  35. package/{chunk-YFNQ6HZ3.js → chunk-YL5D7SKZ.js} +3 -3
  36. package/{chunk-5BD4QGW2.js → chunk-ZPVVD6CI.js} +6 -6
  37. package/{ci-XJBYXFFJ.js → ci-3R6MFNVV.js} +12 -12
  38. package/cli-package.json +2 -2
  39. package/{config-4Y46SH5K.js → config-4SAA7FD2.js} +9 -9
  40. package/{config-H2Q4ABSS.js → config-WPVXQDM5.js} +11 -11
  41. package/{create-LUYL2QI4.js → create-MS4GFBDA.js} +20 -20
  42. package/{deprecate-5ANCI2L6.js → deprecate-JTTM44ZL.js} +13 -13
  43. package/{devtools-UEMPW5GG.js → devtools-UMJUK42W.js} +2 -2
  44. package/{dist-tag-SD2CRWIL.js → dist-tag-HJEVOOH3.js} +10 -10
  45. package/{docs-B6LVNWTP.js → docs-6OIBQSV6.js} +19 -19
  46. package/{exec-CJ5KQA72.js → exec-LCWL6Z3E.js} +20 -20
  47. package/{exec-cache-EE7DAOW2.js → exec-cache-6UBB7RI2.js} +18 -18
  48. package/{exec-local-HT3VBN6S.js → exec-local-C7MPFSOE.js} +17 -17
  49. package/{help-GZ44WYDS.js → help-DC77D3YW.js} +4 -4
  50. package/{init-HVXRXFVY.js → init-B6G7COKW.js} +12 -12
  51. package/{install-E2C7EE6P.js → install-LJPM2XSF.js} +18 -18
  52. package/{list-V4V6SHJP.js → list-4KT3WIIG.js} +20 -20
  53. package/{login-VRFV7MCE.js → login-CFYSVNFH.js} +14 -14
  54. package/{logout-SU75R7BN.js → logout-5ZUJHYWI.js} +10 -10
  55. package/{pack-IVGKUXTL.js → pack-YP5WBIT6.js} +13 -13
  56. package/package.json +1 -1
  57. package/{ping-WB222SDT.js → ping-LLMQAG3Y.js} +10 -10
  58. package/{pkg-LAAFNONA.js → pkg-QTMOXWRT.js} +13 -13
  59. package/{profile-P3AVHRDI.js → profile-IA3ELAPB.js} +10 -10
  60. package/{publish-IUNB3KH5.js → publish-QSIXKUCZ.js} +36 -21
  61. package/{query-XCN55INS.js → query-KHXMK2ED.js} +20 -20
  62. package/{registry-QQLWJHJI.js → registry-MXAA4HVJ.js} +5 -5
  63. package/registry-client-src-revalidate.js +76 -30
  64. package/{repo-BQDWUCX5.js → repo-XKG2HZ46.js} +19 -19
  65. package/{reporter-5BVUNWQ6.js → reporter-47XFGNJH.js} +75 -75
  66. package/{run-QT7DX243.js → run-3OEGBMSR.js} +17 -17
  67. package/{run-exec-XYUI7GLN.js → run-exec-IH5YQF4G.js} +17 -17
  68. package/security-archive-src-update-expired.js +1 -1
  69. package/{setup-CXDJXRAG.js → setup-LRR3VSGV.js} +17 -17
  70. package/{src-OKMGXMAD.js → src-EJSVFFXB.js} +24 -14
  71. package/{src-UBAERP25.js → src-N3QY4ITW.js} +16 -16
  72. package/{src-2BUT4WYP.js → src-PKFKIVVK.js} +6 -6
  73. package/{token-CBOK6DMT.js → token-UBMP2WBT.js} +10 -10
  74. package/{uninstall-27VP46KJ.js → uninstall-4F4QIOAW.js} +14 -14
  75. package/{unpublish-F4637OQX.js → unpublish-JPDDQZXF.js} +10 -10
  76. package/{update-NGWLJJ22.js → update-CVJFMZOK.js} +17 -17
  77. package/{version-WPD2KNVC.js → version-I7K3J2O2.js} +12 -12
  78. package/{view-YKFTRRPD.js → view-G5O4ZBLM.js} +11 -11
  79. package/vlr.js +1 -1
  80. package/vlrx.js +1 -1
  81. package/vlt.js +1 -1
  82. package/vlx.js +1 -1
  83. package/vlxl.js +1 -1
  84. package/{whoami-I5Q6RTAP.js → whoami-NG7XVRAL.js} +10 -10
  85. package/chunk-SPRVRSEL.js +0 -75
@@ -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-O44Z6MAV.js";
14
+ } from "./chunk-J4NHRZX6.js";
15
15
  import {
16
16
  commandUsage
17
- } from "./chunk-55DYW2MP.js";
18
- import "./chunk-G5NJ7CYI.js";
19
- import "./chunk-6A3XS52F.js";
17
+ } from "./chunk-I6QGYSB4.js";
18
+ import "./chunk-64VFL4WI.js";
19
+ import "./chunk-ENSGPOLR.js";
20
20
  import {
21
21
  RegistryClient
22
- } from "./chunk-OE6VHHN4.js";
22
+ } from "./chunk-P6LBJWJN.js";
23
23
  import "./chunk-APMYKJI2.js";
24
24
  import {
25
25
  assertOk
26
- } from "./chunk-UQUIO7LW.js";
27
- import "./chunk-JTUZP2OD.js";
26
+ } from "./chunk-PBBULTAG.js";
27
+ import "./chunk-LCAH3OGR.js";
28
28
  import "./chunk-U7TEQCBN.js";
29
29
  import "./chunk-XNLSTHDK.js";
30
- import "./chunk-BHJT53TP.js";
31
- import "./chunk-VE6CCH33.js";
32
- import "./chunk-G5BSQ6DP.js";
30
+ import "./chunk-PDWPFR5T.js";
31
+ import "./chunk-Y5PA7DVK.js";
32
+ import "./chunk-BP3PQ67D.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-3CUFJPBK.js";
17
+ } from "./chunk-MC6CESRA.js";
18
18
  import {
19
19
  createHostContextsMap
20
- } from "./chunk-YFNQ6HZ3.js";
21
- import "./chunk-UNWQVOLY.js";
22
- import "./chunk-GUATFMMU.js";
20
+ } from "./chunk-YL5D7SKZ.js";
21
+ import "./chunk-CSZTT7QN.js";
22
+ import "./chunk-CU752KW7.js";
23
23
  import "./chunk-G2YT2GWF.js";
24
- import "./chunk-YTT3UHUB.js";
24
+ import "./chunk-CRGWLUGC.js";
25
25
  import {
26
26
  PackageInfoClient
27
- } from "./chunk-5YB6UIC3.js";
27
+ } from "./chunk-QXKWSPKX.js";
28
28
  import "./chunk-ZWKI5OSF.js";
29
29
  import "./chunk-WGDTG44V.js";
30
- import "./chunk-O44Z6MAV.js";
30
+ import "./chunk-J4NHRZX6.js";
31
31
  import {
32
32
  Query,
33
33
  actual
34
- } from "./chunk-B2FK2HHL.js";
34
+ } from "./chunk-3WBHQEWL.js";
35
35
  import {
36
36
  SecurityArchive
37
- } from "./chunk-FOJCK57G.js";
37
+ } from "./chunk-U3WCCLFD.js";
38
38
  import {
39
39
  commandUsage
40
- } from "./chunk-55DYW2MP.js";
41
- import "./chunk-6G7MTZGS.js";
40
+ } from "./chunk-I6QGYSB4.js";
41
+ import "./chunk-BUKZHMMK.js";
42
42
  import "./chunk-4KCU2KZL.js";
43
- import "./chunk-SYGF27W7.js";
43
+ import "./chunk-JIQBZ2UT.js";
44
44
  import {
45
45
  Spec
46
- } from "./chunk-G5NJ7CYI.js";
47
- import "./chunk-6A3XS52F.js";
46
+ } from "./chunk-64VFL4WI.js";
47
+ import "./chunk-ENSGPOLR.js";
48
48
  import "./chunk-HTOTG4TS.js";
49
49
  import "./chunk-APMYKJI2.js";
50
- import "./chunk-UQUIO7LW.js";
51
- import "./chunk-JTUZP2OD.js";
50
+ import "./chunk-PBBULTAG.js";
51
+ import "./chunk-LCAH3OGR.js";
52
52
  import "./chunk-U7TEQCBN.js";
53
53
  import "./chunk-XNLSTHDK.js";
54
- import "./chunk-BHJT53TP.js";
55
- import "./chunk-VE6CCH33.js";
56
- import "./chunk-G5BSQ6DP.js";
54
+ import "./chunk-PDWPFR5T.js";
55
+ import "./chunk-Y5PA7DVK.js";
56
+ import "./chunk-BP3PQ67D.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-B2FK2HHL.js";
15
- import "./chunk-FOJCK57G.js";
14
+ } from "./chunk-3WBHQEWL.js";
15
+ import "./chunk-U3WCCLFD.js";
16
16
  import {
17
17
  commandUsage
18
- } from "./chunk-55DYW2MP.js";
19
- import "./chunk-6G7MTZGS.js";
20
- import "./chunk-SYGF27W7.js";
21
- import "./chunk-G5NJ7CYI.js";
22
- import "./chunk-6A3XS52F.js";
18
+ } from "./chunk-I6QGYSB4.js";
19
+ import "./chunk-BUKZHMMK.js";
20
+ import "./chunk-JIQBZ2UT.js";
21
+ import "./chunk-64VFL4WI.js";
22
+ import "./chunk-ENSGPOLR.js";
23
23
  import "./chunk-HTOTG4TS.js";
24
- import "./chunk-JTUZP2OD.js";
24
+ import "./chunk-LCAH3OGR.js";
25
25
  import "./chunk-U7TEQCBN.js";
26
26
  import "./chunk-XNLSTHDK.js";
27
- import "./chunk-BHJT53TP.js";
28
- import "./chunk-VE6CCH33.js";
27
+ import "./chunk-PDWPFR5T.js";
28
+ import "./chunk-Y5PA7DVK.js";
29
29
  import {
30
30
  isErrorWithCause
31
- } from "./chunk-G5BSQ6DP.js";
31
+ } from "./chunk-BP3PQ67D.js";
32
32
  import {
33
33
  error
34
34
  } from "./chunk-WZWDS3W4.js";
@@ -15,31 +15,31 @@ import {
15
15
  import {
16
16
  stderr,
17
17
  stdout
18
- } from "./chunk-UNWQVOLY.js";
19
- import "./chunk-GUATFMMU.js";
18
+ } from "./chunk-CSZTT7QN.js";
19
+ import "./chunk-CU752KW7.js";
20
20
  import "./chunk-G2YT2GWF.js";
21
- import "./chunk-YTT3UHUB.js";
21
+ import "./chunk-CRGWLUGC.js";
22
22
  import "./chunk-WGDTG44V.js";
23
- import "./chunk-O44Z6MAV.js";
23
+ import "./chunk-J4NHRZX6.js";
24
24
  import {
25
25
  commandUsage
26
- } from "./chunk-55DYW2MP.js";
26
+ } from "./chunk-I6QGYSB4.js";
27
27
  import {
28
28
  ViewClass
29
29
  } from "./chunk-4KCU2KZL.js";
30
- import "./chunk-SYGF27W7.js";
30
+ import "./chunk-JIQBZ2UT.js";
31
31
  import {
32
32
  Spec
33
- } from "./chunk-G5NJ7CYI.js";
34
- import "./chunk-6A3XS52F.js";
33
+ } from "./chunk-64VFL4WI.js";
34
+ import "./chunk-ENSGPOLR.js";
35
35
  import {
36
36
  CacheEntry
37
- } from "./chunk-OE6VHHN4.js";
37
+ } from "./chunk-P6LBJWJN.js";
38
38
  import "./chunk-APMYKJI2.js";
39
39
  import {
40
40
  assertOk
41
- } from "./chunk-UQUIO7LW.js";
42
- import "./chunk-JTUZP2OD.js";
41
+ } from "./chunk-PBBULTAG.js";
42
+ import "./chunk-LCAH3OGR.js";
43
43
  import "./chunk-U7TEQCBN.js";
44
44
  import "./chunk-XNLSTHDK.js";
45
45
  import {
@@ -50,12 +50,12 @@ import {
50
50
  storeEntryNames,
51
51
  storeEntryTime,
52
52
  verifyStoreEntry
53
- } from "./chunk-QA6RE2GS.js";
54
- import "./chunk-BHJT53TP.js";
55
- import "./chunk-VE6CCH33.js";
53
+ } from "./chunk-X2WYIUFQ.js";
54
+ import "./chunk-PDWPFR5T.js";
55
+ import "./chunk-Y5PA7DVK.js";
56
56
  import {
57
57
  integrityHex
58
- } from "./chunk-G5BSQ6DP.js";
58
+ } from "./chunk-BP3PQ67D.js";
59
59
  import {
60
60
  error
61
61
  } from "./chunk-WZWDS3W4.js";
@@ -1762,6 +1762,11 @@ var normalizeBinPaths = (manifest) => {
1762
1762
  var integrityRE = /^sha512-[a-zA-Z0-9/+]{86}==$/;
1763
1763
  var isIntegrity = (i) => typeof i === "string" && integrityRE.test(i);
1764
1764
  var integrityHex = (i) => isIntegrity(i) ? Buffer.from(i.slice(7), "base64").toString("hex") : void 0;
1765
+ var BROTLI_TARBALL_EXT = ".tar.br";
1766
+ var tarballFormat = (url) => {
1767
+ const end = /[?#]/.exec(url)?.index ?? url.length;
1768
+ return url.endsWith(BROTLI_TARBALL_EXT, end) ? "brotli" : void 0;
1769
+ };
1765
1770
  var asError = (er, fallbackMessage = "Unknown error") => er instanceof Error ? er : new Error(String(er) || fallbackMessage);
1766
1771
  var isObject = (v2) => !!v2 && typeof v2 === "object" && (v2.constructor === Object || v2.constructor === void 0);
1767
1772
  var maybeRecordStringString = (o) => o === void 0 || isRecordStringString(o);
@@ -6889,7 +6894,12 @@ var parseKVLine = (set, line) => {
6889
6894
  };
6890
6895
 
6891
6896
  // ../../src/tar/src/unpack.ts
6892
- import { unzip as unzipCB, unzipSync as unzipSyncCB } from "node:zlib";
6897
+ import {
6898
+ brotliDecompress as brotliCB,
6899
+ brotliDecompressSync as brotliSyncCB,
6900
+ unzip as unzipCB,
6901
+ unzipSync as unzipSyncCB
6902
+ } from "node:zlib";
6893
6903
 
6894
6904
  // ../../src/tar/src/find-tar-dir.ts
6895
6905
  var findTarDir = (path, tarDir) => {
@@ -6928,6 +6938,16 @@ var unzipSync = (input) => {
6928
6938
  throw unzipError(er, input.length, max);
6929
6939
  }
6930
6940
  };
6941
+ var isGzip = (b) => b[0] === 31 && b[1] === 139;
6942
+ var brotliSync = (input) => {
6943
+ const max = unzipMax(input.length);
6944
+ try {
6945
+ return brotliSyncCB(input, { maxOutputLength: max });
6946
+ } catch (er) {
6947
+ throw unzipError(er, input.length, max);
6948
+ }
6949
+ };
6950
+ var decompressSync = (input, format) => format === "brotli" ? brotliSync(input) : isGzip(input) ? unzipSync(input) : input;
6931
6951
  var tmp = randomBytes2(6).toString("hex") + ".";
6932
6952
  var foldKeys = process.platform === "darwin" || process.platform === "win32";
6933
6953
  var entryKey = (p) => foldKeys ? p.toLowerCase() : p;
@@ -6975,10 +6995,9 @@ var checkFs = (h, tarDir, target) => {
6975
6995
  return true;
6976
6996
  };
6977
6997
  var parseTarball = (buffer, tmp2) => {
6978
- const isGzip = buffer[0] === 31 && buffer[1] === 139;
6979
- if (isGzip) {
6998
+ if (isGzip(buffer)) {
6980
6999
  throw error("still gzipped after unzipping", {
6981
- found: isGzip,
7000
+ found: true,
6982
7001
  wanted: false
6983
7002
  });
6984
7003
  }
@@ -7081,10 +7100,9 @@ var parseTarball = (buffer, tmp2) => {
7081
7100
  }
7082
7101
  return { dirs, files };
7083
7102
  };
7084
- var storeLayout = (tarData, dir) => {
7085
- const isGzip = tarData[0] === 31 && tarData[1] === 139;
7103
+ var storeLayout = (tarData, dir, format) => {
7086
7104
  const { dirs, files } = parseTarball(
7087
- isGzip ? unzipSync(tarData) : tarData,
7105
+ decompressSync(tarData, format),
7088
7106
  dir
7089
7107
  );
7090
7108
  const rel = (p) => relative(dir, p).replace(/\\/g, "/");
@@ -7126,8 +7144,8 @@ var storeLayout = (tarData, dir) => {
7126
7144
  binFiles
7127
7145
  };
7128
7146
  };
7129
- var unpackToStoreSync = (tarData, dir) => {
7130
- const { index, files, binFiles } = storeLayout(tarData, dir);
7147
+ var unpackToStoreSync = (tarData, dir, format) => {
7148
+ const { index, files, binFiles } = storeLayout(tarData, dir, format);
7131
7149
  mkdirSync2(dirname2(dir), { recursive: true });
7132
7150
  mkdirSync2(dir, { mode: 511 });
7133
7151
  let succeeded = false;
@@ -7200,7 +7218,7 @@ var sweep = (tmp2) => {
7200
7218
  }
7201
7219
  };
7202
7220
  var seq = 0;
7203
- var explodeEntry = (store, buf) => {
7221
+ var explodeEntry = (store, buf, format) => {
7204
7222
  const hex = integrityHex(entryIntegrity(buf));
7205
7223
  if (!hex) return "ignored";
7206
7224
  const entry = join2(store, hex);
@@ -7213,7 +7231,8 @@ var explodeEntry = (store, buf) => {
7213
7231
  const sideTmp = join2(store, ".tmp", `${hex}.json.${n7}`);
7214
7232
  const { index } = unpackToStoreSync(
7215
7233
  buf.subarray(buf.readUInt32BE(0)),
7216
- tmp2
7234
+ tmp2,
7235
+ format
7217
7236
  );
7218
7237
  try {
7219
7238
  writeFileSync2(sideTmp, JSON.stringify(index));
@@ -7256,7 +7275,7 @@ var explode = async (cache, store, keys, integrities) => {
7256
7275
  continue;
7257
7276
  }
7258
7277
  try {
7259
- const res = explodeEntry(store, buf);
7278
+ const res = explodeEntry(store, buf, tarballFormat(key));
7260
7279
  if (typeof res === "number") {
7261
7280
  s.exploded.add(key);
7262
7281
  s.written++;
@@ -15,14 +15,14 @@ import {
15
15
  pairsToRecords,
16
16
  registrySelectionFields,
17
17
  registrySelectors
18
- } from "./chunk-5BD4QGW2.js";
18
+ } from "./chunk-ZPVVD6CI.js";
19
19
  import {
20
20
  normalizeRegistryURL
21
- } from "./chunk-O44Z6MAV.js";
21
+ } from "./chunk-J4NHRZX6.js";
22
22
  import {
23
23
  getCommand,
24
24
  isRecordField
25
- } from "./chunk-6A3XS52F.js";
25
+ } from "./chunk-ENSGPOLR.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-G5BSQ6DP.js";
36
+ } from "./chunk-BP3PQ67D.js";
37
37
  import {
38
38
  error
39
39
  } from "./chunk-WZWDS3W4.js";
@@ -13,14 +13,14 @@ import {
13
13
  AbortError,
14
14
  SecurityArchive,
15
15
  pRetry
16
- } from "./chunk-FOJCK57G.js";
16
+ } from "./chunk-U3WCCLFD.js";
17
17
  import {
18
18
  Monorepo,
19
19
  PackageJson,
20
20
  getUser,
21
21
  minimatch,
22
22
  platformCheck
23
- } from "./chunk-6G7MTZGS.js";
23
+ } from "./chunk-BUKZHMMK.js";
24
24
  import {
25
25
  asDepID,
26
26
  baseDepID,
@@ -35,10 +35,10 @@ import {
35
35
  joinExtra,
36
36
  splitDepID,
37
37
  splitExtra
38
- } from "./chunk-SYGF27W7.js";
38
+ } from "./chunk-JIQBZ2UT.js";
39
39
  import {
40
40
  Spec as Spec2
41
- } from "./chunk-G5NJ7CYI.js";
41
+ } from "./chunk-64VFL4WI.js";
42
42
  import {
43
43
  load,
44
44
  walkUp
@@ -46,7 +46,7 @@ import {
46
46
  import {
47
47
  userAgent,
48
48
  userAgentHeaders
49
- } from "./chunk-JTUZP2OD.js";
49
+ } from "./chunk-LCAH3OGR.js";
50
50
  import {
51
51
  graphStep,
52
52
  promiseSpawn
@@ -56,7 +56,7 @@ import {
56
56
  } from "./chunk-XNLSTHDK.js";
57
57
  import {
58
58
  rimraf
59
- } from "./chunk-BHJT53TP.js";
59
+ } from "./chunk-PDWPFR5T.js";
60
60
  import {
61
61
  Spec,
62
62
  Version,
@@ -65,6 +65,8 @@ import {
65
65
  asNormalizedManifest,
66
66
  assertPathSafeName,
67
67
  assertRecordStringString,
68
+ brotliTarballName,
69
+ brotliTarballUrl,
68
70
  compare,
69
71
  defaultGitHostArchives,
70
72
  defaultGitHosts,
@@ -95,8 +97,9 @@ import {
95
97
  patch,
96
98
  satisfies,
97
99
  shortDependencyTypes,
98
- subset
99
- } from "./chunk-G5BSQ6DP.js";
100
+ subset,
101
+ tarballFormat
102
+ } from "./chunk-BP3PQ67D.js";
100
103
  import {
101
104
  error,
102
105
  typeError
@@ -4471,6 +4474,7 @@ var stringifyNode = (node) => {
4471
4474
  };
4472
4475
 
4473
4476
  // ../../src/graph/src/node.ts
4477
+ var brotliAlternate = (dist2) => brotliTarballUrl(dist2?.tarball, dist2?.alternates);
4474
4478
  var Node = class _Node {
4475
4479
  get [Symbol.toStringTag]() {
4476
4480
  return "@vltpkg/graph.Node";
@@ -4574,6 +4578,29 @@ var Node = class _Node {
4574
4578
  * The manifest this node represents in the graph.
4575
4579
  */
4576
4580
  manifest;
4581
+ /**
4582
+ * Whether this node's artifact is the `.tar.br`: from the manifest's
4583
+ * `dist.alternates` at construction, or overwritten by the lockfile's
4584
+ * flag bit when the node came from one (so an existing lockfile keeps
4585
+ * whichever artifact it pinned). Only consulted while `resolved` is
4586
+ * still unset -- once there is a URL, it is the answer (see the
4587
+ * getter).
4588
+ */
4589
+ #brotli = false;
4590
+ /**
4591
+ * True when this node's artifact is the registry's Brotli (`.tar.br`)
4592
+ * tarball rather than the gzip `.tgz`, which makes `integrity` that
4593
+ * artifact's hash. `resolved` is authoritative whenever it is set, so
4594
+ * the two can never drift; the stored bit only carries the lockfile's
4595
+ * answer across to `setResolved()`, which has to know the extension
4596
+ * before it can build the URL.
4597
+ */
4598
+ get brotli() {
4599
+ return this.resolved ? tarballFormat(this.resolved) === "brotli" : this.#brotli;
4600
+ }
4601
+ set brotli(brotli) {
4602
+ this.#brotli = brotli;
4603
+ }
4577
4604
  /**
4578
4605
  * Project where this node resides
4579
4606
  */
@@ -4706,6 +4733,7 @@ var Node = class _Node {
4706
4733
  }
4707
4734
  this.graph = options.graph;
4708
4735
  this.manifest = manifest;
4736
+ this.#brotli = options["brotli-tarballs"] !== false && !!brotliAlternate(manifest?.dist);
4709
4737
  this.#name = name || this.manifest?.name;
4710
4738
  this.version = version || this.manifest?.version;
4711
4739
  }
@@ -4723,8 +4751,17 @@ var Node = class _Node {
4723
4751
  }
4724
4752
  #registryNodeResolved(tuple) {
4725
4753
  const spec2 = hydrateTuple(tuple, this.#name, this.#options);
4726
- this.resolved = this.manifest?.dist?.tarball || spec2.conventionalRegistryTarball;
4727
- this.integrity ??= this.manifest?.dist?.integrity;
4754
+ const dist2 = this.manifest?.dist;
4755
+ const tarball = dist2?.tarball || spec2.conventionalRegistryTarball;
4756
+ const alt = this.#brotli ? brotliAlternate(dist2) : void 0;
4757
+ const brotli = this.#brotli ? alt?.tarball ?? (tarball && brotliTarballName(tarball)) : void 0;
4758
+ if (brotli) {
4759
+ this.resolved = brotli;
4760
+ if (alt?.integrity) this.integrity ??= alt.integrity;
4761
+ return;
4762
+ }
4763
+ this.resolved = tarball;
4764
+ this.integrity ??= dist2?.integrity;
4728
4765
  }
4729
4766
  get options() {
4730
4767
  return this.#options;
@@ -9088,15 +9125,15 @@ import { dirname as dirname2, resolve as resolve3 } from "node:path";
9088
9125
 
9089
9126
  // ../../src/graph/src/lockfile/types.ts
9090
9127
  var LOCKFILE_VERSION = 1;
9091
- var getFlagNumFromNode = (node) => node.optional && node.dev ? LockfileNodeFlagDevOptional : node.optional ? LockfileNodeFlagOptional : node.dev ? LockfileNodeFlagDev : LockfileNodeFlagNone;
9128
+ var getFlagNumFromNode = (node) => (node.optional ? LockfileNodeFlagOptional : 0) | (node.dev ? LockfileNodeFlagDev : 0) | (node.brotli ? LockfileNodeFlagBrotli : 0);
9092
9129
  var getBooleanFlagsFromNum = (flags) => ({
9093
9130
  dev: !!(flags & LockfileNodeFlagDev),
9094
- optional: !!(flags & LockfileNodeFlagOptional)
9131
+ optional: !!(flags & LockfileNodeFlagOptional),
9132
+ brotli: !!(flags & LockfileNodeFlagBrotli)
9095
9133
  });
9096
- var LockfileNodeFlagNone = 0;
9097
9134
  var LockfileNodeFlagOptional = 1;
9098
9135
  var LockfileNodeFlagDev = 2;
9099
- var LockfileNodeFlagDevOptional = 3;
9136
+ var LockfileNodeFlagBrotli = 4;
9100
9137
  var BuildStateNone = void 0;
9101
9138
  var BuildStateNeeded = 1;
9102
9139
  var BuildStateBuilt = 2;
@@ -9690,7 +9727,9 @@ var Graph = class {
9690
9727
  toFoundNode.manifest = manifest;
9691
9728
  this.manifests.set(toFoundNode.id, manifest);
9692
9729
  }
9693
- toFoundNode.integrity ??= manifest.dist?.integrity;
9730
+ if (!toFoundNode.brotli) {
9731
+ toFoundNode.integrity ??= manifest.dist?.integrity;
9732
+ }
9694
9733
  }
9695
9734
  return toFoundNode;
9696
9735
  }
@@ -9710,7 +9749,7 @@ var Graph = class {
9710
9749
  toNode.dev = flags.dev;
9711
9750
  toNode.optional = flags.optional;
9712
9751
  if (samePackage) copyPackageMetadata(toNode, samePackage);
9713
- toNode.integrity ??= manifest?.dist?.integrity;
9752
+ if (!toNode.brotli) toNode.integrity ??= manifest?.dist?.integrity;
9714
9753
  if (extra) {
9715
9754
  const { modifier, peerSetHash } = splitExtra(extra);
9716
9755
  toNode.modifier = modifier;
@@ -10012,10 +10051,11 @@ var loadNodes = (graph, nodes, options, actual2, throwOnMissingManifest) => {
10012
10051
  node.peerSetHash = peerSetHash;
10013
10052
  }
10014
10053
  }
10015
- const { dev: dev2, optional: optional2 } = getBooleanFlagsFromNum(flags);
10054
+ const { dev: dev2, optional: optional2, brotli } = getBooleanFlagsFromNum(flags);
10016
10055
  node.options = options;
10017
10056
  node.dev = dev2;
10018
10057
  node.optional = optional2;
10058
+ node.brotli = brotli;
10019
10059
  node.integrity = integrity ?? referenceNode?.integrity;
10020
10060
  node.resolved = type2 === "remote" ? filepath : resolved ?? referenceNode?.resolved;
10021
10061
  node.resolvedFromLockfile = !!(node.integrity && node.resolved);
@@ -12,7 +12,7 @@ var require = _vlt_createRequire(import.meta.filename);
12
12
  import {
13
13
  Spec,
14
14
  kCustomInspect
15
- } from "./chunk-G5BSQ6DP.js";
15
+ } from "./chunk-BP3PQ67D.js";
16
16
 
17
17
  // ../../src/spec/src/index.ts
18
18
  import { homedir } from "node:os";
@@ -11,18 +11,18 @@ import {createRequire as _vlt_createRequire} from "node:module";
11
11
  var require = _vlt_createRequire(import.meta.filename);
12
12
  import {
13
13
  asUnknownSpecPrefix
14
- } from "./chunk-O44Z6MAV.js";
14
+ } from "./chunk-J4NHRZX6.js";
15
15
  import {
16
16
  addKey,
17
17
  asDependency
18
- } from "./chunk-B2FK2HHL.js";
18
+ } from "./chunk-3WBHQEWL.js";
19
19
  import {
20
20
  joinDepIDTuple,
21
21
  splitDepID
22
- } from "./chunk-SYGF27W7.js";
22
+ } from "./chunk-JIQBZ2UT.js";
23
23
  import {
24
24
  Spec
25
- } from "./chunk-G5NJ7CYI.js";
25
+ } from "./chunk-64VFL4WI.js";
26
26
 
27
27
  // ../../src/cli-sdk/src/parse-add-remove-args.ts
28
28
  import { isAbsolute, relative, resolve } from "node:path";
@@ -11,17 +11,17 @@ 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-5YB6UIC3.js";
14
+ } from "./chunk-QXKWSPKX.js";
15
15
  import {
16
16
  findCmdShimIfExists,
17
17
  install
18
- } from "./chunk-B2FK2HHL.js";
18
+ } from "./chunk-3WBHQEWL.js";
19
19
  import {
20
20
  PathScurry
21
- } from "./chunk-6G7MTZGS.js";
21
+ } from "./chunk-BUKZHMMK.js";
22
22
  import {
23
23
  Spec
24
- } from "./chunk-G5NJ7CYI.js";
24
+ } from "./chunk-64VFL4WI.js";
25
25
  import {
26
26
  walkUp
27
27
  } from "./chunk-HTOTG4TS.js";
@@ -30,7 +30,7 @@ import {
30
30
  } from "./chunk-XNLSTHDK.js";
31
31
  import {
32
32
  parseScope
33
- } from "./chunk-G5BSQ6DP.js";
33
+ } from "./chunk-BP3PQ67D.js";
34
34
  import {
35
35
  error
36
36
  } from "./chunk-WZWDS3W4.js";
@@ -14,12 +14,12 @@ import {
14
14
  } from "./chunk-RIYFGX27.js";
15
15
  import {
16
16
  createHostContextsMap
17
- } from "./chunk-YFNQ6HZ3.js";
17
+ } from "./chunk-YL5D7SKZ.js";
18
18
  import {
19
19
  stderr,
20
20
  stdout,
21
21
  styleTextStdout
22
- } from "./chunk-UNWQVOLY.js";
22
+ } from "./chunk-CSZTT7QN.js";
23
23
  import {
24
24
  require_emoji_regex
25
25
  } from "./chunk-VTEFO2FT.js";
@@ -27,13 +27,13 @@ import {
27
27
  Query,
28
28
  actual,
29
29
  isRunResult
30
- } from "./chunk-B2FK2HHL.js";
30
+ } from "./chunk-3WBHQEWL.js";
31
31
  import {
32
32
  Monorepo
33
- } from "./chunk-6G7MTZGS.js";
33
+ } from "./chunk-BUKZHMMK.js";
34
34
  import {
35
35
  isErrorWithCause
36
- } from "./chunk-G5BSQ6DP.js";
36
+ } from "./chunk-BP3PQ67D.js";
37
37
  import {
38
38
  error
39
39
  } from "./chunk-WZWDS3W4.js";
@@ -1949,6 +1949,33 @@ var isBoolean = (value) => typeof value === "boolean";
1949
1949
  var integrityRE = /^sha512-[a-zA-Z0-9/+]{86}==$/;
1950
1950
  var isIntegrity = (i) => typeof i === "string" && integrityRE.test(i);
1951
1951
  var integrityHex = (i) => isIntegrity(i) ? Buffer.from(i.slice(7), "base64").toString("hex") : void 0;
1952
+ var BROTLI_TARBALL_EXT = ".tar.br";
1953
+ var tarballFormat = (url) => {
1954
+ const end = /[?#]/.exec(url)?.index ?? url.length;
1955
+ return url.endsWith(BROTLI_TARBALL_EXT, end) ? "brotli" : void 0;
1956
+ };
1957
+ var brotliTarballName = (tgz) => tgz.replace(/\.tgz$/, BROTLI_TARBALL_EXT);
1958
+ var brotliTarballUrl = (tarball, alternates) => {
1959
+ if (!tarball) return void 0;
1960
+ const entry = alternates?.find(
1961
+ (a) => a.kind === "tar.br" && !!a.tarball
1962
+ );
1963
+ if (!entry) return void 0;
1964
+ try {
1965
+ const href = new URL(entry.tarball, tarball).href;
1966
+ if (href !== new URL(brotliTarballName(tarball)).href) {
1967
+ return void 0;
1968
+ }
1969
+ return {
1970
+ tarball: href,
1971
+ ...isIntegrity(entry.integrity) && {
1972
+ integrity: entry.integrity
1973
+ }
1974
+ };
1975
+ } catch {
1976
+ return void 0;
1977
+ }
1978
+ };
1952
1979
  var asError = (er, fallbackMessage = "Unknown error") => er instanceof Error ? er : new Error(String(er) || fallbackMessage);
1953
1980
  var isError = (er) => er instanceof Error;
1954
1981
  var isErrorWithCause = (er) => isError(er) && "cause" in er;
@@ -2514,6 +2541,9 @@ export {
2514
2541
  normalizeBinPaths,
2515
2542
  integrityRE,
2516
2543
  integrityHex,
2544
+ tarballFormat,
2545
+ brotliTarballName,
2546
+ brotliTarballUrl,
2517
2547
  asError,
2518
2548
  isError,
2519
2549
  isErrorWithCause,