@vltpkg/cli-js 1.3.3 → 1.3.4
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-KMBBQIIT.js → access-AY2CIGVN.js} +4 -4
- package/{bugs-CABZX76X.js → bugs-6PTC6V7S.js} +12 -12
- package/{build-WNHKYA4E.js → build-R6OJNJDU.js} +6 -6
- package/{cache-KKT4GIYD.js → cache-NVLCCVWQ.js} +6 -6
- package/{chunk-3IDIPSH7.js → chunk-4XTUCYBW.js} +1 -1
- package/{chunk-MC6CESRA.js → chunk-AFUXQ3P4.js} +1 -1
- package/{chunk-GZWJAGBL.js → chunk-B5AKQ5TS.js} +3 -3
- package/{chunk-CU752KW7.js → chunk-BCANUHR3.js} +1 -1
- package/{chunk-LY5FNWRY.js → chunk-BFR3XHEM.js} +3 -3
- package/{chunk-ROCFQPP2.js → chunk-CYN4ADWK.js} +2 -2
- package/{chunk-QBXGMTDE.js → chunk-D4KNFORN.js} +1 -1
- package/{chunk-GA4LA6B2.js → chunk-DK6HGJCF.js} +4 -4
- package/chunk-DM2XRLCS.js +75 -0
- package/{chunk-SH24EMXO.js → chunk-GCLZEI3R.js} +150 -40
- package/{chunk-BUKZHMMK.js → chunk-INEKXXUQ.js} +1 -0
- package/{chunk-I6QGYSB4.js → chunk-LHIDMYN2.js} +1 -1
- package/{chunk-DCFLXO2M.js → chunk-MVD5AUNS.js} +1 -1
- package/{chunk-HCMAX6Q5.js → chunk-MWAWPY3P.js} +3 -3
- package/chunk-OFHNSAQ5.js +2155 -0
- package/{chunk-TJBBYDUN.js → chunk-QEWKCTQY.js} +4 -4
- package/{chunk-ZRRNOLEG.js → chunk-QGFDMXDH.js} +196 -96
- package/{chunk-ZBJRZXSU.js → chunk-QZIC3WVP.js} +3 -3
- package/{chunk-ZWKI5OSF.js → chunk-SRWDPPLX.js} +0 -1377
- package/{chunk-MOL2DUEQ.js → chunk-TL5SYXSC.js} +279 -35
- package/{chunk-CSZTT7QN.js → chunk-TOKUDCSW.js} +2 -2
- package/{chunk-YU2W5UPG.js → chunk-WXRS5PRL.js} +1 -1
- package/{chunk-ENSGPOLR.js → chunk-XU5WNX4S.js} +3 -1
- package/{ci-BGVGC5RF.js → ci-FEZ6B33S.js} +7 -7
- package/cli-package.json +1 -1
- package/{config-AWX2VEKL.js → config-EV5S74AA.js} +5 -5
- package/{config-FIKZ4VWG.js → config-VVPVV36W.js} +6 -6
- package/{create-CHTG7KO3.js → create-VGCARZLU.js} +13 -13
- package/{deprecate-W7KQ62HF.js → deprecate-3E27QREJ.js} +7 -7
- package/{dist-tag-66CC6HT7.js → dist-tag-ZIDIGEIM.js} +4 -4
- package/{docs-HW4U5TGD.js → docs-GESU73FF.js} +12 -12
- package/{exec-BVVNAGFI.js → exec-3SE4PRXY.js} +13 -13
- package/{exec-cache-L3ONPM5C.js → exec-cache-7QOIKCYP.js} +11 -11
- package/{exec-local-NR3RYQDQ.js → exec-local-EVAI6IYM.js} +10 -10
- package/{help-5YL6SUAN.js → help-H54DUW2F.js} +4 -4
- package/{init-RI2WVCGL.js → init-JOAMKEKV.js} +7 -7
- package/{install-OWAI4EOW.js → install-WHOVSLKH.js} +12 -12
- package/{list-4ZFX7ANG.js → list-7X2RIDA4.js} +12 -12
- package/{login-6TL3EE6Q.js → login-P5NRTQDS.js} +8 -8
- package/{logout-VQWHVHBE.js → logout-5PCTGCJZ.js} +4 -4
- package/{pack-Q5IRRAMU.js → pack-MLOVKXJZ.js} +9 -9
- package/package.json +1 -1
- package/{ping-2WV3V7GB.js → ping-6D6EEICV.js} +4 -4
- package/{pkg-RXB6BRS5.js → pkg-HC6N3DDH.js} +8 -8
- package/{profile-GNGWS5H2.js → profile-C3MNVMAE.js} +4 -4
- package/{publish-PI74W4GH.js → publish-3KUMQXKT.js} +12 -12
- package/{query-NESDWXGE.js → query-HNBW2ZGX.js} +12 -12
- package/{registry-MXAA4HVJ.js → registry-PY2L5ZWC.js} +2 -2
- package/registry-client-src-revalidate.js +150 -40
- package/{repo-PPBN3SKP.js → repo-VWEPCUXK.js} +12 -12
- package/{reporter-XBHCUW7W.js → reporter-UUDMEN4E.js} +6 -6
- package/{run-7GTWIFMV.js → run-OFW4MPAV.js} +10 -10
- package/{run-exec-VLSH5SOB.js → run-exec-ACGX23HX.js} +10 -10
- package/security-archive-src-update-expired.js +1 -1
- package/{setup-6O7RFGU2.js → setup-5C56O3S3.js} +10 -10
- package/{src-EJSVFFXB.js → src-3MEJQYBG.js} +21 -7
- package/{src-U4MCZFJT.js → src-LH2HZ6FT.js} +2 -2
- package/{src-6E7KCC7J.js → src-SI5YMOJI.js} +9 -9
- package/{token-NZ4HODXE.js → token-RPQP6BV5.js} +4 -4
- package/{uninstall-KBZ6PJBG.js → uninstall-HDUNLNAD.js} +8 -8
- package/{unpublish-JBWSIBRX.js → unpublish-SB647KPY.js} +4 -4
- package/{update-X4EC6MPP.js → update-PAIZPQPH.js} +11 -11
- package/{version-QEHPAFAE.js → version-5O2P2ROI.js} +7 -7
- package/{view-WGGZTYAT.js → view-3YVL4M7Z.js} +7 -7
- 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-RYNXOULV.js → whoami-KFXNKZOX.js} +4 -4
- package/chunk-7JK53T6G.js +0 -75
- package/chunk-KH3ERNCA.js +0 -783
|
@@ -10,9 +10,8 @@ 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
|
-
Qn
|
|
14
|
-
|
|
15
|
-
} from "./chunk-ZWKI5OSF.js";
|
|
13
|
+
Qn
|
|
14
|
+
} from "./chunk-SRWDPPLX.js";
|
|
16
15
|
import {
|
|
17
16
|
Monorepo,
|
|
18
17
|
PackageJson,
|
|
@@ -20,7 +19,7 @@ import {
|
|
|
20
19
|
pickManifest,
|
|
21
20
|
resolve,
|
|
22
21
|
revs
|
|
23
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-INEKXXUQ.js";
|
|
24
23
|
import {
|
|
25
24
|
Spec
|
|
26
25
|
} from "./chunk-64VFL4WI.js";
|
|
@@ -44,12 +43,66 @@ import {
|
|
|
44
43
|
import {
|
|
45
44
|
error
|
|
46
45
|
} from "./chunk-WZWDS3W4.js";
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
} from "
|
|
46
|
+
|
|
47
|
+
// ../../src/package-info/src/resolve-batch.ts
|
|
48
|
+
import { createInterface } from "node:readline";
|
|
49
|
+
var fetchResolve = async (client, registry, request, onRecord) => {
|
|
50
|
+
if (!request.roots.length) return;
|
|
51
|
+
let body;
|
|
52
|
+
try {
|
|
53
|
+
const response = await client.requestStream(
|
|
54
|
+
new URL("-/vlt/resolve", registry),
|
|
55
|
+
{
|
|
56
|
+
// POST, not QUERY: CloudFront's allowed-method sets are fixed and
|
|
57
|
+
// none includes QUERY. The registry answers both.
|
|
58
|
+
method: "POST",
|
|
59
|
+
headers: {
|
|
60
|
+
"content-type": "application/json",
|
|
61
|
+
accept: "application/x-ndjson"
|
|
62
|
+
},
|
|
63
|
+
body: JSON.stringify(request)
|
|
64
|
+
}
|
|
65
|
+
);
|
|
66
|
+
if (response.statusCode !== 207) {
|
|
67
|
+
response.body.resume();
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
body = response.body;
|
|
71
|
+
} catch {
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
try {
|
|
75
|
+
for await (const line of createInterface({ input: body })) {
|
|
76
|
+
const record = parseRecord(line);
|
|
77
|
+
if (record) onRecord(record);
|
|
78
|
+
}
|
|
79
|
+
} catch {
|
|
80
|
+
body.destroy();
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
var parseRecord = (l) => {
|
|
84
|
+
let record;
|
|
85
|
+
try {
|
|
86
|
+
record = JSON.parse(l);
|
|
87
|
+
} catch {
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
const { status, name, requested, manifest } = record;
|
|
91
|
+
if (status !== 200 || typeof name !== "string") return;
|
|
92
|
+
if (!Array.isArray(requested) || !requested.every((s) => typeof s === "string"))
|
|
93
|
+
return;
|
|
94
|
+
if (typeof manifest !== "object" || manifest === null) return;
|
|
95
|
+
const mani = manifest;
|
|
96
|
+
if (mani.name !== name || typeof mani.version !== "string") return;
|
|
97
|
+
return {
|
|
98
|
+
name,
|
|
99
|
+
version: mani.version,
|
|
100
|
+
requested,
|
|
101
|
+
manifest: mani
|
|
102
|
+
};
|
|
103
|
+
};
|
|
50
104
|
|
|
51
105
|
// ../../src/package-info/src/index.ts
|
|
52
|
-
var import_ssri = __toESM(require_lib(), 1);
|
|
53
106
|
import { createHash, randomBytes } from "node:crypto";
|
|
54
107
|
import {
|
|
55
108
|
mkdir,
|
|
@@ -66,6 +119,7 @@ import {
|
|
|
66
119
|
resolve as pathResolve,
|
|
67
120
|
relative
|
|
68
121
|
} from "node:path";
|
|
122
|
+
import { setTimeout } from "node:timers/promises";
|
|
69
123
|
import { debuglog } from "node:util";
|
|
70
124
|
|
|
71
125
|
// ../../src/package-info/src/capabilities.ts
|
|
@@ -147,6 +201,18 @@ var delimiter = "~";
|
|
|
147
201
|
var VLT_PACKUMENT_MIME = "application/vnd.vlt.packument-v1+json";
|
|
148
202
|
var VLT_PACKUMENT_V2_MIME = "application/vnd.vlt.packument-v2+json";
|
|
149
203
|
var PACKUMENT_ACCEPT = `${VLT_PACKUMENT_V2_MIME}; q=1.0, ${VLT_PACKUMENT_MIME}; q=0.9, application/json; q=0.8, */*; q=0.1`;
|
|
204
|
+
var resolveWaitMs = () => {
|
|
205
|
+
const configured = Number(process.env.VLT_BATCH_RESOLVE_WAIT_MS);
|
|
206
|
+
return Number.isFinite(configured) && configured >= 0 ? configured : 1e3;
|
|
207
|
+
};
|
|
208
|
+
var stalled = /* @__PURE__ */ Symbol("stalled");
|
|
209
|
+
var SELECTION_OPTIONS = [
|
|
210
|
+
"before",
|
|
211
|
+
"os",
|
|
212
|
+
"arch",
|
|
213
|
+
"libc",
|
|
214
|
+
"node-version"
|
|
215
|
+
];
|
|
150
216
|
var manifestCacheMaxAge = 5 * 60 * 1e3;
|
|
151
217
|
var noRegistryError = (spec) => error(
|
|
152
218
|
'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',
|
|
@@ -160,6 +226,7 @@ var isStableSelector = (f) => {
|
|
|
160
226
|
return !range.isAny && !range.raw.includes("-");
|
|
161
227
|
};
|
|
162
228
|
var storeLinkers = /* @__PURE__ */ new Set(["auto", "hardlink", "copy"]);
|
|
229
|
+
var storedIntegrity = (response) => !response.fromCache ? response.integrityActual : !response.contentType ? void 0 : response.integrity ?? (response.isGzip ? response.integrityActual : void 0);
|
|
163
230
|
var PackageInfoClient = class {
|
|
164
231
|
#registryClient;
|
|
165
232
|
#projectRoot;
|
|
@@ -204,11 +271,31 @@ var PackageInfoClient = class {
|
|
|
204
271
|
// needed. entries are removed when the on-disk file is invalidated
|
|
205
272
|
// so the refreshed manifest can be written again.
|
|
206
273
|
#manifestWritePaths = /* @__PURE__ */ new Set();
|
|
274
|
+
// Manifests a resolve batch delivered, keyed both as
|
|
275
|
+
// `${registry}${name}@${range}` for every spec that chose a version and
|
|
276
|
+
// `${registry}${name}@${version}` for the version itself.
|
|
277
|
+
#resolvedManifests = /* @__PURE__ */ new Map();
|
|
278
|
+
// The resolves still streaming, per registry, each settling when its
|
|
279
|
+
// stream ends. The requests overlap whatever the graph build does before
|
|
280
|
+
// it asks for its first manifest.
|
|
281
|
+
#resolveInflight = /* @__PURE__ */ new Map();
|
|
282
|
+
// Requests already sent, so the same ask is not repeated. Keyed on the
|
|
283
|
+
// request rather than the registry: a later step asking for a different
|
|
284
|
+
// root set is a different question.
|
|
285
|
+
#resolveSent = /* @__PURE__ */ new Set();
|
|
286
|
+
// Keys `manifest()` is waiting for, each woken by the record that carries
|
|
287
|
+
// it. Waiting per key rather than on the whole response is what lets a
|
|
288
|
+
// build place level N while the server still walks level N+1.
|
|
289
|
+
#resolveWaiters = /* @__PURE__ */ new Map();
|
|
290
|
+
// When each registry's resolve last delivered a record, which is what a
|
|
291
|
+
// waiter checks to tell a stream that is still coming from one that has
|
|
292
|
+
// stalled.
|
|
293
|
+
#resolveLastRecordAt = /* @__PURE__ */ new Map();
|
|
207
294
|
#registryClientPromise;
|
|
208
295
|
#tarPoolPromise;
|
|
209
296
|
async getRegistryClient() {
|
|
210
297
|
if (this.#registryClient) return this.#registryClient;
|
|
211
|
-
this.#registryClientPromise ??= import("./src-
|
|
298
|
+
this.#registryClientPromise ??= import("./src-LH2HZ6FT.js").then(({ RegistryClient }) => {
|
|
212
299
|
this.#registryClient = new RegistryClient(this.options);
|
|
213
300
|
return this.#registryClient;
|
|
214
301
|
});
|
|
@@ -248,7 +335,7 @@ var PackageInfoClient = class {
|
|
|
248
335
|
}
|
|
249
336
|
async getTarPool() {
|
|
250
337
|
if (this.#tarPool) return this.#tarPool;
|
|
251
|
-
this.#tarPoolPromise ??= import("./src-
|
|
338
|
+
this.#tarPoolPromise ??= import("./src-3MEJQYBG.js").then(
|
|
252
339
|
({ Pool }) => {
|
|
253
340
|
this.#tarPool = new Pool();
|
|
254
341
|
return this.#tarPool;
|
|
@@ -298,8 +385,7 @@ var PackageInfoClient = class {
|
|
|
298
385
|
from = this.#projectRoot,
|
|
299
386
|
integrity,
|
|
300
387
|
resolved,
|
|
301
|
-
fromLockfile = false
|
|
302
|
-
installScripts = false
|
|
388
|
+
fromLockfile = false
|
|
303
389
|
} = options;
|
|
304
390
|
const f = spec.final;
|
|
305
391
|
const brotli = !!resolved && tarballFormat(resolved) === "brotli";
|
|
@@ -345,7 +431,7 @@ var PackageInfoClient = class {
|
|
|
345
431
|
const pool = await this.getTarPool();
|
|
346
432
|
const format = tarballFormat(r.resolved);
|
|
347
433
|
const storeOn = f.type === "registry" && this.#storeLinker !== "unpack";
|
|
348
|
-
const copy = this.#storeLinker === "copy"
|
|
434
|
+
const copy = this.#storeLinker === "copy";
|
|
349
435
|
const hex = !storeOn ? void 0 : r.integrity ? integrityHex(r.integrity) : integrityHex(
|
|
350
436
|
(await this.getRegistryClient()).cachedIntegrity(
|
|
351
437
|
r.resolved
|
|
@@ -467,30 +553,71 @@ var PackageInfoClient = class {
|
|
|
467
553
|
return r;
|
|
468
554
|
}
|
|
469
555
|
case "remote": {
|
|
470
|
-
const
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
556
|
+
const rc = await this.getRegistryClient();
|
|
557
|
+
const { CacheEntry: Entry, cacheKey } = await import("./src-LH2HZ6FT.js");
|
|
558
|
+
const key = cacheKey("GET", new URL(r.resolved));
|
|
559
|
+
const unzipped = (entry) => {
|
|
560
|
+
try {
|
|
561
|
+
return entry.unzippedIntegrity() === r.integrity;
|
|
562
|
+
} catch {
|
|
563
|
+
return false;
|
|
564
|
+
}
|
|
565
|
+
};
|
|
566
|
+
const fetchTarball = async (readCache) => {
|
|
567
|
+
let response2;
|
|
568
|
+
try {
|
|
569
|
+
response2 = await rc.request(r.resolved, {
|
|
570
|
+
integrity: r.integrity,
|
|
571
|
+
...readCache === false ? { readCache } : {}
|
|
572
|
+
});
|
|
573
|
+
} catch (er) {
|
|
574
|
+
const cause = er.cause;
|
|
575
|
+
if (cause?.code !== "EINTEGRITY" || !(cause.response instanceof Entry) || !unzipped(cause.response)) {
|
|
576
|
+
throw er;
|
|
479
577
|
}
|
|
480
|
-
|
|
578
|
+
response2 = cause.response;
|
|
579
|
+
r.integrity = response2.integrityActual;
|
|
580
|
+
response2.labelArtifact();
|
|
581
|
+
rc.cache.set(key, response2.encode(), {
|
|
582
|
+
integrity: r.integrity
|
|
583
|
+
});
|
|
584
|
+
}
|
|
585
|
+
if (response2.statusCode !== 200) {
|
|
586
|
+
throw this.#resolveError(
|
|
587
|
+
spec,
|
|
588
|
+
options,
|
|
589
|
+
`failed to fetch remote tarball: ${registryErrorMessage(response2)}`,
|
|
590
|
+
{
|
|
591
|
+
url: r.resolved,
|
|
592
|
+
response: response2
|
|
593
|
+
}
|
|
594
|
+
);
|
|
595
|
+
}
|
|
596
|
+
return response2;
|
|
597
|
+
};
|
|
598
|
+
let response = await fetchTarball();
|
|
599
|
+
let found = storedIntegrity(response);
|
|
600
|
+
if (response.fromCache && found && r.integrity && r.integrity !== found && unzipped(response)) {
|
|
601
|
+
r.integrity = found;
|
|
481
602
|
}
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
603
|
+
if (response.fromCache && (!found || r.integrity && r.integrity !== found)) {
|
|
604
|
+
rc.cache.delete(key, true, found);
|
|
605
|
+
if (r.integrity) rc.cache.delete(key, true, r.integrity);
|
|
606
|
+
await rc.cache.promise();
|
|
607
|
+
response = await fetchTarball(false);
|
|
608
|
+
found = storedIntegrity(response);
|
|
609
|
+
}
|
|
610
|
+
if (!found || r.integrity && r.integrity !== found) {
|
|
485
611
|
throw error("Integrity check failure", {
|
|
486
612
|
code: "EINTEGRITY",
|
|
487
613
|
spec,
|
|
488
614
|
url: r.resolved,
|
|
489
615
|
wanted: r.integrity,
|
|
490
|
-
found
|
|
616
|
+
found
|
|
491
617
|
});
|
|
492
618
|
}
|
|
493
|
-
r.integrity =
|
|
619
|
+
r.integrity = found;
|
|
620
|
+
const buf = response.buffer();
|
|
494
621
|
try {
|
|
495
622
|
await (await this.getTarPool()).unpack(buf, target);
|
|
496
623
|
} catch (er) {
|
|
@@ -760,6 +887,110 @@ var PackageInfoClient = class {
|
|
|
760
887
|
}
|
|
761
888
|
}
|
|
762
889
|
}
|
|
890
|
+
/**
|
|
891
|
+
* Start a server-side resolve for `request` against `registry` and
|
|
892
|
+
* return without waiting. `manifest()` answers from what has arrived,
|
|
893
|
+
* and blocks on the request only when it needs a key that has not.
|
|
894
|
+
*
|
|
895
|
+
* A no-op unless the registry says it serves the endpoint. Anything it
|
|
896
|
+
* does not deliver is left to `manifest()`.
|
|
897
|
+
*/
|
|
898
|
+
prefetchResolve(registry, request) {
|
|
899
|
+
if (!request.roots.length) return;
|
|
900
|
+
if (!registry.endsWith("/")) registry += "/";
|
|
901
|
+
const sent = `${registry}\0${JSON.stringify(request)}`;
|
|
902
|
+
if (this.#resolveSent.has(sent)) return;
|
|
903
|
+
this.#resolveSent.add(sent);
|
|
904
|
+
const promise = this.#runResolve(registry, request);
|
|
905
|
+
let inflight = this.#resolveInflight.get(registry);
|
|
906
|
+
if (!inflight)
|
|
907
|
+
this.#resolveInflight.set(registry, inflight = /* @__PURE__ */ new Set());
|
|
908
|
+
inflight.add(promise);
|
|
909
|
+
const clear = () => inflight.delete(promise);
|
|
910
|
+
promise.then(clear, clear);
|
|
911
|
+
}
|
|
912
|
+
/** Never rejects: a resolve that fails leaves every spec to manifest(). */
|
|
913
|
+
async #runResolve(registry, request) {
|
|
914
|
+
try {
|
|
915
|
+
if ((await this.capabilities(registry)).resolve === void 0)
|
|
916
|
+
return;
|
|
917
|
+
const client = await this.getRegistryClient();
|
|
918
|
+
this.#resolveLastRecordAt.set(registry, Date.now());
|
|
919
|
+
await fetchResolve(client, registry, request, (record) => {
|
|
920
|
+
this.#resolveLastRecordAt.set(registry, Date.now());
|
|
921
|
+
absolutizeTarball(
|
|
922
|
+
record.manifest,
|
|
923
|
+
`${registry}${record.name}/-/`
|
|
924
|
+
);
|
|
925
|
+
this.#vltPackuments.add(`${registry}${record.name}`);
|
|
926
|
+
for (const spec of record.requested) {
|
|
927
|
+
this.#deliverResolved(
|
|
928
|
+
`${registry}${record.name}@${spec}`,
|
|
929
|
+
record.manifest
|
|
930
|
+
);
|
|
931
|
+
}
|
|
932
|
+
this.#deliverResolved(
|
|
933
|
+
`${registry}${record.name}@${record.version}`,
|
|
934
|
+
record.manifest
|
|
935
|
+
);
|
|
936
|
+
});
|
|
937
|
+
} catch {
|
|
938
|
+
}
|
|
939
|
+
}
|
|
940
|
+
/** Record an arrived manifest and wake whoever was waiting for it. */
|
|
941
|
+
#deliverResolved(key, manifest) {
|
|
942
|
+
debug("resolve delivered %s", key);
|
|
943
|
+
this.#resolvedManifests.set(key, manifest);
|
|
944
|
+
const waiters = this.#resolveWaiters.get(key);
|
|
945
|
+
if (waiters) {
|
|
946
|
+
this.#resolveWaiters.delete(key);
|
|
947
|
+
for (const wake of waiters) wake(manifest);
|
|
948
|
+
}
|
|
949
|
+
}
|
|
950
|
+
/**
|
|
951
|
+
* The manifest an in-flight resolve is expected to carry for `key`, or
|
|
952
|
+
* undefined once waiting stopped being worth it: every request settled
|
|
953
|
+
* without the key, or no record of any kind arrived for a whole wait.
|
|
954
|
+
*
|
|
955
|
+
* A stream that is still delivering is worth waiting on, since its records
|
|
956
|
+
* come in the order the build needs them; one that has stalled is not, and
|
|
957
|
+
* the packument fetch was the alternative anyway.
|
|
958
|
+
*/
|
|
959
|
+
async #awaitResolved(registry, key) {
|
|
960
|
+
const inflight = this.#resolveInflight.get(registry);
|
|
961
|
+
if (!inflight?.size) return void 0;
|
|
962
|
+
let wake;
|
|
963
|
+
const arrival = new Promise((res) => {
|
|
964
|
+
wake = res;
|
|
965
|
+
});
|
|
966
|
+
let waiters = this.#resolveWaiters.get(key);
|
|
967
|
+
if (!waiters) this.#resolveWaiters.set(key, waiters = /* @__PURE__ */ new Set());
|
|
968
|
+
waiters.add(wake);
|
|
969
|
+
const settled = Promise.all([...inflight]).then(
|
|
970
|
+
() => this.#resolvedManifests.get(key)
|
|
971
|
+
);
|
|
972
|
+
const waitMs = resolveWaitMs();
|
|
973
|
+
try {
|
|
974
|
+
for (; ; ) {
|
|
975
|
+
const outcome = await Promise.race([
|
|
976
|
+
arrival,
|
|
977
|
+
settled,
|
|
978
|
+
// unref'd: a pending wait must never be what keeps the process up
|
|
979
|
+
setTimeout(waitMs, stalled, { ref: false })
|
|
980
|
+
]);
|
|
981
|
+
if (outcome !== stalled) return outcome;
|
|
982
|
+
const lastRecordAt = this.#resolveLastRecordAt.get(registry) ?? 0;
|
|
983
|
+
if (Date.now() - lastRecordAt >= waitMs) return void 0;
|
|
984
|
+
}
|
|
985
|
+
} finally {
|
|
986
|
+
waiters.delete(wake);
|
|
987
|
+
if (!waiters.size) this.#resolveWaiters.delete(key);
|
|
988
|
+
}
|
|
989
|
+
}
|
|
990
|
+
/** How many manifests resolve batches have delivered. For tests. */
|
|
991
|
+
get resolvedManifestCount() {
|
|
992
|
+
return this.#resolvedManifests.size;
|
|
993
|
+
}
|
|
763
994
|
async manifest(spec, options = {}) {
|
|
764
995
|
const { from = this.#projectRoot } = options;
|
|
765
996
|
if (typeof spec === "string")
|
|
@@ -767,6 +998,16 @@ var PackageInfoClient = class {
|
|
|
767
998
|
const f = spec.final;
|
|
768
999
|
switch (f.type) {
|
|
769
1000
|
case "registry": {
|
|
1001
|
+
if (!SELECTION_OPTIONS.some((k) => options[k] !== void 0)) {
|
|
1002
|
+
const key = `${f.registry ?? ""}${f.name}@${f.bareSpec}`;
|
|
1003
|
+
const resolved = this.#resolvedManifests.get(key);
|
|
1004
|
+
if (resolved) return resolved;
|
|
1005
|
+
if (f.registry) {
|
|
1006
|
+
const arrived = await this.#awaitResolved(f.registry, key);
|
|
1007
|
+
if (arrived) return arrived;
|
|
1008
|
+
debug("resolve miss %s", key);
|
|
1009
|
+
}
|
|
1010
|
+
}
|
|
770
1011
|
const cachePath = this._manifestCachePath(spec, options);
|
|
771
1012
|
if (cachePath) {
|
|
772
1013
|
try {
|
|
@@ -849,7 +1090,7 @@ var PackageInfoClient = class {
|
|
|
849
1090
|
);
|
|
850
1091
|
}
|
|
851
1092
|
const buf = response.buffer();
|
|
852
|
-
const
|
|
1093
|
+
const integrity = storedIntegrity(response);
|
|
853
1094
|
try {
|
|
854
1095
|
await (await this.getTarPool()).unpack(buf, dir);
|
|
855
1096
|
} catch (er) {
|
|
@@ -861,7 +1102,7 @@ var PackageInfoClient = class {
|
|
|
861
1102
|
);
|
|
862
1103
|
}
|
|
863
1104
|
const mani = this.#readExtracted(dir, s, options);
|
|
864
|
-
mani.dist = { integrity
|
|
1105
|
+
if (integrity) mani.dist = { integrity };
|
|
865
1106
|
return mani;
|
|
866
1107
|
});
|
|
867
1108
|
}
|
|
@@ -1179,11 +1420,14 @@ var PackageInfoClient = class {
|
|
|
1179
1420
|
}
|
|
1180
1421
|
};
|
|
1181
1422
|
var absolutizeTarballs = (paku, base) => {
|
|
1182
|
-
for (const
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1423
|
+
for (const manifest of Object.values(paku.versions)) {
|
|
1424
|
+
absolutizeTarball(manifest, base);
|
|
1425
|
+
}
|
|
1426
|
+
};
|
|
1427
|
+
var absolutizeTarball = (manifest, base) => {
|
|
1428
|
+
const dist = manifest.dist;
|
|
1429
|
+
if (dist?.tarball && !/^[a-z][a-z0-9+.-]*:/i.test(dist.tarball)) {
|
|
1430
|
+
dist.tarball = String(new URL(dist.tarball, base));
|
|
1187
1431
|
}
|
|
1188
1432
|
};
|
|
1189
1433
|
|
|
@@ -12,7 +12,7 @@ var require = _vlt_createRequire(import.meta.filename);
|
|
|
12
12
|
import {
|
|
13
13
|
generateDefaultHelp,
|
|
14
14
|
generateFullHelp
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-BCANUHR3.js";
|
|
16
16
|
import {
|
|
17
17
|
flush,
|
|
18
18
|
trackCommand,
|
|
@@ -38,7 +38,7 @@ import {
|
|
|
38
38
|
} from "./chunk-JIQBZ2UT.js";
|
|
39
39
|
import {
|
|
40
40
|
defaultView
|
|
41
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-XU5WNX4S.js";
|
|
42
42
|
import {
|
|
43
43
|
emitter
|
|
44
44
|
} from "./chunk-U7TEQCBN.js";
|
|
@@ -14,7 +14,7 @@ var require = _vlt_createRequire(import.meta.filename);
|
|
|
14
14
|
var package_default = {
|
|
15
15
|
name: "@vltpkg/user-agent",
|
|
16
16
|
description: "The User-Agent string that vlt sends with every outbound request",
|
|
17
|
-
version: "1.3.
|
|
17
|
+
version: "1.3.4",
|
|
18
18
|
repository: {
|
|
19
19
|
type: "git",
|
|
20
20
|
url: "git+https://github.com/vltpkg/vltpkg.git",
|
|
@@ -1383,7 +1383,9 @@ var definition = j2.heading("Configuration").description(
|
|
|
1383
1383
|
- unpack: Unpack each package tarball, skipping the
|
|
1384
1384
|
global store.
|
|
1385
1385
|
|
|
1386
|
-
|
|
1386
|
+
A package is copied right before its install
|
|
1387
|
+
scripts run, so they don't change its files in the
|
|
1388
|
+
store.
|
|
1387
1389
|
An invalid \`VLT_STORE_LINKER\` warns and uses
|
|
1388
1390
|
\`unpack\`.`,
|
|
1389
1391
|
validOptions: storeLinkers,
|
|
@@ -11,20 +11,20 @@ import {createRequire as _vlt_createRequire} from "node:module";
|
|
|
11
11
|
var require = _vlt_createRequire(import.meta.filename);
|
|
12
12
|
import {
|
|
13
13
|
install
|
|
14
|
-
} from "./chunk-
|
|
15
|
-
import "./chunk-
|
|
14
|
+
} from "./chunk-QGFDMXDH.js";
|
|
15
|
+
import "./chunk-MVD5AUNS.js";
|
|
16
16
|
import {
|
|
17
17
|
commandUsage
|
|
18
|
-
} from "./chunk-
|
|
19
|
-
import "./chunk-
|
|
18
|
+
} from "./chunk-LHIDMYN2.js";
|
|
19
|
+
import "./chunk-INEKXXUQ.js";
|
|
20
20
|
import {
|
|
21
21
|
lazyView
|
|
22
22
|
} from "./chunk-4KCU2KZL.js";
|
|
23
23
|
import "./chunk-JIQBZ2UT.js";
|
|
24
24
|
import "./chunk-64VFL4WI.js";
|
|
25
|
-
import "./chunk-
|
|
25
|
+
import "./chunk-XU5WNX4S.js";
|
|
26
26
|
import "./chunk-HTOTG4TS.js";
|
|
27
|
-
import "./chunk-
|
|
27
|
+
import "./chunk-WXRS5PRL.js";
|
|
28
28
|
import "./chunk-U7TEQCBN.js";
|
|
29
29
|
import "./chunk-XNLSTHDK.js";
|
|
30
30
|
import "./chunk-PDWPFR5T.js";
|
|
@@ -63,7 +63,7 @@ var usage = () => commandUsage({
|
|
|
63
63
|
var views = {
|
|
64
64
|
json: (i) => i.graph.toJSON(),
|
|
65
65
|
human: lazyView(
|
|
66
|
-
async () => (await import("./reporter-
|
|
66
|
+
async () => (await import("./reporter-UUDMEN4E.js")).InstallReporter
|
|
67
67
|
)
|
|
68
68
|
};
|
|
69
69
|
var command = async (conf) => {
|
package/cli-package.json
CHANGED
|
@@ -16,10 +16,10 @@ import {
|
|
|
16
16
|
kCustomInspect,
|
|
17
17
|
pairsToRecords,
|
|
18
18
|
recordsToPairs
|
|
19
|
-
} from "./chunk-
|
|
20
|
-
import "./chunk-
|
|
21
|
-
import "./chunk-
|
|
22
|
-
import "./chunk-
|
|
19
|
+
} from "./chunk-B5AKQ5TS.js";
|
|
20
|
+
import "./chunk-TL5SYXSC.js";
|
|
21
|
+
import "./chunk-SRWDPPLX.js";
|
|
22
|
+
import "./chunk-INEKXXUQ.js";
|
|
23
23
|
import "./chunk-JIQBZ2UT.js";
|
|
24
24
|
import "./chunk-64VFL4WI.js";
|
|
25
25
|
import {
|
|
@@ -27,7 +27,7 @@ import {
|
|
|
27
27
|
definition,
|
|
28
28
|
isRecordField,
|
|
29
29
|
recordFields
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-XU5WNX4S.js";
|
|
31
31
|
import "./chunk-HTOTG4TS.js";
|
|
32
32
|
import "./chunk-PBBULTAG.js";
|
|
33
33
|
import "./chunk-U7TEQCBN.js";
|
|
@@ -19,19 +19,19 @@ import {
|
|
|
19
19
|
import {
|
|
20
20
|
pairsToRecords,
|
|
21
21
|
recordsToPairs
|
|
22
|
-
} from "./chunk-
|
|
23
|
-
import "./chunk-
|
|
24
|
-
import "./chunk-
|
|
22
|
+
} from "./chunk-B5AKQ5TS.js";
|
|
23
|
+
import "./chunk-TL5SYXSC.js";
|
|
24
|
+
import "./chunk-SRWDPPLX.js";
|
|
25
25
|
import {
|
|
26
26
|
commandUsage
|
|
27
|
-
} from "./chunk-
|
|
28
|
-
import "./chunk-
|
|
27
|
+
} from "./chunk-LHIDMYN2.js";
|
|
28
|
+
import "./chunk-INEKXXUQ.js";
|
|
29
29
|
import "./chunk-JIQBZ2UT.js";
|
|
30
30
|
import "./chunk-64VFL4WI.js";
|
|
31
31
|
import {
|
|
32
32
|
getSortedKeys,
|
|
33
33
|
isRecordField
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-XU5WNX4S.js";
|
|
35
35
|
import {
|
|
36
36
|
find,
|
|
37
37
|
load
|
|
@@ -11,40 +11,40 @@ import {createRequire as _vlt_createRequire} from "node:module";
|
|
|
11
11
|
var require = _vlt_createRequire(import.meta.filename);
|
|
12
12
|
import {
|
|
13
13
|
vlxResolve
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-QZIC3WVP.js";
|
|
15
15
|
import {
|
|
16
16
|
ExecCommand,
|
|
17
17
|
views
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-QEWKCTQY.js";
|
|
19
19
|
import "./chunk-RIYFGX27.js";
|
|
20
|
-
import "./chunk-
|
|
20
|
+
import "./chunk-BFR3XHEM.js";
|
|
21
21
|
import {
|
|
22
22
|
styleTextStdout
|
|
23
|
-
} from "./chunk-
|
|
24
|
-
import "./chunk-
|
|
23
|
+
} from "./chunk-TOKUDCSW.js";
|
|
24
|
+
import "./chunk-BCANUHR3.js";
|
|
25
25
|
import "./chunk-G2YT2GWF.js";
|
|
26
26
|
import "./chunk-CRGWLUGC.js";
|
|
27
27
|
import "./chunk-VTEFO2FT.js";
|
|
28
|
-
import "./chunk-
|
|
29
|
-
import "./chunk-
|
|
28
|
+
import "./chunk-TL5SYXSC.js";
|
|
29
|
+
import "./chunk-SRWDPPLX.js";
|
|
30
30
|
import "./chunk-WGDTG44V.js";
|
|
31
31
|
import "./chunk-J4NHRZX6.js";
|
|
32
32
|
import {
|
|
33
33
|
exec,
|
|
34
34
|
execFG
|
|
35
|
-
} from "./chunk-
|
|
36
|
-
import "./chunk-
|
|
35
|
+
} from "./chunk-QGFDMXDH.js";
|
|
36
|
+
import "./chunk-MVD5AUNS.js";
|
|
37
37
|
import {
|
|
38
38
|
commandUsage
|
|
39
|
-
} from "./chunk-
|
|
40
|
-
import "./chunk-
|
|
39
|
+
} from "./chunk-LHIDMYN2.js";
|
|
40
|
+
import "./chunk-INEKXXUQ.js";
|
|
41
41
|
import "./chunk-4KCU2KZL.js";
|
|
42
42
|
import "./chunk-JIQBZ2UT.js";
|
|
43
43
|
import "./chunk-64VFL4WI.js";
|
|
44
|
-
import "./chunk-
|
|
44
|
+
import "./chunk-XU5WNX4S.js";
|
|
45
45
|
import "./chunk-HTOTG4TS.js";
|
|
46
46
|
import "./chunk-PBBULTAG.js";
|
|
47
|
-
import "./chunk-
|
|
47
|
+
import "./chunk-WXRS5PRL.js";
|
|
48
48
|
import "./chunk-U7TEQCBN.js";
|
|
49
49
|
import "./chunk-XNLSTHDK.js";
|
|
50
50
|
import "./chunk-PDWPFR5T.js";
|
|
@@ -11,30 +11,30 @@ 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-
|
|
15
|
-
import "./chunk-
|
|
14
|
+
} from "./chunk-TL5SYXSC.js";
|
|
15
|
+
import "./chunk-SRWDPPLX.js";
|
|
16
16
|
import {
|
|
17
17
|
resolveRegistry
|
|
18
18
|
} from "./chunk-J4NHRZX6.js";
|
|
19
19
|
import {
|
|
20
20
|
commandUsage
|
|
21
|
-
} from "./chunk-
|
|
22
|
-
import "./chunk-
|
|
21
|
+
} from "./chunk-LHIDMYN2.js";
|
|
22
|
+
import "./chunk-INEKXXUQ.js";
|
|
23
23
|
import "./chunk-JIQBZ2UT.js";
|
|
24
24
|
import {
|
|
25
25
|
Spec
|
|
26
26
|
} from "./chunk-64VFL4WI.js";
|
|
27
|
-
import "./chunk-
|
|
27
|
+
import "./chunk-XU5WNX4S.js";
|
|
28
28
|
import "./chunk-HTOTG4TS.js";
|
|
29
29
|
import {
|
|
30
30
|
RegistryClient
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-GCLZEI3R.js";
|
|
32
32
|
import "./chunk-APMYKJI2.js";
|
|
33
33
|
import {
|
|
34
34
|
assertOk,
|
|
35
35
|
requestError
|
|
36
36
|
} from "./chunk-PBBULTAG.js";
|
|
37
|
-
import "./chunk-
|
|
37
|
+
import "./chunk-WXRS5PRL.js";
|
|
38
38
|
import "./chunk-U7TEQCBN.js";
|
|
39
39
|
import "./chunk-XNLSTHDK.js";
|
|
40
40
|
import "./chunk-PDWPFR5T.js";
|