Replies: 3 comments 1 reply
-
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.
-
@AlexAegis Thanks, seems this is a workaround for now. |
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.
-
Goals
Allow to put
turbo
commands into thepackage.json
of packagesNon-goals
No response
Background
For users who have not installed
turbo
globally, they will need to run commands within sub-packages usingpnpm turbo <command>
instead ofturbo <command>
. If they only runpnpm build
without 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
turbo
command in sub packagesscripts
and 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
--prepare
flag to therun
commandIntroduce a
--prepare
flag to therun
command, which will execute thedependsOn
task only, without running the command from the package itself.Example:
Original:
After:
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