Skip to content

extension create storefront-js-plugin adds discoverable Storefront JavaScript behavior to an existing plugin #1296

Description

User story

As a plugin developer, I want to generate Storefront JavaScript using the extension model supported by my target Shopware version, so that the behavior is built and initialized correctly.

Problem

A Storefront JavaScript class can compile successfully but never run when its entry-point import, registration, selector, template hook, or component convention is missing or inconsistent.

Shopware versions may use different Storefront extension models. The generator should not blindly hard-code legacy plugin registration when the target version supports or expects the newer Storefront component model.

The generator should add one minimal JavaScript behavior and the coordination required to initialize it without prescribing plugin-specific behavior.

Implementation decisions

  • Whether storefront-js-plugin remains limited to the legacy plugin system or becomes a version-neutral Storefront JavaScript generator.
  • Which Storefront extension model applies to each supported Shopware version.
  • How the JavaScript name and initialization target are provided or derived.
  • Whether the generator creates a minimal Twig hook or requires an existing initialization target.
  • How existing Storefront entry points or co-located component files are updated.
  • Which source and build paths apply to each supported Shopware version.
  • How JavaScript names, selectors, component names, imports, and template changes are checked for collisions.
  • How successful build and runtime initialization are verified.

Out of scope

  • Plugin-specific JavaScript behavior
  • Overriding an existing Storefront plugin or component
  • Storefront styling
  • Reworking the plugin's asset build configuration

Acceptance criteria

  • The generated JavaScript is built and initialized using the Storefront extension model supported by the target Shopware version.
  • Existing JavaScript and templates are preserved, and missing infrastructure or conflicts are reported before writing.

Readiness checklist

  • Acceptance criteria are clearly defined.
  • Backward compatibility impact addressed.
  • Documentation written.
  • Tests added or adjusted accordingly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Fields

    No fields configured for Story.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions