Skip to content

Commit ddf9e3f

Browse files
authored
[rush-lib] Fix .npmrc syncing cache bug that strips pnpm hoisting properties (#5642)
1 parent b06e297 commit ddf9e3f

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"changes": [
3+
{
4+
"packageName": "@microsoft/rush",
5+
"comment": "Fix .npmrc syncing to common/temp incorrectly caching results, which caused pnpm-specific properties like hoist-pattern to be stripped when the same .npmrc was processed with different options.",
6+
"type": "none"
7+
}
8+
],
9+
"packageName": "@microsoft/rush"
10+
}

libraries/rush-lib/src/utilities/npmrcUtilities.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,6 @@ export interface ILogger {
1919
* The text of the the .npmrc.
2020
*/
2121

22-
// create a global _combinedNpmrc for cache purpose
23-
const _combinedNpmrcMap: Map<string, string> = new Map();
24-
2522
function _trimNpmrcFile(
2623
options: Pick<
2724
INpmrcTrimOptions,
@@ -41,10 +38,6 @@ function _trimNpmrcFile(
4138
filterNpmIncompatibleProperties,
4239
env = process.env
4340
} = options;
44-
const combinedNpmrcFromCache: string | undefined = _combinedNpmrcMap.get(sourceNpmrcPath);
45-
if (combinedNpmrcFromCache !== undefined) {
46-
return combinedNpmrcFromCache;
47-
}
4841

4942
let npmrcFileLines: string[] = [];
5043
if (linesToPrepend) {
@@ -70,9 +63,6 @@ function _trimNpmrcFile(
7063

7164
const combinedNpmrc: string = resultLines.join('\n');
7265

73-
//save the cache
74-
_combinedNpmrcMap.set(sourceNpmrcPath, combinedNpmrc);
75-
7666
return combinedNpmrc;
7767
}
7868

0 commit comments

Comments
 (0)