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] Enable "rush install" to install only a subset of dependencies using PNPM's "--filter" option #1669

Open
1 task
sunilsurana opened this issue Jan 3, 2020 · 5 comments
Assignees
Labels
enhancement The issue is asking for a new feature or design change

Comments

@sunilsurana
Copy link
Member

sunilsurana commented Jan 3, 2020

Is this a feature or a bug?

  • Feature

An organisation can decide to host all of its products code under one repo. In this case when a developer starts to work on repo when doing rush install he will have to download whole npm dependencies which are not even related to his work. And this can get bad in PR builds.

Feature ask
Create a workspace feature where the rush.json structure looks like
{
Worspace1:
[package A,
package B],
Workspace2:{
[packageC,
packageD]
}

So when someone run rush install workspace1 it will only download dependencies for packages in that workspace.

@octogonz
Copy link
Collaborator

octogonz commented Jan 9, 2020

#1553 is a top priority on our roadmap for Rush. It will delegate most of the installation responsibility to the package manager. And then we'd try to solve this problem using a PNPM feature rather than a Rush-specific feature.

That said, I'm not sure that PNPM supports this today. @sunilsurana could you investigate that, and if it's supported, could your report back with some details about how PNPM's feature works?

Your proposed feature sounds pretty valuable, so I'd like to get started on the design early in case it has any implications for #1553.

So when someone run rush install workspace1 it will only download dependencies for packages in that workspace.

This would be complex for Rush to implement. The package manager is in the best position to perform this sort of filtering.

@sunilsurana
Copy link
Member Author

In Pnpm i see that there is option the specify filter and supply package using different patterns but not a standardized way to say install all dependecies for productA or something like that.
Do you think it makes sense to create feature ask for this on PNPM?

@octogonz
Copy link
Collaborator

octogonz commented Jan 9, 2020

Yes. The basic idea would be to install a subset of the package-lock.yaml tree, based on a set of monorepo projects that we want to build. I feel like this should be fairly easy for PNPM to do within its current model. I bet people have asked it before. Please CC me on your issue so I can follow along. Thanks!

@DylanVann
Copy link

This will become easier with PnP / Yarn 2 since the package manager doesn't have to resolve conflicts between versions.

It would probably be a Yarn feature though. e.g. You could ask Yarn to install dependencies for a workspace (which could possibly also install them for workspaces it depends on).

@D4N14L
Copy link
Member

D4N14L commented May 28, 2020

I've created a separate issue to track PNPM workspaces support here: #1887

@octogonz octogonz changed the title Rush - Support workspaces features [rush] Enable "rush install" to install only a subset of dependencies using PNPM's "--filter" option Nov 18, 2020
@octogonz octogonz added the enhancement The issue is asking for a new feature or design change label Nov 18, 2020
@iclanton iclanton moved this to High priority in Bug Triage Aug 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement The issue is asking for a new feature or design change
Projects
Status: High priority
Development

No branches or pull requests

5 participants