@pnpm/local-resolver
Advanced tools
Comparing version 8.0.15 to 9.0.0
@@ -7,3 +7,3 @@ import { DirectoryResolution, ResolveResult, TarballResolution } from '@pnpm/resolver-base'; | ||
*/ | ||
export default function resolveLocal(wantedDependency: WantedLocalDependency, opts: { | ||
export declare function resolveFromLocal(wantedDependency: WantedLocalDependency, opts: { | ||
lockfileDir?: string; | ||
@@ -10,0 +10,0 @@ projectDir: string; |
@@ -6,14 +6,15 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.resolveFromLocal = void 0; | ||
const fs_1 = require("fs"); | ||
const path_1 = __importDefault(require("path")); | ||
const error_1 = __importDefault(require("@pnpm/error")); | ||
const error_1 = require("@pnpm/error"); | ||
const graceful_fs_1 = __importDefault(require("@pnpm/graceful-fs")); | ||
const read_project_manifest_1 = require("@pnpm/read-project-manifest"); | ||
const ssri_1 = __importDefault(require("ssri")); | ||
const parsePref_1 = __importDefault(require("./parsePref")); | ||
const parsePref_1 = require("./parsePref"); | ||
/** | ||
* Resolves a package hosted on the local filesystem | ||
*/ | ||
async function resolveLocal(wantedDependency, opts) { | ||
const spec = (0, parsePref_1.default)(wantedDependency, opts.projectDir, opts.lockfileDir ?? opts.projectDir); | ||
async function resolveFromLocal(wantedDependency, opts) { | ||
const spec = (0, parsePref_1.parsePref)(wantedDependency, opts.projectDir, opts.lockfileDir ?? opts.projectDir); | ||
if (spec == null) | ||
@@ -39,3 +40,3 @@ return null; | ||
if (spec.id.startsWith('file:')) { | ||
throw new error_1.default('LINKED_PKG_DIR_NOT_FOUND', `Could not install from "${spec.fetchSpec}" as it does not exist.`); | ||
throw new error_1.PnpmError('LINKED_PKG_DIR_NOT_FOUND', `Could not install from "${spec.fetchSpec}" as it does not exist.`); | ||
} | ||
@@ -50,3 +51,3 @@ localDependencyManifest = { | ||
case 'ENOTDIR': { | ||
throw new error_1.default('NOT_PACKAGE_DIRECTORY', `Could not install from "${spec.fetchSpec}" as it is not a directory.`); | ||
throw new error_1.PnpmError('NOT_PACKAGE_DIRECTORY', `Could not install from "${spec.fetchSpec}" as it is not a directory.`); | ||
} | ||
@@ -78,3 +79,3 @@ case 'ERR_PNPM_NO_IMPORTER_MANIFEST_FOUND': | ||
} | ||
exports.default = resolveLocal; | ||
exports.resolveFromLocal = resolveFromLocal; | ||
async function getFileIntegrity(filename) { | ||
@@ -81,0 +82,0 @@ return (await ssri_1.default.fromStream(graceful_fs_1.default.createReadStream(filename))).toString(); |
@@ -12,2 +12,2 @@ export interface LocalPackageSpec { | ||
} | ||
export default function parsePref(wd: WantedLocalDependency, projectDir: string, lockfileDir: string): LocalPackageSpec | null; | ||
export declare function parsePref(wd: WantedLocalDependency, projectDir: string, lockfileDir: string): LocalPackageSpec | null; |
@@ -6,5 +6,6 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.parsePref = void 0; | ||
const os_1 = __importDefault(require("os")); | ||
const path_1 = __importDefault(require("path")); | ||
const error_1 = __importDefault(require("@pnpm/error")); | ||
const error_1 = require("@pnpm/error"); | ||
const normalize_path_1 = __importDefault(require("normalize-path")); | ||
@@ -29,3 +30,3 @@ const isWindows = process.platform === 'win32' || global['FAKE_WINDOWS']; | ||
if (wd.pref.startsWith('path:')) { | ||
const err = new error_1.default('PATH_IS_UNSUPPORTED_PROTOCOL', 'Local dependencies via `path:` protocol are not supported. ' + | ||
const err = new error_1.PnpmError('PATH_IS_UNSUPPORTED_PROTOCOL', 'Local dependencies via `path:` protocol are not supported. ' + | ||
'Use the `link:` protocol for folder dependencies and `file:` for local tarballs'); | ||
@@ -39,3 +40,3 @@ err['pref'] = wd.pref; | ||
} | ||
exports.default = parsePref; | ||
exports.parsePref = parsePref; | ||
function fromLocal({ pref, injected }, projectDir, lockfileDir, type) { | ||
@@ -42,0 +43,0 @@ const spec = pref.replace(/\\/g, '/') |
{ | ||
"name": "@pnpm/local-resolver", | ||
"version": "8.0.15", | ||
"version": "9.0.0", | ||
"description": "Resolver for local packages", | ||
@@ -27,5 +27,5 @@ "main": "lib/index.js", | ||
"dependencies": { | ||
"@pnpm/error": "3.1.0", | ||
"@pnpm/error": "4.0.0", | ||
"@pnpm/graceful-fs": "2.0.0", | ||
"@pnpm/read-project-manifest": "3.0.13", | ||
"@pnpm/read-project-manifest": "4.0.0", | ||
"@pnpm/resolver-base": "9.1.2", | ||
@@ -37,3 +37,3 @@ "@pnpm/types": "8.7.0", | ||
"devDependencies": { | ||
"@pnpm/local-resolver": "8.0.15", | ||
"@pnpm/local-resolver": "9.0.0", | ||
"@types/normalize-path": "^3.0.0", | ||
@@ -40,0 +40,0 @@ "@types/ssri": "^7.1.1" |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
16330
200
+ Added@pnpm/error@4.0.0(transitive)
+ Added@pnpm/read-project-manifest@4.0.0(transitive)
+ Added@pnpm/write-project-manifest@4.0.0(transitive)
- Removed@pnpm/error@3.1.0(transitive)
- Removed@pnpm/read-project-manifest@3.0.13(transitive)
- Removed@pnpm/write-project-manifest@3.0.10(transitive)
Updated@pnpm/error@4.0.0