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
Expose topological sorting of packages via command or option #1652
Expose topological sorting of packages via command or option #1652
Comments
Yeah, totally. chain = chain.then(() => getFilteredPackages(this.packageGraph, this.execOpts, this.options));
if (this.options.toposort) {
chain = chain.then(filteredPackages =>
batchPackages(filteredPackages)
// flatten batched packages for display
.reduce((arr, batch) => arr.concat(batch), [])
);
}
chain = chain.then(filteredPackages => {
this.result = listable.format(filteredPackages, this.options);
}); |
This would be useful for me right now :-) I'm having an issue where a build is failing. In logs it appears that For others, this modification of the command shared by OP worked:
|
This thread has been automatically locked because there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
I'm hoping that we may be able to provide either a new command or a flag to
ls
to expose the topologically sorting of artifacts to a consumer.Expected Behavior
lerna ls --toposort
(or similar) could return a list of artifacts but in the topologically sorted behaviorCurrent Behavior
Currently
exec
/run
support topological sorting, but there doesn't seem to be an easy way to the topologically sorted dependency structure via a command.Right now to get that structure, we're using
lerna exec $LERNA_PACKAGE_NAME
.Possible Solution
lerna ls --toposort
(or similar) could return a list of artifacts but in the topologically sorted behaviorlist
command for testing flag combinations/piping to other scripts #610Context
We have a few use cases:
I think this is kind of similar to #610 . Was hoping it might be somewhat simple for me to create a PR where the results of
batchPackages
could be used to display this to user.The text was updated successfully, but these errors were encountered: