@pnpm/cache.api 1000.0.10 → 1000.0.12
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/cacheList.js +3 -2
- package/lib/cacheList.js.map +1 -1
- package/lib/cacheView.js +3 -2
- package/lib/cacheView.js.map +1 -1
- package/package.json +23 -23
package/lib/cacheList.js
CHANGED
|
@@ -8,7 +8,7 @@ exports.cacheList = cacheList;
|
|
|
8
8
|
exports.findMetadataFiles = findMetadataFiles;
|
|
9
9
|
const fs_1 = __importDefault(require("fs"));
|
|
10
10
|
const encode_registry_1 = __importDefault(require("encode-registry"));
|
|
11
|
-
const
|
|
11
|
+
const tinyglobby_1 = require("tinyglobby");
|
|
12
12
|
async function cacheListRegistries(opts) {
|
|
13
13
|
return fs_1.default.readdirSync(opts.cacheDir).sort().join('\n');
|
|
14
14
|
}
|
|
@@ -19,8 +19,9 @@ async function cacheList(opts, filter) {
|
|
|
19
19
|
async function findMetadataFiles(opts, filter) {
|
|
20
20
|
const prefix = opts.registry ? `${(0, encode_registry_1.default)(opts.registry)}` : '*';
|
|
21
21
|
const patterns = filter.length ? filter.map((filter) => `${prefix}/${filter}.json`) : [`${prefix}/**`];
|
|
22
|
-
const metaFiles = await (0,
|
|
22
|
+
const metaFiles = await (0, tinyglobby_1.glob)(patterns, {
|
|
23
23
|
cwd: opts.cacheDir,
|
|
24
|
+
expandDirectories: false,
|
|
24
25
|
});
|
|
25
26
|
return metaFiles;
|
|
26
27
|
}
|
package/lib/cacheList.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cacheList.js","sourceRoot":"","sources":["../src/cacheList.ts"],"names":[],"mappings":";;;;;AAIA,kDAEC;AAED,8BAGC;AAED,
|
|
1
|
+
{"version":3,"file":"cacheList.js","sourceRoot":"","sources":["../src/cacheList.ts"],"names":[],"mappings":";;;;;AAIA,kDAEC;AAED,8BAGC;AAED,8CAQC;AArBD,4CAAmB;AACnB,sEAA6C;AAC7C,2CAAiC;AAE1B,KAAK,UAAU,mBAAmB,CAAE,IAAmE;IAC5G,OAAO,YAAE,CAAC,WAAW,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,IAAI,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AACxD,CAAC;AAEM,KAAK,UAAU,SAAS,CAAE,IAAmE,EAAE,MAAgB;IACpH,MAAM,SAAS,GAAG,MAAM,iBAAiB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAA;IACvD,OAAO,SAAS,CAAC,IAAI,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AACpC,CAAC;AAEM,KAAK,UAAU,iBAAiB,CAAE,IAA6C,EAAE,MAAgB;IACtG,MAAM,MAAM,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,IAAA,yBAAe,EAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAA;IACxE,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,GAAG,MAAM,IAAI,MAAM,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,MAAM,KAAK,CAAC,CAAA;IACtG,MAAM,SAAS,GAAG,MAAM,IAAA,iBAAI,EAAC,QAAQ,EAAE;QACrC,GAAG,EAAE,IAAI,CAAC,QAAQ;QAClB,iBAAiB,EAAE,KAAK;KACzB,CAAC,CAAA;IACF,OAAO,SAAS,CAAA;AAClB,CAAC"}
|
package/lib/cacheView.js
CHANGED
|
@@ -6,13 +6,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.cacheView = cacheView;
|
|
7
7
|
const fs_1 = __importDefault(require("fs"));
|
|
8
8
|
const path_1 = __importDefault(require("path"));
|
|
9
|
-
const
|
|
9
|
+
const tinyglobby_1 = require("tinyglobby");
|
|
10
10
|
const store_cafs_1 = require("@pnpm/store.cafs");
|
|
11
11
|
const encode_registry_1 = __importDefault(require("encode-registry"));
|
|
12
12
|
async function cacheView(opts, packageName) {
|
|
13
13
|
const prefix = opts.registry ? `${(0, encode_registry_1.default)(opts.registry)}` : '*';
|
|
14
|
-
const metaFilePaths = (await (0,
|
|
14
|
+
const metaFilePaths = (await (0, tinyglobby_1.glob)(`${prefix}/${packageName}.json`, {
|
|
15
15
|
cwd: opts.cacheDir,
|
|
16
|
+
expandDirectories: false,
|
|
16
17
|
})).sort();
|
|
17
18
|
const metaFilesByPath = {};
|
|
18
19
|
for (const filePath of metaFilePaths) {
|
package/lib/cacheView.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cacheView.js","sourceRoot":"","sources":["../src/cacheView.ts"],"names":[],"mappings":";;;;;AAcA,
|
|
1
|
+
{"version":3,"file":"cacheView.js","sourceRoot":"","sources":["../src/cacheView.ts"],"names":[],"mappings":";;;;;AAcA,8BAgCC;AA9CD,4CAAmB;AACnB,gDAAuB;AACvB,2CAAiC;AACjC,iDAAyD;AAEzD,sEAA6C;AAStC,KAAK,UAAU,SAAS,CAAE,IAA+D,EAAE,WAAmB;IACnH,MAAM,MAAM,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,IAAA,yBAAe,EAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAA;IACxE,MAAM,aAAa,GAAG,CAAC,MAAM,IAAA,iBAAI,EAAC,GAAG,MAAM,IAAI,WAAW,OAAO,EAAE;QACjE,GAAG,EAAE,IAAI,CAAC,QAAQ;QAClB,iBAAiB,EAAE,KAAK;KACzB,CAAC,CAAC,CAAC,IAAI,EAAE,CAAA;IACV,MAAM,eAAe,GAAmC,EAAE,CAAA;IAC1D,KAAK,MAAM,QAAQ,IAAI,aAAa,EAAE,CAAC;QACrC,MAAM,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,YA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ClC,CAAA;IACH,CAAC;IACD,OAAO,IAAI,CAAC,SAAS,CAAC,eAAe,EAAE,IAAI,EAAE,CAAC,CAAC,CAAA;AACjD,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,45 +1,45 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pnpm/cache.api",
|
|
3
|
-
"version": "1000.0.
|
|
3
|
+
"version": "1000.0.12",
|
|
4
4
|
"description": "API for controlling the cache",
|
|
5
|
-
"main": "lib/index.js",
|
|
6
|
-
"types": "lib/index.d.ts",
|
|
7
|
-
"files": [
|
|
8
|
-
"lib",
|
|
9
|
-
"!*.map"
|
|
10
|
-
],
|
|
11
|
-
"engines": {
|
|
12
|
-
"node": ">=18.12"
|
|
13
|
-
},
|
|
14
|
-
"repository": "https://github.com/pnpm/pnpm/blob/main/cache/api",
|
|
15
5
|
"keywords": [
|
|
16
|
-
"pnpm10",
|
|
17
6
|
"pnpm",
|
|
7
|
+
"pnpm10",
|
|
18
8
|
"cache"
|
|
19
9
|
],
|
|
20
10
|
"license": "MIT",
|
|
11
|
+
"funding": "https://opencollective.com/pnpm",
|
|
12
|
+
"repository": "https://github.com/pnpm/pnpm/blob/main/cache/api",
|
|
13
|
+
"homepage": "https://github.com/pnpm/pnpm/blob/main/cache/api#readme",
|
|
21
14
|
"bugs": {
|
|
22
15
|
"url": "https://github.com/pnpm/pnpm/issues"
|
|
23
16
|
},
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
|
|
27
|
-
"
|
|
17
|
+
"main": "lib/index.js",
|
|
18
|
+
"types": "lib/index.d.ts",
|
|
19
|
+
"exports": {
|
|
20
|
+
".": "./lib/index.js"
|
|
28
21
|
},
|
|
22
|
+
"files": [
|
|
23
|
+
"lib",
|
|
24
|
+
"!*.map"
|
|
25
|
+
],
|
|
29
26
|
"dependencies": {
|
|
30
27
|
"encode-registry": "^3.0.1",
|
|
31
|
-
"
|
|
28
|
+
"tinyglobby": "^0.2.12",
|
|
32
29
|
"@pnpm/constants": "1001.1.0",
|
|
33
|
-
"@pnpm/
|
|
34
|
-
"@pnpm/npm-resolver": "1000.1.
|
|
35
|
-
"@pnpm/
|
|
30
|
+
"@pnpm/config": "1002.5.0",
|
|
31
|
+
"@pnpm/npm-resolver": "1000.1.5",
|
|
32
|
+
"@pnpm/store.cafs": "1000.0.6"
|
|
36
33
|
},
|
|
37
34
|
"peerDependencies": {
|
|
38
35
|
"@pnpm/logger": ">=5.1.0 <1001.0.0"
|
|
39
36
|
},
|
|
40
|
-
"
|
|
41
|
-
|
|
42
|
-
"
|
|
37
|
+
"devDependencies": {
|
|
38
|
+
"@pnpm/cache.api": "1000.0.12",
|
|
39
|
+
"@pnpm/logger": "1000.0.0"
|
|
40
|
+
},
|
|
41
|
+
"engines": {
|
|
42
|
+
"node": ">=18.12"
|
|
43
43
|
},
|
|
44
44
|
"jest": {
|
|
45
45
|
"preset": "@pnpm/jest-config"
|