All You Always Wanted to Know About
Monorepo
But Were Afraid to Ask

🐘 PHP friendly ❤️️


What is Monorepo?

A repository that contains multiple packages or projects. Those projects can, but don't have to be related. Outside PHP world the monorepo is used by Google, Facebook, Twitter and Foursquare.

The most famous monorepos in PHP are Symfony, Laravel, Symplify, Sylius, Yii2, Shopsys, Contao,

Add Yours Too!

Monorepo vs. Multirepo

Single-repo or split-repo

Monorepo is split into many single-repos, e.g. Symfony/Symfony is split into Symfony/Console, Symfony/Validator etc. The single-repo repository is read-only. You can change its code via pull-request to the monorepo.

Many-repo

The other approach to manage multiple repositories. 1 package = 1 own repository. Each package has it's own development, tagging and even maintainers. E.g. Doctrine 2 or Nette 2.

Monolith

Monolith ≠ monorepo. Monolith is huge amount of coupled code of 1 application that is hell to maintain.


Why is Monorepo so Awesome?

  • Simplified organization
  • Easy to coordinate changes across modules.
  • Simplified dependencies
  • Single lint, build, test and release process
  • Tooling
  • Single place to report issues
  • Cross-project changes
  • Tests across modules are run together → finds bugs that touch multiple modules easier

Cherry-picked reasons from legendary Advantages of Monolithic Version Control and Why is Babel a monorepo?. Read them to get deeper insight.


Tools for You

Learn More