AI Newsway
Back to glossary

A monorepo is a single version-controlled repository that holds several projects or packages that would otherwise live apart. A web app, an API server, a shared UI library, and internal tooling sit side by side, with one commit history and one place to open a pull request. The benefit is atomic change: renaming a field in a shared type and updating every consumer happens in one commit that CI verifies as a whole, so the cross-package breakage typical of separately versioned libraries disappears. Dependency management is centralised, and code sharing needs no publish step. The cost is tooling. Naive setups rebuild and retest everything on each change, so monorepos rely on task runners that understand the dependency graph and cache results: Turborepo and Nx in the JavaScript ecosystem, Bazel at larger scale, with pnpm or Yarn workspaces linking packages. Google and Meta run famously large ones. A monorepo is not the same as a monolith, since the code can still deploy as separate services. The main pitfall is adopting it for a couple of packages, where the extra configuration costs more than the coordination it saves.