Turborepo 1.5
Turborepo 1.5 is a huge leap forward for our documentation and DX, as well as bringing big improvements to turbo prune
:
- The Monorepo Handbook: We've built the missing manual for your monorepo - a guide on workspaces, code sharing, integrating common tools and much more.
- Drop the
run
:turbo run <task>
can now be shortened toturbo <task>
turbo prune
now supports pnpm and yarn 2+: Pruning your monorepo is now supported inpnpm
andyarn@berry
.- Improved environment variables in
turbo.json
: Environment variables are now first-class citizens in your Turborepo pipeline configuration. - Changes to
package.json
hashing: We've improved how we hashpackage.json
when running tasks.
Update today by running npm install turbo@latest
.
The Monorepo Handbook
Setting up a monorepo for the first time often means navigating a lot of new concepts. You'll need to understand workspaces, package installation, sharing code and dependency management - and a lot more.
This often meant that folks who wanted to set up a monorepo from scratch had to piece information together from different documentation sites. First pnpm
, then tsup
, then back to changesets
, then back to Turborepo for dessert.
We want to fill this gap with the Monorepo Handbook. We've built guides on how to integrate all the tools you'll need to make ship happen with your monorepo, including guides on:
Drop the run
You can now run tasks with the Turborepo CLI using turbo <task>
.
If your task name conflicts with a built-in turbo
subcommand, we'll run our subcommand instead. That means you shouldn't name your tasks things like prune
, run
, or login
- since those are built-in subcommands.
turbo run <task>
will continue to work, and there are no plans to deprecate it.
Prune now supported on pnpm and yarn 2+
We're delighted to announce that turbo prune
now supports in pnpm, yarn, and yarn 2+.
You can use turbo prune
to create a pruned subset of your monorepo with a dedicated lockfile--with the correct dependencies needed for a given target application and its dependencies. This is especially useful for using efficiently Turborepo within a Docker image.
As part of the new handbook, we've also added a section on using turbo prune
to build docker images.
Check out our previous blog on prune to learn more.
Environment variables in turbo.json
We've introduced two new keys to turbo.json
- env
and globalEnv
. These allow environment variables to be configured separately from tasks:
globalEnv
and env
allow you to specify a list of environment variables without $
prefixes. This makes the configuration file significantly easier to read. Read more in our updated docs.
To help migrate from the previous syntax, we've prepared a codemod. You can run npx @turbo/codemod migrate-env-var-dependencies
.
This work builds on the automatic env variable detection we added in 1.4.0.
Changes to package.json
hashing
The package.json
file in each workspace is now always considered an input for tasks in that workspace. This means that if you change the definition for a task in package.json
, we want to invalidate any caches from the previous definition.
This also counts for the package.json
in the root. Changes to the root package.json
will invalidate tasks in the root workspace.
This helps make Turborepo's cache a bit smarter, and less likely to trip up when task definitions change.
Community
Since releasing Turborepo v1.4 in August, we've seen incredible adoption and community growth:
- 9.5k+ GitHub Stars
- 440k weekly NPM downloads
- 15 years of compute time saved through Remote Caching on Vercel, saving over a 1 year per week, up 2x since July
Turborepo is the result of the combined work of all of our contributors including our core team.
This release was brought to you by the contributions of: @7flash, @afady, @alexander-young, @atilafassina, @bguedes-moz, @bobaaaaa, @brunojppb, @chris-olszewski, @DoctorJohn, @erj826, @futantan, @gsoltis, @HosseinAgha, @ivov, @jaredpalmer, @joelhooks, @knownasnaffy, @laurentlucian, @leerob, @MarceloAlves, @mattpocock, @mauricekleine, @mehulkar, @Misikir, @nareshbhatia, @nathanhammond, @pakaponk, @PhentomPT, @renovate, @ruisaraiva19, @samuelhorn, @shemayas, @shuding, @t-i-0414, @theurgi, @tknickman, @yanmao-cc, and more!
Thank you for your continued support, feedback, and collaboration to make Turborepo your build tool of choice.