Skip to content
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@microsoft/rush",
"comment": "Fix path parsing issue when running rush bridge-package",
"type": "none"
}
],
"packageName": "@microsoft/rush"
}
7 changes: 2 additions & 5 deletions libraries/rush-lib/src/utilities/HotlinkManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -196,9 +194,8 @@ export class HotlinkManager {
);
const packageSourcePathSet: Set<string> = 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);
Expand Down