Skip to content

Commit

Permalink
fix: update shrinkwrap when globalOverrides has change (microsoft#4898)
Browse files Browse the repository at this point in the history
  • Loading branch information
kenrick95 authored Aug 22, 2024
1 parent 4cd9b54 commit de9aa4a
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@microsoft/rush",
"comment": "Always update shrinkwrap when globalOverrides has been changed",
"type": "none"
}
],
"packageName": "@microsoft/rush"
}
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,17 @@ export class WorkspaceInstallManager extends BaseInstallManager {
shrinkwrapIsUpToDate = false;
}

// Check if overrides and globalOverrides are the same
const overridesAreEqual: boolean = objectsAreDeepEqual<Record<string, string>>(
this.rushConfiguration.pnpmOptions.globalOverrides ?? {},
shrinkwrapFile?.overrides ? Object.fromEntries(shrinkwrapFile?.overrides) : {}
);

if (!overridesAreEqual) {
shrinkwrapWarnings.push("The overrides settings doesn't match the current shrinkwrap.");
shrinkwrapIsUpToDate = false;
}

// Write the common package.json
InstallHelpers.generateCommonPackageJson(this.rushConfiguration, subspace, undefined);

Expand Down

0 comments on commit de9aa4a

Please sign in to comment.