IchHabRecht / mask_export

Export your mask elements as extension
GNU General Public License v2.0
45 stars 27 forks source link

Version handling in composer.json #208

Closed dkoether closed 1 year ago

dkoether commented 1 year ago

Hello everyone,

when working with composer and an mask element extension exported by EXT:mask_export the version string in the composer.lock file is always the name of the current branch of the project repository because no real version number is given.

E.g.

{
     "name": "vendor/extension",
     "version": "dev-feature/some-temporary-feature-branch",
     [...]
}

To minimize the amount of changes in composer.lock when executing composer update I would like to define a real version number. 1.0.0 or even 0.1.0 (like ext_emconf.php) would be fine. What do you think?

Thanks in advance!

IchHabRecht commented 1 year ago

Hi @dkoether,

I don't see any problem with defining a version in your own composer.json for the export. Although I don't recommend to do so and I don't want to change the export at all. I would suggest to set a version number for your export package in the root composer.json.

    "repositories": {
        "0": {
            "type": "path",
            "url": "[the path to your local packages]/*",
            "options": {
                "versions": {
                    "[your namespace]/[your package name]": "0.1.0"
                }
            }
        },
    }
dkoether commented 1 year ago

Thank you, @IchHabRecht! I didn't know that overriding the version of a package is possible in the repositories section. This works for me 👍🏻

One further question: Are you planning to remove the version in general since ext_emconf.php is getting more and more exchanged by composer.json and even the Extension Manager is using the composer package version?

IchHabRecht commented 1 year ago

Hi @dkoether

with the current compatibility no updates are planned. And as said, I don't recommend a version in any composer.json and would always include it in the ext_emconf.php as far as this file is still supported.

dkoether commented 1 year ago

Hi @IchHabRecht, thank you for all the informations! I close the issue :)