hiqdev / asset-packagist

Asset Packagist
https://asset-packagist.org
BSD 3-Clause "New" or "Revised" License
247 stars 24 forks source link

Package not found #40

Closed LCSKJ closed 7 years ago

LCSKJ commented 7 years ago

I am including the following package

bower-asset/scriptaculous-bower

from bower through asset-packagist which used to work since today. Now it gives a message that the package exists but is rejected by composer. I stripped down the composer.json to

{
    "name": "test/test",
    "require": {
        "bower-asset/scriptaculous-bower": "^1.9"
    },
    "repositories": [{
    "type": "composer",
    "url": "https://asset-packagist.org"
    }]
}

When running composer install I am receiving the following error message

The requested package bower-asset/scriptaculous-bower ^1.9 exists as bower-asset/scriptaculous-bower[1.9.0, 1.8.1, dev-master] but these are rejected by your constraint.

This used to work before, if I change the requirement to ^1.8 it works and 1.8.1 is installed. The message is kinda weird because 1.9.0 is present and composer even knows about it. Not sure if it is a problem with asset-packagist, but nor the original bower package neither the entry at asset-packagist.org have changed lately.

SilverFire commented 7 years ago

The problem occurred because of the recent changes in #31 For 1.9.0 was generated the following: "version_normalized":"dev-1.9.0-dev" Reverting that change solved the problem. @edgardmessias

SilverFire commented 7 years ago

@edgardmessias do you know why $package->getVersion() returned this value?

edgardmessias commented 7 years ago

The problem occurs because of bower.json in the master contains version.

The code $repository->getPackages() return six packages:

Class Type Pretty Version Version
Fxp\Composer\AssetPlugin\Package\LazyCompletePackage 1.9.0 1.9.0.0
Fxp\Composer\AssetPlugin\Package\LazyCompletePackage 1.8.1 1.8.1.0
Composer\Package\AliasPackage 1.9.0 dev-1.9.0
Composer\Package\CompletePackage dev-master 9999999-dev
Composer\Package\AliasPackage 1.9.0 dev-1.9.0-dev
Composer\Package\CompletePackage dev-master 9999999-dev

The AliasPackage override LazyCompletePackage in loop

edgardmessias commented 7 years ago

If run composer show bower-asset/scriptaculous-bower -a show: versions : dev-master, 1.8.1, 1.9.0, but the 1.9.0 is dev-1.9.0-dev

That is, it is a BUG in fxp/composer-asset-plugin

ctrlaltca commented 7 years ago

Looks like https://asset-packagist.org/p/bower-asset/scriptaculous-bower/272df73d58bc6d747a9187005aff5cb61e0ddd304020286e3082092f551b26e6.json is still reporting version dev-1.9.0-dev:

{
  "packages": {
    "bower-asset/scriptaculous-bower": {
      "1.9.0": {
        "uid": 1331895,
        "name": "bower-asset/scriptaculous-bower",
        "version": "1.9.0",
        "version_normalized": "dev-1.9.0-dev",
        "type": "bower-asset",
edgardmessias commented 7 years ago

This change has not been for production.

@SilverFire @hiqsol , Do you have date to put this change into production?

SilverFire commented 7 years ago

No, it is not deployed yet. Will do it during day

hiqsol commented 7 years ago

Sorry, not today, still several things to do. But Wednesday definitively.

edgardmessias commented 7 years ago

@LCSKJ , it is ok now: https://asset-packagist.org/p/bower-asset/scriptaculous-bower/ac34c59c10c93006370ab249f4fc8e0498b22668662404d52f25dabe916223df.json

Thank's @hiqsol @SilverFire

LCSKJ commented 7 years ago

Thank you, works as expected.