fxpio / composer-asset-plugin

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

Add option for common dependency between npm and Bower #311

Closed MrPetovan closed 6 years ago

MrPetovan commented 6 years ago

We are using the composer-asset-plugin with much success so far at https://github.com/friendica/friendica, seamlessly mixing npm and Bower dependencies.

However, I'm currently about to import a second time jQuery 2.2.4 because Bower packages can't see that it's already available as an npm-asset. Would it be feasible to add a satisfies option to prevent Bower to import a duplicate dependency if it's already present as an npm-asset?

Something like:

{
    "config": {
        "fxp-asset": {
            "satisfies": {
                "npm-asset/jquery": "bower-asset/jquery"
            }
        }
    }
}

Additional information: We're using a common asset directory for both repositories.

francoispluchino commented 6 years ago

It will be very difficult. You can see the answer for the issue #312, and that even if we create a "package mock" for the bower dependencies, we're going to have trouble with the lock file, and the package installer of the Composer.

However, if you have a PR to propose, I'm interested.

MrPetovan commented 6 years ago

Ok, thanks, I didn't look at the code itself, I trust you about the difficulty of implementing it.