bower-shrinkwrap-resolver icon indicating copy to clipboard operation
bower-shrinkwrap-resolver copied to clipboard

Compatibility with third party resolvers

Open mhofman opened this issue 8 years ago • 1 comments

I can't seem to get this resolver to work with other resolvers, in particular bower-npm-resolver.

npm install --save-dev bower bower-npm-resolver bower-shrinkwrap-resolver

.bowerrc:

{
    "resolvers": [
        "bower-npm-resolver",
        "bower-shrinkwrap-resolver"
    ]
}

It doesn't matter if the resolvers are in the reverse order.

npm install --save npm:jquery npm:@angular/core

Neither package ends up in the bower-shrinkwrap.json.

In my opinion, bower-shrinkwrap should capture which version of the package was actually installed, and be able to restore that on future bower install.

mhofman avatar May 18 '16 18:05 mhofman

Hi Mathieu.

Yeah, bower-shrinkwrap-resolver doesn't play well with other resolvers. Unfortunately given current resolver API getting it work might be (quite) challenging. Each resolver has it's own idea of resolved version (take mercurial resolver for example). It should be relatively easy to get bower-shrinkwrap-resolver to work with bower-npm-resolver but getting a universal solution not so much.

My advice would be to use package.json for packages available on npm (which supports shrinkwrap out-of-the-box) and (over time) drop bower in favor of npm. This module was created to support our legacy codebases, we personally moved away from using bower a long time ago.

shyiko avatar May 18 '16 21:05 shyiko