Turborepo 1.9
Monday, April 11th, 2023
Turborepo 1.9 focuses on improving observability for your task runs to better understand your caching behavior:
- Run Summaries: Use the
--summarize
flag to generate a summary of your task to compare against previous runs. - Easier Starters: Use the
--example
flag withnpx create-turbo
to start from official Turborepo examples or custom repositories. - Strict Environments Experimental: Try enabling strict mode to restrict the environment variables your tasks have access to.
Update today by running npx @turbo/codemod migrate
.
View and compare task runs
You can now produce a JSON summary of your task run using the --summarize
flag:
turbo build --summarize
When this flag is enabled, Turborepo will generate a summary in .turbo/runs/
that contains all the information necessary to understand how turbo
interpreted your your task's configuration and code.
Tasks: 3 successful, 3 total
Cached: 0 cached, 3 total
Time: 1.707s
Summary: /Users/acme/projects/acme/.turbo/runs/2Nn3X6nWDhP9ag8BnmivWRxHpHC.json
You can then compare summaries using your favorite JSON diffing tool to understand why you got a cache hit or a cache miss.
Learn more in the docs.
Bring your own starter
create-turbo
now supports starting a new project from any of the official Turborepo examples (opens in a new tab). Get started with an example using a single command:
npx create-turbo@latest -e kitchen-sink
In your terminal UI, choose your preferred package manager and create-turbo
will automatically convert the chosen example to your package manager of choice.
Additionally, you can use create-turbo
with custom repository sources, allowing you to re-use your own custom starter or another starter from around the community:
npx create-turbo -e https://github.com/your-org/turbo-starter
Strict Environments Experimental
You can now use the --env-mode=strict
flag to restrict the environment variables your tasks have access to. Your tasks will only be aware of the variables you explicitly state, creating a safer caching environment.
In strict
mode, Turborepo will pass environment variables declared in:
globalEnv
andglobalPassThroughEnv
to all tasksenv
andpassThroughEnv
for each task
{
// Available to all tasks
"globalPassThroughEnv": ["GLOBAL_VAR_1"],
// Available to all tasks and invalidates caches
"globalEnv": ["GLOBAL_VAR_2"],
"pipeline": {
"build": {
// Only available to `build` tasks
"passThroughEnv": ["VAR_1"],
// Available to `build` task and invalidates caches
"env": ["VAR_2"]
}
}
}
In strict
mode, this configuration will only expose four environment variables to your build
tasks, helping you catch missing variables earlier in the development process.
--env-mode
also supports loose
and infer
.
Learn more in the docs.
Community
Since releasing Turborepo v1.8 we've seen incredible adoption and community growth:
- 20.5k+ GitHub Stars (opens in a new tab)
- 1.1M weekly NPM downloads (opens in a new tab)
- 64 years of compute time saved through Remote Caching on Vercel (opens in a new tab)
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.