@vltpkg/package-info 1.6.3 → 1.6.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/dist/index.js +31 -13
- package/package.json +14 -14
package/dist/index.js
CHANGED
|
@@ -269,14 +269,15 @@ export class PackageInfoClient {
|
|
|
269
269
|
/**
|
|
270
270
|
* Whether the packument for `f` can be fetched with `?stable`: the
|
|
271
271
|
* selector has to be one a prerelease cannot answer, and the registry
|
|
272
|
-
*
|
|
272
|
+
* has to have said it serves the filter.
|
|
273
273
|
*
|
|
274
274
|
* Never waits on the capability document, which would put a round trip in
|
|
275
275
|
* front of the first packument of every cold install. Until that document
|
|
276
|
-
* arrives the answer is
|
|
277
|
-
*
|
|
278
|
-
*
|
|
279
|
-
* so a registry
|
|
276
|
+
* arrives the answer is no: the plain url is right on every registry and
|
|
277
|
+
* cached by every CDN, where a `?stable` the registry does not know is a
|
|
278
|
+
* cache miss on the npm registry's. The document is on disk for a day
|
|
279
|
+
* once fetched, so only a registry's first install asks the first level
|
|
280
|
+
* unfiltered.
|
|
280
281
|
*/
|
|
281
282
|
#stable(f) {
|
|
282
283
|
const { registry } = f;
|
|
@@ -285,12 +286,11 @@ export class PackageInfoClient {
|
|
|
285
286
|
const client = this.#registryClient;
|
|
286
287
|
if (!client) {
|
|
287
288
|
// the registry client is built lazily, so the first caller starts it
|
|
288
|
-
// and the document along with it
|
|
289
|
+
// and the document along with it
|
|
289
290
|
this.#inBackground(this.capabilities(registry));
|
|
290
|
-
return
|
|
291
|
+
return false;
|
|
291
292
|
}
|
|
292
|
-
|
|
293
|
-
return !caps || !!caps['stable-filter'];
|
|
293
|
+
return !!peekCapabilities(client, registry)?.['stable-filter'];
|
|
294
294
|
}
|
|
295
295
|
async getTarPool() {
|
|
296
296
|
if (this.#tarPool)
|
|
@@ -1070,12 +1070,30 @@ export class PackageInfoClient {
|
|
|
1070
1070
|
}
|
|
1071
1071
|
owner.controller.abort();
|
|
1072
1072
|
}
|
|
1073
|
-
/**
|
|
1073
|
+
/**
|
|
1074
|
+
* Never rejects: a resolve that fails leaves every spec to manifest().
|
|
1075
|
+
*
|
|
1076
|
+
* Sent without waiting for the capability document, which on a cold
|
|
1077
|
+
* cache is a round trip of its own. A registry already known not to
|
|
1078
|
+
* serve resolve is not asked. One that turns out not to serve it has
|
|
1079
|
+
* the request ended as soon as its document says so, and any answer
|
|
1080
|
+
* but a 207 already leaves every spec to manifest().
|
|
1081
|
+
*/
|
|
1074
1082
|
async #runResolve(registry, request, signal, inflight) {
|
|
1075
1083
|
try {
|
|
1076
|
-
if ((await this.capabilities(registry)).resolve === undefined)
|
|
1077
|
-
return;
|
|
1078
1084
|
const client = await this.getRegistryClient();
|
|
1085
|
+
const known = peekCapabilities(client, registry);
|
|
1086
|
+
if (known && known.resolve === undefined)
|
|
1087
|
+
return;
|
|
1088
|
+
const unsupported = new AbortController();
|
|
1089
|
+
if (!known) {
|
|
1090
|
+
this.#inBackground(this.capabilities(registry).then(caps => {
|
|
1091
|
+
if (caps.resolve === undefined)
|
|
1092
|
+
unsupported.abort();
|
|
1093
|
+
}));
|
|
1094
|
+
}
|
|
1095
|
+
// the stream's grace runs from when it is asked for
|
|
1096
|
+
inflight.lastRecordAt = Date.now();
|
|
1079
1097
|
await fetchResolve(client, registry, request, record => {
|
|
1080
1098
|
inflight.lastRecordAt = Date.now();
|
|
1081
1099
|
// A resolve record is a vlt manifest: `dist.tarball` is the
|
|
@@ -1091,7 +1109,7 @@ export class PackageInfoClient {
|
|
|
1091
1109
|
this.#deliverResolved(`${registry}${record.name}@${spec}`, record.manifest);
|
|
1092
1110
|
}
|
|
1093
1111
|
this.#deliverResolved(`${registry}${record.name}@${record.version}`, record.manifest);
|
|
1094
|
-
}, signal);
|
|
1112
|
+
}, AbortSignal.any([signal, unsupported.signal]));
|
|
1095
1113
|
}
|
|
1096
1114
|
catch {
|
|
1097
1115
|
// The per-name path still has every spec.
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vltpkg/package-info",
|
|
3
3
|
"description": "Resolve and fetch package metadata and tarballs",
|
|
4
|
-
"version": "1.6.
|
|
4
|
+
"version": "1.6.4",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "git+https://github.com/vltpkg/vltpkg.git",
|
|
@@ -13,17 +13,17 @@
|
|
|
13
13
|
"url": "http://vlt.sh"
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@vltpkg/error-cause": "1.6.
|
|
17
|
-
"@vltpkg/git": "1.6.
|
|
18
|
-
"@vltpkg/output": "1.6.
|
|
19
|
-
"@vltpkg/package-json": "1.6.
|
|
20
|
-
"@vltpkg/pick-manifest": "1.6.
|
|
21
|
-
"@vltpkg/registry-client": "1.6.
|
|
22
|
-
"@vltpkg/spec": "1.6.
|
|
23
|
-
"@vltpkg/tar": "1.6.
|
|
24
|
-
"@vltpkg/types": "1.6.
|
|
25
|
-
"@vltpkg/workspaces": "1.6.
|
|
26
|
-
"@vltpkg/xdg": "1.6.
|
|
16
|
+
"@vltpkg/error-cause": "1.6.4",
|
|
17
|
+
"@vltpkg/git": "1.6.4",
|
|
18
|
+
"@vltpkg/output": "1.6.4",
|
|
19
|
+
"@vltpkg/package-json": "1.6.4",
|
|
20
|
+
"@vltpkg/pick-manifest": "1.6.4",
|
|
21
|
+
"@vltpkg/registry-client": "1.6.4",
|
|
22
|
+
"@vltpkg/spec": "1.6.4",
|
|
23
|
+
"@vltpkg/tar": "1.6.4",
|
|
24
|
+
"@vltpkg/types": "1.6.4",
|
|
25
|
+
"@vltpkg/workspaces": "1.6.4",
|
|
26
|
+
"@vltpkg/xdg": "1.6.4",
|
|
27
27
|
"tar": "^7.5.2"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
@@ -31,8 +31,8 @@
|
|
|
31
31
|
"@types/node": "^22.19.2",
|
|
32
32
|
"@types/pacote": "^11.1.8",
|
|
33
33
|
"@vltpkg/benchmark": "0.0.0",
|
|
34
|
-
"@vltpkg/cache-unzip": "1.6.
|
|
35
|
-
"@vltpkg/vlt-json": "1.6.
|
|
34
|
+
"@vltpkg/cache-unzip": "1.6.4",
|
|
35
|
+
"@vltpkg/vlt-json": "1.6.4",
|
|
36
36
|
"eslint": "^9.39.1",
|
|
37
37
|
"pacote": "^21.0.4",
|
|
38
38
|
"prettier": "^3.7.4",
|