PHPackages                             contao/monorepo-tools - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. contao/monorepo-tools

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

contao/monorepo-tools
=====================

Contao Monorepo Tools

0.2.1(1y ago)480.2k↓41.8%5[1 issues](https://github.com/contao/monorepo-tools/issues)LGPL-3.0-or-laterPHPPHP ^8.1CI passing

Since May 15Pushed 1y ago3 watchersCompare

[ Source](https://github.com/contao/monorepo-tools)[ Packagist](https://packagist.org/packages/contao/monorepo-tools)[ Fund](https://to.contao.org/donate)[ RSS](/packages/contao-monorepo-tools/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (3)Dependencies (13)Versions (5)Used By (0)

Contao Monorepo Tools
=====================

[](#contao-monorepo-tools)

[![](https://camo.githubusercontent.com/fb5d5bc573ad7ffc65741e458136976450e1c072ae05ff0cfd099de8d3450312/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f636f6e74616f2f6d6f6e6f7265706f2d746f6f6c732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/contao/monorepo-tools)[![](https://camo.githubusercontent.com/beddfdfe66e0cc6e0de80f064f4cfad88a04ceba7e1e0af813d2ed852f9b2792/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f636f6e74616f2f6d6f6e6f7265706f2d746f6f6c732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/contao/monorepo-tools)

This project provides tools to work with a [monorepo](https://en.wikipedia.org/wiki/Monorepo). The main usage is continuously splitting up a monorepo of a PHP project into multiple read-only splits for every commit, branch and tag. It also provides a command that can merge the *composer.json* files of the splits into a single *composer.json* file for the root directory to make it possible to install the monorepo itself as a replacement of the single packages.

There is also a [merger](#merge-command) available that can be used to merge multiple projects into one monorepo as a one-time process, but it is still experimental and should be used with caution.

Installation
------------

[](#installation)

```
composer require --dev contao/monorepo-tools
```

Usage
-----

[](#usage)

How the tools are used in action can be seen in the *monorepo.yml* and *.github/workflows/ci.yml* files of the project [Contao](https://github.com/contao/contao).

### Split command

[](#split-command)

```
vendor/bin/monorepo-tools split [--force-push] []
```

Splits the monorepo into repositories by subfolder as configured in the *monorepo.yml* file and pushes the results to the configured remotes.

### Composer-json command

[](#composer-json-command)

```
vendor/bin/monorepo-tools composer-json [--validate]
```

Updates (or validates) the root *composer.json* file to include a union of all settings from the splits. The autoload configuration gets rewritten to include the correct path to the right subfolder. Version constraints for requirements and conflicts get merged using intersections and unions.

### Merge command

[](#merge-command)

Merges multiple repositories into one monorepo. This is intended to be a one-time process, and most probably needs some fine-tuning. The biggest benefit of using it is that it’s reversible, meaning that after splitting the monorepo back the splits commit history of the past is kept untouched.

Feel free to contact me (`@ausi`) on the [Contao Slack workspace](https://to.contao.org/slack)if you consider using it for your project.

### Configuration

[](#configuration)

The configuration is stored in a *monorepo.yml* file in the root of your monorepo project.

```
# URL or absolute path to the remote GIT repository of the monorepo
monorepo_url: https://github.com/YOUR-VENDORNAME/YOUR-PROJECT.git

# All branches that match this regular expression will be split by default
branch_filter: /^(main|develop|\d+\.\d+)$/

# List of all split projects
repositories:

    # The first split project living in the folder /first-subfolder
    first-subfolder:

        # URL or absolute path to the remote GIT repository
        url: https://github.com/YOUR-VENDORNAME/YOUR-FIRST-SPLIT-PROJECT.git

    # Second split project living in the folder /second-subfolder
    second-subfolder:

        # URL or absolute path to the remote GIT repository
        url: https://github.com/YOUR-VENDORNAME/YOUR-SECOND-SPLIT-PROJECT.git

        # Optional mapping of commit hashes between the monorepo and split repo
        # This is only relevant to projects that got merged from existing split repos in the past
        mapping:
            # :
            86f7e437faa5a7fce15d1ddcb9eaeaea377667b8: e9d71f5ee7c92d6dc9e92ffdad17b8bd49418f98

# Optional additional composer settings for the root composer.json
composer:
    require-dev:
        contao/monorepo-tools: ^1.0
    require:
        vendor/package: ^1.2.3
    conflict:
        vendor/package: ^1.2.3
```

###  Health Score

40

—

FairBetter than 88% of packages

Maintenance41

Moderate activity, may be stable

Popularity35

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 79.6% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~184 days

Total

3

Last Release

414d ago

PHP version history (2 changes)0.1.0PHP ^7.4 || ^8.0

0.2.0PHP ^8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/3de3a0dd7c29df679eb280585220c17c1a7340b46c2792d5e8298be859acfbba?d=identicon)[leofeyer](/maintainers/leofeyer)

![](https://www.gravatar.com/avatar/8c7bdddffcaec444b7891b633f45fe2713d2b04ff21a6362fd748720d0822d58?d=identicon)[ausi](/maintainers/ausi)

---

Top Contributors

[![ausi](https://avatars.githubusercontent.com/u/367169?v=4)](https://github.com/ausi "ausi (90 commits)")[![leofeyer](https://avatars.githubusercontent.com/u/1192057?v=4)](https://github.com/leofeyer "leofeyer (21 commits)")[![m-vo](https://avatars.githubusercontent.com/u/5305677?v=4)](https://github.com/m-vo "m-vo (1 commits)")[![Toflar](https://avatars.githubusercontent.com/u/481937?v=4)](https://github.com/Toflar "Toflar (1 commits)")

---

Tags

monorepophp

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/contao-monorepo-tools/health.svg)

```
[![Health](https://phpackages.com/badges/contao-monorepo-tools/health.svg)](https://phpackages.com/packages/contao-monorepo-tools)
```

###  Alternatives

[symfony/maker-bundle

Symfony Maker helps you create empty commands, controllers, form classes, tests and more so you can forget about writing boilerplate code.

3.4k111.1M568](/packages/symfony-maker-bundle)[shopware/platform

The Shopware e-commerce core

3.3k1.5M3](/packages/shopware-platform)[symplify/monorepo-builder

Not only Composer tools to build a Monorepo.

5205.3M82](/packages/symplify-monorepo-builder)[drupal/core

Drupal is an open source content management platform powering millions of websites and applications.

19562.3M1.3k](/packages/drupal-core)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.3M152](/packages/sulu-sulu)[contao/core-bundle

Contao Open Source CMS

1231.6M2.4k](/packages/contao-core-bundle)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
