Evaluating turbo: how to run a dev command for "current" project and all its dependencies #7950
Replies: 2 comments
-
You can do this with global As far as a "global watcher" goes, we're building a Watch Mode right now. |
Beta Was this translation helpful? Give feedback.
-
Sorry if I wasn't clear. It's not prepending Ideally, I'd like to be able to run You are right of course, I can still add a custom script inside package.json to write once the full command. Regarding the watch mode, It's cool it's in progress. thanks for the help |
Beta Was this translation helpful? Give feedback.
-
Summary
Hi,
I'm maintaining a large monorepo, currently orchestrated by nx. However, due to reliability issues, I'm evaluating the opportunity to migrate to turbo.
The repository contains different types of packages (25 packages):
Because of the internal architecture of the webapp compilation), running a "watch mode" for a web app requires watching the webapp itself but also every dependencies.
This leads to a few questions:
Shorthand for "current project" ?
As far as I understand, if I want to run a "serve" command for a project and all its dependencies, I need to execute
pnpm turbo run serve --filter "@myrepo/somewebapp..."
.Is there a simpler command to run this? Is there any shorthand to express
run this script in the current folder, and all its dependencies
?I can probably add another package.json script like
"start-serve" : "turbo run serve --filter \"@myrepo/somewebapp...\""
but it adds extra maintenance to every web apps.Concurrency pressure
If a webapp requires a large dependency stack, the concurrent tasks are eating all CPU and memory.
turbo detects automatically the depth of dependencies and suggest to add
--concurrency 12
(actual depth of my repo).So running the serve command will create 12 concurrent serve operations for every package, which makes the system being unusable. My laptop is a core I7 + 16gb of ram, and the CPU + RAM are getting used at max.
How to prevent this ?
As a side note, the "nx" version of my repo rely on the nx "global watch" command. There's a single watch context, for the whole repo, and nx call a package.json script "build-incremental" on package owning the change. It's not as efficient as a real watch mode, like tsc --watch, but it allows me to keep the system working.
Thanks for any insights
Additional information
No response
Example
No response
Beta Was this translation helpful? Give feedback.
All reactions