@vltpkg/cli-js 1.0.0-rc.26 → 1.0.0-rc.28

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-6HRR4HXE.js +293 -0
  2. package/{bugs-5UZKBRJ6.js → bugs-2CAZQ32S.js} +19 -22
  3. package/{build-HHRMIGWX.js → build-OAWTNBMS.js} +10 -13
  4. package/{cache-S7AIJNAW.js → cache-ZR7VPPVQ.js} +14 -15
  5. package/cache-unzip-src-unzip.js +606 -575
  6. package/chunk-2FIRKA7R.js +73 -0
  7. package/{chunk-D27QPHKI.js → chunk-2V4AQPBR.js} +67 -20
  8. package/{chunk-CEEMJNRZ.js → chunk-3MWZTKGK.js} +419 -328
  9. package/chunk-5TSPKXO4.js +116 -0
  10. package/{chunk-D3UYPLBW.js → chunk-7RZL7BZI.js} +159 -74
  11. package/{chunk-REEVCBSC.js → chunk-BW6C3YUV.js} +6 -6
  12. package/{chunk-JXGBASMB.js → chunk-CPM47YUH.js} +5 -3
  13. package/{chunk-5E5GX4G6.js → chunk-FBTBHRPG.js} +1 -1
  14. package/{chunk-AZLX27EM.js → chunk-FXDRM4ZO.js} +296 -258
  15. package/{chunk-WC3VIV77.js → chunk-HAG4VBEA.js} +11 -11
  16. package/{chunk-KSOWJE5Z.js → chunk-HAGUS4HI.js} +121 -95
  17. package/{chunk-FI5TUER7.js → chunk-HQ4US6G3.js} +681 -687
  18. package/chunk-IEISSXS4.js +711 -0
  19. package/{chunk-5TAPASMO.js → chunk-IYO5QKUW.js} +1 -1
  20. package/{chunk-UNANFLLJ.js → chunk-M7HPHM7B.js} +14 -12
  21. package/{chunk-BRSCRAUI.js → chunk-MAIQR5GM.js} +5 -5
  22. package/{chunk-TDTJOKF2.js → chunk-NLFBANVO.js} +8 -1
  23. package/{chunk-GM7VNI3N.js → chunk-OUUIOZ2I.js} +1 -1
  24. package/{chunk-HIGHMXU7.js → chunk-Q3DNNTPG.js} +27 -4
  25. package/{chunk-VCSVHRCS.js → chunk-R44FR7BY.js} +1269 -590
  26. package/{chunk-LCUNWXND.js → chunk-RK2PISOZ.js} +54 -6
  27. package/{chunk-45PZMAKV.js → chunk-TYV4N3S3.js} +6 -692
  28. package/{chunk-CY225LQK.js → chunk-VPKJNCKL.js} +26 -13
  29. package/{chunk-ORGRCZV6.js → chunk-VRIS5HAW.js} +3 -3
  30. package/{chunk-3T3M5JJF.js → chunk-WX2DCAG2.js} +7 -7
  31. package/{chunk-R3KDJL6J.js → chunk-XYCCQT7N.js} +34 -39
  32. package/{chunk-D7U7KDEM.js → chunk-YCQTLBWF.js} +1 -1
  33. package/{chunk-3PCMZMV5.js → chunk-ZINDEKAU.js} +144 -93
  34. package/{chunk-WYE4WWGF.js → chunk-ZS2RCG25.js} +5 -5
  35. package/{ci-2U44K5HH.js → ci-TOJJVHI4.js} +13 -16
  36. package/cli-package.json +2 -1
  37. package/{config-2OSWSNLR.js → config-DVAPEE5D.js} +12 -14
  38. package/{config-J7A3MQFH.js → config-GOV4E2KK.js} +26 -26
  39. package/{create-QORFVTHP.js → create-CDFZFVHL.js} +24 -26
  40. package/deprecate-WROL4AHK.js +176 -0
  41. package/{devtools-NOLON5YL.js → devtools-TPMVKPB5.js} +80 -77
  42. package/dist-tag-WZXXWXMB.js +204 -0
  43. package/{docs-5X4WDWUP.js → docs-YCOZFMZG.js} +19 -22
  44. package/{exec-YMICUMJA.js → exec-V4K5KJMZ.js} +24 -26
  45. package/{exec-cache-A6CMJUZ7.js → exec-cache-FHCGIY6J.js} +21 -23
  46. package/{exec-local-TYAKTIYJ.js → exec-local-YU6PF7HM.js} +19 -21
  47. package/{help-OKCOEMB3.js → help-DADL3NOX.js} +4 -5
  48. package/{init-VC6AG2UU.js → init-XNMWYATA.js} +10 -8
  49. package/{install-P5AO6772.js → install-FEGZHZRR.js} +28 -17
  50. package/{list-CIK732ED.js → list-JWAIDRFZ.js} +19 -21
  51. package/{login-R3B4H2I2.js → login-52SA2DSI.js} +6 -9
  52. package/{logout-YUUXIVUO.js → logout-5YYHNV5W.js} +6 -9
  53. package/{pack-QEI3LPIQ.js → pack-B7QZHMYP.js} +14 -17
  54. package/package.json +1 -1
  55. package/{ping-QSR64W6S.js → ping-PRGDYDRI.js} +6 -9
  56. package/{pkg-CNGHBNXD.js → pkg-UEIQIVVD.js} +15 -19
  57. package/profile-46FKVQEL.js +129 -0
  58. package/{publish-5N6MWW6E.js → publish-HBYHOSKH.js} +17 -20
  59. package/{query-MIH452QT.js → query-UJ2LXHJ5.js} +19 -21
  60. package/registry-client-package.json +1 -1
  61. package/registry-client-src-revalidate.js +1157 -1032
  62. package/{repo-I7XLLP24.js → repo-I6X66PHD.js} +19 -22
  63. package/{reporter-WBQK75RI.js → reporter-NUXJTV4G.js} +2 -3
  64. package/{run-NUQ63SUS.js → run-4VSEFXVM.js} +19 -21
  65. package/{run-exec-ZJSAJPME.js → run-exec-5JVZDUZD.js} +19 -21
  66. package/security-archive-src-update-expired.js +8 -7
  67. package/{src-BTES32CE.js → src-GIDTI3OJ.js} +20 -22
  68. package/token-YK6L74PA.js +206 -0
  69. package/{uninstall-A6XPKFIM.js → uninstall-UBUZBV7E.js} +14 -17
  70. package/unpublish-ZHJEKT7A.js +224 -0
  71. package/{update-FOBAWWTD.js → update-WO4BHJF4.js} +13 -16
  72. package/{version-AZK2MPTV.js → version-RLESYHML.js} +13 -16
  73. package/{view-PMXWE6QG.js → view-UA5HXFXG.js} +16 -17
  74. package/vlr.js +1 -1
  75. package/vlrx.js +1 -1
  76. package/vlt.js +1 -1
  77. package/vlx.js +1 -1
  78. package/vlxl.js +1 -1
  79. package/{whoami-OLZU4KG7.js → whoami-7H3FPR2O.js} +6 -9
  80. package/chunk-BGQCUUCA.js +0 -667
  81. package/chunk-E74WGW5C.js +0 -49
  82. package/chunk-J5OZBIY5.js +0 -68
  83. package/chunk-JLJKOF75.js +0 -40
  84. package/chunk-QI6PGM7S.js +0 -75
  85. package/token-JOS6MHEW.js +0 -103
@@ -12,28 +12,28 @@ var require = _vlt_createRequire(import.meta.filename);
12
12
  import {
13
13
  createDiffFilesProvider
14
14
  } from "./chunk-RIYFGX27.js";
15
+ import {
16
+ createHostContextsMap
17
+ } from "./chunk-VRIS5HAW.js";
15
18
  import {
16
19
  stderr,
17
20
  stdout,
18
21
  styleTextStdout
19
- } from "./chunk-LCUNWXND.js";
20
- import {
21
- require_emoji_regex
22
- } from "./chunk-VTEFO2FT.js";
23
- import {
24
- createHostContextsMap
25
- } from "./chunk-ORGRCZV6.js";
22
+ } from "./chunk-RK2PISOZ.js";
26
23
  import {
27
24
  Query,
28
25
  actual,
29
26
  isRunResult
30
- } from "./chunk-D3UYPLBW.js";
27
+ } from "./chunk-7RZL7BZI.js";
28
+ import {
29
+ require_emoji_regex
30
+ } from "./chunk-VTEFO2FT.js";
31
31
  import {
32
32
  Monorepo
33
- } from "./chunk-R3KDJL6J.js";
33
+ } from "./chunk-XYCCQT7N.js";
34
34
  import {
35
35
  isErrorWithCause
36
- } from "./chunk-HIGHMXU7.js";
36
+ } from "./chunk-Q3DNNTPG.js";
37
37
  import {
38
38
  error
39
39
  } from "./chunk-WZWDS3W4.js";
@@ -1018,7 +1018,6 @@ var ExecCommand = class {
1018
1018
  this.conf = conf;
1019
1019
  this.bg = bg;
1020
1020
  this.fg = fg;
1021
- this.view = this.validViewValues.get(conf.values.view) ?? "human";
1022
1021
  const {
1023
1022
  projectRoot,
1024
1023
  positionals: [arg0, ...args]
@@ -1026,6 +1025,7 @@ var ExecCommand = class {
1026
1025
  this.arg0 = arg0;
1027
1026
  this.args = args;
1028
1027
  this.projectRoot = projectRoot;
1028
+ this.view = this.validViewValues.get(conf.values.view) ?? "human";
1029
1029
  }
1030
1030
  #targetCount() {
1031
1031
  if (this.#nodes) return this.#nodes.length;
@@ -10,12 +10,9 @@ globalThis.clearInterval = _vlt_clearInterval;
10
10
  import {createRequire as _vlt_createRequire} from "node:module";
11
11
  var require = _vlt_createRequire(import.meta.filename);
12
12
  import {
13
- require_lib,
14
- zn
15
- } from "./chunk-FI5TUER7.js";
16
- import {
17
- RegistryClient
18
- } from "./chunk-CEEMJNRZ.js";
13
+ Zn,
14
+ require_lib
15
+ } from "./chunk-HQ4US6G3.js";
19
16
  import {
20
17
  Monorepo,
21
18
  PackageJson,
@@ -23,18 +20,20 @@ import {
23
20
  pickManifest,
24
21
  resolve,
25
22
  revs
26
- } from "./chunk-R3KDJL6J.js";
27
- import {
28
- rimraf
29
- } from "./chunk-BGQCUUCA.js";
23
+ } from "./chunk-XYCCQT7N.js";
30
24
  import {
31
25
  Spec2 as Spec
32
- } from "./chunk-45PZMAKV.js";
26
+ } from "./chunk-IEISSXS4.js";
27
+ import {
28
+ RegistryClient
29
+ } from "./chunk-3MWZTKGK.js";
30
+ import {
31
+ rimraf
32
+ } from "./chunk-R44FR7BY.js";
33
33
  import {
34
34
  asError,
35
- asPackument,
36
- isIntegrity
37
- } from "./chunk-HIGHMXU7.js";
35
+ asPackument
36
+ } from "./chunk-Q3DNNTPG.js";
38
37
  import {
39
38
  XDG
40
39
  } from "./chunk-XNLSTHDK.js";
@@ -50,10 +49,10 @@ import { randomBytes } from "node:crypto";
50
49
  import { lstat, mkdir, rename, writeFile } from "node:fs/promises";
51
50
  import { basename as basename2, dirname, resolve as resolve2, sep } from "node:path";
52
51
 
53
- // ../../node_modules/.vlt/~npm~tar@7.5.11/node_modules/tar/dist/esm/header.js
52
+ // ../../node_modules/.vlt/~npm~tar@7.5.13/node_modules/tar/dist/esm/header.js
54
53
  import { posix as pathModule } from "node:path";
55
54
 
56
- // ../../node_modules/.vlt/~npm~tar@7.5.11/node_modules/tar/dist/esm/large-numbers.js
55
+ // ../../node_modules/.vlt/~npm~tar@7.5.13/node_modules/tar/dist/esm/large-numbers.js
57
56
  var encode = (num, buf) => {
58
57
  if (!Number.isSafeInteger(num)) {
59
58
  throw Error("cannot encode number outside of javascript safe integer range");
@@ -134,7 +133,7 @@ var pos = (buf) => {
134
133
  var onesComp = (byte) => (255 ^ byte) & 255;
135
134
  var twosComp = (byte) => (255 ^ byte) + 1 & 255;
136
135
 
137
- // ../../node_modules/.vlt/~npm~tar@7.5.11/node_modules/tar/dist/esm/types.js
136
+ // ../../node_modules/.vlt/~npm~tar@7.5.13/node_modules/tar/dist/esm/types.js
138
137
  var isCode = (c) => name.has(c);
139
138
  var name = /* @__PURE__ */ new Map([
140
139
  ["0", "File"],
@@ -177,7 +176,7 @@ var name = /* @__PURE__ */ new Map([
177
176
  ]);
178
177
  var code = new Map(Array.from(name).map((kv) => [kv[1], kv[0]]));
179
178
 
180
- // ../../node_modules/.vlt/~npm~tar@7.5.11/node_modules/tar/dist/esm/header.js
179
+ // ../../node_modules/.vlt/~npm~tar@7.5.13/node_modules/tar/dist/esm/header.js
181
180
  var Header = class {
182
181
  cksumValid = false;
183
182
  needPax = false;
@@ -291,7 +290,7 @@ var Header = class {
291
290
  this.needPax = encNumber(buf, off + 116, 8, this.gid) || this.needPax;
292
291
  this.needPax = encNumber(buf, off + 124, 12, this.size) || this.needPax;
293
292
  this.needPax = encDate(buf, off + 136, 12, this.mtime) || this.needPax;
294
- buf[off + 156] = this.#type.charCodeAt(0);
293
+ buf[off + 156] = Number(this.#type.codePointAt(0));
295
294
  this.needPax = encString(buf, off + 157, 100, this.linkpath) || this.needPax;
296
295
  buf.write("ustar\x0000", off + 257, 8);
297
296
  this.needPax = encString(buf, off + 265, 32, this.uname) || this.needPax;
@@ -380,7 +379,7 @@ var encDate = (buf, off, size, date) => date === void 0 ? false : encNumber(buf,
380
379
  var NULLS = new Array(156).join("\0");
381
380
  var encString = (buf, off, size, str) => str === void 0 ? false : (buf.write(str + NULLS, off, size, "utf8"), str.length !== Buffer.byteLength(str) || str.length > size);
382
381
 
383
- // ../../node_modules/.vlt/~npm~tar@7.5.11/node_modules/tar/dist/esm/pax.js
382
+ // ../../node_modules/.vlt/~npm~tar@7.5.13/node_modules/tar/dist/esm/pax.js
384
383
  import { basename } from "node:path";
385
384
  var Pax = class _Pax {
386
385
  atime;
@@ -867,10 +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 fromLockfile = !!(integrity && resolved);
873
- const r = fromLockfile ? { 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);
874
878
  switch (f.type) {
875
879
  case "git": {
876
880
  const {
@@ -904,41 +908,58 @@ var PackageInfoClient = class {
904
908
  }
905
909
  }
906
910
  case "registry": {
907
- const trustIntegrity = this.#trustedIntegrities.get(r.resolved) === r.integrity;
908
- const response = await this.registryClient.request(
909
- r.resolved,
910
- {
911
- integrity: r.integrity,
912
- trustIntegrity
913
- }
914
- );
915
- if (response.statusCode !== 200) {
916
- throw this.#resolveError(
917
- spec,
918
- options,
919
- "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,
920
915
  {
921
- url: r.resolved,
922
- response
916
+ integrity: r.integrity,
917
+ trustIntegrity,
918
+ ...useCache === false ? { useCache } : {}
923
919
  }
924
920
  );
925
- }
926
- if (!trustIntegrity && response.checkIntegrity({ spec, url: resolved })) {
927
- this.#trustedIntegrities.set(r.resolved, response.integrity);
928
- }
929
- const buf = response.buffer();
930
- if (r.integrity && !fromLockfile) {
931
- const hash = createHash("sha512");
932
- hash.update(buf);
933
- const computed = `sha512-${hash.digest("base64")}`;
934
- if (computed !== r.integrity) {
935
- throw error("Tarball integrity check failed", {
936
- code: "EINTEGRITY",
921
+ if (response.statusCode !== 200) {
922
+ throw this.#resolveError(
937
923
  spec,
938
- url: r.resolved,
939
- wanted: r.integrity,
940
- found: computed
941
- });
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;
942
963
  }
943
964
  }
944
965
  try {
@@ -1138,39 +1159,53 @@ var PackageInfoClient = class {
1138
1159
  "no tarball found in manifest.dist"
1139
1160
  );
1140
1161
  }
1141
- const trustIntegrity = this.#trustedIntegrities.get(tarball) === integrity;
1142
- const response = await this.registryClient.request(tarball, {
1143
- ...options,
1144
- integrity,
1145
- trustIntegrity
1146
- });
1147
- if (response.statusCode !== 200) {
1148
- throw this.#resolveError(
1149
- spec,
1150
- options,
1151
- "failed to fetch tarball",
1152
- { 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
+ }
1153
1172
  );
1154
- }
1155
- if (!trustIntegrity && response.checkIntegrity({ spec, url: tarball })) {
1156
- this.#trustedIntegrities.set(tarball, response.integrity);
1157
- }
1158
- const buf = response.buffer();
1159
- if (integrity) {
1160
- const hash = createHash("sha512");
1161
- hash.update(buf);
1162
- const computed = `sha512-${hash.digest("base64")}`;
1163
- if (computed !== integrity) {
1164
- throw error("Tarball integrity check failed", {
1165
- code: "EINTEGRITY",
1173
+ if (response.statusCode !== 200) {
1174
+ throw this.#resolveError(
1166
1175
  spec,
1167
- url: tarball,
1168
- wanted: integrity,
1169
- found: computed
1170
- });
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);
1171
1206
  }
1207
+ throw er;
1172
1208
  }
1173
- return buf;
1174
1209
  }
1175
1210
  case "git": {
1176
1211
  const {
@@ -1205,7 +1240,7 @@ var PackageInfoClient = class {
1205
1240
  await rename2(src, pkg);
1206
1241
  }
1207
1242
  }
1208
- return zn({ cwd, gzip: true }, ["package"]).concat();
1243
+ return Zn({ cwd, gzip: true }, ["package"]).concat();
1209
1244
  });
1210
1245
  }
1211
1246
  }
@@ -1235,7 +1270,7 @@ var PackageInfoClient = class {
1235
1270
  if (st.isDirectory()) {
1236
1271
  const p = dirname2(path);
1237
1272
  const b = basename3(path);
1238
- return zn({ cwd: p, gzip: true }, [b]).concat();
1273
+ return Zn({ cwd: p, gzip: true }, [b]).concat();
1239
1274
  }
1240
1275
  return readFile(path);
1241
1276
  }
@@ -1243,7 +1278,7 @@ var PackageInfoClient = class {
1243
1278
  const ws = this.#getWS(spec, options);
1244
1279
  const p = dirname2(ws.fullpath);
1245
1280
  const b = basename3(ws.fullpath);
1246
- return zn({ cwd: p, gzip: true }, [b]).concat();
1281
+ return Zn({ cwd: p, gzip: true }, [b]).concat();
1247
1282
  }
1248
1283
  }
1249
1284
  }
@@ -1276,15 +1311,6 @@ var PackageInfoClient = class {
1276
1311
  options
1277
1312
  );
1278
1313
  if (!mani) throw this.#resolveError(spec, options);
1279
- const { integrity, tarball } = mani.dist ?? /* c8 ignore next */
1280
- {};
1281
- if (isIntegrity(integrity) && tarball) {
1282
- const registryOrigin = new URL(String(f.registry)).origin;
1283
- const tgzOrigin = new URL(tarball).origin;
1284
- if (tgzOrigin === registryOrigin) {
1285
- this.#trustedIntegrities.set(tarball, integrity);
1286
- }
1287
- }
1288
1314
  if (cachePath) {
1289
1315
  const json = JSON.stringify({
1290
1316
  ...mani,