From a002ade2afce8de5e8b5eca4d71cc33fc6ca6371 Mon Sep 17 00:00:00 2001 From: qun Date: Fri, 9 Aug 2024 10:37:50 +0000 Subject: [PATCH 1/3] fix rush-pnpm patch commit --- libraries/rush-lib/src/cli/RushPnpmCommandLineParser.ts | 5 +++-- libraries/rush-lib/src/logic/base/BaseInstallManager.ts | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/libraries/rush-lib/src/cli/RushPnpmCommandLineParser.ts b/libraries/rush-lib/src/cli/RushPnpmCommandLineParser.ts index 3af75b88013..5228f5ca115 100644 --- a/libraries/rush-lib/src/cli/RushPnpmCommandLineParser.ts +++ b/libraries/rush-lib/src/cli/RushPnpmCommandLineParser.ts @@ -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 diff --git a/libraries/rush-lib/src/logic/base/BaseInstallManager.ts b/libraries/rush-lib/src/logic/base/BaseInstallManager.ts index 8ce864ed08e..72fd88975ad 100644 --- a/libraries/rush-lib/src/logic/base/BaseInstallManager.ts +++ b/libraries/rush-lib/src/logic/base/BaseInstallManager.ts @@ -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); From f0a183e8c4d5d58803deeff81d815dfc0a30e648 Mon Sep 17 00:00:00 2001 From: qun Date: Fri, 9 Aug 2024 10:38:37 +0000 Subject: [PATCH 2/3] rush change --- .../rush/fix-pnpm-patch_2024-08-09-10-38.json | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 common/changes/@microsoft/rush/fix-pnpm-patch_2024-08-09-10-38.json diff --git a/common/changes/@microsoft/rush/fix-pnpm-patch_2024-08-09-10-38.json b/common/changes/@microsoft/rush/fix-pnpm-patch_2024-08-09-10-38.json new file mode 100644 index 00000000000..c17f96a9a46 --- /dev/null +++ b/common/changes/@microsoft/rush/fix-pnpm-patch_2024-08-09-10-38.json @@ -0,0 +1,10 @@ +{ + "changes": [ + { + "packageName": "@microsoft/rush", + "comment": "Fix rush-pnpm patch-commit", + "type": "none" + } + ], + "packageName": "@microsoft/rush" +} \ No newline at end of file From 6e997f16cb0b8e8add42e1c8591be60c94056931 Mon Sep 17 00:00:00 2001 From: Lincoln <778157949@qq.com> Date: Sat, 10 Aug 2024 09:46:34 +0800 Subject: [PATCH 3/3] Update common/changes/@microsoft/rush/fix-pnpm-patch_2024-08-09-10-38.json Co-authored-by: Ian Clanton-Thuon --- .../@microsoft/rush/fix-pnpm-patch_2024-08-09-10-38.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/changes/@microsoft/rush/fix-pnpm-patch_2024-08-09-10-38.json b/common/changes/@microsoft/rush/fix-pnpm-patch_2024-08-09-10-38.json index c17f96a9a46..b8a55f9c378 100644 --- a/common/changes/@microsoft/rush/fix-pnpm-patch_2024-08-09-10-38.json +++ b/common/changes/@microsoft/rush/fix-pnpm-patch_2024-08-09-10-38.json @@ -2,7 +2,7 @@ "changes": [ { "packageName": "@microsoft/rush", - "comment": "Fix rush-pnpm patch-commit", + "comment": "Fix an issue where `rush-pnpm patch-commit` would not correctly resolve patch files when the subspaces feature is enabled.", "type": "none" } ],