@pnpm/store.pkg-finder 1000.0.0-0 → 1100.0.0
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/lib/index.d.ts +3 -1
- package/lib/index.js +15 -9
- package/package.json +9 -9
- package/lib/index.js.map +0 -1
package/lib/index.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { Resolution } from '@pnpm/resolving.resolver-base';
|
|
2
|
+
import { type StoreIndex } from '@pnpm/store.index';
|
|
2
3
|
export interface ReadPackageFileMapOptions {
|
|
3
4
|
storeDir: string;
|
|
5
|
+
storeIndex: StoreIndex;
|
|
4
6
|
lockfileDir: string;
|
|
5
7
|
virtualStoreDirMaxLength: number;
|
|
6
8
|
}
|
package/lib/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import path from 'path';
|
|
2
|
-
import {
|
|
3
|
-
import { fetchFromDir } from '@pnpm/directory-fetcher';
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
import path from 'node:path';
|
|
2
|
+
import { parse } from '@pnpm/deps.path';
|
|
3
|
+
import { fetchFromDir } from '@pnpm/fetching.directory-fetcher';
|
|
4
|
+
import { getFilePathByModeInCafs } from '@pnpm/store.cafs';
|
|
5
|
+
import { gitHostedStoreIndexKey, storeIndexKey } from '@pnpm/store.index';
|
|
6
6
|
/**
|
|
7
7
|
* Reads the file index for a package and returns a `Map<string, string>`
|
|
8
8
|
* mapping filenames to absolute paths on disk.
|
|
@@ -30,16 +30,22 @@ export async function readPackageFileMap(packageResolution, packageId, opts) {
|
|
|
30
30
|
let pkgIndexFilePath;
|
|
31
31
|
if (isPackageWithIntegrity) {
|
|
32
32
|
const parsedId = parse(packageId);
|
|
33
|
-
pkgIndexFilePath =
|
|
33
|
+
pkgIndexFilePath = storeIndexKey(packageResolution.integrity, parsedId.nonSemverVersion ?? `${parsedId.name}@${parsedId.version}`);
|
|
34
34
|
}
|
|
35
35
|
else if (!packageResolution.type && 'tarball' in packageResolution && packageResolution.tarball) {
|
|
36
|
-
|
|
37
|
-
pkgIndexFilePath = path.join(opts.storeDir, packageDirInStore, 'integrity.mpk');
|
|
36
|
+
pkgIndexFilePath = gitHostedStoreIndexKey(packageId, { built: true });
|
|
38
37
|
}
|
|
39
38
|
else {
|
|
40
39
|
return undefined;
|
|
41
40
|
}
|
|
42
|
-
const
|
|
41
|
+
const pkgFilesIndex = opts.storeIndex.get(pkgIndexFilePath);
|
|
42
|
+
if (!pkgFilesIndex) {
|
|
43
|
+
const err = new Error(`ENOENT: package index not found for '${pkgIndexFilePath}'`);
|
|
44
|
+
err.code = 'ENOENT';
|
|
45
|
+
err.path = pkgIndexFilePath;
|
|
46
|
+
throw err;
|
|
47
|
+
}
|
|
48
|
+
const { files: indexFiles } = pkgFilesIndex;
|
|
43
49
|
const files = new Map();
|
|
44
50
|
for (const [name, info] of indexFiles) {
|
|
45
51
|
files.set(name, getFilePathByModeInCafs(opts.storeDir, info.digest, info.mode));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pnpm/store.pkg-finder",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "1100.0.0",
|
|
4
4
|
"description": "Read a package's file map from the content-addressable store",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"pnpm",
|
|
@@ -24,14 +24,14 @@
|
|
|
24
24
|
"!*.map"
|
|
25
25
|
],
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@pnpm/
|
|
28
|
-
"@pnpm/
|
|
29
|
-
"@pnpm/resolver-base": "
|
|
30
|
-
"@pnpm/
|
|
31
|
-
"@pnpm/store.
|
|
27
|
+
"@pnpm/deps.path": "1100.0.0",
|
|
28
|
+
"@pnpm/fetching.directory-fetcher": "1100.0.0",
|
|
29
|
+
"@pnpm/resolving.resolver-base": "1100.0.0",
|
|
30
|
+
"@pnpm/store.cafs": "1100.0.0",
|
|
31
|
+
"@pnpm/store.index": "1100.0.0"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
|
-
"@pnpm/store.pkg-finder": "
|
|
34
|
+
"@pnpm/store.pkg-finder": "1100.0.0"
|
|
35
35
|
},
|
|
36
36
|
"engines": {
|
|
37
37
|
"node": ">=22.13"
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
},
|
|
42
42
|
"scripts": {
|
|
43
43
|
"lint": "eslint \"src/**/*.ts\"",
|
|
44
|
-
"compile": "tsgo --build &&
|
|
45
|
-
"test": "
|
|
44
|
+
"compile": "tsgo --build && pn lint --fix",
|
|
45
|
+
"test": "pn compile"
|
|
46
46
|
}
|
|
47
47
|
}
|
package/lib/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAA;AACvB,OAAO,EAAE,iBAAiB,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAA;AAChE,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAA;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAEvD,OAAO,EAAE,uBAAuB,EAAE,sBAAsB,EAA0B,MAAM,kBAAkB,CAAA;AAQ1G;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,CAAC,KAAK,UAAU,kBAAkB,CACtC,iBAA6B,EAC7B,SAAiB,EACjB,IAA+B,EACW;IAC1C,IAAI,iBAAiB,CAAC,IAAI,KAAK,WAAW,EAAE,CAAC;QAC3C,MAAM,SAAS,GAAG,MAAM,YAAY,CAClC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,iBAAiB,CAAC,SAAS,CAAC,EACxD,EAAE,CACH,CAAA;QACD,OAAO,SAAS,CAAC,QAAQ,CAAA;IAC3B,CAAC;IAED,MAAM,sBAAsB,GAAG,WAAW,IAAI,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