fengyuanchen / cropper

⚠️ [Deprecated] No longer maintained, please use https://github.com/fengyuanchen/jquery-cropper
MIT License
7.75k stars 1.74k forks source link

chore: add composer support #956

Closed Pascalmh closed 6 years ago

Pascalmh commented 6 years ago

This adds support for composer. Users can then install it via composer require fengyuanchen/cropper.

It has to be added to packagist.

fengyuanchen commented 6 years ago

Composer is dependency management for PHP, but this repo is a JavaScript library... So, I think it is not a good idea to add this config file.

Pascalmh commented 6 years ago

I wanted to add some more context to as why I opened the PR, but then I did not.

Anyway: I already use your great cropper in a PHP Project: https://github.com/blankogmbh/kirby-cropper

What it does is adding a new field to the admincenter of a Content Management System.

Now I want to make the live of the people who want to use my "kirby-cropper"-plugin as easy as possible and as an install instruction I want to just say composer require blankogmbh/kirby-cropper.

I know it sounds strange to have a PHP Dependency Manager in a JavaScript project but it would make my live so much easier.

The only thing I could do otherwise would be to download the master-branch from the repository (no version control) or to run npm install cropper in the after script of composer install, this would add the need to have npm installed for PHP Developers (and also on their CI-Servers).

fengyuanchen commented 6 years ago

It seems composer require fengyuanchen/cropper (https://packagist.org/packages/fengyuanchen/cropper) will install a fork of this repo...

Pascalmh commented 6 years ago

@Scalar4eg seems to have added your package to packagist - source is still this repository. To get the tags working we would still need the composer.json in this repo, currently you can just download the master-branch via composer (so no versioning).

I do not know how you are managing releases but this would add the extra step to bump the version in the composer.json aswell I'm afraid.

fengyuanchen commented 6 years ago

Can the version field in the composer.json be removed? I found Bootstrap has a composer.json without version field.

Pascalmh commented 6 years ago

It is actually recommended to omit it - i did not know that!

https://getcomposer.org/doc/04-schema.md#version

I am updating the PR accordingly.

Pascalmh commented 6 years ago

Thank you, I asked the Mike (the one that added your repo to packagist back in 2014) to abandon the package (which hopefully makes you the new owner).