vuestorefront / shopware-pwa

Shopware PWA for eCommerce. Headless storefront solution for Shopware 6, which communicates through the SalesChannel-API. Always Open Source, MIT license. Made with :blue_heart: by shopware AG & Vue Storefront.
https://frontends.shopware.com
MIT License
345 stars 103 forks source link

Create endpoint with the list of plugins #254

Closed rmakara closed 4 years ago

elkmod commented 4 years ago

Create an endpoint / routine which dumps all the plugins (including their configuration) which are currently installed in Shopware, so that the PWA build process can pick up on these and integrate the plugins.

Proposal

  1. Create Symfony command bin/console plugin:dump-pwa. (Or even better: extend current bundle:dump command)
  2. Output will be something like (very close to current dump):
    [
        "SwagHelloDolly": {
            "basePath": "custom\/plugins\/SwagHelloDolly\/src\/,
            "technicalName": "swag-hello-dolly",
            "pwa": {
                "path": "Resources\/app\/pwa\/src",
                "entryFilePath": null,
                "webpack": null
            },
            "storefront": {
                "path": "Resources\/app\/storefront\/src",
                "entryFilePath": null,
                "webpack": null,
                "styleFiles": []
            }
        },
    ]
patzick commented 4 years ago

Hey, thanks for this proposal, here are my thoughts and questions

AD 1

Can this be triggered automatically after any plugin installation/uninstallation/config change? So whenever PWA will hit actual endpoint then it always is up to date.

AD 2

To have a complete understanding:

  1. The array is a list of PWA plugins, ordered that previous one can be overridden by others
  2. How does basePath tell us where to fetch resource? if it for example https://shopware-2.vuestorefront.io/custom/plugins/SwagHelloDolly/src?
  3. Could you describe path, entryFilePath and webpack?
  4. Does it have information about all files inside plugin?
  5. What endpoint URL do you see for this?
patzick commented 4 years ago

@elkmod I rethought that with #255 :) so basically if we have a path to every dump folder it is enough, I'm not sure how basePath is working here then. Additional question

  1. Where plugin config will be visible? (For example in RandomPictureCMSPlugin we could add settings for a category of these random images, like "cats", "dogs" etc. in admin panel)