This is a suggested way in which we can combine the power of Turborepo with the consistent, reliable process management of Overmind for managing local services during development.
If we like this approach, I believe it would be a good solution to the "services not ending correctly" issue we've encountered with turborepo.
The only install step for devs introduced by this PR would be: brew install overmind tmux
.
- We want a reliable process manager, rather than having ports left hanging or processes in an uncertain state.
- Turbo knows what packages have a dev task per package.json, and what needs to happen before running processes, but isn't great at process management.
- It would be nice if we could pass that information off to overmind which does a better job of the process management.
- We can! The
--dry=json
dry run data from turbo contains everything we need to construct an on-the-fly Procfile, which is what overmind needs to manage processes (The Procfile format comes from Heroku, and is just a one-line-per-service list of services, see https://devcenter.heroku.com/articles/procfile#procfile-format) - Now overmind is in charge, and we can see logs together, or separately per service, as well as benefit from its time-tested reliability.
- See the scripts/run-dev.mjs script for an explanation of how this approach lets turborepo and overmind "talk", i.e. how overmind knows what services to run, given turborepo's direction.
To pass --filter args for turborepo, you can just pass them via the pnpm command. Examples:
pnpm dev --filter=@gosynthschool/av-client
pnpm dev --filter="*/av-*" --filter="*/play-*"