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

Distribution Laravel Package

spiral/distribution

Spiral Distribution helps install and publish Spiral framework distributions, bundling app skeletons, modules, and configs into reusable packages. It streamlines project bootstrapping, updates, and sharing standardized setups across teams.

View on GitHub
Deep Wiki
Context7

Getting Started

This package is not for Laravel—it’s a niche, read-only CDN client for the Spiral Framework ecosystem. Since its repository is unknown (no Packagist/GitHub), you cannot install it via Composer in a Laravel project. To evaluate it (only possible in a Spiral app), locate the source code manually (e.g., via local ZIP, archived release, or internal mirror). Start by inspecting src/ for core classes like DistributionService or AssetPublisher, and check for a service provider (e.g., DistributionServiceProvider). A typical first use case is registering a CDN prefix for static assets—e.g., swapping /build/app.jshttps://cdn.example.com/build/app.js—via a config file (e.g., config/distribution.php) containing keys like cdn_url, enabled, and paths.

Implementation Patterns

  • Build-Time Asset Rewriting: In CI, use the package to generate distributable builds where asset paths are pre-patched with CDN URLs (e.g., via a vendor/bin/distribution build command).
  • Runtime Asset Path Injection: In Spiral views, wrap asset helpers (e.g., asset()) with a macro or directive that prepends CDN URLs when distribution.enabled is true.
  • Conditional CDN Toggle: Control via environment variables (e.g., CDN_ENABLED=true in prod, false locally) and inject the setting into a middleware that prepends CDN URLs to responses.
  • Static Asset Bundling: If the package supports it, define glob patterns (e.g., ['assets/*.js']) to batch and prefix multiple assets—ideal for pre-bundled assets from Vite/Webpack.
  • Dependency Injection: Bind the service manually in Spiral’s AppServiceProvider (e.g., $this->app->singleton(DistributionInterface::class, CdnDistribution::class)), then inject it into controllers/views.

Gotchas and Tips

  • Framework Lock-in: It only works with Spiral (not Laravel). Attempting to force-integrate it into Laravel will fail—Spiral’s core contracts (e.g., Cycle, Runner, Http pipeline) are incompatible.
  • Read-Only Repository: As indicated in [READ ONLY], contributions/fixes are impossible—patch locally, fork, or vendor manually if needed.
  • No Public Tests: Expect zero unit/integration coverage. Validate behavior against edge cases: asset versioning (app.css?hash=abc), nested paths (/assets/vendor/react.js), and mixed HTTP/HTTPS.
  • No Cache Invalidation: The package does not handle cache busting or purge APIs (e.g., Cloudflare, Fastly). You must implement cache headers (Cache-Control: max-age=31536000) or manual purges separately.
  • Path Matching Fragility: Pattern matching is likely string-based and naive—test with symlinks, symlinks in public_path(), and multi-domain setups.
  • Version Risk: Without a public repo or tags, you cannot verify BC breaks. Pin to an exact commit only if absolutely necessary, and treat it as a technical debt item.
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