@pnpm/testing.temp-store 1000.0.42 → 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 -3
- package/lib/index.js +16 -38
- package/package.json +13 -12
- package/lib/index.js.map +0 -1
package/lib/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { type ClientOptions } from '@pnpm/client';
|
|
2
|
-
import { type CreatePackageStoreOptions } from '@pnpm/
|
|
3
|
-
import {
|
|
1
|
+
import { type ClientOptions } from '@pnpm/installing.client';
|
|
2
|
+
import { type CreatePackageStoreOptions } from '@pnpm/store.controller';
|
|
3
|
+
import type { StoreController } from '@pnpm/store.controller-types';
|
|
4
4
|
export interface CreateTempStoreResult {
|
|
5
5
|
storeController: StoreController;
|
|
6
6
|
storeDir: string;
|
package/lib/index.js
CHANGED
|
@@ -1,40 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.createTempStore = createTempStore;
|
|
27
|
-
const path = __importStar(require("path"));
|
|
28
|
-
const client_1 = require("@pnpm/client");
|
|
29
|
-
const package_store_1 = require("@pnpm/package-store");
|
|
30
|
-
const registry_mock_1 = require("@pnpm/registry-mock");
|
|
31
|
-
const registry = `http://localhost:${registry_mock_1.REGISTRY_MOCK_PORT}/`;
|
|
32
|
-
function createTempStore(opts) {
|
|
33
|
-
const authConfig = { registry };
|
|
1
|
+
import * as path from 'node:path';
|
|
2
|
+
import { createClient } from '@pnpm/installing.client';
|
|
3
|
+
import { REGISTRY_MOCK_PORT } from '@pnpm/registry-mock';
|
|
4
|
+
import { createPackageStore } from '@pnpm/store.controller';
|
|
5
|
+
import { StoreIndex } from '@pnpm/store.index';
|
|
6
|
+
const registry = `http://localhost:${REGISTRY_MOCK_PORT}/`;
|
|
7
|
+
export function createTempStore(opts) {
|
|
8
|
+
const configByUri = {};
|
|
34
9
|
const cacheDir = path.resolve('cache');
|
|
35
|
-
const
|
|
36
|
-
|
|
37
|
-
|
|
10
|
+
const storeDir = opts?.storeDir ?? path.resolve('.store');
|
|
11
|
+
const storeIndex = new StoreIndex(storeDir);
|
|
12
|
+
const { resolve, fetchers, clearResolutionCache } = createClient({
|
|
13
|
+
configByUri,
|
|
38
14
|
retry: {
|
|
39
15
|
retries: 4,
|
|
40
16
|
factor: 10,
|
|
@@ -42,16 +18,18 @@ function createTempStore(opts) {
|
|
|
42
18
|
minTimeout: 10_000,
|
|
43
19
|
},
|
|
44
20
|
cacheDir,
|
|
21
|
+
storeDir,
|
|
22
|
+
storeIndex,
|
|
45
23
|
registries: {
|
|
46
24
|
default: registry,
|
|
47
25
|
},
|
|
48
26
|
...opts?.clientOptions,
|
|
49
27
|
});
|
|
50
|
-
const
|
|
51
|
-
const storeController = (0, package_store_1.createPackageStore)(resolve, fetchers, {
|
|
28
|
+
const storeController = createPackageStore(resolve, fetchers, {
|
|
52
29
|
cacheDir,
|
|
53
30
|
ignoreFile: opts?.fastUnpack === false ? undefined : (filename) => filename !== 'package.json',
|
|
54
31
|
storeDir,
|
|
32
|
+
storeIndex,
|
|
55
33
|
verifyStoreIntegrity: true,
|
|
56
34
|
virtualStoreDirMaxLength: process.platform === 'win32' ? 60 : 120,
|
|
57
35
|
clearResolutionCache,
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pnpm/testing.temp-store",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "1100.0.0",
|
|
4
4
|
"description": "A temporary store for testing purposes",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"pnpm",
|
|
7
|
-
"
|
|
7
|
+
"pnpm11",
|
|
8
8
|
"store"
|
|
9
9
|
],
|
|
10
10
|
"license": "MIT",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"bugs": {
|
|
15
15
|
"url": "https://github.com/pnpm/pnpm/issues"
|
|
16
16
|
},
|
|
17
|
-
"type": "
|
|
17
|
+
"type": "module",
|
|
18
18
|
"main": "lib/index.js",
|
|
19
19
|
"types": "lib/index.d.ts",
|
|
20
20
|
"exports": {
|
|
@@ -25,24 +25,25 @@
|
|
|
25
25
|
"!*.map"
|
|
26
26
|
],
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@pnpm/registry-mock": "
|
|
29
|
-
"@pnpm/
|
|
30
|
-
"@pnpm/
|
|
31
|
-
"@pnpm/
|
|
28
|
+
"@pnpm/registry-mock": "6.0.0",
|
|
29
|
+
"@pnpm/installing.client": "1100.0.0",
|
|
30
|
+
"@pnpm/store.controller": "1100.0.0",
|
|
31
|
+
"@pnpm/store.index": "1100.0.0",
|
|
32
|
+
"@pnpm/store.controller-types": "1100.0.0"
|
|
32
33
|
},
|
|
33
34
|
"devDependencies": {
|
|
34
|
-
"@pnpm/testing.temp-store": "
|
|
35
|
+
"@pnpm/testing.temp-store": "1100.0.0"
|
|
35
36
|
},
|
|
36
37
|
"engines": {
|
|
37
|
-
"node": ">=
|
|
38
|
+
"node": ">=22.13"
|
|
38
39
|
},
|
|
39
40
|
"jest": {
|
|
40
41
|
"preset": "@pnpm/jest-config"
|
|
41
42
|
},
|
|
42
43
|
"scripts": {
|
|
43
44
|
"lint": "eslint \"src/**/*.ts\"",
|
|
44
|
-
"test": "
|
|
45
|
-
"start": "
|
|
46
|
-
"compile": "
|
|
45
|
+
"test": "pn compile",
|
|
46
|
+
"start": "tsgo --watch",
|
|
47
|
+
"compile": "tsgo --build && pn lint --fix"
|
|
47
48
|
}
|
|
48
49
|
}
|
package/lib/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAcA,0CA0CC;AAxDD,2CAA4B;AAC5B,yCAA+D;AAC/D,uDAAwF;AACxF,uDAAwD;AAGxD,MAAM,QAAQ,GAAG,oBAAoB,kCAAkB,GAAG,CAAA;AAQ1D,SAAgB,eAAe,CAAE,IAKhC;IACC,MAAM,UAAU,GAAG,EAAE,QAAQ,EAAE,CAAA;IAC/B,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAA;IACtC,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,oBAAoB,EAAE,GAAG,IAAA,qBAAY,EAAC;QAC/D,UAAU;QACV,SAAS,EAAE,EAAE;QACb,KAAK,EAAE;YACL,OAAO,EAAE,CAAC;YACV,MAAM,EAAE,EAAE;YACV,UAAU,EAAE,MAAM;YAClB,UAAU,EAAE,MAAM;SACnB;QACD,QAAQ;QACR,UAAU,EAAE;YACV,OAAO,EAAE,QAAQ;SAClB;QACD,GAAG,IAAI,EAAE,aAAa;KACvB,CAAC,CAAA;IACF,MAAM,QAAQ,GAAG,IAAI,EAAE,QAAQ,IAAI,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAA;IACzD,MAAM,eAAe,GAAG,IAAA,kCAAkB,EACxC,OAAO,EACP,QAAQ,EACR;QACE,QAAQ;QACR,UAAU,EAAE,IAAI,EAAE,UAAU,KAAK,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,KAAK,cAAc;QAC9F,QAAQ;QACR,oBAAoB,EAAE,IAAI;QAC1B,wBAAwB,EAAE,OAAO,CAAC,QAAQ,KAAK,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG;QACjE,oBAAoB;QACpB,GAAG,IAAI,EAAE,YAAY;KACtB,CACF,CAAA;IACD,OAAO;QACL,eAAe;QACf,QAAQ;QACR,QAAQ;KACT,CAAA;AACH,CAAC"}
|