Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compatibility with Composer 2.0 #334

Open
cebe opened this issue Apr 15, 2020 · 25 comments
Open

Compatibility with Composer 2.0 #334

cebe opened this issue Apr 15, 2020 · 25 comments

Comments

@cebe
Copy link
Contributor

cebe commented Apr 15, 2020

Running composer 2.0 disabled the composer-asset-plugin:

The "fxp/composer-asset-plugin" plugin was skipped because it requires a Plugin API version ("^1.0") that does not match your Composer installation ("2.0.0"). You may need to run composer update with the "--no-plugins" option.

Here is the list of changes:

https://github.com/composer/composer/blob/master/UPGRADE-2.0.md#for-integrators-and-plugin-authors

@schmunk42
Copy link
Contributor

Bump, since composer 2 is the stable now.

@haohetao
Copy link

request support for composer 2.0

@encryptedroot
Copy link

I second (or "third" I guess?) this request

@samuelexyz
Copy link

request support for composer 2.0

@francoispluchino
Copy link
Member

Until the end of the year, it is very difficult for me to have time for my open source projects. So if you want to help, any contribution is welcome. Thanks

arjun024 added a commit to paketo-buildpacks/php-composer that referenced this issue Nov 5, 2020
paketo-bot pushed a commit to paketo-buildpacks/php-composer that referenced this issue Nov 5, 2020
@huaiguoguo
Copy link

when i am compose self-update --2
then i am exec "composer create-project --prefer-dist yiisoft/yii2-app-advanced ./"
its response "Could not find package yiisoft/yii2-app-advanced with stability stable."

@MrPetovan
Copy link

Hi, this question doesn't have anything to do with the composer-asset-plugin, please refer to the Composer documentation about package stability: https://getcomposer.org/doc/01-basic-usage.md#package-version-constraints

@sagittaracc
Copy link

How do I downgrade composer to 1.0?

@MrPetovan
Copy link

If you used composer selfupdate, you can revert to your previous bersion with composer selfupdate -r.

Otherwise, you can download the latest 1.x version from the official website: https://getcomposer.org/composer-1.phar

@wiltonlcsj
Copy link

Any news or date to merge this?

@MrPetovan
Copy link

No work has been done towards solving this issue yet.

@Insolita
Copy link

Insolita commented Jan 2, 2021

Does anyone work for solving this?

@MrPetovan
Copy link

Probably not.

@sagittaracc
Copy link

Fuck this!
Happy New Year guys 🥳

@philwolstenholme
Copy link

philwolstenholme commented Jan 3, 2021

Looks like Composer 2 support has already been added for the Foxy project which is the successor to this project:

fxpio/foxy#33

If you are a user of this package and need Composer 2 support then why not take a look at how the Foxy project fixed the issue and see if you can make the same changes for this project? Alternatively you could switch your projects to use to Foxy instead.

Either way, leaving entitled and rude comments like the one above won't help yourself or anyone else. Change and updates in open source projects usually comes from maintainers who are generous with their own time (for which we should be grateful), or from people fixing their own problems rather than complaining about them.

@francoispluchino
Copy link
Member

I will not note the relevance of certain comments, even if I can still understand the frustration that can cause. However I would like to thank @philwolstenholme for his reminder that a lot of projects like this one are managed by people in their spare time, and that there are no companies or larger projects to allow to allocate part of their resources to maintain the code. It is therefore only through personal motivation that leads these people to give of their personal time to maintain open source projects.

As indicated in one of my previous comments on this issue, my end of the professional year was very busy, and I still planned to take a day to try to make this plugin compatible with Composer 2. I would like to remind that it is indicated on the README, the following note:

Important:

The next major version of Composer Asset Plugin is so different, but also incompatible with the current version, that it became a new project named Foxy.

Foxy is the new way to manage the assets of PHP libraries, because it works nativelly with all the features of NPM or Yarn. However, this plugin will continue to be maintained by the community, without having new features.

You can read the reasons for this new version, or the difference between Foxy and Fxp Composer Asset Plugin, but also how does Foxy work.

This project is therefore maintained by contributors other than me, however, I understand that few people can contribute, because it takes a minimum of knowledge of the internal workings of Composer. It is for this reason that I still to contribute to this project (when I can), even if it is no longer used by any of my personal and professional projects. I just spent the day trying to make this plugin compatible with Composer 2, however, unlike Foxy, this plugin uses a lot more internal components, which makes the upgrade much more complex, especially since there have been many changes.

So I appreciate after spending a whole Sunday working for free for others instead of spending time with my family, to read this kind of comment. I understand that more and more contributors are detaching themselves from open source projects. Most of the time, contributing is in our DNA, and we keep ignoring that sort of thing, but it is certain that does not motivate us at all to give of our personal time. Thoughts can get heated in comments of issues when there is disagreement between developers on a project, but respect must always be present.

Frustration should therefore not lead people to be insulting, but more to have the will to technically understand a project, and try to contribute to it.

I take this opportunity to thank all the contributors who continue to maintain this small project, initially personal, even if it is recommended to switch to Foxy.

@WNYmathGuy
Copy link

If you used composer selfupdate, you can revert to your previous bersion with composer selfupdate -r.

Dude! You just rescued me again! What kind of gift should I send you? I got in a jamb by updating my Friendica badly (I went from 2020 09 to 2021 01 unknowingly skipping the December version).

php7.4 /home/outmathadmin/bin/composer install --no-dev
The "fxp/composer-asset-plugin" plugin was skipped because it requires a Plugin API version ("^1.0") that does not match your Composer installation ("2.0.0"). You may need to run composer update with the "--no-plugins" option.
Installing dependencies from lock file
Verifying lock file contents can be installed on current platform.
Your lock file does not contain a compatible set of packages. Please run composer update.

  Problem 1
    - fxp/composer-asset-plugin is locked to version v1.4.6 and an update of this package was not requested.
    - fxp/composer-asset-plugin v1.4.6 requires composer-plugin-api ^1.0 -> found composer-plugin-api[2.0.0] but it does not match the constraint.

You are using Composer 2, which some of your plugins seem to be incompatible with. Make sure you update your plugins or report a plugin-issue to ask them to support Composer 2.

That php7.4 /home/outmathadmin/bin/composer selfupdate -r command got it working again.

@MrPetovan
Copy link

Glad I could help you! And while it's irrelevant to this thread I'd like to point out that from version 2020.03 on, you can skip versions when updating Friendica.

@simialbi
Copy link

I tried to update it to get it running with composer v2: I had some success, so installing already works. But my knowledge of the internals of composer is not the same as the one from @francoispluchino. So it's in alpha stage:
https://github.com/simialbi/composer-asset-plugin

@simialbi
Copy link

simialbi commented Jul 20, 2022

Update: Update command does work too now. And i added Artifactory bower support (they have an own bower resolver) and a possibility to override npm registry url (e.g. to use with Artifactory)

@MrPetovan
Copy link

Thanks, I wasn't able to figure out how Foxy works with regard to our current workflow, so you might have saved us from deprecation hell.

@simialbi
Copy link

I've you'd like to give it a try, you can install it with composer global require simialbi/composer-asset-plugin:2.0.0-beta.2.

@MrPetovan
Copy link

Thanks!

@francoispluchino
Copy link
Member

@simialbi It's good news that you were able to take the time to evolve this plugin.

Small precision, this plugin is not deprecated, but as indicated, it is maintained by contributors other than me. Foxy remains another project which is effectively an evolution of the same need, but with other asset management tools.

I welcome any contributions that can benefit all users of this plugin, and therefore, do not hesitate to make a Pull Request if you wish. Of course, I always remain open to welcome new maintainers.

@MrPetovan
Copy link

I've you'd like to give it a try, you can install it with composer global require simialbi/composer-asset-plugin:2.0.0-beta.2.

Hmm, unfortunately it's PHP 8 minimum, this won't work with our project, but I appreciate you spearheading this initiative!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests