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
Requires
- php: ^8.2
- composer-plugin-api: ^2.0
Requires (Dev)
- composer/composer: ^2.0
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
- The plugin scans all files matching the
includepatterns - For each
composer.jsonfile found, it reads theautoload-devconfiguration - It merges all found autoload-dev configurations into the root project's autoload-dev
- 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)