hiqdev / asset-packagist

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

asset-packagist conflicts with fxpio/composer-asset-plugin #72

Closed schmunk42 closed 6 years ago

schmunk42 commented 6 years ago

My composer plugins:

> composer global show
Changed current directory to /Users/tobias/.composer
fxp/composer-asset-plugin v1.4.1 NPM/Bower Dependency Manager for Composer

Problematic composer.json

{
    "require": {
        "dmstr/yii2-adminlte-asset": ">=2.0"
    },
    "repositories": [
      {
        "type": "composer",
        "url": "https://asset-packagist.org"
      }
    ]
}

Running

composer update -vvv

fails.

Running

composer update -vvv --no-plugins

works.

What also works is this:

{
    "require": {
        "dmstr/yii2-adminlte-asset": ">=2.0"
    }
}

The error

Adding VCS repository bower-asset/eve
Executing command (CWD): git clone --mirror 'https://github.com/DmitryBaranovskiy/eve.git' '/Users/tobias/.composer/cache/vcs/https---github.com-DmitryBaranovskiy-eve.git/'
Executing command (CWD): git clone --mirror 'git@github.com:DmitryBaranovskiy/eve.git' '/Users/tobias/.composer/cache/vcs/https---github.com-DmitryBaranovskiy-eve.git/'
Executing command (CWD): git --version

  [Composer\Repository\InvalidRepositoryException]                                                                                       
  No valid bower.json was found in any branch or tag of https://github.com/DmitryBaranovskiy/eve.git, could not load a package from it.                          

In version 2.0 of my package I had included bower-asset/admin-lte this was moved to a composer package from 2.1 on.

I can't really say why this is happening, but it's a strange edge case, when having ap and c-a-p running together.

See also

CC: @francoispluchino @samdark @cebe

hiqsol commented 6 years ago

Do you receive this error without asset-packagist?

cebe commented 6 years ago

In version 2.0 of my package I had included bower-asset/admin-lte this was moved to a composer package from 2.1 on.

but the composer package name is not bower-asset/admin-lte is it? it should not matter if it has a different name.

when having ap and c-a-p running together.

its not a good idea to do that...

schmunk42 commented 6 years ago

Do you receive this error without asset-packagist?

No, it's the second example without repositories. I only get the error, when using both.

its not a good idea to do that...

Yeah, might be, but the fact is that many people have a global installation of the plugin and you'd have to disable it manually or in composer.json in order to actually use asset-packagist. Normally the plugin takes precedence.

schmunk42 commented 6 years ago

@hiqsol You might have a look at the current json output of bower-asset/admin-lte from asset-packagist. And compare this with the output generated now by the asset plugin.

It's just an idea, but maybe this is related to some redirect which is resolved when using the plugin, but not when using static json files.

Related stuff from the web:

and800 commented 6 years ago

@schmunk42 it seems that if you want to use asset-packagist, you may simply disable asset plugin via your composer.json configuration: https://github.com/fxpio/composer-asset-plugin/blob/master/Resources/doc/index.md#disable-the-plugin

Upd: this hack requires composer asset plugin ≥ 1.3.0

Upd: wow, I just saw that Tobias had already stated this in the thread, but actually nobody paid attention to it 😃

samdark commented 6 years ago

@SilverFire, @hiqsol how about putting ↑ at the website?

hiqsol commented 6 years ago

PR?

and800 commented 6 years ago

@hiqsol gonna do it tonight