-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
[BUG] run transitive dependencies with --workspace
flag?
#3413
Comments
This would be a huge advantage of NPM workspaces - right now we are keeping |
I'm looking into a similar issue with some software I'm working on, where I'm scoping to a folder filled with workspaces, e.g. Lerna builds a dependency tree by which to order their operations: see their PackageGraph class. NPM's It seems like one would just have to implement this Arborist in place of the simplified operation taking place to set workspaces. |
Hi @adiun thanks for taking the time to bring this up to our attention. Given that this would be an entire new feature for npm workspaces to support I would recommend you to propose this as either a issue or discussion over at our RFC repo where it can pick up the attention from the community and the rest of the npm cli team. |
I went ahead and opened an RFC issue here We are hoping for this feature to land in |
Is there an existing issue for this?
Current Behavior
I have a monorepo that contains:
If I run
npm run build --workspace [packageA]
, this only builds packageA and notsharedC
orsharedD
Expected Behavior
I migrated from lerna to npm workspaces - in lerna there was a flag
--include-filtered-dependencies
which would look at the transitive dependencies ofpackageA
and would run those first. So annpm run build --workspace packageA
would run the build first onsharedD
and thensharedC
before running the build onpackageA
. I expected to find something like this in npm workspaces.Right now I have to define the workspaces in the right order in the root package.json but that doesn't solve the problem of
npm run
since I have many packages and only want to run some command (like abuild
) on a subtree. In CI it seems I have to specify each of the dependent packages and build them in the right order.Steps To Reproduce
packageA
that has dependencies on a shared packageshared
andbuild
npm scripts specified for bothpackageA
andshared
npm run build --workspace packageA
shared
package build first. Actual:packageA
builds -shared
never builds.Environment
The text was updated successfully, but these errors were encountered: