> For the complete documentation index, see [llms.txt](https://quinck.gitbook.io/multijet/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://quinck.gitbook.io/multijet/configuration/turborepo.md).

# Turborepo

**NPM workspaces** can manage and run scripts for multiple packages by itself. For example, if we have a **workspace** and inside that we have **multiple packages** each with a `build` script, we can run the command `npm run build` in the root of the project and npm workspaces will run the `build` script of each package **one by one**.

Multijet uses [**Turborepo**](https://turbo.build/repo) to simplify the managment of the monorepo.

Turborepo runs the desired scripts **in parallel**, and not sequentially. This means that a Multijet project is **extremely** **scalable** because the speed of the build is not directly affected by the number of libs or microservices.

The following is the default `turbo.json` configuration file:

{% code title="turbo.json" %}

```json
{
    "pipeline": {
        "typecheck": {
            "dependsOn": ["^typecheck"]
        },
        "build": {
            "dependsOn": ["^build", "typecheck"],
            "outputs": ["dist/**"]
        },
        "build:debug": {
            "dependsOn": ["^build:debug", "typecheck"]
        },
        "lint": {},
        "lint:fix": {},
        "start": {
            "dependsOn": ["build"]
        },
        "openapi:generate": {
            "cache": false
        },
        "test": {},
        "clean": {
            "cache": false
        }
    },
    "globalDependencies": ["tsconfig.base.json"]
}
```

{% endcode %}

A pipeline is simply a script that runs **all npm scripts** for **every package** in **every workspace**.

For example, if we run `turbo run build` or simply `npm run build` in the root of your Multijet project, Turborepo will run the build script in **parallel** for **every package** (in this case only microservices have a build script).

You can also specify if a scripts **depends** on another: for example, the `build` script depends on the `typecheck` script so Turborepo will first run `typecheck` for every package and then `build`.
