Skip to content

Commit a8686d5

Browse files
committed
Add comment clarifying why it's okay to use a local configuration to perform a global installation
1 parent 161a29a commit a8686d5

2 files changed

Lines changed: 12 additions & 0 deletions

File tree

apps/rush-lib/src/logic/InstallManager.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,12 @@ export class InstallManager {
286286
version: this._rushConfiguration.packageManagerToolVersion,
287287
tempPackageTitle: `${packageManager}-local-install`,
288288
maxInstallAttempts: MAX_INSTALL_ATTEMPTS,
289+
// This is using a local configuration to install a package in a shared global location.
290+
// Generally that's a bad practice, but in this case if we can successfully install
291+
// the package at all, we can reasonably assume it's good for all the repositories.
292+
// In particular, we'll assume that two different NPM registries cannot have two
293+
// different implementations of the same version of the same package.
294+
// This was needed for: https://github.com/Microsoft/web-build-tools/issues/691
289295
commonRushConfigFolder: this._rushConfiguration.commonRushConfigFolder
290296
});
291297

apps/rush/src/RushVersionSelector.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,12 @@ export class RushVersionSelector {
5555
version: version,
5656
tempPackageTitle: 'rush-local-install',
5757
maxInstallAttempts: MAX_INSTALL_ATTEMPTS,
58+
// This is using a local configuration to install a package in a shared global location.
59+
// Generally that's a bad practice, but in this case if we can successfully install
60+
// the package at all, we can reasonably assume it's good for all the repositories.
61+
// In particular, we'll assume that two different NPM registries cannot have two
62+
// different implementations of the same version of the same package.
63+
// This was needed for: https://github.com/Microsoft/web-build-tools/issues/691
5864
commonRushConfigFolder: configuration ? configuration.commonRushConfigFolder : undefined,
5965
suppressOutput: true
6066
});

0 commit comments

Comments
 (0)