symplify/monorepo-builder
Tools for PHP monorepos: discover packages, merge and propagate composer.json, validate dependency/version consistency, and automate releases. Configure via monorepo-builder.php and manage packages across /packages or custom directories.
Monorepo Strategy for Laravel Ecosystems: Justify transitioning to a PHP monorepo for Laravel-based projects (e.g., modular SaaS platforms, plugin ecosystems, or microservices). This package automates critical workflows, reducing friction for teams scaling Laravel codebases by:
composer.json files into a root (e.g., consolidating Laravel core + plugin dependencies) via the merge command, ensuring consistency across require, require-dev, and custom sections like scripts-aliases.laravel/framework, symfony/console) across packages with the validate command to prevent version conflicts, critical for Laravel ecosystems with tightly coupled plugins.release command, cutting release cycle time by 50–70%—ideal for Laravel projects with frequent updates.Build vs. Buy Decision:
composer.json merging/propagation (replaces manual scripts or custom PHP logic).bump-interdependency for Laravel plugin dependencies).package-alias for branch-aware development).localize-composer-paths for testing plugins in isolation), and MIT license reduce custom development risk.CI/CD & Developer Experience:
init command to generate standardized package structures (e.g., packages/laravel-plugin-*).localize-composer-paths (e.g., testing a Laravel plugin against a local core framework version).composerSectionOrder to preserve Laravel’s autoload-dev or extra.laravel sections during merges.LTS & Multi-Version Support:
NotifySlackReleaseWorker for Laravel release announcements or a RunLaravelTestsReleaseWorker to execute tests post-release).Adopt if:
composer.json files (e.g., core framework + plugins/microservices).composer.json sections across packages to avoid manual drudgery (e.g., shared Laravel dependencies like laravel/framework or spatie/laravel-permission).Look elsewhere if:
composer.json management or release automation.For Executives:
"This package automates the pain points of managing a Laravel monorepo—merging dependencies, validating versions, and orchestrating releases—saving 50–70% of release cycle time while reducing manual errors. For example, teams maintaining Laravel plugins or microservices can now release all packages simultaneously with a single command, ensuring consistency across shared dependencies like laravel/framework. It’s a turnkey solution for scaling PHP projects, with minimal maintenance overhead (MIT license, active updates). The cost of adoption is low: a few hours to configure, and the ROI comes from faster releases, fewer dependency conflicts, and easier CI/CD integration."
For Engineering Teams: *"Monorepo Builder solves three critical problems for Laravel monorepos:
composer.json files across packages, preventing version conflicts (e.g., laravel/framework mismatches).ReleaseWorkerInterface.localize-composer-paths enable parallel testing (e.g., testing a plugin against a local Laravel core), and init scaffolds new packages with consistent structure.Why use it?
composer.json or propagating versions.autoload-dev or extra.laravel sections.Getting Started:
composer require monorepo-php/monorepo --dev and vendor/bin/monorepo-builder init.monorepo-builder.php to define package directories, exclusions, and custom merge rules.merge, validate, or release in CI/CD pipelines.Example Use Case:
A Laravel SaaS platform with 10+ plugins can now release all packages in one command, ensuring plugins use compatible versions of the core framework. The validate command catches dependency conflicts before they break builds, and localize-composer-paths speeds up plugin testing by 30%."
How can I help you explore Laravel packages today?