Replies: 4 comments 1 reply
-
|
I've been using |
Beta Was this translation helpful? Give feedback.
-
|
This doesn't answer directly to the intent of your post, but I did notice this and wanted to make sure you knew about it.
This is possible with |
Beta Was this translation helpful? Give feedback.
-
|
@AlexAegis Thanks, seems this is a workaround for now. |
Beta Was this translation helpful? Give feedback.
-
|
What I'm doing is all my tasks are postfixed with For example I have this in individual packages in my monorepo: {
"scripts": {
"test": "turbo run test_ --concurrency 16 --filter @org/package",
"test_": "vitest --passWithNoTests --coverage --run",
}
}If I understood your problem correctly, this approach would eliminate your problem. Here's an example of this in one of my repos: https://github.com/AlexAegis/js-tooling I don't directly invoke turbo and I can invoke tasks in sub-packages too and have turbo execute all dependencies as expected. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Goals
Allow to put
turbocommands into thepackage.jsonof packagesNon-goals
No response
Background
For users who have not installed
turboglobally, they will need to run commands within sub-packages usingpnpm turbo <command>instead ofturbo <command>. If they only runpnpm buildwithout explicitly using Turbo, some dependencies' build from workspace might not be updated.However, if we include
turbo run <command>insidepackage.json, as mentioned in the documentation, this could result in recursive calls.So I want to find a way to let user able to put
turbocommand in sub packagesscriptsand able to run it in both inside sub packages or from root package.Related: #1232
Proposal
Solution 1: Check if Turbo is running recursively
I’m not sure if there’s currently a way to check if Turbo itself is running recursively, but if possible, it would be helpful to have a mechanism that skips repeated tasks when this occurs.
Solution 2: Add a
--prepareflag to theruncommandIntroduce a
--prepareflag to theruncommand, which will execute thedependsOntask only, without running the command from the package itself.Example:
Original:
{ "scripts": { "build": "next build" } }After:
{ "scripts": { "build": "turbo run build --prepare && next build" } }Now, if we run
pnpm build, it will executeturbo run build --prepare, followed bynext build. If the command is run from the root, it will automatically detect that it is already running inside a Turbo process and skip the prepare task.Beta Was this translation helpful? Give feedback.
All reactions