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

Cpm Bundle Laravel Package

ajgl/cpm-bundle

View on GitHub
Deep Wiki
Context7

Getting Started

Minimal Setup

  1. Installation Add the bundle via Composer (if still viable, despite archival):

    composer require ajgl/cpm-bundle
    

    Register in config/bundles.php (Symfony 2.x):

    Ajgl\CpmBundle\AjglCpmBundle::class => ['all' => true],
    
  2. First Use Case Define a JavaScript dependency in a Twig template:

    {% javascripts
        '@AjglCpmBundle/Resources/public/cpm.js'
        filter='cpm'
    %}
        <script src="{{ asset(url) }}"></script>
    {% endjavascripts %}
    

    Ensure cpm.js is a CPM-compatible loader (e.g., CPM’s official loader).


Implementation Patterns

Workflow Integration

  1. Dependency Management

    • Use Twig filters (filter='cpm') to process CPM-compatible manifests.
    • Example manifest (cpm.json):
      {
        "main": "path/to/entry.js",
        "dependencies": {
          "dojo": "1.10.4",
          "dgrid": "0.5.0"
        }
      }
      
    • Reference in Twig:
      {% javascripts '@YourBundle/Resources/public/cpm.json' filter='cpm' %}
      
  2. Asset Pipeline

    • Leverage Symfony’s Asset component to resolve CPM-managed paths.
    • Cache-busting: Append ?v={{ timestamp }} to generated <script> tags.
  3. Symfony Integration

    • Extend AjglCpmBundle\Dependency\DependencyManager to add custom CPM resolvers.
    • Override Twig extensions for advanced filtering (e.g., minification).

Gotchas and Tips

Pitfalls

  1. Archival Warning

    • Bundle is archived (no updates). Test thoroughly in staging.
    • Fork or migrate to alternatives like Webpack Encore if critical.
  2. CPM Compatibility

    • Ensure all dependencies are CPM-compatible (not npm/yarn-only).
    • Debug missing modules with:
      cpm install --dry-run
      
  3. Symfony 2.x Constraint

    • Hard dependency on Symfony 2.0–2.1. Use a polyfill or rewrite for newer versions.

Debugging

  • Twig Errors: Check Resources/doc/index.md for filter syntax nuances.
  • CPM Logs: Enable verbose mode:
    cpm install -v
    
  • Asset Resolution: Verify app/Resources/public paths are correct.

Extension Points

  1. Custom Resolvers Extend AjglCpmBundle\Dependency\Resolver\BaseResolver to support private CPM registries.

  2. Twig Filters Override AjglCpmBundle\Twig\Extension\CpmExtension to add pre/post-processing.

  3. Build Automation Hook into post-install-cmd in composer.json to auto-run cpm install:

    "scripts": {
      "post-install-cmd": [
        "Ajgl\\CpmBundle\\Composer\\ScriptHandler::postInstall"
      ]
    }
    
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.
emuniq/filament-browser-notifications
syriable/filament-translator
hungnm28/livewire-form
wenprise/eloquent
crudly/encrypted
fadion/bouncy
cuci/prototurk-sdk
gos/pubsub-router-bundle
cuci/prototurk-sdk-symfony
clementtalleu/easyadmin-markdown-bundle
codeflextech/permission-manager
karnoweb/livewire-datepicker
sayedenam/sayed-dashboard
milito/query-filter
apiboxsym/user-bundle
apiboxsym/health-check-bundle
jayeshmepani/jpl-moshier-ephemeris-php
elnasnato/laraliveui
labrodev/rest-sdk
sampaui/sampaui