@pnpm/crypto.shasums-file 1100.2.4 → 1100.2.5
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/CHANGELOG.md +9 -0
- package/lib/index.d.ts +11 -0
- package/lib/index.js +14 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# @pnpm/crypto.shasums-file
|
|
2
2
|
|
|
3
|
+
## 1100.2.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Resolving a Node.js runtime now fails when unofficial-builds.nodejs.org cannot be reached. pnpm used to ignore that failure and leave the musl builds out of `pnpm-lock.yaml`. `pnpm update` then wrote a different lockfile on a machine whose network blocks the mirror [pnpm/pnpm#14813](https://github.com/pnpm/pnpm/issues/14813).
|
|
8
|
+
|
|
9
|
+
- Updated dependencies:
|
|
10
|
+
- @pnpm/crypto.hash@1100.0.5
|
|
11
|
+
|
|
3
12
|
## 1100.2.4
|
|
4
13
|
|
|
5
14
|
### Patch Changes
|
package/lib/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { PnpmError } from '@pnpm/error';
|
|
1
2
|
import type { FetchFromRegistry } from '@pnpm/fetching.types';
|
|
2
3
|
import { RUNTIME_SHASUMS_DIR } from './diskCache.js';
|
|
3
4
|
import { type ArmoredKey, fetchVerifiedNodeShasums } from './verifyNodeShasums.js';
|
|
@@ -42,4 +43,14 @@ export declare function fetchVerifiedNodeShasumsFileCached(fetch: FetchFromRegis
|
|
|
42
43
|
export declare function fetchShasumsFileCached(fetch: FetchFromRegistry, shasumsUrl: string, opts?: FetchShasumsFileCachedOpts): Promise<ShasumsFileItem[]>;
|
|
43
44
|
export declare function parseShasumsFile(shasumsFileContent: string): ShasumsFileItem[];
|
|
44
45
|
export declare function fetchShasumsFileRaw(fetch: FetchFromRegistry, shasumsUrl: string): Promise<string>;
|
|
46
|
+
/**
|
|
47
|
+
* A mirror answered a SHASUMS file request with a non-ok status. Callers that
|
|
48
|
+
* treat some statuses as expected (a mirror that never published a given
|
|
49
|
+
* release answers 404) match on {@link status}; every other failure mode
|
|
50
|
+
* reaches them as a plain fetch error.
|
|
51
|
+
*/
|
|
52
|
+
export declare class FetchShasumsFileError extends PnpmError {
|
|
53
|
+
readonly status: number;
|
|
54
|
+
constructor(shasumsUrl: string, status: number);
|
|
55
|
+
}
|
|
45
56
|
export declare function pickFileChecksumFromShasumsFile(body: string, fileName: string): string;
|
package/lib/index.js
CHANGED
|
@@ -75,11 +75,24 @@ export function parseShasumsFile(shasumsFileContent) {
|
|
|
75
75
|
export async function fetchShasumsFileRaw(fetch, shasumsUrl) {
|
|
76
76
|
const res = await fetch(shasumsUrl);
|
|
77
77
|
if (!res.ok) {
|
|
78
|
-
throw new
|
|
78
|
+
throw new FetchShasumsFileError(shasumsUrl, res.status);
|
|
79
79
|
}
|
|
80
80
|
const body = await res.text();
|
|
81
81
|
return body;
|
|
82
82
|
}
|
|
83
|
+
/**
|
|
84
|
+
* A mirror answered a SHASUMS file request with a non-ok status. Callers that
|
|
85
|
+
* treat some statuses as expected (a mirror that never published a given
|
|
86
|
+
* release answers 404) match on {@link status}; every other failure mode
|
|
87
|
+
* reaches them as a plain fetch error.
|
|
88
|
+
*/
|
|
89
|
+
export class FetchShasumsFileError extends PnpmError {
|
|
90
|
+
status;
|
|
91
|
+
constructor(shasumsUrl, status) {
|
|
92
|
+
super('FAILED_DOWNLOAD_SHASUM_FILE', `Failed to fetch integrity file: ${shasumsUrl} (status: ${status})`);
|
|
93
|
+
this.status = status;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
83
96
|
const SHA256_REGEX = /^[a-f0-9]{64}$/;
|
|
84
97
|
export function pickFileChecksumFromShasumsFile(body, fileName) {
|
|
85
98
|
const line = body.split('\n').find(line => line.trim().endsWith(` ${fileName}`));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pnpm/crypto.shasums-file",
|
|
3
|
-
"version": "1100.2.
|
|
3
|
+
"version": "1100.2.5",
|
|
4
4
|
"description": "Utils for working with shasums files",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"pnpm",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"!*.map"
|
|
30
30
|
],
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@pnpm/crypto.hash": "1100.0.
|
|
32
|
+
"@pnpm/crypto.hash": "1100.0.5",
|
|
33
33
|
"@pnpm/error": "1100.1.4",
|
|
34
34
|
"@pnpm/fetching.types": "1100.0.3",
|
|
35
35
|
"openpgp": "^6.3.1"
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@jest/globals": "30.4.1",
|
|
39
39
|
"@openpgp/web-stream-tools": "0.3.1",
|
|
40
|
-
"@pnpm/crypto.shasums-file": "1100.2.
|
|
40
|
+
"@pnpm/crypto.shasums-file": "1100.2.5"
|
|
41
41
|
},
|
|
42
42
|
"engines": {
|
|
43
43
|
"node": ">=22.13"
|