Skip to content

Add support of dependencies resolution in the event of conflict #276

@francoispluchino

Description

@francoispluchino

Bower include a resolution section to solve the conflicts between 2 same dependencies but with different versions.

As for NPM, it is possible to install several versions of the same dependency by different dependencies, which is not the case for Bower and Composer. Only the installation of a single version compatible for all dependencies (flatten) is possible.

The dependency resolution would force (replace) a version or range version directly in the root Composer package.

Example:

    "name": "foo/bar",
    "require": {
        "bower-asset/jquery": "^2.2.0"
    }
    "name": "bar/baz",
    "require": {
        "bower-asset/jquery": "2.0.0"
    }
    "name": "root/package",
    "require": {
        "foo/bar": "^1.0.0",
        "bar/baz": "^1.0.0"
    }
    "config": {
        "fxp-asset": {
            "resolutions": {
                "bower-asset/jquery": "^2.2.4"
            }
        }
    }

Currently Composer throws an exception indicating that only one version of dependency (bower-asset/jquery) can be installed. With the config.fxp-asset.resolutions option, all range versions of bower-asset/jquery dependency are replaced by the value in the resolutions config (^2.2.4).

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions