Turborepo 1.8
Turborepo 1.8 brings better flexibility and more control to your codebase by improving turbo
's understanding of your workspaces.
- Workspace Configurations: You can now add a
turbo.json
configuration file in a workspace to override the root configuration in your repository. - Automatic Workspace Scoping: Global
turbo
now automatically infers your current workspace so that it only runs that workspace’s tasks. - Easier Migrations: Automatically migrate to new versions of
turbo
withnpx @turbo/codemod migrate
.
Update today by running npx @turbo/codemod migrate
.
Workspace Configurations
In workspace directories, you can now add a turbo.json
to:
- add tasks specific to that workspace
- override configuration for tasks
This will enable teams to scale ownership of the projects in their monorepos by moving away from global configuration to fine-grain contol over tasks in workspaces.
For example, imagine your monorepo has a Next.js app and a SvelteKit app, and you want to use Turborepo to cache outputs of the build
task. The Next.js build
script creates a .next
directory, whereas SvelteKit creates a .svelte-kit
directory. Instead of adding both build directories in your root outputs
, you can define the outputs
key in the workspace instead:
The extends
key in the Workspace Configurations enables workspace owners to use the best of the root turbo.json
and customize the parts that makes their app different (The "//"
sigil will look familiar if you’re used to defining tasks to run from your root).
Keys that are declared will replace the key from the root if those keys exist, overriding what is defined in your root configuration. Keys that are not declared are inherited from the root config.
In the example above, outputs
is customized for both apps, while dependsOn
is configured by the root turbo.json
and remains "^codegen"
.
Automatic Workspace Scoping
In Turborepo v1.7, turbo
became globally installable, giving you the power to run your tasks from anywhere in your codebase. However, turbo
would still run tasks from the root, running tasks in other workspaces that you may not have intended to run.
With 1.8, turbo
will automatically detect the workspace you are in and generate the --filter
syntax to scope your task to that workspace.
As an example, if your current directory is apps/admin
and you use the turbo build
command, turbo
will run turbo build --filter=admin
under the hood, focusing on the workspace that you are working on.
Easier Migrations
Manually running individual codemods in the correct order is no longer required when upgrading Turborepo versions. @turbo/codemod
now provides a simple migrate
command which both upgrades your repo to the specified version (latest
by default) of turbo
, and runs any codemods required.
Try it out now with npx @turbo/codemod migrate
.
Community
Since releasing Turborepo v1.7 we've seen incredible adoption and community growth:
- 19.6k+ GitHub Stars
- 987k weekly NPM downloads
- 42 years of compute time saved through Remote Caching on Vercel
Turborepo is the result of the combined work of all of its contributors, including our core team.
Thank you for your continued support, feedback, and collaboration to make Turborepo your build tool of choice.