Turborepo 2.1
Turborepo 2.1 improves integration with your repository, with features like:
- Affected package graph detection: Only run tasks with changes using
--affected
- Repository exploration tools: Find packages and tasks faster with
turbo ls
andturbo run
- Terminal UI improvements: Log selection, task search, resizing, and more
- Expanded configuration options: More flexibility for defaults using
turbo.json
Update today by running npx @turbo/codemod migrate
or get started with npx create-turbo@latest
.
Run tasks for changed packages with --affected
Turborepo’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.
You'll want to use this flag in situations like:
- You're running many tasks across packages in your monorepo, and only want to run those tasks in packages with code changes.
- You’re not using a Remote Cache, but still want to do as little work as possible in CI.
- You are using a Remote Cache, and you’re in a large repository. By minimizing the amount of tasks that will be restored from cache, there will be less data to send across the network, resulting in faster cache restoration.
- You’re already using advanced filtering techniques or
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.
Repository exploration tools
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 run
Use 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.
Visit the documentation to learn more.
turbo ls
Use 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.
turbo ls
supports an experimental --output
flag that can be used to return
results in a specific format. For example, --output=json
can be used to more
easily create inputs for other tools or custom scripts. If you were previously using
turbo build --dry=json
only to retrieve a list of changed packages,
give turbo ls --affected --output=json
a try. Visit the docs for more information and
leave feedback on output format on the turbo ls
RFC.
Visit the documentation to learn more.
Terminal UI Improvements
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:
- Highlighting of logs for copying to clipboard (PR)
- Search through task list (PR)
- Cleaner layout resizing when your terminal changes size (PR)
- New icon for cache hits in task list (PR)
- Task status indicators updated when Watch Mode triggers a restart (PR)
- Output logs are respected after the terminal UI exits (PR)
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.
Expanded configuration options
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:
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:
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.- System environment variables customize behavior in a specific environment.
- Flags customize behavior for specific invocations of
turbo
.
To learn more about available options and configurations, visit the documentation.
Other improvements
- We’d like to especially thank Shaharking for their contribution in #9023 to make the colors for task names in streamed UIs deterministic, closing #2564. This makes it easier to compare tasks across
turbo run
invocations.
View the full changelog at vercel/turborepo
.
Community
Since releasing Turborepo 2.0 we've seen incredible adoption and community growth:
- 25.9k+ GitHub Stars
- 2.9M+ weekly NPM downloads
- 428 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.