PHPackages                             rollerworks/monolith-versions - 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. rollerworks/monolith-versions

ActiveComposer-plugin[Utility &amp; Helpers](/categories/utility)

rollerworks/monolith-versions
=============================

Composer plug-in to enforce all versions for the same packages of a monolith versioned distribution.

v0.1.0(3mo ago)02[2 issues](https://github.com/rollerworks/composer-monolith-versions/issues)MITPHPPHP &gt;=8.1CI passing

Since Feb 3Pushed 2mo agoCompare

[ Source](https://github.com/rollerworks/composer-monolith-versions)[ Packagist](https://packagist.org/packages/rollerworks/monolith-versions)[ RSS](/packages/rollerworks-monolith-versions/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (5)Versions (2)Used By (0)

Composer MonolithVersion
========================

[](#composer-monolithversion)

This Composer plugin enforces all to-be-installed packages of a monolith versioned distribution to have the same version.

**This library is in early development, use at your own risk!**

Note

This will only work with monolith versioned distributions.

Only packages that would be normally installed are enforced to have the same version. Packages that are not installed are not enforced.

For example, if you have a monolith versioned distribution with the following packages:

- `rollerworks/search`
- `rollerworks/search-doctrine-dbal`
- `rollerworks/search-doctrine-orm`
- `rollerworks/search-elasticsearch`
- `rollerworks/search-bundle`

All the `rollerworks/search-*` packages should have the same version to ensure proper compatibility between them. While Composer always installs the latest possible version of a package, you might want to ensure all packages are the same version.

Possible scenarios where this is useful:

You want to test that all packages are compatible
-------------------------------------------------

[](#you-want-to-test-that-all-packages-are-compatible)

The `rollerworks-search-doctrine-orm` package also installs the `rollerworks/search-doctrine-dbal`package, which depends on `doctrine/dbal`. When the `doctrine/dbal` is not compatible with the latest version of the `rollerworks/search-doctrine-dbal` package, an older version of the `rollerworks/search-doctrine-dbal` package will be installed. Which would go unnoticed.

Testing with `--prefer-lowest`
------------------------------

[](#testing-with---prefer-lowest)

When testing with `--prefer-lowest` you don't want to add all sub-packages to the `require` section, yet you want to ensure the packages are the same version.

Usage
-----

[](#usage)

Before installing the plugin, make sure you have the latest version of Composer installed.

### Enabling the plugin

[](#enabling-the-plugin)

Because plugins are disabled by default, you need to enable this plugin before usage.

```
composer config --no-plugins allow-plugins.rollerworks/monolith-versions true
```

Install the plugin:

```
composer require lifthill/composer-monolith-version
```

### Configuring the plugin

[](#configuring-the-plugin)

Add the following to your `composer.json` file (in the extra section):

```
{
    "extra": {
        "monolith-versions": {
            "monolith-package-name": {
                "package": "vendor/package-pattern",
                "constraint": "^2.1"
            }
        }
    }
}
```

For example:

```
{
    "extra": {
        "monolith-versions": {
            "rollersearch": {
                "pattern": "rollerworks/search-*",
                "constraint": "^2.1",
                "exclude": [
                    "rollerworks/search-testing"
                ]
            }
        }
    }
}
```

Each entry in the `monolith-versions` array is a monolith configuration, where the key is the name of the monolith and the value is an array with the following keys:

1. `package` (required) – The pattern to match the package names against (multiple patterns are allowed using an array).
2. `constraint` (required) – The constraint to enforce on the matched packages (same as in `require`).
3. `exclude` (optional) – An array of package names to exclude.

A package name can contain a wildcard (`search-*`, `*search`, `*`), or a expand pattern (`{core, doctrine-dbal}`).

**Please take note of the following limitations:**

- A monolith name can only consist of `[a-z]` characters, numbers and dashes, and must start an `[a-z]` character, and contain no consecutive dashes (`--`).
- Conflicting patterns are ignored with a warning (only the first matching pattern is used).
- A vendor name cannot contain a wildcard (`*` or expands pattern `{rollerworks,symfony}`).

    Use an array for multiple patterns instead.
- Only a single wildcard (`*`) *or* expands pattern is allowed in the package name.
- A package name (not the vendor) can contain a wildcard (`search-*`, `*search`, `*`), or a expand pattern (`{core, doctrine-dbal}`).
- The `exclude` key currently doesn't support patterns, only full names.

Override constraints using environment variables
------------------------------------------------

[](#override-constraints-using-environment-variables)

If you want to override the constraint for a specific monolith (for example to test a specific version), you can use an environment variable (per configuration) to override the constraint.

Environment VariableEffect`COMPOSER_MONOLITH_ROLLERWORKS_SEARCH`Overrides the constraint for the `rollerworks-search` monolith.`COMPOSER_MONOLITH_ROLLERWORKS_SEARCH_DOCTRINE_DBAL`Overrides the constraint for the `rollerworks-search-doctrine-dbal` monolith.This is best used for testing purposes.

```
COMPOSER_MONOLITH_ROLLERWORKS_SEARCH="^2.1" composer update
```

Or in a CI environment:

```
export COMPOSER_MONOLITH_ROLLERWORKS_SEARCH="^2.1"

composer update
```

Conflicts when using `--with`
-----------------------------

[](#conflicts-when-using---with)

Using the `--with` option of the `composer update` command might not work as expected when a lower version is required than the monolith constraint allows.

Use an environment variable to override the constraint with a more permissive value to resolve this issue.

Like `COMPOSER_MONOLITH_ROLLERWORKS_SEARCH="^2.0" composer update --with rollerworks/search:2.1`.

Contributing
------------

[](#contributing)

This is an open source project. If you'd like to contribute, please read the [Contributing Guidelines](https://contributing.rollerscapes.net/). If you're submitting a pull request, please follow the guidelines in the [Submitting a Patch](https://contributing.rollerscapes.net/latest/patches.html) section.

About Us
--------

[](#about-us)

This library is brought to you by [Sebastiaan Stok (@sstok)](https://github.com/sstok) and supported by \[contributors\]\[9\].

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance82

Actively maintained with recent releases

Popularity2

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity33

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% 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

Unknown

Total

1

Last Release

104d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/f0e812c04e848e9cc3afe6e966d2b81e81308124d96ce5f54eff4db0f8db0ea9?d=identicon)[sstok](/maintainers/sstok)

---

Top Contributors

[![sstok](https://avatars.githubusercontent.com/u/904790?v=4)](https://github.com/sstok "sstok (3 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/rollerworks-monolith-versions/health.svg)

```
[![Health](https://phpackages.com/badges/rollerworks-monolith-versions/health.svg)](https://phpackages.com/packages/rollerworks-monolith-versions)
```

###  Alternatives

[vaimo/composer-patches

Applies a patch from a local or remote file to any package that is part of a given composer project. Patches can be defined both on project and on package level. Optional support for patch versioning, sequencing, custom patch applier configuration and patch command for testing/troubleshooting added patches.

2994.3M16](/packages/vaimo-composer-patches)[mglaman/composer-drupal-lenient

1317.4M15](/packages/mglaman-composer-drupal-lenient)[drupal/core-composer-scaffold

A flexible Composer project scaffold builder.

5341.9M446](/packages/drupal-core-composer-scaffold)[drupal/core-project-message

Adds a message after Composer installation.

2122.6M172](/packages/drupal-core-project-message)[olvlvl/composer-attribute-collector

A convenient and near zero-cost way to retrieve targets of PHP 8 attributes

184108.8k8](/packages/olvlvl-composer-attribute-collector)[lullabot/drainpipe

An automated build tool to allow projects to have a set standardized operations scripts.

41716.4k2](/packages/lullabot-drainpipe)

PHPackages © 2026

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