Skip to content
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

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

Open
apoco opened this issue Jun 22, 2023 · 1 comment
Open

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

apoco opened this issue Jun 22, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@apoco
Copy link

apoco commented Jun 22, 2023

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:

  • Link to an example monorepo project showcasing recommended practices
  • Describe when you would use multiple triggers versus multiple turbowatch files
  • Explain how spawn works in better details. Is it just a copy of the $ object from zx? Is there a way to access the cd function from zx, or is spawn the only thing available for running commands? Can you run cd inside of the spawn command, an if you do so is the CWD scoped to the invoke of your trigger or is it a global context? Side note, it'd be nice if you could just specify a working directory on an individual trigger level.

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.

@apoco apoco added the enhancement New feature or request label Jun 22, 2023
@szszoke
Copy link

szszoke commented Jan 24, 2024

I would also appreciate an example repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants