@vltpkg/cli-js 1.0.0-rc.32 → 1.0.0-rc.34
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-SXQICNAN.js} +23 -12
- package/{bugs-BMZ5UERM.js → bugs-OOPMFRCI.js} +19 -17
- package/{build-LGQI6OGM.js → build-HDXI5OA7.js} +13 -9
- package/{cache-JWHNATAX.js → cache-RW4Y4XNQ.js} +19 -14
- package/cache-unzip-src-unzip.js +434 -428
- package/{chunk-6YXVQ5HC.js → chunk-2PLIV3N3.js} +1 -27
- package/{chunk-G6PG3AGN.js → chunk-3SQ5Y324.js} +11 -8
- package/{chunk-ZUP6UTME.js → chunk-4RZDJQ5U.js} +42 -61
- package/{chunk-M2WD7IBO.js → chunk-4ZXA6RLP.js} +1 -1
- package/{chunk-R44FR7BY.js → chunk-7NHXV6AH.js} +439 -433
- package/{chunk-SIXXDCBI.js → chunk-CCQYIYTA.js} +7 -7
- package/{chunk-FXDRM4ZO.js → chunk-CLVRCGOZ.js} +247 -235
- package/{chunk-YCQTLBWF.js → chunk-CNSTFT7U.js} +1 -1
- package/{chunk-7XE7OES7.js → chunk-D5CP6O6G.js} +3 -3
- package/{chunk-YQXDHMHG.js → chunk-E5YE7UTZ.js} +3167 -2991
- package/chunk-E74WGW5C.js +49 -0
- package/{chunk-DFNHGGGV.js → chunk-EFWPI6IY.js} +1 -1
- package/{chunk-5UXEBLLT.js → chunk-EHEVBLDB.js} +68 -7
- 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-HB7CKTYO.js +75 -0
- package/{chunk-KRGA5VLT.js → chunk-ICJRCXSG.js} +31 -27
- package/{chunk-FBTBHRPG.js → chunk-LCDBW6IT.js} +1 -1
- package/{chunk-IAKUGHGT.js → chunk-MT76WHSM.js} +1 -1
- package/{chunk-3TVABXAG.js → chunk-MU7Y4R5E.js} +3 -3
- package/{chunk-JKAZKVQU.js → chunk-PW6S6AIO.js} +15 -11
- package/{chunk-DI2CYYXF.js → chunk-U6DM3ROE.js} +706 -442
- package/chunk-UBLFPJHV.js +40 -0
- package/{chunk-SDBTQF2Y.js → chunk-UCD3RJYG.js} +5 -5
- package/{chunk-XFQ2EH5D.js → chunk-VM2RMMY4.js} +3 -3
- package/{chunk-DIKKTUBV.js → chunk-VZ7UNZHR.js} +3 -3
- package/{chunk-2V4AQPBR.js → chunk-WP6CYBPM.js} +81 -46
- package/{chunk-LEX7YPHR.js → chunk-WXMYKCQW.js} +118 -92
- package/{chunk-LRPTCGTW.js → chunk-XA47WS4N.js} +11 -15
- package/{chunk-NLFBANVO.js → chunk-Y7CQIZ7Y.js} +106 -150
- package/{ci-FQJANSQW.js → ci-MTYU2K2A.js} +14 -10
- package/cli-package.json +6 -2
- package/{config-4KQTTXJH.js → config-6NXV2BXW.js} +15 -13
- package/{config-LRL3N7TN.js → config-TVAXCTQO.js} +13 -11
- package/{create-KN6AXEA6.js → create-LXI5DCDW.js} +24 -19
- package/{deprecate-P26WHVFB.js → deprecate-2AQBL5XT.js} +22 -14
- package/{devtools-6NFQDW4L.js → devtools-HGLF4KAO.js} +82 -28
- package/{dist-tag-FA2BT7SA.js → dist-tag-BFSYLRIH.js} +16 -9
- package/{docs-OAPIY4SC.js → docs-ADPJ4B4C.js} +19 -17
- package/{exec-CVZGHJZS.js → exec-GMS54RAC.js} +24 -19
- package/{exec-cache-3AHODVRN.js → exec-cache-R5LVZL5Z.js} +22 -17
- package/{exec-local-I4OJX76E.js → exec-local-TVCLZGIM.js} +17 -14
- package/{help-QFIQSPNS.js → help-6CECUD6C.js} +5 -4
- package/{init-QLADIAP5.js → init-XXFLGYVP.js} +12 -10
- package/{install-B7CU2BLC.js → install-6KMXYSF5.js} +27 -12
- package/{list-OTFV3LOM.js → list-RUO3SUKY.js} +20 -15
- package/{login-LG2ZOIDQ.js → login-6I2CGO7I.js} +23 -9
- package/{logout-KUI773AM.js → logout-JTU4BJKH.js} +19 -8
- package/{pack-C55TTBIQ.js → pack-NCWH2TUA.js} +17 -13
- package/package.json +8 -1
- package/{ping-VNUOC26G.js → ping-4MEAC2WD.js} +17 -10
- package/{pkg-H4RJEBK5.js → pkg-ENSKG6G7.js} +13 -11
- package/{profile-DIJ5JUSE.js → profile-62YHNFSO.js} +16 -8
- package/{publish-XF2TRBPH.js → publish-PPY724N2.js} +58 -23
- package/{query-BGP5JMJ7.js → query-NLWXKOOT.js} +61 -15
- package/registry-QGI44LG4.js +117 -0
- package/registry-client-package.json +6 -2
- package/registry-client-src-revalidate.js +1245 -977
- package/{repo-NCEHK7KB.js → repo-BFRAXIVU.js} +19 -17
- package/{reporter-OB6SNHOZ.js → reporter-2XBYWAVU.js} +3 -2
- package/{run-ZNJJYEJF.js → run-7O65747G.js} +17 -14
- package/{run-exec-F5OV7MVN.js → run-exec-2OYWHL6K.js} +19 -14
- package/security-archive-src-update-expired.js +16 -11
- package/setup-MMIDAIJI.js +181 -0
- package/{src-M3WI7TSB.js → src-OK3KHDYR.js} +25 -17
- package/{token-KXCVRJGF.js → token-VLVXUW54.js} +20 -9
- package/{uninstall-33SUWR6K.js → uninstall-TAG6QIAG.js} +15 -11
- package/{unpublish-7AZPBZF2.js → unpublish-Y4L5J2IA.js} +17 -9
- package/{update-2EQF6IKZ.js → update-RYH4RKBS.js} +14 -10
- package/{version-HFYI3SEX.js → version-COHB32ON.js} +12 -10
- package/{view-C5OT36OB.js → view-P7U4MF43.js} +18 -14
- 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-47MVFMZC.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-U6DM3ROE.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,38 @@ var PackageInfoClient = class {
|
|
|
1455
1470
|
}
|
|
1456
1471
|
case "registry": {
|
|
1457
1472
|
const { registry, name: name2 } = f;
|
|
1473
|
+
if (!registry) throw noRegistryError(spec);
|
|
1474
|
+
const packumentKey = `${registry}${name2}`;
|
|
1475
|
+
const inflight = this.#packumentPromises.get(packumentKey);
|
|
1476
|
+
if (inflight) return inflight;
|
|
1458
1477
|
const pakuURL = new URL(name2, registry);
|
|
1459
|
-
const
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
spec,
|
|
1467
|
-
options,
|
|
1468
|
-
"failed to fetch packument",
|
|
1469
|
-
{
|
|
1470
|
-
url: pakuURL,
|
|
1471
|
-
response
|
|
1472
|
-
}
|
|
1473
|
-
);
|
|
1474
|
-
}
|
|
1475
|
-
return response.json();
|
|
1478
|
+
const promise = this.#fetchPackument(spec, options, pakuURL);
|
|
1479
|
+
this.#packumentPromises.set(packumentKey, promise);
|
|
1480
|
+
promise.then(
|
|
1481
|
+
() => this.#packumentPromises.delete(packumentKey),
|
|
1482
|
+
() => this.#packumentPromises.delete(packumentKey)
|
|
1483
|
+
);
|
|
1484
|
+
return promise;
|
|
1476
1485
|
}
|
|
1477
1486
|
}
|
|
1478
1487
|
}
|
|
1488
|
+
async #fetchPackument(spec, options, pakuURL) {
|
|
1489
|
+
const response = await this.registryClient.request(pakuURL, {
|
|
1490
|
+
headers: { accept: "application/json" }
|
|
1491
|
+
});
|
|
1492
|
+
if (response.statusCode !== 200) {
|
|
1493
|
+
throw this.#resolveError(
|
|
1494
|
+
spec,
|
|
1495
|
+
options,
|
|
1496
|
+
"failed to fetch packument",
|
|
1497
|
+
{
|
|
1498
|
+
url: pakuURL,
|
|
1499
|
+
response
|
|
1500
|
+
}
|
|
1501
|
+
);
|
|
1502
|
+
}
|
|
1503
|
+
return response.json();
|
|
1504
|
+
}
|
|
1479
1505
|
async resolve(spec, options = {}) {
|
|
1480
1506
|
const memoKey = String(spec);
|
|
1481
1507
|
if (typeof spec === "string")
|
|
@@ -10,7 +10,7 @@ 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
|
|
|
13
|
-
// ../../node_modules/.vlt/~npm~pretty-bytes@7.1.
|
|
13
|
+
// ../../node_modules/.vlt/~npm~pretty-bytes@7.1.1/node_modules/pretty-bytes/index.js
|
|
14
14
|
var BYTE_UNITS = [
|
|
15
15
|
"B",
|
|
16
16
|
"kB",
|
|
@@ -132,21 +132,17 @@ function prettyBytes(number, options) {
|
|
|
132
132
|
number = -number;
|
|
133
133
|
}
|
|
134
134
|
const localeOptions = buildLocaleOptions(options);
|
|
135
|
-
let
|
|
136
|
-
if (number
|
|
137
|
-
|
|
138
|
-
result = prefix + numberString + separator + UNITS[0];
|
|
139
|
-
} else {
|
|
140
|
-
const exponent = Math.min(Math.floor(options.binary ? log(number) / Math.log(1024) : log10(number) / 3), UNITS.length - 1);
|
|
141
|
-
number = divide(number, (options.binary ? 1024 : 1e3) ** exponent);
|
|
142
|
-
if (!localeOptions) {
|
|
143
|
-
const minPrecision = Math.max(3, Math.floor(number).toString().length);
|
|
144
|
-
number = number.toPrecision(minPrecision);
|
|
145
|
-
}
|
|
146
|
-
const numberString = toLocaleString(Number(number), options.locale, localeOptions);
|
|
147
|
-
const unit = UNITS[exponent];
|
|
148
|
-
result = prefix + numberString + separator + unit;
|
|
135
|
+
let exponent = 0;
|
|
136
|
+
if (number >= 1) {
|
|
137
|
+
exponent = Math.min(Math.floor(options.binary ? log(number) / Math.log(1024) : log10(number) / 3), UNITS.length - 1);
|
|
149
138
|
}
|
|
139
|
+
number = divide(number, (options.binary ? 1024 : 1e3) ** exponent);
|
|
140
|
+
if (!localeOptions) {
|
|
141
|
+
const minPrecision = Math.max(3, Math.floor(number).toString().length);
|
|
142
|
+
number = Number(number.toPrecision(minPrecision));
|
|
143
|
+
}
|
|
144
|
+
const numberString = toLocaleString(number, options.locale, localeOptions);
|
|
145
|
+
const result = prefix + numberString + separator + UNITS[exponent];
|
|
150
146
|
return applyFixedWidth(result, options.fixedWidth);
|
|
151
147
|
}
|
|
152
148
|
|