@pnpm/store.pkg-finder 1100.0.32 → 1100.0.33
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 +10 -0
- package/lib/index.d.ts +4 -2
- package/lib/index.js +22 -6
- package/package.json +7 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# @pnpm/store.pkg-finder
|
|
2
2
|
|
|
3
|
+
## 1100.0.33
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- `pnpm licenses list` now reports the runtime downloaded through `devEngines.runtime` with `onFail: "download"`. The command previously failed with `ERR_PNPM_UNSUPPORTED_PACKAGE_TYPE` [#14172](https://github.com/pnpm/pnpm/issues/14172).
|
|
8
|
+
|
|
9
|
+
- Updated dependencies:
|
|
10
|
+
- @pnpm/fetching.directory-fetcher@1100.0.33
|
|
11
|
+
- @pnpm/store.cafs@1100.3.2
|
|
12
|
+
|
|
3
13
|
## 1100.0.32
|
|
4
14
|
|
|
5
15
|
### Patch Changes
|
package/lib/index.d.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type Resolution } from '@pnpm/resolving.resolver-base';
|
|
2
2
|
import { type StoreIndex } from '@pnpm/store.index';
|
|
3
|
+
import type { SupportedArchitectures } from '@pnpm/types';
|
|
3
4
|
export interface ReadPackageFileMapOptions {
|
|
4
5
|
storeDir: string;
|
|
5
6
|
storeIndex: StoreIndex;
|
|
6
7
|
lockfileDir: string;
|
|
8
|
+
supportedArchitectures?: SupportedArchitectures;
|
|
7
9
|
virtualStoreDirMaxLength: number;
|
|
8
10
|
}
|
|
9
11
|
/**
|
|
@@ -18,7 +20,7 @@ export interface ReadPackageFileMapOptions {
|
|
|
18
20
|
* depends on whether build scripts ran during fetch (preparePackage), so
|
|
19
21
|
* the `built` dimension is part of the key. Folding them under the
|
|
20
22
|
* integrity-only key would collapse that distinction.
|
|
21
|
-
* - npm-registry tarballs with integrity: keyed by
|
|
23
|
+
* - npm-registry tarballs and binary archives with integrity: keyed by
|
|
22
24
|
* `storeIndexKey(integrity, packageId)`.
|
|
23
25
|
* - Other tarball / git resolutions without integrity: keyed by
|
|
24
26
|
* `gitHostedStoreIndexKey(packageId, { built: true })`.
|
package/lib/index.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import path from 'node:path';
|
|
2
2
|
import { fetchFromDir } from '@pnpm/fetching.directory-fetcher';
|
|
3
|
+
import { resolvePlatformSelector, selectPlatformVariant, } from '@pnpm/resolving.resolver-base';
|
|
3
4
|
import { getFilePathByModeInCafs } from '@pnpm/store.cafs';
|
|
4
5
|
import { pickStoreIndexKey } from '@pnpm/store.index';
|
|
6
|
+
import { familySync } from 'detect-libc';
|
|
5
7
|
/**
|
|
6
8
|
* Reads the file index for a package and returns a `Map<string, string>`
|
|
7
9
|
* mapping filenames to absolute paths on disk.
|
|
@@ -14,7 +16,7 @@ import { pickStoreIndexKey } from '@pnpm/store.index';
|
|
|
14
16
|
* depends on whether build scripts ran during fetch (preparePackage), so
|
|
15
17
|
* the `built` dimension is part of the key. Folding them under the
|
|
16
18
|
* integrity-only key would collapse that distinction.
|
|
17
|
-
* - npm-registry tarballs with integrity: keyed by
|
|
19
|
+
* - npm-registry tarballs and binary archives with integrity: keyed by
|
|
18
20
|
* `storeIndexKey(integrity, packageId)`.
|
|
19
21
|
* - Other tarball / git resolutions without integrity: keyed by
|
|
20
22
|
* `gitHostedStoreIndexKey(packageId, { built: true })`.
|
|
@@ -29,14 +31,18 @@ import { pickStoreIndexKey } from '@pnpm/store.index';
|
|
|
29
31
|
* decide how to handle this case. Throws if the index file cannot be read.
|
|
30
32
|
*/
|
|
31
33
|
export async function readPackageFileMap(packageResolution, packageId, opts) {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
+
const selectedResolution = selectPackageResolution(packageResolution, opts.supportedArchitectures);
|
|
35
|
+
if (!selectedResolution)
|
|
36
|
+
return undefined;
|
|
37
|
+
if (selectedResolution.type === 'directory') {
|
|
38
|
+
const localInfo = await fetchFromDir(path.join(opts.lockfileDir, selectedResolution.directory), {});
|
|
34
39
|
return localInfo.filesMap;
|
|
35
40
|
}
|
|
36
41
|
let pkgIndexFilePath;
|
|
37
|
-
if ((!
|
|
38
|
-
|
|
39
|
-
|
|
42
|
+
if ((!selectedResolution.type && 'tarball' in selectedResolution && selectedResolution.tarball) ||
|
|
43
|
+
selectedResolution.type === 'git' ||
|
|
44
|
+
selectedResolution.type === 'binary') {
|
|
45
|
+
pkgIndexFilePath = pickStoreIndexKey(selectedResolution, packageId, { built: true });
|
|
40
46
|
}
|
|
41
47
|
else {
|
|
42
48
|
return undefined;
|
|
@@ -55,4 +61,14 @@ export async function readPackageFileMap(packageResolution, packageId, opts) {
|
|
|
55
61
|
}
|
|
56
62
|
return files;
|
|
57
63
|
}
|
|
64
|
+
function selectPackageResolution(resolution, supportedArchitectures) {
|
|
65
|
+
if (resolution.type !== 'variations')
|
|
66
|
+
return resolution;
|
|
67
|
+
const selector = resolvePlatformSelector(supportedArchitectures, {
|
|
68
|
+
platform: process.platform,
|
|
69
|
+
arch: process.arch,
|
|
70
|
+
libc: familySync(),
|
|
71
|
+
});
|
|
72
|
+
return selectPlatformVariant(resolution.variants, selector)?.resolution;
|
|
73
|
+
}
|
|
58
74
|
//# sourceMappingURL=index.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pnpm/store.pkg-finder",
|
|
3
|
-
"version": "1100.0.
|
|
3
|
+
"version": "1100.0.33",
|
|
4
4
|
"description": "Read a package's file map from the content-addressable store",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"pnpm",
|
|
@@ -27,14 +27,16 @@
|
|
|
27
27
|
"!*.map"
|
|
28
28
|
],
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@pnpm/fetching.directory-fetcher": "1100.0.
|
|
30
|
+
"@pnpm/fetching.directory-fetcher": "1100.0.33",
|
|
31
31
|
"@pnpm/resolving.resolver-base": "1101.2.0",
|
|
32
|
-
"@pnpm/store.cafs": "1100.3.
|
|
33
|
-
"@pnpm/store.index": "1100.3.1"
|
|
32
|
+
"@pnpm/store.cafs": "1100.3.2",
|
|
33
|
+
"@pnpm/store.index": "1100.3.1",
|
|
34
|
+
"@pnpm/types": "1102.1.0",
|
|
35
|
+
"detect-libc": "^2.1.2"
|
|
34
36
|
},
|
|
35
37
|
"devDependencies": {
|
|
36
38
|
"@jest/globals": "30.4.1",
|
|
37
|
-
"@pnpm/store.pkg-finder": "1100.0.
|
|
39
|
+
"@pnpm/store.pkg-finder": "1100.0.33"
|
|
38
40
|
},
|
|
39
41
|
"engines": {
|
|
40
42
|
"node": ">=22.13"
|