diff --git a/common/changes/@microsoft/rush/feat-add-cursor-rules_2025-05-08-12-27.json b/common/changes/@microsoft/rush/feat-add-cursor-rules_2025-05-08-12-27.json new file mode 100644 index 0000000000..83671cd5a6 --- /dev/null +++ b/common/changes/@microsoft/rush/feat-add-cursor-rules_2025-05-08-12-27.json @@ -0,0 +1,10 @@ +{ + "changes": [ + { + "packageName": "@microsoft/rush", + "comment": "Fix path parsing issue when running rush bridge-package", + "type": "none" + } + ], + "packageName": "@microsoft/rush" +} \ No newline at end of file diff --git a/libraries/rush-lib/src/utilities/HotlinkManager.ts b/libraries/rush-lib/src/utilities/HotlinkManager.ts index 643df7e6b7..4018c37f8c 100644 --- a/libraries/rush-lib/src/utilities/HotlinkManager.ts +++ b/libraries/rush-lib/src/utilities/HotlinkManager.ts @@ -13,10 +13,8 @@ import { type INodePackageJson, type IPackageJsonDependencyTable } from '@rushstack/node-core-library'; -import type { DependencyPath } from '@pnpm/dependency-path'; import { PackageExtractor } from '@rushstack/package-extractor'; import { pnpmSyncUpdateFileAsync, pnpmSyncCopyAsync, type ILogMessageCallbackOptions } from 'pnpm-sync-lib'; -import { parse } from '@pnpm/dependency-path'; import * as semver from 'semver'; import type { RushConfiguration } from '../api/RushConfiguration'; @@ -196,9 +194,8 @@ export class HotlinkManager { ); const packageSourcePathSet: Set = new Set(); for (const dirName of subDirectories) { - const parsedDependency: DependencyPath = parse(dirName); - if (parsedDependency?.name === packageName) { - const packageSourcePath: string = `${consumerPackagePnpmDependenciesFolderPath}/${dirName}/${RushConstants.nodeModulesFolderName}/${packageName}`; + const packageSourcePath: string = `${consumerPackagePnpmDependenciesFolderPath}/${dirName}/${RushConstants.nodeModulesFolderName}/${packageName}`; + if (await FileSystem.existsAsync(packageSourcePath)) { const { version } = await JsonFile.loadAsync(`${packageSourcePath}/${FileConstants.PackageJson}`); if (semver.satisfies(version, versionRange)) { packageSourcePathSet.add(packageSourcePath);