@vltpkg/cli-js 1.0.0-rc.32 → 1.0.0-rc.33
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.
- package/{access-SQZRJLJA.js → access-VP3KSJ2M.js} +23 -12
- package/{bugs-BMZ5UERM.js → bugs-4ZQXJA4F.js} +19 -17
- package/{build-LGQI6OGM.js → build-P74RVUUP.js} +13 -9
- package/{cache-JWHNATAX.js → cache-J4J3ZWXP.js} +19 -14
- package/cache-unzip-src-unzip.js +434 -428
- package/{chunk-6YXVQ5HC.js → chunk-2PLIV3N3.js} +1 -27
- package/{chunk-ZUP6UTME.js → chunk-4RZDJQ5U.js} +42 -61
- package/{chunk-LEX7YPHR.js → chunk-4SSFBFB5.js} +123 -92
- package/{chunk-SDBTQF2Y.js → chunk-5COWONUB.js} +5 -5
- package/{chunk-5UXEBLLT.js → chunk-7KI6XHXZ.js} +68 -7
- package/{chunk-R44FR7BY.js → chunk-7NHXV6AH.js} +439 -433
- package/{chunk-FBTBHRPG.js → chunk-7TNSW6W3.js} +1 -1
- package/{chunk-DI2CYYXF.js → chunk-BAUMCTQK.js} +694 -440
- package/{chunk-FXDRM4ZO.js → chunk-CLVRCGOZ.js} +247 -235
- package/{chunk-YCQTLBWF.js → chunk-CNSTFT7U.js} +1 -1
- package/{chunk-SIXXDCBI.js → chunk-DJYKQWV2.js} +7 -7
- package/chunk-E74WGW5C.js +49 -0
- package/chunk-EAWRHC27.js +75 -0
- package/{chunk-DFNHGGGV.js → chunk-EFWPI6IY.js} +1 -1
- package/{chunk-JBVLIV37.js → chunk-EQ633HIM.js} +14 -13
- package/{chunk-DM3WGEVB.js → chunk-F2FKLPZD.js} +7 -7
- package/chunk-FAG776ZD.js +137 -0
- package/{chunk-HQ4US6G3.js → chunk-FWKQ7YDF.js} +1049 -980
- package/{chunk-G6PG3AGN.js → chunk-GTICKXWZ.js} +11 -8
- package/{chunk-KRGA5VLT.js → chunk-ICJRCXSG.js} +31 -27
- package/{chunk-3TVABXAG.js → chunk-JEE4B4FL.js} +3 -3
- package/{chunk-7XE7OES7.js → chunk-JLGPPV6Z.js} +3 -3
- package/{chunk-M2WD7IBO.js → chunk-JZQAUAHT.js} +1 -1
- package/{chunk-IAKUGHGT.js → chunk-MT76WHSM.js} +1 -1
- package/{chunk-DIKKTUBV.js → chunk-OTNMX4EK.js} +3 -3
- package/{chunk-2V4AQPBR.js → chunk-PMCAQG5J.js} +85 -46
- package/{chunk-JKAZKVQU.js → chunk-PW6S6AIO.js} +15 -11
- package/{chunk-NLFBANVO.js → chunk-SSN4CYZF.js} +18 -2
- package/chunk-UBLFPJHV.js +40 -0
- package/{chunk-YQXDHMHG.js → chunk-VGWEB64T.js} +2932 -2786
- package/{chunk-LRPTCGTW.js → chunk-XA47WS4N.js} +11 -15
- package/{chunk-XFQ2EH5D.js → chunk-XIJFEV6U.js} +3 -3
- package/{ci-FQJANSQW.js → ci-GIDCFAZF.js} +14 -10
- package/cli-package.json +6 -2
- package/{config-4KQTTXJH.js → config-LIQMIMTF.js} +15 -13
- package/{config-LRL3N7TN.js → config-NBO3COMM.js} +13 -11
- package/{create-KN6AXEA6.js → create-K2S3J62I.js} +24 -19
- package/{deprecate-P26WHVFB.js → deprecate-4PJKNFXN.js} +22 -14
- package/{devtools-6NFQDW4L.js → devtools-HGLF4KAO.js} +82 -28
- package/{dist-tag-FA2BT7SA.js → dist-tag-TA6LWT2V.js} +16 -9
- package/{docs-OAPIY4SC.js → docs-ZCMIKQAN.js} +19 -17
- package/{exec-CVZGHJZS.js → exec-XVF4KCRJ.js} +24 -19
- package/{exec-cache-3AHODVRN.js → exec-cache-2IWJNBFB.js} +22 -17
- package/{exec-local-I4OJX76E.js → exec-local-FNFTQYFP.js} +17 -14
- package/{help-QFIQSPNS.js → help-ZDRILKVQ.js} +5 -4
- package/{init-QLADIAP5.js → init-VMYJE5Q3.js} +12 -10
- package/{install-B7CU2BLC.js → install-ZHMWN27D.js} +27 -12
- package/{list-OTFV3LOM.js → list-BPFKWXCR.js} +20 -15
- package/{login-LG2ZOIDQ.js → login-DQL5A4NT.js} +23 -9
- package/{logout-KUI773AM.js → logout-Q74VRDSN.js} +19 -8
- package/{pack-C55TTBIQ.js → pack-GLURO5KY.js} +17 -13
- package/package.json +8 -1
- package/{ping-VNUOC26G.js → ping-PPEYPKZD.js} +17 -10
- package/{pkg-H4RJEBK5.js → pkg-UTEKJ5CB.js} +13 -11
- package/{profile-DIJ5JUSE.js → profile-5QFRWC2L.js} +16 -8
- package/{publish-XF2TRBPH.js → publish-5VDI3JXX.js} +23 -16
- package/{query-BGP5JMJ7.js → query-I6DZ7TF2.js} +20 -15
- package/registry-ZVO3VAHY.js +117 -0
- package/registry-client-package.json +6 -2
- package/registry-client-src-revalidate.js +1233 -975
- package/{repo-NCEHK7KB.js → repo-SB3C7MZZ.js} +19 -17
- package/{reporter-OB6SNHOZ.js → reporter-2XBYWAVU.js} +3 -2
- package/{run-ZNJJYEJF.js → run-U6CW5Q56.js} +17 -14
- package/{run-exec-F5OV7MVN.js → run-exec-RFB572AL.js} +19 -14
- package/security-archive-src-update-expired.js +16 -11
- package/setup-BFKUYGJB.js +181 -0
- package/{src-M3WI7TSB.js → src-ZWBXAZOV.js} +25 -17
- package/{token-KXCVRJGF.js → token-M5HPJJJQ.js} +20 -9
- package/{uninstall-33SUWR6K.js → uninstall-UUBTM4ZQ.js} +15 -11
- package/{unpublish-7AZPBZF2.js → unpublish-WDSRB6DV.js} +17 -9
- package/{update-2EQF6IKZ.js → update-J4BEFJRC.js} +14 -10
- package/{version-HFYI3SEX.js → version-ZVG66SKC.js} +12 -10
- package/{view-C5OT36OB.js → view-WFK75G74.js} +19 -15
- package/vlr.js +1 -1
- package/vlrx.js +1 -1
- package/vlt.js +1 -1
- package/vlx.js +1 -1
- package/vlxl.js +1 -1
- package/{whoami-KKFV3XR6.js → whoami-TCSDOBU2.js} +19 -8
- package/chunk-FXIBCUIM.js +0 -73
|
@@ -10,9 +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
|
-
|
|
13
|
+
Qn,
|
|
14
14
|
require_lib
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-FWKQ7YDF.js";
|
|
16
16
|
import {
|
|
17
17
|
Monorepo,
|
|
18
18
|
PackageJson,
|
|
@@ -20,20 +20,20 @@ import {
|
|
|
20
20
|
pickManifest,
|
|
21
21
|
resolve,
|
|
22
22
|
revs
|
|
23
|
-
} from "./chunk-
|
|
24
|
-
import {
|
|
25
|
-
Spec2 as Spec
|
|
26
|
-
} from "./chunk-JKAZKVQU.js";
|
|
23
|
+
} from "./chunk-ICJRCXSG.js";
|
|
27
24
|
import {
|
|
28
25
|
RegistryClient
|
|
29
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-BAUMCTQK.js";
|
|
30
27
|
import {
|
|
31
28
|
rimraf
|
|
32
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-7NHXV6AH.js";
|
|
30
|
+
import {
|
|
31
|
+
Spec2 as Spec
|
|
32
|
+
} from "./chunk-PW6S6AIO.js";
|
|
33
33
|
import {
|
|
34
34
|
asError,
|
|
35
35
|
asPackument
|
|
36
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-2PLIV3N3.js";
|
|
37
37
|
import {
|
|
38
38
|
XDG
|
|
39
39
|
} from "./chunk-XNLSTHDK.js";
|
|
@@ -49,10 +49,10 @@ import { randomBytes } from "node:crypto";
|
|
|
49
49
|
import { lstat, mkdir, rename, writeFile } from "node:fs/promises";
|
|
50
50
|
import { basename as basename2, dirname, resolve as resolve2, sep } from "node:path";
|
|
51
51
|
|
|
52
|
-
// ../../node_modules/.vlt/~npm~tar@7.5.
|
|
52
|
+
// ../../node_modules/.vlt/~npm~tar@7.5.20/node_modules/tar/dist/esm/header.js
|
|
53
53
|
import { posix as pathModule } from "node:path";
|
|
54
54
|
|
|
55
|
-
// ../../node_modules/.vlt/~npm~tar@7.5.
|
|
55
|
+
// ../../node_modules/.vlt/~npm~tar@7.5.20/node_modules/tar/dist/esm/large-numbers.js
|
|
56
56
|
var encode = (num, buf) => {
|
|
57
57
|
if (!Number.isSafeInteger(num)) {
|
|
58
58
|
throw Error("cannot encode number outside of javascript safe integer range");
|
|
@@ -133,8 +133,20 @@ var pos = (buf) => {
|
|
|
133
133
|
var onesComp = (byte) => (255 ^ byte) & 255;
|
|
134
134
|
var twosComp = (byte) => (255 ^ byte) + 1 & 255;
|
|
135
135
|
|
|
136
|
-
// ../../node_modules/.vlt/~npm~tar@7.5.
|
|
136
|
+
// ../../node_modules/.vlt/~npm~tar@7.5.20/node_modules/tar/dist/esm/types.js
|
|
137
137
|
var isCode = (c) => name.has(c);
|
|
138
|
+
var normalFsTypes = /* @__PURE__ */ new Set([
|
|
139
|
+
"0",
|
|
140
|
+
"",
|
|
141
|
+
"1",
|
|
142
|
+
"2",
|
|
143
|
+
"3",
|
|
144
|
+
"4",
|
|
145
|
+
"5",
|
|
146
|
+
"6",
|
|
147
|
+
"7",
|
|
148
|
+
"D"
|
|
149
|
+
]);
|
|
138
150
|
var name = /* @__PURE__ */ new Map([
|
|
139
151
|
["0", "File"],
|
|
140
152
|
// same as File
|
|
@@ -176,7 +188,8 @@ var name = /* @__PURE__ */ new Map([
|
|
|
176
188
|
]);
|
|
177
189
|
var code = new Map(Array.from(name).map((kv) => [kv[1], kv[0]]));
|
|
178
190
|
|
|
179
|
-
// ../../node_modules/.vlt/~npm~tar@7.5.
|
|
191
|
+
// ../../node_modules/.vlt/~npm~tar@7.5.20/node_modules/tar/dist/esm/header.js
|
|
192
|
+
var notNegative = (n) => n === void 0 || n < 0 ? void 0 : n;
|
|
180
193
|
var Header = class {
|
|
181
194
|
cksumValid = false;
|
|
182
195
|
needPax = false;
|
|
@@ -213,18 +226,21 @@ var Header = class {
|
|
|
213
226
|
if (!buf || !(buf.length >= off + 512)) {
|
|
214
227
|
throw new Error("need 512 bytes for header");
|
|
215
228
|
}
|
|
216
|
-
this.path = ex?.path ?? decString(buf, off, 100);
|
|
217
|
-
this.mode = ex?.mode ?? gex?.mode ?? decNumber(buf, off + 100, 8);
|
|
218
|
-
this.uid = ex?.uid ?? gex?.uid ?? decNumber(buf, off + 108, 8);
|
|
219
|
-
this.gid = ex?.gid ?? gex?.gid ?? decNumber(buf, off + 116, 8);
|
|
220
|
-
this.size = ex?.size ?? gex?.size ?? decNumber(buf, off + 124, 12);
|
|
221
|
-
this.mtime = ex?.mtime ?? gex?.mtime ?? decDate(buf, off + 136, 12);
|
|
222
|
-
this.cksum = decNumber(buf, off + 148, 12);
|
|
223
|
-
if (gex)
|
|
224
|
-
this.#slurp(gex, true);
|
|
225
|
-
if (ex)
|
|
226
|
-
this.#slurp(ex);
|
|
227
229
|
const t = decString(buf, off + 156, 1);
|
|
230
|
+
const isNormalFS = normalFsTypes.has(t);
|
|
231
|
+
const exForFields = isNormalFS ? ex : void 0;
|
|
232
|
+
const gexForFields = isNormalFS ? gex : void 0;
|
|
233
|
+
this.path = exForFields?.path ?? decString(buf, off, 100);
|
|
234
|
+
this.mode = exForFields?.mode ?? gexForFields?.mode ?? decNumber(buf, off + 100, 8);
|
|
235
|
+
this.uid = exForFields?.uid ?? gexForFields?.uid ?? decNumber(buf, off + 108, 8);
|
|
236
|
+
this.gid = exForFields?.gid ?? gexForFields?.gid ?? decNumber(buf, off + 116, 8);
|
|
237
|
+
this.size = notNegative(exForFields?.size ?? gexForFields?.size ?? decNumber(buf, off + 124, 12));
|
|
238
|
+
this.mtime = exForFields?.mtime ?? gexForFields?.mtime ?? decDate(buf, off + 136, 12);
|
|
239
|
+
this.cksum = decNumber(buf, off + 148, 12);
|
|
240
|
+
if (gexForFields)
|
|
241
|
+
this.#slurp(gexForFields, true);
|
|
242
|
+
if (exForFields)
|
|
243
|
+
this.#slurp(exForFields);
|
|
228
244
|
if (isCode(t)) {
|
|
229
245
|
this.#type = t || "0";
|
|
230
246
|
}
|
|
@@ -236,10 +252,10 @@ var Header = class {
|
|
|
236
252
|
}
|
|
237
253
|
this.linkpath = decString(buf, off + 157, 100);
|
|
238
254
|
if (buf.subarray(off + 257, off + 265).toString() === "ustar\x0000") {
|
|
239
|
-
this.uname =
|
|
240
|
-
this.gname =
|
|
241
|
-
this.devmaj =
|
|
242
|
-
this.devmin =
|
|
255
|
+
this.uname = exForFields?.uname ?? gexForFields?.uname ?? decString(buf, off + 265, 32);
|
|
256
|
+
this.gname = exForFields?.gname ?? gexForFields?.gname ?? decString(buf, off + 297, 32);
|
|
257
|
+
this.devmaj = exForFields?.devmaj ?? gexForFields?.devmaj ?? decNumber(buf, off + 329, 8) ?? 0;
|
|
258
|
+
this.devmin = exForFields?.devmin ?? gexForFields?.devmin ?? decNumber(buf, off + 337, 8) ?? 0;
|
|
243
259
|
if (buf[off + 475] !== 0) {
|
|
244
260
|
const prefix = decString(buf, off + 345, 155);
|
|
245
261
|
this.path = prefix + "/" + this.path;
|
|
@@ -266,7 +282,7 @@ var Header = class {
|
|
|
266
282
|
}
|
|
267
283
|
#slurp(ex, gex = false) {
|
|
268
284
|
Object.assign(this, Object.fromEntries(Object.entries(ex).filter(([k, v]) => {
|
|
269
|
-
return !(v === null || v === void 0 || k === "path" && gex || k === "linkpath" && gex || k === "global");
|
|
285
|
+
return !(v === null || v === void 0 || k === "size" && Number(v) < 0 || k === "path" && gex || k === "linkpath" && gex || k === "global");
|
|
270
286
|
})));
|
|
271
287
|
}
|
|
272
288
|
encode(buf, off = 0) {
|
|
@@ -379,7 +395,7 @@ var encDate = (buf, off, size, date) => date === void 0 ? false : encNumber(buf,
|
|
|
379
395
|
var NULLS = new Array(156).join("\0");
|
|
380
396
|
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);
|
|
381
397
|
|
|
382
|
-
// ../../node_modules/.vlt/~npm~tar@7.5.
|
|
398
|
+
// ../../node_modules/.vlt/~npm~tar@7.5.20/node_modules/tar/dist/esm/pax.js
|
|
383
399
|
import { basename } from "node:path";
|
|
384
400
|
var Pax = class _Pax {
|
|
385
401
|
atime;
|
|
@@ -491,8 +507,36 @@ var parseKVLine = (set, line) => {
|
|
|
491
507
|
return set;
|
|
492
508
|
}
|
|
493
509
|
const k = r.replace(/^SCHILY\.(dev|ino|nlink)/, "$1");
|
|
494
|
-
const v = kv.join("=");
|
|
495
|
-
|
|
510
|
+
const v = kv.join("=").replace(/\0.*/, "");
|
|
511
|
+
switch (k) {
|
|
512
|
+
case "path":
|
|
513
|
+
case "linkpath":
|
|
514
|
+
case "type":
|
|
515
|
+
case "charset":
|
|
516
|
+
case "comment":
|
|
517
|
+
case "gname":
|
|
518
|
+
case "uname":
|
|
519
|
+
set[k] = v;
|
|
520
|
+
break;
|
|
521
|
+
case "ctime":
|
|
522
|
+
case "atime":
|
|
523
|
+
case "mtime":
|
|
524
|
+
set[k] = new Date(Number(v) * 1e3);
|
|
525
|
+
break;
|
|
526
|
+
case "size":
|
|
527
|
+
const s = +v;
|
|
528
|
+
if (s >= 0)
|
|
529
|
+
set[k] = s;
|
|
530
|
+
break;
|
|
531
|
+
case "gid":
|
|
532
|
+
case "uid":
|
|
533
|
+
case "dev":
|
|
534
|
+
case "ino":
|
|
535
|
+
case "nlink":
|
|
536
|
+
case "mode":
|
|
537
|
+
set[k] = +v;
|
|
538
|
+
break;
|
|
539
|
+
}
|
|
496
540
|
return set;
|
|
497
541
|
};
|
|
498
542
|
|
|
@@ -822,6 +866,10 @@ var rename2 = platform !== "win32" ? fsRename : (async function(oldPath, newPath
|
|
|
822
866
|
var xdg = new XDG("vlt");
|
|
823
867
|
var delimiter = "~";
|
|
824
868
|
var manifestCacheMaxAge = 5 * 60 * 1e3;
|
|
869
|
+
var noRegistryError = (spec) => error(
|
|
870
|
+
'No registry configured to resolve this spec. Set "registry" in vlt.json, pass --registry, or run `vlt login --registry=<url>`. See https://docs.vlt.sh/cli',
|
|
871
|
+
{ code: "ECONFIG", spec }
|
|
872
|
+
);
|
|
825
873
|
var PackageInfoClient = class {
|
|
826
874
|
#registryClient;
|
|
827
875
|
#projectRoot;
|
|
@@ -833,6 +881,7 @@ var PackageInfoClient = class {
|
|
|
833
881
|
#trustedIntegrities = /* @__PURE__ */ new Map();
|
|
834
882
|
#manifestCacheMinAge = Date.now() - manifestCacheMaxAge;
|
|
835
883
|
#cachePath;
|
|
884
|
+
#packumentPromises = /* @__PURE__ */ new Map();
|
|
836
885
|
get registryClient() {
|
|
837
886
|
if (!this.#registryClient) {
|
|
838
887
|
this.#registryClient = new RegistryClient(this.options);
|
|
@@ -922,7 +971,7 @@ var PackageInfoClient = class {
|
|
|
922
971
|
throw this.#resolveError(
|
|
923
972
|
spec,
|
|
924
973
|
options,
|
|
925
|
-
|
|
974
|
+
`Registry returned HTTP ${response.statusCode} when fetching the tarball for ${spec}. The resolved version may have been unpublished, or the registry may be misconfigured or unreachable.`,
|
|
926
975
|
{
|
|
927
976
|
url: r.resolved,
|
|
928
977
|
response
|
|
@@ -1085,7 +1134,7 @@ var PackageInfoClient = class {
|
|
|
1085
1134
|
extra += `${delimiter}arch:${options.arch}`;
|
|
1086
1135
|
}
|
|
1087
1136
|
return encodeURIComponent(
|
|
1088
|
-
`${spec.registry}${delimiter}${spec}${extra}`
|
|
1137
|
+
`${spec.registry ?? ""}${delimiter}${spec}${extra}`
|
|
1089
1138
|
);
|
|
1090
1139
|
}
|
|
1091
1140
|
/**
|
|
@@ -1104,40 +1153,6 @@ var PackageInfoClient = class {
|
|
|
1104
1153
|
const key = this.#manifestCacheKey(f, options);
|
|
1105
1154
|
return pathResolve(this.#cachePath, "package-info", key);
|
|
1106
1155
|
}
|
|
1107
|
-
async #registryManifestRequest(spec, options) {
|
|
1108
|
-
const { registry, name: name2, registrySpec } = spec.final;
|
|
1109
|
-
if (!spec.range?.isSingle || !registrySpec) {
|
|
1110
|
-
throw this.#resolveError(
|
|
1111
|
-
spec,
|
|
1112
|
-
options,
|
|
1113
|
-
"failed to request manifest",
|
|
1114
|
-
{ spec }
|
|
1115
|
-
);
|
|
1116
|
-
}
|
|
1117
|
-
const possibleLeadingChars = ["=", "^", "~", "v"];
|
|
1118
|
-
const hasLeadingRange = possibleLeadingChars.some(
|
|
1119
|
-
(char) => registrySpec.startsWith(char)
|
|
1120
|
-
);
|
|
1121
|
-
const version = hasLeadingRange ? registrySpec.slice(1) : registrySpec;
|
|
1122
|
-
const pakuURL = new URL(`${name2}/${version}`, registry);
|
|
1123
|
-
const response = await this.registryClient.request(pakuURL, {
|
|
1124
|
-
headers: {
|
|
1125
|
-
accept: "application/json"
|
|
1126
|
-
}
|
|
1127
|
-
});
|
|
1128
|
-
if (response.statusCode !== 200) {
|
|
1129
|
-
throw this.#resolveError(
|
|
1130
|
-
spec,
|
|
1131
|
-
options,
|
|
1132
|
-
"failed to fetch manifest",
|
|
1133
|
-
{
|
|
1134
|
-
url: pakuURL,
|
|
1135
|
-
response
|
|
1136
|
-
}
|
|
1137
|
-
);
|
|
1138
|
-
}
|
|
1139
|
-
return response.json();
|
|
1140
|
-
}
|
|
1141
1156
|
async tarball(spec, options = {}) {
|
|
1142
1157
|
if (typeof spec === "string")
|
|
1143
1158
|
spec = Spec.parse(spec, this.options);
|
|
@@ -1149,14 +1164,14 @@ var PackageInfoClient = class {
|
|
|
1149
1164
|
throw this.#resolveError(
|
|
1150
1165
|
spec,
|
|
1151
1166
|
options,
|
|
1152
|
-
|
|
1167
|
+
`The registry manifest for ${spec} has no "dist" section, so no tarball can be resolved. The package version may be malformed or unpublished.`
|
|
1153
1168
|
);
|
|
1154
1169
|
const { tarball, integrity } = dist;
|
|
1155
1170
|
if (!tarball) {
|
|
1156
1171
|
throw this.#resolveError(
|
|
1157
1172
|
spec,
|
|
1158
1173
|
options,
|
|
1159
|
-
|
|
1174
|
+
`The registry manifest for ${spec} is missing a tarball URL (dist.tarball). The package version may be malformed or unpublished in this registry.`
|
|
1160
1175
|
);
|
|
1161
1176
|
}
|
|
1162
1177
|
const fetchTarball = async (useCache) => {
|
|
@@ -1174,7 +1189,7 @@ var PackageInfoClient = class {
|
|
|
1174
1189
|
throw this.#resolveError(
|
|
1175
1190
|
spec,
|
|
1176
1191
|
options,
|
|
1177
|
-
|
|
1192
|
+
`Registry returned HTTP ${response.statusCode} when fetching the tarball for ${spec} at ${tarball}. The version may have been unpublished, or the registry may be misconfigured or unreachable.`,
|
|
1178
1193
|
{ response, url: tarball }
|
|
1179
1194
|
);
|
|
1180
1195
|
}
|
|
@@ -1240,7 +1255,7 @@ var PackageInfoClient = class {
|
|
|
1240
1255
|
await rename2(src, pkg);
|
|
1241
1256
|
}
|
|
1242
1257
|
}
|
|
1243
|
-
return
|
|
1258
|
+
return Qn({ cwd, gzip: true }, ["package"]).concat();
|
|
1244
1259
|
});
|
|
1245
1260
|
}
|
|
1246
1261
|
}
|
|
@@ -1270,7 +1285,7 @@ var PackageInfoClient = class {
|
|
|
1270
1285
|
if (st.isDirectory()) {
|
|
1271
1286
|
const p = dirname2(path);
|
|
1272
1287
|
const b = basename3(path);
|
|
1273
|
-
return
|
|
1288
|
+
return Qn({ cwd: p, gzip: true }, [b]).concat();
|
|
1274
1289
|
}
|
|
1275
1290
|
return readFile(path);
|
|
1276
1291
|
}
|
|
@@ -1278,7 +1293,7 @@ var PackageInfoClient = class {
|
|
|
1278
1293
|
const ws = this.#getWS(spec, options);
|
|
1279
1294
|
const p = dirname2(ws.fullpath);
|
|
1280
1295
|
const b = basename3(ws.fullpath);
|
|
1281
|
-
return
|
|
1296
|
+
return Qn({ cwd: p, gzip: true }, [b]).concat();
|
|
1282
1297
|
}
|
|
1283
1298
|
}
|
|
1284
1299
|
}
|
|
@@ -1305,7 +1320,7 @@ var PackageInfoClient = class {
|
|
|
1305
1320
|
} catch {
|
|
1306
1321
|
}
|
|
1307
1322
|
}
|
|
1308
|
-
const mani =
|
|
1323
|
+
const mani = pickManifest(
|
|
1309
1324
|
await this.packument(f, options),
|
|
1310
1325
|
spec,
|
|
1311
1326
|
options
|
|
@@ -1455,27 +1470,43 @@ var PackageInfoClient = class {
|
|
|
1455
1470
|
}
|
|
1456
1471
|
case "registry": {
|
|
1457
1472
|
const { registry, name: name2 } = f;
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
}
|
|
1463
|
-
});
|
|
1464
|
-
if (response.statusCode !== 200) {
|
|
1465
|
-
throw this.#resolveError(
|
|
1466
|
-
spec,
|
|
1467
|
-
options,
|
|
1468
|
-
"failed to fetch packument",
|
|
1469
|
-
{
|
|
1470
|
-
url: pakuURL,
|
|
1471
|
-
response
|
|
1472
|
-
}
|
|
1473
|
-
);
|
|
1473
|
+
if (!registry) throw noRegistryError(spec);
|
|
1474
|
+
if (options.fullPackument) {
|
|
1475
|
+
const pakuURL2 = new URL(name2, registry);
|
|
1476
|
+
return this.#fetchPackument(spec, options, pakuURL2);
|
|
1474
1477
|
}
|
|
1475
|
-
|
|
1478
|
+
const packumentKey = `${registry}${name2}`;
|
|
1479
|
+
const inflight = this.#packumentPromises.get(packumentKey);
|
|
1480
|
+
if (inflight) return inflight;
|
|
1481
|
+
const pakuURL = new URL(name2, registry);
|
|
1482
|
+
const promise = this.#fetchPackument(spec, options, pakuURL);
|
|
1483
|
+
this.#packumentPromises.set(packumentKey, promise);
|
|
1484
|
+
promise.then(
|
|
1485
|
+
() => this.#packumentPromises.delete(packumentKey),
|
|
1486
|
+
() => this.#packumentPromises.delete(packumentKey)
|
|
1487
|
+
);
|
|
1488
|
+
return promise;
|
|
1476
1489
|
}
|
|
1477
1490
|
}
|
|
1478
1491
|
}
|
|
1492
|
+
async #fetchPackument(spec, options, pakuURL) {
|
|
1493
|
+
const accept = options.fullPackument ? "application/json" : "application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*";
|
|
1494
|
+
const response = await this.registryClient.request(pakuURL, {
|
|
1495
|
+
headers: { accept }
|
|
1496
|
+
});
|
|
1497
|
+
if (response.statusCode !== 200) {
|
|
1498
|
+
throw this.#resolveError(
|
|
1499
|
+
spec,
|
|
1500
|
+
options,
|
|
1501
|
+
"failed to fetch packument",
|
|
1502
|
+
{
|
|
1503
|
+
url: pakuURL,
|
|
1504
|
+
response
|
|
1505
|
+
}
|
|
1506
|
+
);
|
|
1507
|
+
}
|
|
1508
|
+
return response.json();
|
|
1509
|
+
}
|
|
1479
1510
|
async resolve(spec, options = {}) {
|
|
1480
1511
|
const memoKey = String(spec);
|
|
1481
1512
|
if (typeof spec === "string")
|
|
@@ -14,26 +14,26 @@ import {
|
|
|
14
14
|
} from "./chunk-RIYFGX27.js";
|
|
15
15
|
import {
|
|
16
16
|
createHostContextsMap
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-XIJFEV6U.js";
|
|
18
18
|
import {
|
|
19
19
|
stderr,
|
|
20
20
|
stdout,
|
|
21
21
|
styleTextStdout
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-7KI6XHXZ.js";
|
|
23
23
|
import {
|
|
24
24
|
Query,
|
|
25
25
|
actual,
|
|
26
26
|
isRunResult
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-VGWEB64T.js";
|
|
28
28
|
import {
|
|
29
29
|
require_emoji_regex
|
|
30
30
|
} from "./chunk-VTEFO2FT.js";
|
|
31
31
|
import {
|
|
32
32
|
Monorepo
|
|
33
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-ICJRCXSG.js";
|
|
34
34
|
import {
|
|
35
35
|
isErrorWithCause
|
|
36
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-2PLIV3N3.js";
|
|
37
37
|
import {
|
|
38
38
|
error
|
|
39
39
|
} from "./chunk-WZWDS3W4.js";
|
|
@@ -17,24 +17,31 @@ import {
|
|
|
17
17
|
import {
|
|
18
18
|
generateDefaultHelp,
|
|
19
19
|
generateFullHelp
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-SSN4CYZF.js";
|
|
21
21
|
import {
|
|
22
22
|
isViewClass
|
|
23
23
|
} from "./chunk-RXNA2XCX.js";
|
|
24
24
|
import {
|
|
25
25
|
parseError
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-EFWPI6IY.js";
|
|
27
27
|
import {
|
|
28
28
|
isGraphRunError,
|
|
29
29
|
splitDepID
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-MT76WHSM.js";
|
|
31
|
+
import {
|
|
32
|
+
hasConfiguredRegistry,
|
|
33
|
+
missingRegistryError
|
|
34
|
+
} from "./chunk-FAG776ZD.js";
|
|
31
35
|
import {
|
|
32
36
|
defaultView
|
|
33
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-PMCAQG5J.js";
|
|
38
|
+
import {
|
|
39
|
+
emitter
|
|
40
|
+
} from "./chunk-UBLFPJHV.js";
|
|
34
41
|
import {
|
|
35
42
|
isErrorWithCause,
|
|
36
43
|
isObject
|
|
37
|
-
} from "./chunk-
|
|
44
|
+
} from "./chunk-2PLIV3N3.js";
|
|
38
45
|
import {
|
|
39
46
|
XDG
|
|
40
47
|
} from "./chunk-XNLSTHDK.js";
|
|
@@ -53,6 +60,8 @@ var formatURL = (v, format) => v instanceof URL ? v.toString() : (
|
|
|
53
60
|
/* c8 ignore next */
|
|
54
61
|
format(v)
|
|
55
62
|
);
|
|
63
|
+
var hasCustomToString = (v) => isObject(v) && v.toString !== Object.prototype.toString;
|
|
64
|
+
var formatToString = (v, format) => hasCustomToString(v) ? v.toString() : format(v);
|
|
56
65
|
var formatArray = (v, format, joiner = ", ") => Array.isArray(v) ? v.join(joiner) : (
|
|
57
66
|
/* c8 ignore next */
|
|
58
67
|
format(v)
|
|
@@ -191,7 +200,7 @@ var printCode = (err, usage, stderr2, format) => {
|
|
|
191
200
|
stderr2(indent(`While fetching: ${formatURL(url, format)}`));
|
|
192
201
|
}
|
|
193
202
|
if (spec) {
|
|
194
|
-
stderr2(indent(`To satisfy: ${
|
|
203
|
+
stderr2(indent(`To satisfy: ${formatToString(spec, format)}`));
|
|
195
204
|
}
|
|
196
205
|
if (from) {
|
|
197
206
|
stderr2(indent(`From: ${format(from)}`));
|
|
@@ -381,6 +390,48 @@ var supportsColor = {
|
|
|
381
390
|
stderr: createSupportsColor({ isTTY: tty.isatty(2) })
|
|
382
391
|
};
|
|
383
392
|
|
|
393
|
+
// ../../src/cli-sdk/src/verbose-log.ts
|
|
394
|
+
var rank = {
|
|
395
|
+
silent: 0,
|
|
396
|
+
error: 1,
|
|
397
|
+
warn: 2,
|
|
398
|
+
info: 3,
|
|
399
|
+
verbose: 4,
|
|
400
|
+
debug: 5
|
|
401
|
+
};
|
|
402
|
+
var isVerbose = (level) => rank[level] >= rank.verbose;
|
|
403
|
+
var isDebug = (level) => rank[level] >= rank.debug;
|
|
404
|
+
var identityStyle = (_f, s) => s;
|
|
405
|
+
var tagStyle = (state, statusCode) => {
|
|
406
|
+
switch (state) {
|
|
407
|
+
case "cache":
|
|
408
|
+
case "stale":
|
|
409
|
+
case "304":
|
|
410
|
+
return "green";
|
|
411
|
+
case "start":
|
|
412
|
+
return "gray";
|
|
413
|
+
case "complete":
|
|
414
|
+
return statusCode !== void 0 && statusCode >= 400 ? "red" : "green";
|
|
415
|
+
}
|
|
416
|
+
};
|
|
417
|
+
var formatRequestEvent = (event, style = identityStyle) => {
|
|
418
|
+
const { url, state, method = "GET", statusCode, durationMs } = event;
|
|
419
|
+
const tag = state === "complete" ? String(statusCode ?? "") : state;
|
|
420
|
+
const duration = durationMs === void 0 ? "" : style("gray", ` (${durationMs}ms)`);
|
|
421
|
+
return `${style(tagStyle(state, statusCode), tag.padEnd(8))} ${method} ${String(url)}${duration}`;
|
|
422
|
+
};
|
|
423
|
+
var startRequestLog = (level, write, style = identityStyle) => {
|
|
424
|
+
if (!isVerbose(level)) return () => {
|
|
425
|
+
};
|
|
426
|
+
const debug = isDebug(level);
|
|
427
|
+
const handler = (event) => {
|
|
428
|
+
if (event.state === "start" && !debug) return;
|
|
429
|
+
write(formatRequestEvent(event, style));
|
|
430
|
+
};
|
|
431
|
+
emitter.on("request", handler);
|
|
432
|
+
return () => emitter.off("request", handler);
|
|
433
|
+
};
|
|
434
|
+
|
|
384
435
|
// ../../src/cli-sdk/src/output.ts
|
|
385
436
|
var isCI = () => !!(process.env.CI || process.env.GITHUB_ACTIONS || process.env.GITLAB_CI || process.env.CIRCLECI || process.env.JENKINS_URL || process.env.BUILDKITE || process.env.TRAVIS);
|
|
386
437
|
var supportsColor2 = (stream) => {
|
|
@@ -428,7 +479,7 @@ var startView = (conf, opts, views, { start } = { start: Date.now() }) => {
|
|
|
428
479
|
var outputCommand = async (cliCommand, conf, { start, vltVersion } = {
|
|
429
480
|
start: Date.now()
|
|
430
481
|
}) => {
|
|
431
|
-
const { usage, views, command } = cliCommand;
|
|
482
|
+
const { usage, views, command, needsRegistry } = cliCommand;
|
|
432
483
|
const stdoutColor = conf.values.color ?? supportsColor2(process.stdout);
|
|
433
484
|
const stderrColor = conf.values.color ?? supportsColor2(process.stderr);
|
|
434
485
|
if (conf.values.help) {
|
|
@@ -442,6 +493,11 @@ var outputCommand = async (cliCommand, conf, { start, vltVersion } = {
|
|
|
442
493
|
}
|
|
443
494
|
if (stdoutColor) styleTextStdout = styleText;
|
|
444
495
|
if (stderrColor) styleTextStderr = styleText;
|
|
496
|
+
const stopRequestLog = startRequestLog(
|
|
497
|
+
conf.values.loglevel,
|
|
498
|
+
(line) => stderr(line),
|
|
499
|
+
styleTextStderr
|
|
500
|
+
);
|
|
445
501
|
const { onDone, onError } = startView(
|
|
446
502
|
conf,
|
|
447
503
|
// assume views will always output to stdout so use color support from there
|
|
@@ -452,7 +508,11 @@ var outputCommand = async (cliCommand, conf, { start, vltVersion } = {
|
|
|
452
508
|
const telemetryEnabled = conf.values.telemetry;
|
|
453
509
|
const commandName = conf.command;
|
|
454
510
|
try {
|
|
511
|
+
if (needsRegistry && !hasConfiguredRegistry(conf)) {
|
|
512
|
+
throw missingRegistryError();
|
|
513
|
+
}
|
|
455
514
|
const output = await onDone(await command(conf));
|
|
515
|
+
stopRequestLog();
|
|
456
516
|
const duration_ms = Date.now() - start;
|
|
457
517
|
trackCommand(
|
|
458
518
|
{
|
|
@@ -480,6 +540,7 @@ var outputCommand = async (cliCommand, conf, { start, vltVersion } = {
|
|
|
480
540
|
}
|
|
481
541
|
await flush();
|
|
482
542
|
} catch (err) {
|
|
543
|
+
stopRequestLog();
|
|
483
544
|
onError?.(err);
|
|
484
545
|
process.exitCode ||= 1;
|
|
485
546
|
const duration_ms = Date.now() - start;
|