tgvashworth / cdnjs-transform

Transforms the CDNjs packages JSON into something more useful, extracting all assets and cleaning out the crap.
2 stars 9 forks source link

Dependency conflict #3

Open jackfranklin opened 10 years ago

jackfranklin commented 10 years ago

It's being caused by nicescroll and jquery.nicescroll.js:

Error: Conflicted 'jquery.nicescroll.js'. 'nicescroll' != 'jquery.nicescroll'.
    at /Users/jackfranklin/git/cdnjs-transform/index.js:83:13
    at Array.reduce (native)
    at processAssetFiles (/Users/jackfranklin/git/cdnjs-transform/index.js:57:22)
    at Array.reduce (native)
    at extractAssets (/Users/jackfranklin/git/cdnjs-transform/index.js:99:25)
    at Array.reduce (native)
    at processPackages (/Users/jackfranklin/git/cdnjs-transform/index.js:103:52)
    at module.exports (/Users/jackfranklin/git/cdnjs-transform/index.js:107:16)
    at Object.<anonymous> (/Users/jackfranklin/git/cdnjs-transform/example.js:4:37)
    at Module._compile (module.js:456:26)

Kind of not sure of the best way of fixing it?

jackfranklin commented 10 years ago

A hacky way to fix is just changing the bit that throws an error to:

    // If multiple libraries specific the same file, this will throw. Again,
    // this is weird dependency shit.
    if (package.name !== memo[name].root) {
      delete memo[name];
      return memo;
      // throw new Error(tmplt("Conflicted '{asset}'. '{package}' != '{root}'.", {
      //   asset: filename,
      //   package: package.name,
      //   root: memo[name].root
      // }));
    }

But that seems icky (but then again, this is all a bit icky), and right now this is causing Pulldown to be down :(

tgvashworth commented 10 years ago

I think figure out the problem and the 'right' behaviour in this case. Why is this happening? What would be the expected outcome?

I have next-to-no internet so can't check this stuff out properly :/

jackfranklin commented 10 years ago

So I think the problem here and why the module is erroring (although you wrote this, so feel free to correct me if I'm interpreting wrongly!) is that both the modules use the same filename screen shot 2014-06-21 at 18 27 23

Forgive me if I'm being stupid, but as the URLs are different, I don't see too much why this is a problem?

tgvashworth commented 10 years ago

Yup, that looks bang on. I think, instead of throwing, we should pick one – perhaps the longer – and go with it?

jackfranklin commented 10 years ago

Stupid Q, why can't we keep both?

jackfranklin commented 10 years ago

See #4