PHPackages                             mile23/drupal-merge-plugin - 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. mile23/drupal-merge-plugin

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

mile23/drupal-merge-plugin
==========================

Dependency discovery for Drupal contrib projects.

7290[1 issues](https://github.com/paul-m/drupal-merge-plugin/issues)PHP

Since Sep 25Pushed 9y ago3 watchersCompare

[ Source](https://github.com/paul-m/drupal-merge-plugin)[ Packagist](https://packagist.org/packages/mile23/drupal-merge-plugin)[ RSS](/packages/mile23-drupal-merge-plugin/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

drupal-merge-plugin
===================

[](#drupal-merge-plugin)

Note: This project is in development. It currently does not have even any releases. Want to help? Try using it. File issues. Run the tests. Write tests. Thanks. :-)

This plugin is currently being considered for use in the `drupalci_testbot`. Want to participate in this decision? Talk here:

What?
-----

[](#what)

`drupal-merge-plugin` is a Composer plugin that allows Drupal extensions to specify their own Composer-based dependencies without extra infrastructure. This includes Drupal modules, themes, and profiles.

This plugin is an evolution of the `plugin_manager` module concept, using Drupal extension discovery to merge Composer-based dependencies.

It builds on the Wikimedia project's `composer-merge-plugin`, and inherits some of that project's behaviors.

You can read the documentation for Wikimedia's `composer-merge-plugin` here:

Why?
----

[](#why)

Adding `packagist.drupal-composer.org` to your `composer.json` file is enough to help it find Drupal extensions, and install them along with their dependencies.

However, if you need to update, or re-install without a lock file, that won't be enough to manage those dependencies.

With this plugin, that's possible.

Once you're using this plugin, it will search for `composer.json` files within the extensions present in your Drupal project's file system, and then try to satisfy them. If they can't be satisfied (due to version constraints, etc.) then Composer will tell you.

Note that the plugin does not care if a given extension is enabled or not. It will satisfy all extensions in the Drupal filesystem regardless of the extension's enabled status.

How?
----

[](#how)

At the command line, type this:

```
$ composer require mile23/drupal-merge-plugin

```

This adds the plugin to your Drupal project.

In order to get Drupal extensions using Composer, you must then add the special Drupal Packagist clone to your `repositories` section. There are instructions here:

Basically, add a repository like this to your `composer.json` file:

```
"repositories": {
    "drupal": {
        "type": "composer",
        "url":  "https://packages.drupal.org/8"
    }
}

```

Then you can add Drupal extensions:

```
$ composer require drupal/your-module-here

```

You can add command-line scripts to your `composer.json` like this:

```
"scripts": {
    "list-extensions": "Mile23\\DrupalMerge\\Script::listExtensions",
    "list-managed-extensions": "Mile23\\DrupalMerge\\Script::listManagedExtensions",
    "list-unmanaged-extensions": "Mile23\\DrupalMerge\\Script::listUnmanagedExtensions",
},

```

Once you've done that, you can list available modules by their Composer status.

- `composer list-extensions` gives you all discoverable Drupal extensions which have a `composer.json` file.
- `composer list-managed-extensions` gives you the Drupal extensions which are in the `requires` section of the current Composer package. Restated: If the extension is in your `composer.json` file, it appears in this list.
- `composer list-unmanaged-extensions` gives you a list of extensions which have `composer.json` files, but which are not listed as dependencies in the current project. These would be extensions downloaded as tarballs, for instance.

What Should My Contrib Module's `composer.json` File Look Like?
---------------------------------------------------------------

[](#what-should-my-contrib-modules-composerjson-file-look-like)

Drupal extensions SHOULD NOT specify that they depend on this plugin. Only project-level `composer.json` files should use this plugin.

This plugin's behavior might also conflict with other Composer solutions built by the Drupal community.

You can supply a `composer.json` file per extension, at any folder depth supported by normal Drupal module discovery.

Your `composer.json` file must be in the same directory as the extension's `.info.yml` file.

Your `comopser.json` file should pass the test of running `composer validate` from the command line.

If your `composer.json` file does not specify `requires` and/or `requires-dev`, then this plugin probably won't be terribly useful to you.

`drupal-merge-plugin` will use the same merging rules as `wikimedia/composer-merge-plugin`. That is, `requires` and `requires-dev` will be merged, along with other sections of `composer.json`. Consult the `composer-merge-plugin` documentation for more information.

You should NOT use the `autoload` feature of Composer for your extension. Drupal will autoload the module as needed.

`drupal-merge-plugin` uses the same project type naming convention as `composer-installers`. This means your module's `type` field should be `drupal-module`. This allows the `composer-installer` plugin to place your module in the proper directory, and allows `drupal-merge-plugin` to discover it.

###  Health Score

23

—

LowBetter than 26% of packages

Maintenance17

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/7114cbf293c268d132d118bdd5ba25ccc523c62968307de9662e7c9fca72e379?d=identicon)[paul-m](/maintainers/paul-m)

---

Top Contributors

[![paul-m](https://avatars.githubusercontent.com/u/360238?v=4)](https://github.com/paul-m "paul-m (52 commits)")

### Embed Badge

![Health badge](/badges/mile23-drupal-merge-plugin/health.svg)

```
[![Health](https://phpackages.com/badges/mile23-drupal-merge-plugin/health.svg)](https://phpackages.com/packages/mile23-drupal-merge-plugin)
```

###  Alternatives

[geniusts/laravel-hijri-dates

Hijri dates package for Laravel

2722.8k](/packages/geniusts-laravel-hijri-dates)

PHPackages © 2026

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