fxpio / composer-asset-plugin

NPM/Bower Dependency Manager for Composer
MIT License
892 stars 156 forks source link

Overriding repository dependencies #176

Closed leandrogehlen closed 8 years ago

leandrogehlen commented 8 years ago

I have follow situation:

project: php-base - composer.json:

{
    "name": "leandrogehlen/php-base",
    "description": "Base project",    
    "minimum-stability": "dev",
    "require": {
        "bower-asset/select2": "dev-master"
    },    
    "extra": {
        "asset-repositories": [
            {
                "type": "bower-github",
                "url": "https://github.com/leandrogehlen/select2.git",
                "name": "bower-asset/select2"
            }
        ]
    }
}

When i run composer, he install the correct assets from overrided repository in this case https://github.com/leandrogehlen/select2.git.

But if i use the php-base in other project like:

project: php-other - composer.json

{
    "name": "leandrogehlen/php-other",
    "description": "Other project",   
    "repositories": [{
        "type": "vcs",
        "url": "https://github.com/leandrogehlen/php-base"
    }],
    "minimum-stability": "stable",
    "require": {
        "php": ">=5.4.0",
        "leandrogehlen/php-base": "dev-master"
    }
}

In this case the follow error occurs: bower-asset/select2 @dev -> no matching package found.

Seems that is ignored extra configurations from php-base

francoispluchino commented 8 years ago

Because the extra.asset-repositories option is only used in your root composer package, see the doc.

leandrogehlen commented 8 years ago

Ok, you are right doc:

Repositories are not resolved recursively.

But doesn't necessary to implement this feature?

francoispluchino commented 8 years ago

This is a limitation of Composer, not the plugin ... But it might be possible to do it anyway, the same way that the plugin create VCS Repositories for dependencies with the direct links (but I still doubt).

leandrogehlen commented 8 years ago

Ok, thanks, but my problem is solved. I will add the configurations in main project like you told me.

francoispluchino commented 8 years ago

Ok, cool :)