Migrating from Turborepo monorepo - looking for best practices with vp run #1216
Unanswered
nikolailehbrink
asked this question in
Q&A
Replies: 2 comments
-
|
cc @branchseer |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
I'll add to this: is there a plan to make a TUI for the persistent task runners? In Turborepo, you can run n tasks at the same time and it gives you a nice TUI to swap between the logs of each. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
We just tried migrating a large monorepo (tRPC + NestJS backend, React + Vite frontend, shared packages) from Turborepo + Vitest + Oxlint + Prettier + Husky + lint-staged to Vite+. The migration went well overall, but we ran into a few gaps compared to Turborepo's task runner and want to make sure we're not missing something.
1. Parallel/persistent dev tasks
In Turborepo we had:
This ran all dev servers (client, backend, shared types) concurrently and kept them alive. With
vp run dev --filter client --filter backend --filter apiTypes, tasks run in topological order — the first long-running watch process blocks the others from starting.Our workaround: Fall back to
pnpm --parallel --filter client --filter backend --filter apiTypes run devfor thedevscript.Question: Is there a
vp runequivalent for concurrent/persistent tasks? Something like--parallelor apersistent: truetask config? Or ispnpm --parallelthe intended approach here?2. Implicit recursive execution
Turborepo's
turbo run buildran across all workspace packages by default.vp run buildonly runs in the current package — you need-rfor recursive. We initially missed this and got silent 0-task runs.Question: Is this by design? Would a
recursive: truedefault invite.config.tstask config make sense, or is explicit-rthe intended UX?3.
vp testvsvp run testin monoreposvp test(built-in Vitest) from the workspace root runs all test files with a single vitest process — ignoring per-package vitest configs (different environments, setup files, etc.). This caused failures because backend tests need env var mocking and client tests need jsdom.vp run test:unit -rworks correctly by delegating to each package's own test script.Question: Is there a recommended way to make
vp testwork from the monorepo root while respecting per-package vitest configs? Or isvp run test -rthe intended pattern for monorepos?4.
turbo prune --dockerTurborepo's
turbo prune --dockercreates a minimal subset of the monorepo for Docker layer caching. We couldn't find avpequivalent, so we keptturboinstalled solely in the Docker pruner stage.Question: Is there a
vpequivalent planned, or is the recommendation to keep usingturbo prune/pnpm deploy/ manual COPY for Docker builds?5. Adding
dependsOn/envto existing package.json scriptsIn Turborepo,
turbo.jsonlet us adddependsOn,env, andcacheconfig to any package.json script by name — without modifying the script itself. In Vite+, these features only work on tasks defined invite.config.ts, and task names cannot overlap with package.json script names.This means to add
dependsOn: ["^build"]orenv: ["CDN_BASE_URL"]to our existingbuildscript, we'd have to remove it frompackage.jsonand redefine it as a task with an explicitcommandfield — which is more disruptive.Question: Is there a way to annotate/extend package.json scripts with
dependsOn/env/cacheconfig without converting them to tasks? Or is the migration path to move scripts intovite.config.tstasks over timeBeta Was this translation helpful? Give feedback.
All reactions