@pnpm/lockfile-utils
Advanced tools
Comparing version 4.2.8 to 5.0.0
@@ -6,3 +6,3 @@ import { Lockfile } from '@pnpm/lockfile-types'; | ||
virtualStoreDir: string; | ||
pkgLocationByDepPath?: Record<string, string>; | ||
pkgLocationsByDepPath?: Record<string, string[]>; | ||
}): Array<T & { | ||
@@ -9,0 +9,0 @@ id: string; |
@@ -11,5 +11,5 @@ "use strict"; | ||
function extendProjectsWithTargetDirs(projects, lockfile, ctx) { | ||
const getLocalLocation = ctx.pkgLocationByDepPath != null | ||
? (depPath) => ctx.pkgLocationByDepPath[depPath] | ||
: (depPath, pkgName) => path_1.default.join(ctx.virtualStoreDir, (0, dependency_path_1.depPathToFilename)(depPath), 'node_modules', pkgName); | ||
const getLocalLocations = ctx.pkgLocationsByDepPath != null | ||
? (depPath) => ctx.pkgLocationsByDepPath[depPath] | ||
: (depPath, pkgName) => [path_1.default.join(ctx.virtualStoreDir, (0, dependency_path_1.depPathToFilename)(depPath), 'node_modules', pkgName)]; | ||
const projectsById = (0, fromPairs_1.default)(projects.map((project) => [project.id, { ...project, targetDirs: [] }])); | ||
@@ -24,4 +24,4 @@ Object.entries(lockfile.packages ?? {}) | ||
return; | ||
const localLocation = getLocalLocation(depPath, pkg.name); | ||
projectsById[importerId].targetDirs.push(localLocation); | ||
const localLocations = getLocalLocations(depPath, pkg.name); | ||
projectsById[importerId].targetDirs.push(...localLocations); | ||
projectsById[importerId].stages = ['preinstall', 'install', 'postinstall', 'prepare', 'prepublishOnly']; | ||
@@ -28,0 +28,0 @@ }); |
{ | ||
"name": "@pnpm/lockfile-utils", | ||
"version": "4.2.8", | ||
"version": "5.0.0", | ||
"description": "Utils for dealing with pnpm-lock.yaml", | ||
@@ -27,3 +27,3 @@ "main": "lib/index.js", | ||
"devDependencies": { | ||
"@pnpm/lockfile-utils": "4.2.8", | ||
"@pnpm/lockfile-utils": "5.0.0", | ||
"@types/js-yaml": "^4.0.5", | ||
@@ -30,0 +30,0 @@ "@types/ramda": "0.28.15", |
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
25042