apps/docs/content/blog/turbo-2-1-0.mdx
import { Authors } from "@/components/blog/authors"; import { Date } from "@/components/blog/date"; import { Callout } from "@/components/geistdocs/callout";
<Date>Tuesday, August 27th, 2024</Date>
<Authors authors={[ "tomknickman", "anthonyshew", "chrisolszewski", "nicholasyang", "dimitrimitropoulos", ]} />
Turborepo 2.1 improves integration with your repository, with features like:
--affectedturbo ls and turbo runturbo.jsonUpdate today by running npx @turbo/codemod migrate or get started with npx create-turbo@latest.
--affectedTurborepo’s Remote Caching shares a single cache across all of your machines, so you never have to do the same work twice. But, what if you could ignore unchanged packages altogether?
You can now use the --affected flag with turbo run to automatically target packages with changes between the latest commit of your current branch, and the default branch of your repository (usually main or master).
turbo will use your Package Graph to ensure tasks are run for packages with direct changes or changes to internal dependencies.
turbo run lint test --affected
You'll want to use this flag in situations like:
turbo-ignore to create the same or similar behavior as --affected. You likely have the opportunity to simplify your scripting using this new flag.To learn more, visit the documentation.
As a repository grows and changes, it can be difficult to quickly find what you’re looking for. We want to quickly surface your tasks, packages, and their relationships to make understanding your repository faster and easier.
turbo runUse turbo run (with no task arguments) to get a list of the available tasks in your repository. This command also works with filters and Automatic Package Scoping.
# List all tasks in the repository
turbo run
# List tasks in a specific package
turbo run --filter=@repo/ui
# Using Automatic Package Scoping
cd packages/ui && turbo run
Visit the documentation to learn more.
turbo lsUse turbo ls to get a list of all the packages in your repository with their locations, or filter to a specific package to see a summary of its internal dependencies and tasks.
turbo ls also supports --filter, and --affected, making it easy to gather a list of changed packages.
# List all packages in the repository
turbo ls
# List dependencies and tasks for the `web` package
turbo ls web
## List affected packages
turbo ls --affected
Visit the documentation to learn more.
In Turborepo 2.0, we released a new terminal UI to improve clarity for logs and allow for interactive tasks in local development. We heard your feedback, and prioritized polishing this UI, releasing improvements in patches to 2.0 and in this 2.1 release:
Building a great terminal UI experience has unique challenges, and we’re continuing to iterate on this experience. We appreciate your continued feedback as we keep up our work on creating great UI for monorepos.
In this release, we’re adding more keys to turbo.json to give you more flexibility for your repository’s defaults. The following keys are new in this release:
{
"envMode": "loose",
"daemon": false,
"cacheDir": "./my-custom-directory/"
}
You may have been using the flag equivalents for these configurations on many or all of your turbo invocations, littering your codebase with commands like:
turbo run build --env-mode=loose --no-daemon --cache-dir=./my-custom-directory
These can now be simplified with a centralized configuration in turbo.json using Turborepo’s existing configuration model:
turbo.json sets the defaults for your repository.turbo.To learn more about available options and configurations, visit the documentation.
turbo run invocations.View the full changelog at vercel/turborepo.
Since releasing Turborepo 2.0 we've seen incredible adoption and community growth:
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.