From 6840f8e355fc7ee79c284ab67abfcf123849b0a4 Mon Sep 17 00:00:00 2001 From: Sergey Astapov Date: Wed, 16 Feb 2022 13:44:03 -0500 Subject: [PATCH] Fix check in `dependencySatisfies` in monorepo --- packages/shared-internals/src/package-cache.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/shared-internals/src/package-cache.ts b/packages/shared-internals/src/package-cache.ts index 4282f1a1d..4c926c53a 100644 --- a/packages/shared-internals/src/package-cache.ts +++ b/packages/shared-internals/src/package-cache.ts @@ -11,7 +11,7 @@ export default class PackageCache { let cache = getOrCreate(this.resolutionCache, fromPackage, () => new Map() as Map); let result = getOrCreate(cache, packageName, () => { // the type cast is needed because resolvePackagePath itself is erroneously typed as `any`. - let packagePath = resolvePackagePath(packageName, this.basedir(fromPackage)) as string | null; + let packagePath = resolvePackagePath(packageName, this.appRoot) as string | null; if (!packagePath) { // this gets our null into the cache so we don't keep trying to resolve // a thing that is not found @@ -43,10 +43,9 @@ export default class PackageCache { get(packageRoot: string) { let root = realpathSync(packageRoot); - let p = getOrCreate(this.rootCache, root, () => { + return getOrCreate(this.rootCache, root, () => { return new Package(root, this, root === this.appRoot); }); - return p; } ownerOfFile(filename: string): Package | undefined {