@pnpm/pnpr.client 1.2.2 → 1.2.3
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.
|
@@ -59,7 +59,7 @@ export interface ResolveViaPnprServerResult {
|
|
|
59
59
|
* Resolve a project against a pnpr server and return the resolved
|
|
60
60
|
* lockfile.
|
|
61
61
|
*
|
|
62
|
-
* `POST /
|
|
62
|
+
* `POST /-/pnpr/v0/resolve` answers with an `application/x-ndjson` stream: one
|
|
63
63
|
* `package` frame per resolved tarball as the server's tree walk yields
|
|
64
64
|
* it, then exactly one terminal frame — `done` (full lockfile + stats),
|
|
65
65
|
* `error`, or `violations`. pnpr serves no file content — the caller
|
|
@@ -7,7 +7,7 @@ import { convertToLockfileObject } from '@pnpm/lockfile.fs';
|
|
|
7
7
|
* Resolve a project against a pnpr server and return the resolved
|
|
8
8
|
* lockfile.
|
|
9
9
|
*
|
|
10
|
-
* `POST /
|
|
10
|
+
* `POST /-/pnpr/v0/resolve` answers with an `application/x-ndjson` stream: one
|
|
11
11
|
* `package` frame per resolved tarball as the server's tree walk yields
|
|
12
12
|
* it, then exactly one terminal frame — `done` (full lockfile + stats),
|
|
13
13
|
* `error`, or `violations`. pnpr serves no file content — the caller
|
|
@@ -55,7 +55,7 @@ export async function resolveViaPnprServer(opts) {
|
|
|
55
55
|
};
|
|
56
56
|
}
|
|
57
57
|
/**
|
|
58
|
-
* Parse the NDJSON
|
|
58
|
+
* Parse the NDJSON `/-/pnpr/v0/resolve` body and return its single terminal
|
|
59
59
|
* frame. `package` frames are skipped — this client fetches tarballs the
|
|
60
60
|
* normal way after resolution rather than overlapping fetch with the
|
|
61
61
|
* stream. Throws on an unknown frame type (so a protocol mismatch fails
|
|
@@ -72,13 +72,13 @@ function parseTerminalFrame(body) {
|
|
|
72
72
|
if (frame.type === 'done' || frame.type === 'error' || frame.type === 'violations') {
|
|
73
73
|
return frame;
|
|
74
74
|
}
|
|
75
|
-
throw new Error(`pnpr server /
|
|
75
|
+
throw new Error(`pnpr server /-/pnpr/v0/resolve stream emitted an unknown frame type: ${String(frame.type)}`);
|
|
76
76
|
}
|
|
77
|
-
throw new Error('pnpr server /
|
|
77
|
+
throw new Error('pnpr server /-/pnpr/v0/resolve stream ended without a terminal frame');
|
|
78
78
|
}
|
|
79
79
|
const REQUEST_TIMEOUT = 600_000; // 10 minutes — server-side resolution can be slow on first run
|
|
80
80
|
/**
|
|
81
|
-
* `POST /
|
|
81
|
+
* `POST /-/pnpr/v0/resolve` and return the full response body, decompressed.
|
|
82
82
|
*
|
|
83
83
|
* `urlPath` resolution normalizes the base to end with "/" so a path
|
|
84
84
|
* prefix configured on the pnpr server URL (e.g. https://host/pnpr/) is
|
|
@@ -86,7 +86,7 @@ const REQUEST_TIMEOUT = 600_000; // 10 minutes — server-side resolution can be
|
|
|
86
86
|
*/
|
|
87
87
|
async function postResolve(registryUrl, body, authorization) {
|
|
88
88
|
const base = registryUrl.endsWith('/') ? registryUrl : `${registryUrl}/`;
|
|
89
|
-
const url = new URL('
|
|
89
|
+
const url = new URL('-/pnpr/v0/resolve', base);
|
|
90
90
|
const requestFn = url.protocol === 'https:' ? https.request : http.request;
|
|
91
91
|
const headers = {
|
|
92
92
|
'Content-Type': 'application/json',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pnpm/pnpr.client",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.3",
|
|
4
4
|
"description": "Client for the pnpr server — resolves a project server-side and receives the resolved lockfile",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"pnpm",
|
|
@@ -27,11 +27,11 @@
|
|
|
27
27
|
"!*.map"
|
|
28
28
|
],
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@pnpm/lockfile.
|
|
31
|
-
"@pnpm/lockfile.
|
|
30
|
+
"@pnpm/lockfile.fs": "1100.1.7",
|
|
31
|
+
"@pnpm/lockfile.types": "1100.0.12"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
|
-
"@pnpm/pnpr.client": "1.2.
|
|
34
|
+
"@pnpm/pnpr.client": "1.2.3",
|
|
35
35
|
"@pnpm/types": "1101.3.2"
|
|
36
36
|
},
|
|
37
37
|
"engines": {
|