@pnpm/default-resolver 0.0.0-20230605-20230605142810

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/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2015-2016 Rico Sta. Cruz and other contributors
4
+ Copyright (c) 2016-2023 Zoltan Kochan and other contributors
5
+
6
+ Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ of this software and associated documentation files (the "Software"), to deal
8
+ in the Software without restriction, including without limitation the rights
9
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ copies of the Software, and to permit persons to whom the Software is
11
+ furnished to do so, subject to the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be included in all
14
+ copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,17 @@
1
+ # @pnpm/default-resolver
2
+
3
+ > pnpm's default package resolver
4
+
5
+ <!--@shields('npm')-->
6
+ [![npm version](https://img.shields.io/npm/v/@pnpm/default-resolver.svg)](https://www.npmjs.com/package/@pnpm/default-resolver)
7
+ <!--/@-->
8
+
9
+ ## Installation
10
+
11
+ ```sh
12
+ pnpm add @pnpm/default-resolver
13
+ ```
14
+
15
+ ## License
16
+
17
+ MIT
package/lib/index.d.ts ADDED
@@ -0,0 +1,5 @@
1
+ import { type FetchFromRegistry, type GetAuthHeader } from '@pnpm/fetching-types';
2
+ import { type PackageMeta, type PackageMetaCache, type ResolverFactoryOptions } from '@pnpm/npm-resolver';
3
+ import { type ResolveFunction } from '@pnpm/resolver-base';
4
+ export type { PackageMeta, PackageMetaCache, ResolveFunction, ResolverFactoryOptions, };
5
+ export declare function createResolver(fetchFromRegistry: FetchFromRegistry, getAuthHeader: GetAuthHeader, pnpmOpts: ResolverFactoryOptions): ResolveFunction;
package/lib/index.js ADDED
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createResolver = void 0;
4
+ const error_1 = require("@pnpm/error");
5
+ const git_resolver_1 = require("@pnpm/git-resolver");
6
+ const local_resolver_1 = require("@pnpm/local-resolver");
7
+ const npm_resolver_1 = require("@pnpm/npm-resolver");
8
+ const tarball_resolver_1 = require("@pnpm/tarball-resolver");
9
+ function createResolver(fetchFromRegistry, getAuthHeader, pnpmOpts) {
10
+ const resolveFromNpm = (0, npm_resolver_1.createNpmResolver)(fetchFromRegistry, getAuthHeader, pnpmOpts);
11
+ const resolveFromGit = (0, git_resolver_1.createGitResolver)(pnpmOpts);
12
+ return async (wantedDependency, opts) => {
13
+ const resolution = await resolveFromNpm(wantedDependency, opts) ??
14
+ (wantedDependency.pref && (await (0, tarball_resolver_1.resolveFromTarball)(wantedDependency) ??
15
+ await resolveFromGit(wantedDependency) ??
16
+ await (0, local_resolver_1.resolveFromLocal)(wantedDependency, opts)));
17
+ if (!resolution) {
18
+ throw new error_1.PnpmError('SPEC_NOT_SUPPORTED_BY_ANY_RESOLVER', `${wantedDependency.alias ? wantedDependency.alias + '@' : ''}${wantedDependency.pref ?? ''} isn't supported by any available resolver.`);
19
+ }
20
+ return resolution;
21
+ };
22
+ }
23
+ exports.createResolver = createResolver;
24
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,uCAAuC;AAEvC,qDAAsD;AACtD,yDAAuD;AACvD,qDAM2B;AAE3B,6DAA2D;AAS3D,SAAgB,cAAc,CAC5B,iBAAoC,EACpC,aAA4B,EAC5B,QAAgC;IAEhC,MAAM,cAAc,GAAG,IAAA,gCAAiB,EAAC,iBAAiB,EAAE,aAAa,EAAE,QAAQ,CAAC,CAAA;IACpF,MAAM,cAAc,GAAG,IAAA,gCAAiB,EAAC,QAAQ,CAAC,CAAA;IAClD,OAAO,KAAK,EAAE,gBAAgB,EAAE,IAAI,EAAE,EAAE;QACtC,MAAM,UAAU,GAAG,MAAM,cAAc,CAAC,gBAAgB,EAAE,IAA6B,CAAC;YACtF,CAAC,gBAAgB,CAAC,IAAI,IAAI,CACxB,MAAM,IAAA,qCAAkB,EAAC,gBAAoC,CAAC;gBAC9D,MAAM,cAAc,CAAC,gBAAoC,CAAC;gBAC1D,MAAM,IAAA,iCAAgB,EAAC,gBAAoC,EAAE,IAAI,CAAC,CACnE,CAAC,CAAA;QACJ,IAAI,CAAC,UAAU,EAAE;YACf,MAAM,IAAI,iBAAS,CACjB,oCAAoC,EACpC,GAAG,gBAAgB,CAAC,KAAK,CAAC,CAAC,CAAC,gBAAgB,CAAC,KAAK,GAAG,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,gBAAgB,CAAC,IAAI,IAAI,EAAE,6CAA6C,CAAC,CAAA;SAC5I;QACD,OAAO,UAAU,CAAA;IACnB,CAAC,CAAA;AACH,CAAC;AArBD,wCAqBC"}
package/package.json ADDED
@@ -0,0 +1,49 @@
1
+ {
2
+ "name": "@pnpm/default-resolver",
3
+ "version": "0.0.0-20230605-20230605142810",
4
+ "description": "pnpm's default package resolver",
5
+ "main": "lib/index.js",
6
+ "types": "lib/index.d.ts",
7
+ "files": [
8
+ "lib",
9
+ "!*.map"
10
+ ],
11
+ "engines": {
12
+ "node": ">=16.14"
13
+ },
14
+ "repository": "https://github.com/pnpm/pnpm/blob/main/resolving/default-resolver",
15
+ "keywords": [
16
+ "pnpm8",
17
+ "pnpm",
18
+ "resolver",
19
+ "npm"
20
+ ],
21
+ "license": "MIT",
22
+ "bugs": {
23
+ "url": "https://github.com/pnpm/pnpm/issues"
24
+ },
25
+ "homepage": "https://github.com/pnpm/pnpm/blob/main/resolving/default-resolver#readme",
26
+ "dependencies": {
27
+ "@pnpm/fetching-types": "5.0.0",
28
+ "@pnpm/resolver-base": "10.0.1",
29
+ "@pnpm/npm-resolver": "0.0.0-20230605-20230605142810",
30
+ "@pnpm/error": "0.0.0-20230605-20230605142810",
31
+ "@pnpm/git-resolver": "8.0.3",
32
+ "@pnpm/local-resolver": "0.0.0-20230605-20230605142810",
33
+ "@pnpm/tarball-resolver": "8.0.1"
34
+ },
35
+ "devDependencies": {
36
+ "@pnpm/default-resolver": "0.0.0-20230605-20230605142810",
37
+ "@pnpm/fetch": "7.0.2"
38
+ },
39
+ "funding": "https://opencollective.com/pnpm",
40
+ "exports": {
41
+ ".": "./lib/index.js"
42
+ },
43
+ "scripts": {
44
+ "lint": "eslint \"src/**/*.ts\" \"test/**/*.ts\"",
45
+ "_test": "jest",
46
+ "test": "pnpm run compile && pnpm run _test",
47
+ "compile": "tsc --build && pnpm run lint --fix"
48
+ }
49
+ }