# 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`.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://quinck.gitbook.io/multijet/configuration/turborepo.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
