@@ -42,6 +42,7 @@ import type {
4242 ResolvedDependencies
4343} from '@pnpm/lockfile.types' ;
4444import { convertLockfileV9ToLockfileObject } from './PnpmShrinkWrapFileConverters' ;
45+ import type { IReadonlyLookupByPath } from '@rushstack/lookup-by-path' ;
4546
4647const yamlModule : typeof import ( 'js-yaml' ) = Import . lazy ( 'js-yaml' , require ) ;
4748
@@ -812,12 +813,15 @@ export class PnpmShrinkwrapFile extends BaseShrinkwrapFile {
812813 return super . findOrphanedProjects ( rushConfiguration , subspace ) ;
813814 }
814815
816+ const subspaceTempFolder : string = subspace . getSubspaceTempFolderPath ( ) ;
817+ const lookup : IReadonlyLookupByPath < RushConfigurationProject > =
818+ rushConfiguration . getProjectLookupForRoot ( subspaceTempFolder ) ;
819+
815820 const orphanedProjectPaths : string [ ] = [ ] ;
816821 for ( const importerKey of this . getImporterKeys ( ) ) {
817- // PNPM importer keys are relative paths from the workspace root, which is the common temp folder
818- const rushProjectPath : string = path . resolve ( subspace . getSubspaceTempFolderPath ( ) , importerKey ) ;
819- if ( ! rushConfiguration . tryGetProjectForPath ( rushProjectPath ) ) {
820- orphanedProjectPaths . push ( rushProjectPath ) ;
822+ if ( ! lookup . findChildPath ( importerKey ) ) {
823+ // PNPM importer keys are relative paths from the workspace root, which is the common temp folder
824+ orphanedProjectPaths . push ( path . resolve ( subspaceTempFolder , importerKey ) ) ;
821825 }
822826 }
823827 return orphanedProjectPaths ;
0 commit comments