Closed chrisui closed 2 years ago
Thank you for this RRFC and sharing you current script! There is a new RRFC for this (#548) that was discusses in the last RFC call and has gained some traction. I'm going to close this in favor of that in order to consolidate the discussion, but please feel free to comment there if it doesn't fit your use case (I think it does from reading this issue).
Motivation ("The Why")
We would like to have a very thin layer of script management over npm workspaces to run scripts in packages, using the npm cli as a dependency resolver and symlinker.
To run scripts within workspaces which may have dependencies we would want to be able to enforce a good order which is based on the dependency graph. Right now, as far as I can see, this is left for users to implement however as npm tooling owns the dependency graph and implements the ability to provide multiple
--workspace
options to commands then it would be a sane default that these would be run in good order.Example
Given the workspaces below:
The following script:
Should guarantee the following run order:
Currently this is not the case and the run order seems dependent on user input order, which means a whole lot of complexity is left on the outside of npm where it is well-defined.
Our Current Script
Note that the output of this script is not guaranteed, or designed, to be in good dependency running order.
How
Current Behaviour
See Example (NON-deterministic order of commands given knowledge of workspace dependency graph)
Desired Behaviour
See Example (deterministic order of commands given knowledge of workspace dependency graph)
References