eternagame / workspace-helpers

Helper packages for JS projects
BSD 3-Clause "New" or "Revised" License
4 stars 0 forks source link

fix(nx-spawn): Task completion when a package has > 1 dep #211

Closed luxaritas closed 1 year ago

luxaritas commented 1 year ago

Summary

Previously, if package a relied on b and c, and nx-spawn initiated a task on package a that ran tasks on b and c, the task on b or c would complete, but the task on a would not be run.

Implementation Notes

The source of this issue was in promise-walker, which is responsible for keeping track of task completion promises and returning one completed task result at a time. Because the second argument (deleteCount) was never provided to splice, when there were multiple promises being waited on at once, when one resolved all were removed, preventing it from returning the result of the other promises.

Testing

Created testapp, testlib, and testwlib, with the libs added as dependencies of the app, and ran nx dev testapp. Ensured an initial failure, then verified the fix resolved the issue.

Related Issues

Resolves #210