@pnpm/client 7.2.10 → 8.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 +11 -2
- package/lib/index.js +12 -12
- package/lib/index.js.map +1 -1
- package/package.json +7 -7
package/lib/index.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { ResolveFunction, ResolverFactoryOptions } from '@pnpm/default-resolver';
|
|
2
2
|
import { AgentOptions } from '@pnpm/fetch';
|
|
3
3
|
import { RetryTimeoutOptions } from '@pnpm/fetching-types';
|
|
4
|
-
import type { CustomFetchers } from '@pnpm/fetcher-base';
|
|
4
|
+
import type { CustomFetchers, GitFetcher, DirectoryFetcher } from '@pnpm/fetcher-base';
|
|
5
|
+
import { TarballFetchers } from '@pnpm/tarball-fetcher';
|
|
5
6
|
export { ResolveFunction };
|
|
6
7
|
export declare type ClientOptions = {
|
|
7
8
|
authConfig: Record<string, string>;
|
|
@@ -12,5 +13,13 @@ export declare type ClientOptions = {
|
|
|
12
13
|
userConfig?: Record<string, string>;
|
|
13
14
|
gitShallowHosts?: string[];
|
|
14
15
|
} & ResolverFactoryOptions & AgentOptions;
|
|
15
|
-
export
|
|
16
|
+
export interface Client {
|
|
17
|
+
fetchers: Fetchers;
|
|
18
|
+
resolve: ResolveFunction;
|
|
19
|
+
}
|
|
20
|
+
export declare function createClient(opts: ClientOptions): Client;
|
|
16
21
|
export declare function createResolver(opts: ClientOptions): ResolveFunction;
|
|
22
|
+
declare type Fetchers = {
|
|
23
|
+
git: GitFetcher;
|
|
24
|
+
directory: DirectoryFetcher;
|
|
25
|
+
} & TarballFetchers;
|
package/lib/index.js
CHANGED
|
@@ -3,34 +3,34 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.createResolver = void 0;
|
|
7
|
-
const default_resolver_1 =
|
|
6
|
+
exports.createResolver = exports.createClient = void 0;
|
|
7
|
+
const default_resolver_1 = require("@pnpm/default-resolver");
|
|
8
8
|
const fetch_1 = require("@pnpm/fetch");
|
|
9
|
-
const directory_fetcher_1 =
|
|
10
|
-
const git_fetcher_1 =
|
|
11
|
-
const tarball_fetcher_1 =
|
|
9
|
+
const directory_fetcher_1 = require("@pnpm/directory-fetcher");
|
|
10
|
+
const git_fetcher_1 = require("@pnpm/git-fetcher");
|
|
11
|
+
const tarball_fetcher_1 = require("@pnpm/tarball-fetcher");
|
|
12
12
|
const credentials_by_uri_1 = __importDefault(require("credentials-by-uri"));
|
|
13
13
|
const mem_1 = __importDefault(require("mem"));
|
|
14
|
-
function
|
|
14
|
+
function createClient(opts) {
|
|
15
15
|
const fetchFromRegistry = (0, fetch_1.createFetchFromRegistry)(opts);
|
|
16
16
|
const getCredentials = (0, mem_1.default)((registry) => (0, credentials_by_uri_1.default)(opts.authConfig, registry, opts.userConfig));
|
|
17
17
|
return {
|
|
18
18
|
fetchers: createFetchers(fetchFromRegistry, getCredentials, opts, opts.customFetchers),
|
|
19
|
-
resolve: (0, default_resolver_1.
|
|
19
|
+
resolve: (0, default_resolver_1.createResolver)(fetchFromRegistry, getCredentials, opts),
|
|
20
20
|
};
|
|
21
21
|
}
|
|
22
|
-
exports.
|
|
22
|
+
exports.createClient = createClient;
|
|
23
23
|
function createResolver(opts) {
|
|
24
24
|
const fetchFromRegistry = (0, fetch_1.createFetchFromRegistry)(opts);
|
|
25
25
|
const getCredentials = (0, mem_1.default)((registry) => (0, credentials_by_uri_1.default)(opts.authConfig, registry));
|
|
26
|
-
return (0, default_resolver_1.
|
|
26
|
+
return (0, default_resolver_1.createResolver)(fetchFromRegistry, getCredentials, opts);
|
|
27
27
|
}
|
|
28
28
|
exports.createResolver = createResolver;
|
|
29
29
|
function createFetchers(fetchFromRegistry, getCredentials, opts, customFetchers) {
|
|
30
30
|
const defaultFetchers = {
|
|
31
|
-
...(0, tarball_fetcher_1.
|
|
32
|
-
...(0, git_fetcher_1.
|
|
33
|
-
...(0, directory_fetcher_1.
|
|
31
|
+
...(0, tarball_fetcher_1.createTarballFetcher)(fetchFromRegistry, getCredentials, opts),
|
|
32
|
+
...(0, git_fetcher_1.createGitFetcher)(opts),
|
|
33
|
+
...(0, directory_fetcher_1.createDirectoryFetcher)(),
|
|
34
34
|
};
|
|
35
35
|
const overwrites = Object.entries(customFetchers ?? {})
|
|
36
36
|
.reduce((acc, [fetcherName, factory]) => {
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;AAAA,6DAI+B;AAC/B,uCAAmE;AAGnE,+DAAgE;AAChE,mDAAoD;AACpD,2DAA6E;AAC7E,4EAAoD;AACpD,8CAAqB;AAmBrB,SAAgB,YAAY,CAAE,IAAmB;IAC/C,MAAM,iBAAiB,GAAG,IAAA,+BAAuB,EAAC,IAAI,CAAC,CAAA;IACvD,MAAM,cAAc,GAAG,IAAA,aAAG,EAAC,CAAC,QAAgB,EAAE,EAAE,CAAC,IAAA,4BAAmB,EAAC,IAAI,CAAC,UAAU,EAAE,QAAQ,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC,CAAA;IACjH,OAAO;QACL,QAAQ,EAAE,cAAc,CAAC,iBAAiB,EAAE,cAAc,EAAE,IAAI,EAAE,IAAI,CAAC,cAAc,CAAC;QACtF,OAAO,EAAE,IAAA,iCAAe,EAAC,iBAAiB,EAAE,cAAc,EAAE,IAAI,CAAC;KAClE,CAAA;AACH,CAAC;AAPD,oCAOC;AAED,SAAgB,cAAc,CAAE,IAAmB;IACjD,MAAM,iBAAiB,GAAG,IAAA,+BAAuB,EAAC,IAAI,CAAC,CAAA;IACvD,MAAM,cAAc,GAAG,IAAA,aAAG,EAAC,CAAC,QAAgB,EAAE,EAAE,CAAC,IAAA,4BAAmB,EAAC,IAAI,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC,CAAA;IAChG,OAAO,IAAA,iCAAe,EAAC,iBAAiB,EAAE,cAAc,EAAE,IAAI,CAAC,CAAA;AACjE,CAAC;AAJD,wCAIC;AAOD,SAAS,cAAc,CACrB,iBAAoC,EACpC,cAA8B,EAC9B,IAAsD,EACtD,cAA+B;IAE/B,MAAM,eAAe,GAAG;QACtB,GAAG,IAAA,sCAAoB,EAAC,iBAAiB,EAAE,cAAc,EAAE,IAAI,CAAC;QAChE,GAAG,IAAA,8BAAgB,EAAC,IAAI,CAAC;QACzB,GAAG,IAAA,0CAAsB,GAAE;KAC5B,CAAA;IAED,MAAM,UAAU,GAAG,MAAM,CAAC,OAAO,CAAC,cAAc,IAAI,EAAE,CAAC;SACpD,MAAM,CAAC,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE,OAAO,CAAC,EAAE,EAAE;QACtC,GAAG,CAAC,WAAW,CAAC,GAAG,OAAO,CAAC,EAAE,eAAe,EAAE,CAAC,CAAA;QAC/C,OAAO,GAAG,CAAA;IACZ,CAAC,EAAE,EAAE,CAAC,CAAA;IAER,OAAO;QACL,GAAG,eAAe;QAClB,GAAG,UAAU;KACd,CAAA;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pnpm/client",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "8.0.0",
|
|
4
4
|
"description": "Creates the package resolve and fetch functions",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -24,18 +24,18 @@
|
|
|
24
24
|
},
|
|
25
25
|
"homepage": "https://github.com/pnpm/pnpm/blob/main/packages/client#readme",
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@pnpm/default-resolver": "
|
|
28
|
-
"@pnpm/directory-fetcher": "
|
|
29
|
-
"@pnpm/fetch": "
|
|
27
|
+
"@pnpm/default-resolver": "16.0.0",
|
|
28
|
+
"@pnpm/directory-fetcher": "4.0.0",
|
|
29
|
+
"@pnpm/fetch": "6.0.0",
|
|
30
30
|
"@pnpm/fetching-types": "3.0.0",
|
|
31
|
-
"@pnpm/git-fetcher": "
|
|
31
|
+
"@pnpm/git-fetcher": "6.0.0",
|
|
32
32
|
"@pnpm/resolver-base": "9.1.2",
|
|
33
|
-
"@pnpm/tarball-fetcher": "
|
|
33
|
+
"@pnpm/tarball-fetcher": "12.0.0",
|
|
34
34
|
"credentials-by-uri": "^2.1.0",
|
|
35
35
|
"mem": "^8.1.1"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
|
-
"@pnpm/client": "
|
|
38
|
+
"@pnpm/client": "8.0.0",
|
|
39
39
|
"@pnpm/fetcher-base": "13.1.2"
|
|
40
40
|
},
|
|
41
41
|
"funding": "https://opencollective.com/pnpm",
|