gajus / turbowatch

Extremely fast file change detector and task orchestrator for Node.js.
Other
943 stars 23 forks source link

Clarify setup for multiple packages in a monorepo in docs #48

Open apoco opened 1 year ago

apoco commented 1 year ago

I know that turbowatch was motivated by challenges working in a monorepo, but the available examples don't really cover how you would do something like setting up build watches for an app's dependencies then triggering app restarts after they finish building. I see two options, but it's not clear what the implications would be for choosing to use multiple projects versus multiple triggers. I started off with looking into the latter option because I like the idea of managing all the watch tasks in one place, but I don't see how you can change the working directory for the commands that are run in the trigger, for example, running tsc inside of a dependency directory. This makes me think that maybe the pattern is instead to have multiple turbowatch.ts files, one for each package in a monorepo, but that seems like it might be harder to maintain than one project with multiple triggers.

Desired Behavior

There might be a few things that would make it easier to get started:

Motivation

The docs are pretty good for showing how to set up a single watch task, but it'd be good to see a clear setup for how to use in a monorepo, leaning heavily on "typical" tasks like linting and tsc.

szszoke commented 9 months ago

I would also appreciate an example repository.