$ show roots/acorn
Acorn is a PHP framework that seamlessly integrates Laravel's core components into WordPress, enabling developers to use Laravel's service container, routing, configuration, caching, and Blade templating within WordPress themes (especially Roots Sage). It provides a custom application bootstrapping process that hooks into WordPress's lifecycle, along with comprehensive asset management (supporting Vite, Bud, and Mix build systems), CLI commands via WP-CLI, exception handling with Whoops integration, and view composers with ACF field support. The codebase is a well-structured library with clean abstractions, extensive test coverage (Pest with snapshot testing), and a devcontainer for integration testing. It is actively maintained with CI workflows to track upstream Laravel foundation updates, though the forked nature introduces moderate technical drift risk.
The LLM identified 4 files worth highlighting for reuse:
Reads and parses different asset manifest formats (JSON, asset.php, entrypoints.json) from Bud, Mix, and Vite build systems. The class is isolated within the Assets namespace and can be extracted as a reusable parser for any PHP project needing to consume frontend build manifests. It demonstrates clean separation of concerns and format flexibility.
Fluent class for managing WordPress script/style enqueuing, supporting dependencies, localization, inline scripts, editor styles, and conditional loading. The builder pattern with callback registration for styles and scripts is a reusable pattern for any CMS that needs to enqueue assets with complex dependency graphs. It is self-contained within the Assets domain.
A trait that provides cache-aside pattern for view composers with flexible tag support. It can be used in any Laravel-based view system to cache rendered data without tight coupling. The implementation is minimal and focuses on the caching concern, making it easily extractable.
Trait that wraps Artisan command calls to silently skip missing commands instead of throwing exceptions. This pattern is useful for plugin or framework console integrations where some commands may not be available. The trait is small, focused, and has no dependencies on Acorn internals beyond the kernel.