mirror of
https://github.com/pnpm/pnpm.git
synced 2026-04-28 02:53:15 -04:00
fix: check the existense of a dep at the right dir
fixes a performance regression caused by #2531
This commit is contained in:
5
.changeset/blue-laws-flow.md
Normal file
5
.changeset/blue-laws-flow.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@pnpm/resolve-dependencies": patch
|
||||
---
|
||||
|
||||
Check the existense of a dependency in `node_modules` at the right location.
|
||||
@@ -34,6 +34,7 @@
|
||||
"@pnpm/npm-resolver": "workspace:8.0.0-alpha.1",
|
||||
"@pnpm/package-is-installable": "workspace:4.0.7",
|
||||
"@pnpm/pick-registry-for-package": "workspace:1.0.0",
|
||||
"@pnpm/pkgid-to-filename": "^3.0.0-0",
|
||||
"@pnpm/resolver-base": "workspace:7.0.0",
|
||||
"@pnpm/store-controller-types": "workspace:8.0.0-alpha.2",
|
||||
"@pnpm/types": "workspace:5.0.0",
|
||||
|
||||
@@ -17,6 +17,7 @@ import {
|
||||
import logger from '@pnpm/logger'
|
||||
import packageIsInstallable from '@pnpm/package-is-installable'
|
||||
import pickRegistryForPackage from '@pnpm/pick-registry-for-package'
|
||||
import pkgIdToFilename from '@pnpm/pkgid-to-filename'
|
||||
import {
|
||||
DirectoryResolution,
|
||||
PreferredVersions,
|
||||
@@ -503,7 +504,7 @@ async function resolveDependency (
|
||||
// we can safely assume that it doesn't exist in `node_modules`
|
||||
currentLockfileContainsTheDep &&
|
||||
options.relDepPath && options.dependencyLockfile &&
|
||||
await exists(path.join(ctx.virtualStoreDir, `${options.depPath}/node_modules/${nameVerFromPkgSnapshot(options.relDepPath, options.dependencyLockfile).name}/package.json`)) &&
|
||||
await exists(path.join(ctx.virtualStoreDir, `${pkgIdToFilename(options.depPath, ctx.prefix)}/node_modules/${nameVerFromPkgSnapshot(options.relDepPath, options.dependencyLockfile).name}/package.json`)) &&
|
||||
(options.currentDepth > 0 || wantedDependency.alias && await exists(path.join(ctx.modulesDir, wantedDependency.alias))))
|
||||
|
||||
if (!proceed && depIsLinked) {
|
||||
|
||||
2
pnpm-lock.yaml
generated
2
pnpm-lock.yaml
generated
@@ -2385,6 +2385,7 @@ importers:
|
||||
'@pnpm/npm-resolver': 'link:../npm-resolver'
|
||||
'@pnpm/package-is-installable': 'link:../package-is-installable'
|
||||
'@pnpm/pick-registry-for-package': 'link:../pick-registry-for-package'
|
||||
'@pnpm/pkgid-to-filename': 3.0.0-0
|
||||
'@pnpm/resolver-base': 'link:../resolver-base'
|
||||
'@pnpm/store-controller-types': 'link:../store-controller-types'
|
||||
'@pnpm/types': 'link:../types'
|
||||
@@ -2407,6 +2408,7 @@ importers:
|
||||
'@pnpm/npm-resolver': 'workspace:8.0.0-alpha.1'
|
||||
'@pnpm/package-is-installable': 'workspace:4.0.7'
|
||||
'@pnpm/pick-registry-for-package': 'workspace:1.0.0'
|
||||
'@pnpm/pkgid-to-filename': ^3.0.0-0
|
||||
'@pnpm/resolve-dependencies': 'link:'
|
||||
'@pnpm/resolver-base': 'workspace:7.0.0'
|
||||
'@pnpm/store-controller-types': 'workspace:8.0.0-alpha.2'
|
||||
|
||||
Reference in New Issue
Block a user