taptapship / wiredep

Wire Bower dependencies to your source code.
MIT License
1.15k stars 142 forks source link

Issue with Polymer/paper-elements #198

Closed george-aprozeanu closed 9 years ago

george-aprozeanu commented 9 years ago

Hi,

I've ran into an issue with Polymer/paper-elements which depends on the whole list of components for polymer. However, itself doesn't have a main file which resolves, and the code skips it's dependency list.

I've commented out the return and it correctly pushes out the rest of the dependencies for me.

stephenplusplus commented 9 years ago

@CWSpear @ruyadorno what do you think about not requiring a component to have "main" defined before including its dependencies mains?

CWSpear commented 9 years ago

Hmm... that's mighty tricky as I would think that most cases, it is an issue if the base component (i.e. paper-elements) doesn't have a main, and we shouldn't just silently go about as if all was well.

Maybe allow the functionality (i.e. remove the return) but display a warning?

Or perhaps, can we handle these edge cases by using an override of an empty main and change the dep.main.length === 0 check to something like _.has(dep, 'main')?

stephenplusplus commented 9 years ago

@george-aprozeanu can you link to a specific bower package that doesn't define main? I'm poking around https://github.com/PolymerElements/ and found https://github.com/PolymerElements/paper-progress/blob/master/bower.json for example, which has a main.

Still need to fully think this one through, and would love to get more opinions.

// ping @addyosmani for the polymer stuff -- is it common for bower.json's to not define a main?

george-aprozeanu commented 9 years ago

https://github.com/PolymerElements/paper-elements/blob/master/bower.json

@stephenplusplus if you look in the bower it does mention a main, but its not physically there in the repo. I must have explained it wrong, its not about an undefined main but a wrong main.

However in both cases I think it should work by grabbing the deps. There seems to be nothing wrong with how they defined paper elements, its sort of a meta package.

stephenplusplus commented 9 years ago

Sorry, I'm catching on now.

I'm wondering why they include a main if it's a file that doesn't exist?

Either way, I think I agree that we should include dependencies regardless.

stephenplusplus commented 9 years ago

Fixed in 6fb88e0160274babba15a969b398a64d27750bda - thanks!