---
title: Turborepo 1.8
date: 2023/02/22
description: Turborepo 1.8 brings better flexibility and more control to your codebase by improving turbo's understanding of your workspaces.
tag: "web development"
ogImage: /images/blog/turbo-1-8-0/x-card.png
---

import { Tabs, Tab } from '../../components/Tabs'

# Turborepo 1.8

import { Authors } from '../../components/Authors'
import { Badge } from '../../components/Badge'
import { Date } from "../../components/blog/Date";

<Date>
  Wednesday, February 22th, 2023
</Date>

<Authors authors={[
  'gregsoltis',
  'nathanhammond',
  'tomknickman',
  'anthonyshew',
  'jaredpalmer',
  'mehulkar',
  'chrisolszewski',
  'nicholasyang',
  'alexanderlyon'
]} />

Turborepo 1.8 brings better flexibility and more control to your codebase by improving `turbo`'s understanding of your workspaces.

- [**Workspace Configurations**](#workspace-configurations): You can now add a `turbo.json` configuration file in a workspace to override the root configuration in your repository.
- [**Automatic Workspace Scoping**](#automatic-workspace-scoping): Global `turbo` now automatically infers your current workspace so that it only runs that workspace’s tasks.
- [**Easier Migrations**](#easier-migrations): Automatically migrate to new versions of `turbo` with `npx @turbo/codemod migrate`.

Update today by running `npx @turbo/codemod migrate`.

## Workspace Configurations

In workspace directories, you can now add a `turbo.json` to:

- add tasks specific to that workspace
- override configuration for tasks

This will enable teams to scale ownership of the projects in their monorepos by moving away from global configuration to fine-grain contol over tasks in workspaces.

For example, imagine your monorepo has a Next.js app and a SvelteKit app, and you want to use Turborepo to cache outputs of the `build` task. The Next.js `build` script creates a `.next` directory, whereas SvelteKit creates a `.svelte-kit` directory. Instead of adding both build directories in your root `outputs`, you can define the `outputs` key in the workspace instead:

```jsonc filename="turbo.json"
{
	"pipeline": {
		"build": {
			"dependsOn": ["^codegen"],
			// no need to define outputs here!
		}
	}
}
```

```jsonc filename="apps/my-nextjs-app/turbo.json"
{
	"extends": ["//"],
	"pipeline": {
		"build": {
			// dependsOn is inherited from root
			"outputs": [".next/**", "!.next/cache/**"]
		}
	}
}
```

```jsonc filename="apps/my-sveltekit-app/turbo.json"
{
	"extends": ["//"],
	"pipeline": {
		"build": {
			// dependsOn is inherited from root
			"outputs": [".svelte-kit/**"]
		}
	}
}
```

The `extends` key in the Workspace Configurations enables workspace owners to use the best of the root `turbo.json` and customize the parts that makes their app different (The `"//"` sigil will look familiar if you’re used to [defining tasks to run from your root](/repo/docs/core-concepts/monorepos/running-tasks#running-tasks-from-the-root)).

Keys that **are** declared will replace the key from the root if those keys exist, overriding what is defined in your root configuration. Keys that **are not** declared are inherited from the root config.

In the example above, `outputs` is customized for both apps, while `dependsOn` is configured by the root `turbo.json` and remains `"^codegen"`.

[Learn more in the docs](/repo/docs/core-concepts/monorepos/configuring-workspaces).

## Automatic Workspace Scoping

In [Turborepo v1.7](/blog/turbo-1-7-0), `turbo` became globally installable, giving you the power to run your tasks from anywhere in your codebase. However, `turbo` would still run tasks from the root, running tasks in other workspaces that you may not have intended to run.

With 1.8, `turbo` will automatically detect the workspace you are in and generate [the `--filter` syntax](/repo/docs/reference/command-line-reference/run#--filter) to scope your task to that workspace.

As an example, if your current directory is `apps/admin` and you use the `turbo build` command, `turbo` will run `turbo build --filter=admin` under the hood, focusing on the workspace that you are working on.

## Easier Migrations

Manually running individual codemods in the correct order is no longer required when upgrading Turborepo versions. `@turbo/codemod` now provides a simple `migrate` command which both upgrades your repo to the specified version (`latest` by default) of `turbo`, _and_ runs any codemods required.

Try it out now with `npx @turbo/codemod migrate`.

## Community

Since releasing [Turborepo v1.7](/blog/turbo-1-7-0) we've seen incredible adoption and community growth:

- [19.6k+ GitHub Stars](https://github.com/vercel/turbo)
- [987k weekly NPM downloads](https://www.npmjs.com/package/turbo)
- 42 years of compute time saved through [Remote Caching on Vercel](https://vercel.com/docs/concepts/monorepos/remote-caching)

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.
