Turborepo 1.10
Turborepo 1.10 introduces new features to improve your local development experience:
- Code Generators: Use
turbo gen
to generate source code, including creating new workspaces and copying existing ones. - Improved Environment Variable Inputs: It's now easier to depend on environment variables with wildcards and
.env
support. - New Environment Modes: You can now specify
--env-mode=strict
to control environment variables that are included in your task hashes.
Update today with
Code Generators
Turborepo Generators allow you to add new code to your repository in a predictable, structured way. Previously, you would need to copy code yourself and manually add dependencies to your new workspace. With Generators, we've automated the process of creating new workspaces and integrating them into your repository.
You can create a blank workspace from scratch, copy an existing workspace, or even create custom generators for more control. Custom generators leverage Plop configurations, a common template definition strategy used in the JavaScript ecosystem.
Custom generators can also be used to scaffold more granular sets of code than workspaces. You can significantly speed up tasks like:
- Adding new components to your UI library
- Creating new unit tests
- Generating a new MDX blog post
Get started with your first generator by running:
For more, check out the documentation.
Improved Environment Variable Inputs
Support for .env
files
.env
files are commonly used to load environment variables. This can cause problems when running with turbo
, because these variables can be invisible, and are not easily
included in the hash for your task. This problem could cause unintended cache hits while working locally.
Turborepo now makes this much easier with automatic support for .env
files.
To ensure that Turborepo includes these variables in your hash, use the dotEnv
key. For example, here is a configuration for a Next.js application:
For more, check out the documentation.
Environment Variable Wildcards
Large applications can end up with many environment variables in their turbo.json
. This can make your configuration difficult to manage and maintain.
With wildcards, you can now specify patterns of variables to include in your hash.
For more, check out the documentation.
Environment modes
Turborepo environment modes are now out of experimental mode and are available for general use.
By default, and when turbo run
is invoked with --env-mode=loose
, all environment variables from the machine are made available to every single Turborepo task.
This ensures the greatest compatibility while accepting some risk that a task will implicitly have access to a environment variable that is not specified in your turbo.json
.
In the new strict mode, when turbo
is invoked with --env-mode=strict
, only important system environment variables and environment variables enumerated inside of turbo.json
will be made available to a task.
For more, check out the documentation.
Community
Since releasing Turborepo v1.9 we've seen incredible adoption and community growth:
- 21.5k+ GitHub Stars
- 1.2M+ weekly NPM downloads
- 85 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.