[rush-pnpm] Fix rush-pnpm patch-commit command (#4874)

* fix rush-pnpm patch commit

* rush change

* Update common/changes/@microsoft/rush/fix-pnpm-patch_2024-08-09-10-38.json

Co-authored-by: Ian Clanton-Thuon <iclanton@users.noreply.github.com>

---------

Co-authored-by: qun <L-Qun@users.noreply.github.com>
Co-authored-by: Ian Clanton-Thuon <iclanton@users.noreply.github.com>
This commit is contained in:
Lincoln 2024-08-10 10:14:33 +08:00 коммит произвёл GitHub
Родитель a6e2bd3ce9
Коммит fceee8e289
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
3 изменённых файлов: 14 добавлений и 3 удалений

Просмотреть файл

@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@microsoft/rush",
"comment": "Fix an issue where `rush-pnpm patch-commit` would not correctly resolve patch files when the subspaces feature is enabled.",
"type": "none"
}
],
"packageName": "@microsoft/rush"
}

Просмотреть файл

@ -443,6 +443,7 @@ export class RushPnpmCommandLineParser {
}
const subspaceTempFolder: string = this._subspace.getSubspaceTempFolder();
const subspaceConfigFolder: string = this._subspace.getSubspaceConfigFolder();
switch (commandName) {
case 'patch-commit': {
@ -468,8 +469,8 @@ export class RushPnpmCommandLineParser {
if (!objectsAreDeepEqual(currentGlobalPatchedDependencies, newGlobalPatchedDependencies)) {
const commonTempPnpmPatchesFolder: string = `${subspaceTempFolder}/${RushConstants.pnpmPatchesFolderName}`;
const rushPnpmPatchesFolder: string = `${subspaceTempFolder}/${RushConstants.pnpmPatchesCommonFolderName}`;
// Copy (or delete) common\temp\patches\ --> common\pnpm-patches\
const rushPnpmPatchesFolder: string = `${subspaceConfigFolder}/${RushConstants.pnpmPatchesCommonFolderName}`;
// Copy (or delete) common\temp\subspace\patches\ --> subspace\pnpm-patches\
if (FileSystem.exists(commonTempPnpmPatchesFolder)) {
FileSystem.ensureEmptyFolder(rushPnpmPatchesFolder);
// eslint-disable-next-line no-console

Просмотреть файл

@ -496,7 +496,7 @@ export abstract class BaseInstallManager {
const commonTempPnpmPatchesFolder: string = `${subspace.getSubspaceTempFolder()}/${
RushConstants.pnpmPatchesFolderName
}`;
const rushPnpmPatchesFolder: string = `${this.rushConfiguration.commonFolder}/${RushConstants.pnpmPatchesCommonFolderName}`;
const rushPnpmPatchesFolder: string = `${subspace.getSubspaceConfigFolder()}/${RushConstants.pnpmPatchesCommonFolderName}`;
let rushPnpmPatches: FolderItem[] | undefined;
try {
rushPnpmPatches = await FileSystem.readFolderItemsAsync(rushPnpmPatchesFolder);