Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Monorepo Builder Laravel Package

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.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture Fit

  • Monorepo-Centric Design: Perfectly aligned with Laravel/PHP monorepo architectures, where multiple composer.json files (e.g., core framework + plugins) need centralized management. The package’s merge/propagate commands directly address Laravel’s dependency sprawl (e.g., shared laravel/framework versions across packages).
  • Laravel-Specific Optimizations: Supports Laravel’s custom composer.json sections (e.g., autoload-dev, extra.laravel) and preserves ordering, critical for CI/CD pipelines where Laravel-specific scripts (e.g., post-autoload-dump) rely on section placement.
  • Modular Configuration: The monorepo-builder.php file enables package-level customization (e.g., excluding secret-package or enforcing Laravel’s composerSectionOrder), reducing friction for teams with mixed Laravel/non-Laravel packages.

Integration Feasibility

  • Composer Integration: Seamless with Laravel’s dependency system. Commands like merge and propagate replace manual composer.json edits, reducing human error (e.g., version conflicts in laravel/framework).
  • CI/CD Readiness: Designed for automation—commands like release and validate integrate with GitHub Actions (via symplify/github-action-monorepo-split) for Laravel’s polyrepo deployments (e.g., splitting a monorepo into independent plugin repos).
  • PHP 8.2+ Requirement: Aligns with Laravel’s current LTS support (Laravel 10/11 require PHP 8.1+), though PHP 8.1 support is deprecated. Risk: Minimal for new Laravel projects; legacy projects may need a version downgrade.

Technical Risk

  • Dependency Conflicts: The validate command may flag false positives if Laravel packages use version ranges (e.g., ^10.0) for shared dependencies. Mitigation: Configure bump-interdependency to enforce stricter versioning (e.g., ^10.0.0).
  • Custom Section Handling: Laravel’s extra.laravel or scripts-aliases sections might break if not explicitly whitelisted in composerSectionOrder. Mitigation: Test with dataToAppend to preserve custom sections.
  • Release Automation Complexity: The release command’s worker-based architecture requires understanding of Laravel’s release workflows (e.g., UpdateBranchAliasReleaseWorker for branch-alias in composer.json). Mitigation: Start with default workers; extend incrementally.
  • Performance at Scale: Merging 100+ composer.json files (e.g., large plugin ecosystems) may impact CI/CD speed. Mitigation: Benchmark with localize-composer-paths for parallel testing.

Key Questions

  1. Laravel-Specific Customization:
    • How will we configure composerSectionOrder to preserve Laravel’s autoload-dev or extra.laravel sections during merges?
    • Can dataToAppend handle Laravel’s custom scripts (e.g., post-autoload-dump) without conflicts?
  2. Dependency Governance:
    • How will we enforce version consistency for Laravel’s core dependencies (e.g., laravel/framework) across packages? (Use validate + bump-interdependency.)
    • What’s the strategy for shared dev dependencies (e.g., phpunit/phpunit) in require-dev vs. require?
  3. Release Workflow:
    • How will we integrate the release command with Laravel’s semantic versioning (e.g., v1.0.0) and changelog generation (e.g., laravel-shift/changelog)?
    • Should we extend the default workers to include Laravel-specific tasks (e.g., running php artisan optimize post-release)?
  4. CI/CD Pipeline:
    • How will we sequence monorepo-builder commands in our Laravel CI pipeline? (Example: mergevalidaterelease.)
    • Can we use localize-composer-paths to test Laravel plugins in isolation before splitting the monorepo?
  5. Long-Term Maintenance:
    • How will we handle LTS branches (e.g., Laravel 10 vs. 11) with the branch-aware tag validation feature?
    • What’s the fallback if a monorepo-builder command fails mid-execution (e.g., merge corrupting composer.json)?

Integration Approach

Stack Fit

  • Laravel Monorepo: Ideal for Laravel projects using a monorepo structure (e.g., modular SaaS platforms, plugin ecosystems, or microservices). The package’s merge/propagate commands replace manual composer.json management, reducing Laravel-specific dependency conflicts.
  • Composer Ecosystem: Works alongside Laravel’s Composer-based dependency system. Commands like validate and bump-interdependency align with Laravel’s versioning strategies (e.g., ^10.0 for laravel/framework).
  • CI/CD Tools: Integrates with GitHub Actions (via symplify/github-action-monorepo-split) for monorepo-to-polyrepo splitting, enabling independent deployments of Laravel modules.
  • Testing Frameworks: Compatible with Laravel’s testing stack (e.g., PestPHP, PHPUnit). The localize-composer-paths command enables parallel testing of Laravel plugins against local core versions.

Migration Path

  1. Assessment Phase:
    • Audit current composer.json files to identify shared dependencies (e.g., laravel/framework, spatie/laravel-permission) and custom sections (e.g., extra.laravel).
    • Document Laravel-specific workflows (e.g., release processes, CI/CD pipelines) that may need adaptation.
  2. Initial Setup:
    • Run vendor/bin/monorepo-builder init to generate a basic monorepo structure (e.g., packages/ directory).
    • Configure monorepo-builder.php to:
      • Define packageDirectories (e.g., ./packages, ./plugins).
      • Exclude non-Laravel packages (e.g., ./packages/non-php-package).
      • Preserve Laravel’s composerSectionOrder (e.g., autoload-dev, scripts).
  3. Pilot Integration:
    • Test merge and propagate commands on a subset of packages (e.g., 2–3 Laravel plugins) to validate dependency consistency.
    • Use validate to catch version conflicts (e.g., mismatched laravel/framework versions).
  4. CI/CD Integration:
    • Add monorepo-builder commands to Laravel’s CI pipeline:
      • Merge phase: mergevalidate (fail fast if dependencies conflict).
      • Release phase: release (with --dry-run for preview) → package-alias.
    • Integrate localize-composer-paths for parallel testing of Laravel plugins.
  5. Full Rollout:
    • Gradually migrate all Laravel packages into the monorepo.
    • Replace custom scripts (e.g., Bash/Python tools for composer.json management) with monorepo-builder commands.
    • Train the team on Laravel-specific configurations (e.g., dataToAppend for autoload-dev).

Compatibility

  • Laravel Versions: Compatible with Laravel 10/11 (PHP 8.2+). For Laravel 9 (PHP 8.1), use symplify/monorepo-builder:^11.2 (deprecated).
  • Composer Plugins: Works alongside Laravel’s Composer plugins (e.g., laravel/installer, spatie/laravel-package-tools).
  • Custom Composer Sections: Supports Laravel’s extra.laravel, scripts-aliases, and other non-standard sections via composerSectionOrder and dataToAppend.
  • Git Workflows: Integrates with Git for tagging (via release command) and branch-aware validation (critical for Laravel’s LTS branches).

Sequencing

  1. Discovery:
    • monorepo-builder init → Configure monorepo-builder.php.
  2. Dependency Management:
    • merge (root composer.json ← packages) → validate (check consistency).
    • propagate (root composer.json → packages) → bump-interdependency (update mutual deps).
  3. Development:
    • localize-composer-paths (for parallel testing) → package-alias (update branch aliases).
  4. Releases:
    • release (with --dry-run
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
milesj/emojibase
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport