QamoosTech
Git & CollaborationIntermediateTypeScript

Monorepo

PronunciationMON-oh-REE-poh

Definition

A monorepo is a single Git repository that holds the code of many projects or packages, so they share tooling and can change together in one commit.

Where you hear it

In teams with a web app, an API and shared libraries, tools like Turborepo, Nx and pnpm workspaces, and "monorepo or polyrepo?" debates.

Examples

  • The web app and the API live in one monorepo and share types.
  • CI only builds the packages affected by the change.
  • A change to the shared types updates the web app and the API in one commit.

Common mistake

Dropping everything in with no tooling. Without caching and affected-only builds, CI times explode.

Don't confuse with

A monolith, which is one application deployed as a unit. A monorepo is about where the code is stored, and can hold many separately deployed apps.

Say it at work

  • In a meeting or chatShould this be a separate repo or in the monorepo?
  • In an email or ticketUse workspaces to link the packages.