Friday, April 8th, 2022
Since releasing Turborepo v1.1 in late January, we’ve seen incredible adoption and community growth:
- 6.5k+ GitHub Stars
- 140k+ weekly NPM downloads (doubling since our last blog post for v1.1)
- 95+ OSS contributors
- 900+ members of the Turborepo Community Discord
- 1.6 years of Time Saved through Remote Caching on Vercel, saving more than 2.5 months every week
We’ve further improved ergonomics, observability, and security with Turborepo v1.2 featuring:
- New Task Filtering API:
--filter
adds more powerful task filtering capabilities toturbo run
- Human-readable and JSON dry runs:
--dry-run
flag can print out information about aturbo run
without executing any tasks, in both human and JSON-parse friendly formats - Improved Internal Scheduler and Graph: We refactored
turbo
‘s internal scheduler and graph to be more ergonomic and predictable - Enhanced Remote Cache Security: Cryptographically sign remote cache artifacts with your own secret key
Update today by running npm install turbo@latest
. After running turbo run
for the first time, you’ll see instructions about how to use @turbo/codemod
to run automatic migrations for v1.2
.
New Task Filtering API
We are excited to release one of our most requested features: the ability to expressively filter tasks through a --filter
flag. The --filter
flag is the much more powerful successor to the current combination of --scope
, --include-dependencies
, --since
, and --no-deps
flags.
With --filter
you can tell turbo
to restrict executing commands to a subset of matched packages in your monorepo based on name, folder, or even if it has changed since a git commit ref.
Take a look at some examples of what you can accomplish with the new --filter
command:
--filter=
– match by exact package name or glob pattern--filter=...
– match by package name/glob and include all dependent packages of matches--filter=...^
– match by package name/glob and include all dependent packages of matches, but exclude the matches themselves--filter=
– match by package name/glob and include all the matched packages’ dependencies... --filter=
– match by package name/glob and include all matched package dependencies, but exclude the matches themselves^... --filter={./path/to/package}
– match by path or filesystem glob pattern--filter=[origin/main]
– match by changed packages since a git commit ref
You can use multiple filters together to get even more granular filtering as well as combine each part of the above patterns {}
, []
, ^
, and ...
to express more complex behavior.
For example, if you had an app located in ./apps/web
directory with local packages used as dependencies, and a Turborepo pipeline where test
depends on ^build
topologically, running:
turbo run test --filter={./apps/web}[HEAD^1]^...
would tell turbo
to ensure dependencies are built and to run the test