lyra / plugin-sylius

MIT License
0 stars 0 forks source link

Add proper composer support #1

Closed pawel-holik-droptica closed 4 months ago

pawel-holik-droptica commented 5 months ago

Hi, I just wanted to ask you to add composer installation support. Either through Packagist or by adding a custom repositories key to the composer.json of the project. To make it work the repository has to have a proper composer.json file in its root folder.

Downloading ZIP files is not even close to modern standards and makes everyone's life harder.

For now, I had to do some hacks to use it with the composer (still better than the ZIP file) but this requires me manual mapping of the release to the project composer.json file so I need to check if there is a new version manually.

This is how I hacked this in my projects composer.json file

The autoload section

    "autoload": {
        "psr-4": {
            "App\\": "src/",
            "Lyranetwork\\Lyra\\": "vendor/lyra/plugin-sylius/LyranetworkLyra/src"
        }
    },

and the repositories section

    "repositories": [
        {
            "type": "package",
            "package": {
                "name": "lyra/plugin-sylius",
                "version": "v1.0.0",
                "type": "sylius-plugin",
                "source": {
                    "url": "https://github.com/lyra/plugin-sylius.git",
                    "type": "git",
                    "reference": "v1.0.0"
                }
            }
        }
    ]

And after this I can run

composer require lyra/plugin-sylius

but this will always download version tagged as v1.0.0 as this is how it is mapped (see keys version and reference).

GIMALima commented 4 months ago

Hello, Thank you for your contribution.

We added composer installation support in our latest version 1.1.0.

Best regards