ck86 / gulp-bower-files

Build gulp.src() of your bower packages main files.
80 stars 13 forks source link

Problem with your package.json / Gulp dependency #46

Closed jedrichards closed 10 years ago

jedrichards commented 10 years ago

Thanks for your work on this, this is a great module :)

I'm using your module outside of Gulp, which basically works fine, except for the fact that you list Gulp as a devDependency but then use it directly in index.js.

That means that when you npm install without having Gulp in your project your module errors out with Error: Cannot find module 'gulp'.

A quick fix for this would be to make Gulp a normal dependency in your project, which is technically correct since you're using it directly.

A better fix (IMO) would be to remove your dependency on Gulp all together. Since as far as I can tell the only thing you use from Gulp is gulp.src which is just an alias of the vinyl-fs src method:

https://github.com/gulpjs/gulp/blob/master/index.js#L25

So instead of pulling in all of Gulp, you could just use vinyl-fs directly.

I could make a PR for either of these solutions if you're in accord?

At the moment the module is unusable standalone.

ck86 commented 10 years ago

Thanks for your feedback and sorry for my delayed answer.

You are welcome to make a PR. Another option would be extract the lib/ directory to a node module, which can be use by any other module and this plugin just use it.

What do you think?

jedrichards commented 10 years ago

Yes, extracting the actual Bower related functionality into its own module is a nice idea. It feels like the "Node way" :)

I've not found any other module that works as well as this one for for just generating a list of Bower main files while maintaining order for dependencies so to have it on its own would be great. This module could then just become a very slim gulp wrapper.

Happy to help.

ck86 commented 10 years ago

Here is the new one: https://github.com/ck86/main-bower-files

I will deprecate this plugin if I made the new one "gulpfriendly".

jedrichards commented 10 years ago

That's great. We'll be using this right away in our build process. Thank you.