Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[rush] Install optional dependencies, except when using npm<5.0.0 #878

Merged
merged 1 commit into from
Oct 16, 2018

Conversation

elliottsj
Copy link
Contributor

Resolves #761

With this change, optional dependencies are no longer ignored, and instead are written to the package manager's (npm/pnpm/yarn) respective lockfile. This allows optional dependencies such as fsevents to be installed on supported systems (e.g. macOS), but remain uninstalled on unsupported systems (e.g. Windows).

For more info about this change, see #761 (comment)

@msftclas
Copy link

msftclas commented Oct 16, 2018

CLA assistant check
All CLA requirements met.

@elliottsj elliottsj force-pushed the rush-install-optional branch from fb0a8ae to 03e8c54 Compare October 16, 2018 03:26
@elliottsj
Copy link
Contributor Author

I've tested this change on macOS, using npm@4.6.1, npm@6.4.1, pnpm@2.16.3, and yarn@1.12.0. Haven't tested on Windows (and don't currently have a Windows machine set up for Node.js development), so any help there is appreciated.

@@ -975,15 +958,34 @@ export class InstallManager {
*/
private _pushConfigurationArgs(args: string[], options: IInstallManagerOptions): void {
if (this._rushConfiguration.packageManager === 'npm') {
args.push('--no-optional');
if (semver.lt(this._rushConfiguration.packageManagerToolVersion, '5.0.0')) {
// NOTE:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I kept this comment (which was originally added in #175), reworded it a bit, and added a couple useful links. lmk if I should change anything else here.

Copy link
Collaborator

@octogonz octogonz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@octogonz octogonz merged commit a16659d into microsoft:master Oct 16, 2018
@elliottsj elliottsj deleted the rush-install-optional branch October 17, 2018 14:06
@octogonz
Copy link
Collaborator

This fix was released with Rush 5.3.4

@octogonz octogonz changed the title Install optional dependencies, except when using npm<5.0.0 [rush] Install optional dependencies, except when using npm<5.0.0 Oct 31, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants