jamiebuilds / workspaces-run

Run tasks/scripts across Yarn/Lerna/Bolt/etc workspaces.
MIT License
94 stars 2 forks source link

orderByDeps doesn't allow relative dependencies #4

Closed Tantalon closed 1 year ago

Tantalon commented 3 years ago

orderByDeps only works if there is a semver match between the dependency and version in package.json

In a npm multi-module project, I use something like this to depend upon other modules:

"dependencies": {
 "module-b": "file:../module-b"
}

This isn't a semver match, so the modules run in the wrong order.

Is there a better way of doing these references?

jamiebuilds commented 3 years ago

I think this is just a matter of updating the getWorkspaceGraph function to support that in addition to semver.

https://github.com/jamiebuilds/workspaces-run/blob/c3fa2d215a247a41946f579671ded5687f58f445/src/utils/workspaces.ts#L60-L104

Tantalon commented 3 years ago

Thanks I've raised PR https://github.com/jamiebuilds/workspaces-run/pull/5 to do this.