Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix check in dependencySatisfies in monorepo #1131

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions packages/shared-internals/src/package-cache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export default class PackageCache {
let cache = getOrCreate(this.resolutionCache, fromPackage, () => new Map() as Map<string, Package | null>);
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
Expand Down Expand Up @@ -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 {
Expand Down