firstandthird / bower-files

Node lib to get a list of files from bower
1 stars 1 forks source link

Specs #1

Closed jgallen23 closed 10 years ago

jgallen23 commented 10 years ago

Overview: a library that will talk to bower and grab all of the files that you need for your app.

Usage:

var bowerFiles = require('bower-files');

bowerFiles(function(err, files) {
//array of all file paths, in order by dependency
//example that includes weekly
//files => ['/path/to/jquery.js', '/path/to/fidel.js', ..., '/path/to/weekly']
})

//just include filetype css (default: type: .js)
bowerFiles({ type: '.css' }, function(err, files) {});

//just grab deps for weekly
bowerFiles({ include: 'weekly', function(err, files) {
});

//grab all deps except jquery
bowerFiles({ exclude: 'jquery', function(err, files) {
});

some of the work is already done here: https://github.com/jgallen23/grunt-concat-bower/blob/master/tasks/concat_bower.js.

make sure it has tests

Antonio-Laguna commented 10 years ago

Should err be populated at some point? Or just fail silently?

jgallen23 commented 10 years ago

err could be if you try to include something that doesn't exist

Antonio-Laguna commented 10 years ago

Ok!

What happens if your dependencies doesn't have any main and hence, you fail getting the file?

jgallen23 commented 10 years ago

hmm. I think it should error. We should add support to pass in main files if the bower.json doesn't have it