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": "Include a `pnpmPatchesCommonFolderName` constant for the folder name \"pnpm-patches\" that gets placed under \"common\".",
"type": "none"
}
],
"packageName": "@microsoft/rush"
}
1 change: 1 addition & 0 deletions common/reviews/api/rush-lib.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -1247,6 +1247,7 @@ export class RushConstants {
static readonly pnpmfileGlobalFilename: string;
static readonly pnpmfileV1Filename: string;
static readonly pnpmfileV6Filename: string;
static readonly pnpmPatchesCommonFolderName: string;
static readonly pnpmPatchesFolderName: string;
static readonly pnpmV3ShrinkwrapFilename: string;
static readonly projectImpactGraphFilename: string;
Expand Down
5 changes: 3 additions & 2 deletions libraries/rush-lib/src/cli/RushPnpmCommandLineParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ export class RushPnpmCommandLineParser {

if (!objectsAreDeepEqual(currentGlobalPatchedDependencies, newGlobalPatchedDependencies)) {
const commonTempPnpmPatchesFolder: string = `${this._rushConfiguration.commonTempFolder}/${RushConstants.pnpmPatchesFolderName}`;
const rushPnpmPatchesFolder: string = `${this._rushConfiguration.commonFolder}/pnpm-${RushConstants.pnpmPatchesFolderName}`;
const rushPnpmPatchesFolder: string = `${this._rushConfiguration.commonFolder}/${RushConstants.pnpmPatchesCommonFolderName}`;
// Copy (or delete) common\temp\patches\ --> common\pnpm-patches\
if (FileSystem.exists(commonTempPnpmPatchesFolder)) {
FileSystem.ensureEmptyFolder(rushPnpmPatchesFolder);
Expand All @@ -433,7 +433,8 @@ export class RushPnpmCommandLineParser {
await this._doRushUpdateAsync();

this._terminal.writeWarningLine(
`Rush refreshed the ${RushConstants.pnpmConfigFilename}, shrinkwrap file and patch files under the "common/pnpm/patches" folder.\n` +
`Rush refreshed the ${RushConstants.pnpmConfigFilename}, shrinkwrap file and patch files under the ` +
`"${RushConstants.commonFolderName}/${RushConstants.pnpmPatchesCommonFolderName}" folder.\n` +
' Please commit this change to Git.'
);
}
Expand Down
6 changes: 6 additions & 0 deletions libraries/rush-lib/src/logic/RushConstants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,12 @@ export class RushConstants {
*/
public static readonly pnpmPatchesFolderName: string = 'patches';

/**
* The folder name under `/common/temp` used to store checked-in patches.
* Example: `C:\MyRepo\common\pnpm-patches`
*/
public static readonly pnpmPatchesCommonFolderName: string = `pnpm-${RushConstants.pnpmPatchesFolderName}`;

/**
* The filename ("shrinkwrap.yaml") used to store state for pnpm
*/
Expand Down
2 changes: 1 addition & 1 deletion libraries/rush-lib/src/logic/base/BaseInstallManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ export abstract class BaseInstallManager {
const commonTempPnpmPatchesFolder: string = `${subspace.getSubspaceTempFolder()}/${
RushConstants.pnpmPatchesFolderName
}`;
const rushPnpmPatchesFolder: string = `${this.rushConfiguration.commonFolder}/pnpm-${RushConstants.pnpmPatchesFolderName}`;
const rushPnpmPatchesFolder: string = `${this.rushConfiguration.commonFolder}/${RushConstants.pnpmPatchesCommonFolderName}`;
if (FileSystem.exists(rushPnpmPatchesFolder)) {
FileSystem.copyFiles({
sourcePath: rushPnpmPatchesFolder,
Expand Down