---
title: Turborepo 1.1
date: 2022/01/31
description: Turborepo 1.1 introduces automatic migrations, turbo.json configuration, environment variable dependencies, partial Yarn v2 support, and more!
tag: web development
ogImage: /images/blog/turbo-1-1-0/twitter-card.png
---

# Turborepo 1.1

import { Authors } from "../../components/Authors";

<Authors authors={["jaredpalmer", "becca__z", "gaspargarcia", "gregsoltis"]} />

Since releasing Turborepo v1.0 in mid-December, we've seen incredible adoption:

- 5.5k+ GitHub Stars
- 70k+ weekly npm downloads
- 65+ OSS contributors
- In production at [Vercel](https://github.com/vercel/next.js), [AWS](https://github.com/aws-amplify/amplify-ui), [PayPal](https://twitter.com/jaredpalmer/status/1485617973477978121), [Twilio](https://github.com/twilio-labs/function-templates), [Contentful](https://github.com/contentful/forma-36), [Miro](https://github.com/miroapp/app-examples), [Framer](https://github.com/framer/motion), [Discord.js](https://github.com/discordjs/discord.js), [Rocket.chat](https://github.com/RocketChat/fuselage), [Astro.build](https://github.com/withastro/astro)
- 585+ members of the [Turborepo Community Discord](https://turbo.build/discord)

![Weekly npm downloads of `turbo`](/images/blog/turbo-1-1-0/turborepo-weekly-npm-downloads.png)

We're further improving build performance and caching with Turborepo v1.1, featuring:

- [**Automatic Migrations:**](#automatic-migrations) Official idempotent migration scripts to assist with upgrading.
- [**`turbo.json` Support:**](#turbojson-support) Turborepo configuration now lives in its own file.
- [**Faster Package Manager Detection:**](#faster-package-manager-detection) Turborepo now respects the `packageManager` key in the root `package.json`.
- [**Environment Variable Dependencies:**](#environment-variable-dependencies) Define how environment variables impact global and task-specific caching.
- [**Partial Support for Yarn v2+:**](#partial-yarn-v2v3-support) Support for yarn v2+ with `nodeLinker: "node-modules"`.

Update today by running `npm install turbo@latest`. After running `turbo`, you'll see instructions about how to use `@turbo/codemod` to run automatic migrations for `v1.1`.

## Automatic Migrations

Turborepo now provides idempotent code transformations and automatic migration scripts (a.k.a "codemods") to help upgrade your Turborepo codebase when a feature is deprecated or will be deprecated in the future.

Codemods are transformations that run on your codebase programmatically. This saves you time by applying a large number of changes to your code automatically, without having to manually go through and edit every file.

### Usage

```bash
npx @turbo/codemod <transform> <path>
```

- `transform` - the name of transform, [see available transforms in the docs](/repo/docs/reference/codemods#turborepo-1x).
- `path` - files or directory to transform.
- `--dry` - Do a dry run, no code will be edited.
- `--print` - Prints the changed output for comparison.

For more information about specific transforms, check out the [new Codemods documentation](/repo/docs/reference/codemods#turborepo-1x).

## `turbo.json` Support

Turborepo configuration is now defined in a `turbo.json` file in the root of your monorepo. This is an improvement over having a `turbo` key in `package.json` for those who want to quickly jump straight to their Turborepo configuration in their code editors.

To automatically migrate from your current configuration in `package.json`, check out a new branch, navigate to the root of your monorepo and run the following codemod:

```bash
npx @turbo/codemod create-turbo-config .
```

For more information on this transformation, [check out the documentation](/repo/docs/reference/codemods#create-turbo-config).

## Faster Package Manager Detection

Turborepo now supports the recently established `packageManager` field in `package.json` for faster package manager detection. Previously, `turbo` would check for specific files to infer this information. To automatically set this field, check out a new branch, navigate to the root of your monorepo and run:

```bash
npx @turbo/codemod add-package-manager .
```

For more information on this transformation, [check out the documentation](/repo/docs/reference/codemods#add-package-manager).

## Environment Variable Dependencies

When you use `turbo` with tools that inline environment variables at build time (e.g. Next.js or Create React App), it is important you tell `turbo` about it to avoid shipping a cached artifact with the wrong environment variables.

You can now control `turbo`'s [cache fingerprinting (a.k.a. hashing)](/repo/docs/core-concepts/caching#hashing) behavior based on the values of both environment variables and the contents of files:

- Including environment variables in a `dependsOn` in your `pipeline` definition prefixed by a `$` will impact the cache fingerprint on a per-task or per-package-task basis.
- Including environment variables in `globalDependencies` list prefixed by a `$` will impact the cache fingerprint of _all_ tasks.
- Including files or globs of files in `globalDependencies` will impact the cache fingerprint of _all_ tasks.
- The value of any environment variable that includes `THASH` in its name will impact the cache fingerprint of _all_ tasks.

```jsonc
{
  "pipeline": {
    "build": {
      "dependsOn": {
        "^build"
        // env vars will impact hashes of all "build" tasks
        "$SOME_ENV_VAR"
      },
      "outputs": ["dist/**"]
    },
    "web#build": { // override settings for the "build" task for the "web" app
      "dependsOn": [
        "^build",
          // env vars that will impact the hash of "build" task for only "web" app
          "$STRIPE_SECRET_KEY",
          "$NEXT_PUBLIC_STRIPE_PUBLIC_KEY",
          "$NEXT_PUBLIC_ANALYTICS_ID",
      ],
      "outputs": [".next/**", "!.next/cache/**"],
    },
    "docs#build": { // override settings for the "build" task for the "docs" app
      "dependsOn": [
        "^build",
          // env vars that will impact the hash of "build" task for only "web" app
          "$STRIPE_SECRET_KEY",
          "$NEXT_PUBLIC_STRIPE_PUBLIC_KEY",
          "$NEXT_PUBLIC_ANALYTICS_ID",
      ],
      "outputs": [".next/**", "!.next/cache/**"],
    }
  },
  "globalDependencies": [
    "$GITHUB_TOKEN"// env var that will impact the hashes of all tasks,
    "tsconfig.json" // file contents will impact the hashes of all tasks,
    ".env.*" // glob file contents will impact the hashes of all tasks,
  ]
}
```

Note: In most monorepos, you don't often use environment variables in shared packages, but mostly in applications. Thus, to get higher cache hit rates, you should only include environment variables in the app-specific tasks where they are used/inlined.

For more information, read the [caching and hashing documentation](/repo/docs/core-concepts/caching).

## Partial Yarn v2/v3 support

In addition to Yarn v1, npm, and pnpm package managers, Turborepo now supports Yarn v2+ with [`nodeLinker: "node-modules"` set in `.yarnrc.yml`](https://yarnpkg.com/configuration/yarnrc#nodeLinker). This key tells Yarn v2+ to mimic Yarn v1's `node_modules` installation behavior. Yarn v2+ Plug'n'Play (a.k.a. "PnP") is not currently supported.

## What's next?

[Since our launch](/blog/joining-vercel), Turborepo has focused on seamless incremental adoption/migration and speeding up CI/CD. We are committed to both of those values, but now we'll also be focusing on improving Turborepo's day-to-day ergonomics for local development and observability. We're really excited about this next chapter and will be sharing more details soon.

## We're hiring!

The Turborepo team at [Vercel](https://vercel.com/) is hiring! We're specifically looking for full time [Senior Full Stack Software Engineers](https://vercel.com/careers) and [Senior DevOps/Infrastructure Engineers](https://vercel.com/careers) to help us make Turborepo even better.
