kyprss/merge-autoload-dev

Composer plugin to merge autoload-dev settings from local package composer.json to root composer.json

Installs: 1 425

Dependents: 0

Suggesters: 0

Security: 0

Stars: 2

Watchers: 0

Forks: 0

Open Issues: 0

Type:composer-plugin

pkg:composer/kyprss/merge-autoload-dev

v1.0.0-beta4 2025-08-12 05:25 UTC

This package is auto-updated.

Last update: 2025-12-12 06:20:37 UTC


README

A Composer plugin that automatically merges autoload-dev configurations from local packages into the root composer.json.

Why?

When working on a monolithic project structured into modules via local Composer packages, the autoload-dev settings from sub-packages are not loaded by default. As a result, test helpers inside a module are not automatically available. This plugin merges those configurations so that your test helpers become accessible when running the project's tests.

Installation

composer require kyprss/merge-autoload-dev --dev

Configuration

Add the following to your root composer.json:

{
    "extra": {
        "merge-autoload-dev": {
            "include": [
                "modules/*/composer.json"
            ]
        }
    }
}

Configuration Options

  • include (array): Glob patterns for composer.json files to scan and merge

How It Works

  1. The plugin scans all files matching the include patterns
  2. For each composer.json file found, it reads the autoload-dev configuration
  3. It merges all found autoload-dev configurations into the root project's autoload-dev
  4. The merged configuration is automatically applied when running composer commands

Example

Given the following structure:

project/
├── composer.json
├── modules/
│   ├── module-a/
│   │   └── composer.json (with autoload-dev)
│   └── module-b/
│       └── composer.json (with autoload-dev)