A Composer plugin for managing monolithic repositories with multiple PHP packages and explicit per-package dependencies.
beberlei/composer-monorepo-plugin is a Composer plugin that extends Composer to support monolithic repositories (monorepos) containing multiple PHP packages. It enables maintainable dependency management across all packages within a single repository by using a root composer.json for external dependencies and simplified monorepo.json files for each sub-package, while generating isolated autoloaders for each package. This approach avoids scattered updates and version inconsistencies common when managing many separate Composer packages.
PHP developers and teams maintaining large-scale applications or libraries with multiple interdependent packages in a single repository. It is particularly suited for organizations adopting a monolithic repository workflow inspired by build systems like Bazel or Buck.
Developers choose this plugin to simplify dependency management in monorepos by centralizing external dependencies in one root composer.json, eliminating the need to update the same library across many separate packages. Its unique selling point is generating isolated autoloaders per package that include only explicitly declared dependencies, preserving explicit dependency definitions while leveraging a unified vendor directory.
Integrates Composer into monolithic repositories with many packages.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Uses a single root composer.json for all external dependencies, simplifying updates across the monorepo and eliminating the mass update sprees described in the README.
Generates separate vendor/autoload.php files for each package with only its explicitly declared dependencies, ensuring clean boundaries and preventing accidental access to unrelated code.
Includes commands like monorepo:git-changed? to identify changed components within a commit range, optimizing build processes by targeting only affected packages.
Draws inspiration from Bazel and Buck, bringing monolithic repository workflows to PHP, which is beneficial for large projects aiming for scalable dependency management.
The README explicitly states the project is still experimental, meaning it may have bugs, breaking changes, or limited long-term support, as seen in the v0.12 backward incompatible changes.
Dependency resolution lacks version constraints and assumes correct versions are present, which could lead to runtime errors if internal or external dependencies are mismatched.
Requires renaming files and adapting to a non-standard monorepo.json format, with breaking changes like the removal of the fiddler script in v0.12, increasing setup effort.
Tightly coupled to Composer and monorepos, making it unsuitable for projects that mix repository styles or rely on tools like Symfony Flex for package management.