ck86 / main-bower-files Goto Github PK
View Code? Open in Web Editor NEWGetting all main bower files
Getting all main bower files
I've setup my overrides object in bower.json as follows:
"overrides": {
"angular-resource": {
"dependencies": null,
"main": {
"dev": "angular-resource.js",
"prod": "angular-resource.min.js",
"test": "angular-resource.min.js"
}
},
"ionic": {
"dependencies": null,
"main": {
"dev": [
"release/js/ionic.bundle.js",
"release/fonts/*"
],
"prod": [
"release/js/ionic.bundle.min.js",
"release/fonts/*"
],
"test": [
"release/js/ionic.bundle.min.js",
"release/fonts/*"
]
}
}
},
And receive this error:
"overrides": {
"angular-resource": {
"dependencies": null,
"main": {
"dev": "angular-resource.js",
"prod": "angular-resource.min.js",
"test": "angular-resource.min.js"
}
},
"ionic": {
"dependencies": null,
"main": {
"dev": [
"release/js/ionic.bundle.js",
"release/fonts/*"
],
"prod": [
"release/js/ionic.bundle.min.js",
"release/fonts/*"
],
"test": [
"release/js/ionic.bundle.min.js",
"release/fonts/*"
]
}
}
},
If i simplify things, and just use main
without the env properties (dev
, prod
, test
) everything works fine.
"overrides": {
"angular-resource": {
"dependencies": null,
"main": "angular-resource.js"
},
"ionic": {
"dependencies": null,
"main": [
"release/js/ionic.bundle.js",
"release/fonts/*"
]
}
},
Twitter bootstrap bower package provides multiple main files from which some must be ignored, is there a way to do this ?
I can't seem to figure out how to get all bower files returned by main-bower-files() concatenated before my source JS files. Seems like you need to combine two gulp.src commands but I can't seem to find away to make it work right. I have tried event-stream merge, but it seems you cannot count on all bower files to precede the JS files since the merge pipes them into the src as them become available. Also tried gulp-order, but this doesn't seem to work with your plugin very well.
Any ideas on how best to ensure that all bower files will precede my JS source files in which are in a separate 'app' directory?
My gulpfile is configured to inject the css and js references into the index.html file. But i observed that the css file of angular-ui-grid package is not injected.
When i put a console.log(mainBowerFiles())
into the vendors task function in my gulpfile.js, following is sent to output:
[ 'bower_components/angular/angular.js',
'bower_components/angular-animate/angular-animate.js',
'bower_components/angular-route/angular-route.js',
'bower_components/angular-aria/angular-aria.js',
'bower_components/hammerjs/hammer.js',
'bower_components/angular-ui-grid/ui-grid.js',
'bower_components/angular-material/angular-material.js',
'bower_components/angular-material/angular-material.css' ]
I couldn't find out why angular-material.css
is available, but ui-grid.css
is not, even though all conditions (file existance, file types, mimetypes, encoding etc.) are same for those two packages.
Here is my bower.json:
{
"name": "userinterface",
"main": [
"/dist/userinterface.min.js",
"/dist/userinterface.min.css"
],
"version": "0.1.1",
"description": "TODO",
"authors": [
"TODO"
],
"ignore": [
"**/.*",
"package.json",
"klei.json",
"gulpfile.js",
"node_modules",
"bower_components",
"src"
],
"dependencies": {
"angular": "1.3.1",
"angular-animate": "1.3.1",
"angular-route": "1.3.1",
"angular-aria": "1.3.1",
"angular-material": "~0.4.2",
"angular-ui-grid": "~3.0.0-rc.12"
},
"devDependencies": {
"angular-mocks": "1.3.1"
},
"resolutions": {
"angular-animate": "1.3.1",
"angular-aria": "1.3.1",
"angular": "1.3.1"
}
Basically main-bower-files works just fine! Thank you guys!
But I've met a buggy situation. Lets say we have installed fontawesome bower component. Apart from CSS-files we have also font-files there that was copied, and it's good. But they were located in separate folder then CSS.
So, in resulting CSS-file we have removed bower_components, that's good, and mentioned files are also located there, but reference in CSS-file is still:
src: url('../fonts/fontawesome-webfont.eot?v=4.2.0');
Some packages depends on other libraries as well; These packages are also copied to bower_components
folder but when using main-bower-files
in conjunction with gulp-inject
, we have no holds of these extra libs
For instance, doing bower install angular-gridster --save
will install the package mentioned, as well as jquery-ui
and some other libs in the bower_components
folder.
main-bower-files
doesn't take jquery-ui
into account in that scenario
I added the overrides
property to my bower.json, but instead of overriding, it is ignoring the package entirely in the output.
{
"overrides": {
"kendo-ui-core": {
"main": {
"production": "src/js/kendo.ui.core.min.js"
"development": "src/js/kendo.ui.core.min.js"
}
}
}
}
PackageCollection add kendo-ui-core d:\Projects\frontend\app\bower_components\kendo-ui-core
Package overriding depedependencies kendo-ui-core undefined
Even copy/pasting the main
field from kendo-ui-core's .bower.json
file gives me the same result.
Also--is "overriding depdependencies" a typo? :)
Thanks
When invoking with a basepath
mainBowerFiles({ paths: 'path/for/project' });
an error is thrown:
Error: bower.json file does not exist at undefined
Maybe an older version of Node allowed you to set properties to strings, but it doesn't seem to be allowed in v0.10.28.
The dependency was added to the bower.json file and I also added the Override as follows ๐
But even after restarting my computer main-bower-files will not copy out to my destination. I even deleted my entire dest. folder and it replaced every other folder in my overides except angular-cookies. I have verified spelling and format with no resolution.
"overrides": {
"angular-cookies": {
"main": [
"./angular-cookies.js",
"./angular-cookies.min.js"
]
}
}
gulp-bower-files would preserve the directory structure. This was useful for css files that reference images. Can there be an option to achieve this?
Is there anyway we can add error handling to the checkExistence
option to provide a more useful message on what command to run if the file doesn't exist?
It should at least tell you whether or not it found overrides
in the bower.json
but ideally would give you loads of info.
It would be good if you could filter the type of file added to the files array ( say, for example, just css files). Currently i'm piping bowerfiles() into gulp-filter, but this would be nice built in functionality.
I've updated to this plugin, after using the deprecated one.
I though it would be simple to switch, but I'm getting some errors.
gulp version : CLI version 3.8.7
Local version 3.8.7
node version : v0.10.30
gulp.task("bower-move", function () {
return gulp.src(gulpBowerFiles({debugging: true}), {base: 'bower_components'})
.pipe(gulp.dest(bowerDestination));
})
Nothing is changed in bower.json
{
"name": "app-name",
"version": "0.0.0",
"authors": [
"Ivan <>"
],
"moduleType": [
"globals"
],
"license": "MIT",
"private": true,
"ignore": [
"**/.*",
"node_modules",
"bower_components",
"test",
"tests"
],
"devDependencies": {
"bootstrap-sass-official": "~3.2.0",
"bourbon": "3.1.8"
},
"dependencies": {
"normalize-css": "~3.0.1",
"velocity": "~0.9.0",
"animo.js": "*",
"pubsubjs": "~0.3.7",
"jquery-sticky": "*",
"bootstrap-sass": "~3.0.2"
},
"overrides": {
"bourbon": {
"main": [
"./app/assets/stylesheets/**/*"
]
},
"jquery": {
"main": [
""
]
},
"animo.js": {
"main": [
"animo.js"
]
},
"velocity": {
"main": [
"jquery.velocity.min.js"
]
}
}
}
This is the error I'm getting:
[gulp] 'bower-move' errored after 11 ms must provide pattern
app_root/node_modules/gulp/node_modules/orchestrator/index.js:153
throw err;
^
Error: must provide pattern
at new Glob (app_root/node_modules/main-bower-files/node_modules/glob/glob.js:134:11)
at glob (app_root/node_modules/main-bower-files/node_modules/glob/glob.js:60:11)
at Function.globSync [as sync] (app_root/node_modules/main-bower-files/node_modules/glob/glob.js:79:10)
at Object.<anonymous> (app_root/node_modules/main-bower-files/lib/package.js:139:31)
at Array.forEach (native)
at Object.Package.getFiles (app_root/node_modules/main-bower-files/lib/package.js:138:14)
at Object.<anonymous> (app_root/node_modules/main-bower-files/lib/package_collection.js:114:39)
at Array.forEach (native)
at Object.PackageCollection.process (app_root/node_modules/main-bower-files/lib/package_collection.js:113:15)
at Object.PackageCollection.getFiles (app_root/node_modules/main-bower-files/lib/package_collection.js:91:21)
I've been trying to get main-bower-files working with angular-ui-bootstrap and for some reason it seems to completely ignore that directory.
My task is similar to this
var bowerFiles = require('main-bower-files')
var files = bowerFiles() # called inside of a gulp task
console.log(files)
My bower file looks like this:
{
"name": "package",
"version": "0.0.0",
"dependencies": {
"json3": "~3.3.1",
"es5-shim": "~3.1.0",
"lodash": "~2.4.1",
"angular": "1.2.x",
"angular-animate": "1.2.x",
"angular-ui-bootstrap": "0.11.x",
"angular-cookies": "1.2.x",
"angular-ui-router": "0.2.x",
"angular-classy": "~0.4.2"
}
}
And My output from the console.log
is similar to this:
[ 'json3/lib/json3.js',
'es5-shim/es5-shim.js',
'lodash/dist/lodash.compat.js',
'angular/angular.js',
'angular-animate/angular-animate.js',
'angular-cookies/angular-cookies.js',
'angular-ui-router/release/angular-ui-router.js',
'angular-classy/angular-classy.js' ]
I've run it through debugging mode and gotten the following output
PackageCollection add angular-ui-bootstrap
But it never selects files from that directory.
All the resources are copied to the same folder, as a result, the folder structure are flattened.
It breaks the resource reference in font-awesome, or bootstrap.
some packages could share the same filename (index.js
)
would be cool if i could set the desired filename in bower.json
overrides section, like
{
"overrides" : {
"library" : {
"main" : {
"lib/index.js" : "more-meaningful-name.js"
}
}
}
}
Or I'm doing something wrong?
gulp.task('bowerStyles', function() {
gulp.src(mainBowerFiles({
filter: /\.js$/i,
debugging: true
}))
.pipe(gulp.dest(paths.styles.libs))
});
This gives me all the files, .js
and .css
.
I installed a bower package: bower install git://github.com/js-coder/cookie.js.git#gh-pages
This package is not picked up by "main-bower-files". Any ideas?
I also tried adding an override for it but still no go.
"cookie.js": {
"main": "cookie.js"
}
I have a gulp task:
gulp.task('bower-install', function(){
gulp.src('./public/index.html')
.pipe(inject(gulp.src(bowerFiles(), {read: false}), {name: 'bower'}))
.pipe(gulp.dest('./public/'))
})
where the folders are located in public/bower_components/
My issue is that when this gulp task injects the scripts it outputs /public/bower_components/angular-resource/angular-resource.js
where I'd like it to be bower_components/...
(no /public/
in the output)
Is there an option where I can change what the string paths look like?
When I add main-bower-files to my gulpfile, using your example:
gulp.task('bower', function() {
return gulp.src(mainBowerFiles())
.pipe(gulp.dest('lib'));
});
I am getting an "invalid glob argument".
Here's what it looks like.
Error: Invalid glob argument
at Gulp.src (/Users/bryce/repo/jf/client/node_modules/gulp/node_modules/vinyl-fs/lib/src/index.js:17:11)
at Gulp.<anonymous> (/Users/bryce/repo/jf/client/gulpfile.js:31:17)
at module.exports (/Users/bryce/repo/jf/client/node_modules/gulp/node_modules/orchestrator/lib/runTask.js:33:7)
at Gulp.Orchestrator._runTask (/Users/bryce/repo/jf/client/node_modules/gulp/node_modules/orchestrator/index.js:273:3)
at Gulp.Orchestrator._runStep (/Users/bryce/repo/jf/client/node_modules/gulp/node_modules/orchestrator/index.js:214:10)
at Gulp.Orchestrator.start (/Users/bryce/repo/jf/client/node_modules/gulp/node_modules/orchestrator/index.js:134:8)
at /usr/local/lib/node_modules/gulp/bin/gulp.js:121:20
at process._tickCallback (node.js:415:13)
at Function.Module.runMain (module.js:499:11)
at startup (node.js:119:16)
Any idea what's going on?
Thank you for writing this! Along with gulp-order, this is a very useful addition to my gulp setup.
Are there any plans to make 'main' configurable? It would be nice to be able to use this package to pull out stylesheets from installed packages.
If not, I'd be happy to write a PR when I get a free moment.
-R
If there is no file in bower_components folder it returns an Error: Invalid glob argument.
as in description, if .bowerrc
file exists and doesn't have "directory" defined, script will fail with:
TypeError: Arguments to path.join must be strings
at path.js:360:15
at Array.filter (native)
at Object.exports.join (path.js:358:36)
at module.exports (node_modules/main-bower-files/lib/index.js:33:42)
source:
opts.paths.bowerDirectory = path.join(opts.paths.bowerDirectory, "/", (JSON.parse(fs.readFileSync(opts.paths.bowerrc))).directory);
Happens to me when trying to use bower package ngAnimate-animate.css
which creates folder bower_components/animate.css
stream.js:94
throw er; // Unhandled stream error in pipe.
^
Error: EISDIR, open '/Users/oclement/Documents/phoenix/MedifastCerBrokenDown/MedifastWeb/build/WebContent/bower_components/animate.css'
I was using the gulp-bower-files package and kept getting the message that it was deprecated and I should be using this package instead. Unfortunately it doesn't seem to just be a simple replacement of the 2. Can you please add some details to the README that explains how to switch from gulp-bower-files to main-bower-files?
Here is a task I'm using with the gulp-bower-files:
gulp.task('fonts', function () {
var streamqueue = require('streamqueue');
return streamqueue({objectMode: true},
$.bowerFiles(),
gulp.src(['app/fonts/**/*', 'bower_components/foundation-icon-fonts/**/*'])
)
.pipe($.filter('**/*.{eot,svg,ttf,woff}'))
.pipe($.flatten())
.pipe(gulp.dest('dist/fonts'))
.pipe($.size());
});
You can create attributes on string object:
if (typeof opts.paths === 'string'){
opts.paths.bowerJson = path.join(opts.paths, defaults.paths.bowerJson);
opts.paths // => undefined;
}
So we can use for example bower.json file with comments and preprocess them with https://github.com/sindresorhus/gulp-strip-json-comments and pass the resulting stream to main-bower-files
If first argument is string
or array
(solution from previous issue) add this to filter
and use the second argument as options.
It could be elegant like gulp.src
Hey! I noticed that you've been using regular commit messages to keep track of versions, but that makes it virtually impossible to reference past versions in the codebase. It would be really helpful if you made a new git tag (or GitHub Release, as it makes a tag too) per version.
Thanks for making such a useful tool!
Hi @ck86 ,
I'm trying to solve this issue:
I need all less files from the bootstrap library to be selected (and then saved) so I used this override in my bower.json file:
"overrides": {
"bootstrap": {
"main": "*/.less"
}
}
The issue I have is that there are couples of files with the same name (like alert.less) situated in different folders.
Now I could probably use some filter and deal with the folders, but I don't want to be specific this way and expect particular folder structure in my gulpfile.
It would be far better if I could set destination folder structure somehow in the override section of my bower.json.
Any thoughts?
Both of these tasks:
gulp.task('mainbower-test', function(){
gulp.log(mainBower());
});
gulp.task('js-lib', function(){
return gulp.src(mainBower(), {main: 'src/bower_components/'})
.pipe(plumber({errorHandler: onError}))
.pipe(filter('*.js'))
.pipe(concat('main.js'))
.pipe(uglify())
.pipe(gulp.dest(paths.js.dest))
});
throw this error:
SyntaxError: Unexpected string
at Object.parse (native)
at Object.PackageCollection.collectPackages (/Users/mhallinan/Sites/gulp-test/node_modules/main-bower-files/lib/package_collection.js:72:30)
at Object.PackageCollection (/Users/mhallinan/Sites/gulp-test/node_modules/main-bower-files/lib/package_collection.js:29:10)
at module.exports (/Users/mhallinan/Sites/gulp-test/node_modules/main-bower-files/lib/index.js:60:22)
at Gulp.gulp.task.gulp.src.main (/Users/mhallinan/Sites/gulp-test/gulpfile.js:60:14)
at module.exports (/Users/mhallinan/Sites/gulp-test/node_modules/gulp/node_modules/orchestrator/lib/runTask.js:34:7)
at Gulp.Orchestrator._runTask (/Users/mhallinan/Sites/gulp-test/node_modules/gulp/node_modules/orchestrator/index.js:273:3)
at Gulp.Orchestrator._runStep (/Users/mhallinan/Sites/gulp-test/node_modules/gulp/node_modules/orchestrator/index.js:214:10)
at Gulp.Orchestrator.start (/Users/mhallinan/Sites/gulp-test/node_modules/gulp/node_modules/orchestrator/index.js:134:8)
at /usr/local/lib/node_modules/gulp/bin/gulp.js:129:20
Bower components directory has structure like this:
- bootstrap
-- dist
-- fonts
-- ...
- jquery
-- dist
-- src
How I can get files with saving structure folder like this:
vendors
- bootstrap
-- somefile.less
- jquery
-- jquery.js
Now I configure all but I get this:
vendors
- somefile.less
- jquery.js
I had checkExistence
and debugging
set to true
and all it showed was:
PackageCollection add domready src\embed\sidebar\third-party\domready
and then just returned an empty array.
Error: EISDIR, open '/Users/me/project/frontend/dist/local/bower_components/lunr.js'
lunr.js package isn't copying to my dist folder because it's got a dot in the folder name. This seems to be treating it as if it's a file when it tries to copy.
In the spirit of Gulp's preference for globs, the filter option should allow for a glob rather than (or in addition to) a regex.
I keep getting the following error
C:\Program Files\WAMP\www\gulp-starter>gulp bower
[11:36:55] Using gulpfile C:\Program Files\WAMP\www\gulp-starter\gulpfile.js
[11:36:55] Starting 'bower'...
[11:36:55] 'bower' errored after 1.65 ms
[11:36:55] Error: Invalid glob argument
at Gulp.src (C:\Users\com265\AppData\Roaming\npm\node_modules\gulp\node_modu
les\vinyl-fs\lib\src\index.js:17:11)
at Gulp.gulp.task.gulp.src.read (C:\Program Files\WAMP\www\gulp-starter\gulp
file.js:192:17)
at module.exports (C:\Users\com265\AppData\Roaming\npm\node_modules\gulp\nod
e_modules\orchestrator\lib\runTask.js:33:7)
at Gulp.Orchestrator._runTask (C:\Users\com265\AppData\Roaming\npm\node_modu
les\gulp\node_modules\orchestrator\index.js:273:3)
at Gulp.Orchestrator._runStep (C:\Users\com265\AppData\Roaming\npm\node_modu
les\gulp\node_modules\orchestrator\index.js:214:10)
at Gulp.Orchestrator.start (C:\Users\com265\AppData\Roaming\npm\node_modules
\gulp\node_modules\orchestrator\index.js:134:8)
at C:\Users\com265\AppData\Roaming\npm\node_modules\gulp\bin\gulp.js:126:20
at process._tickCallback (node.js:419:13)
at Function.Module.runMain (module.js:499:11)
at startup (node.js:119:16)
When I try and run gulp bower
var gulp = require('gulp'),
mainBowerFiles = require('main-bower-files');
gulp.task('bower', function(){
return gulp.src(mainBowerFiles())
.pipe(gulp.dest('app/scripts'))
;
});
With the following folder structure
/app
/scripts
/bower_components
bower.json
gulpfile.js
What am I doing wrong? I've also tried adding {base: 'bower_components'}
but the same error occurs.
In my case its always empty.
I have gulpfile.js in root of my project, and bower_components in this root. Maybe I'm doing something wrong, but I read your readme X times
Prior to 1.0.4 when invoking main-bower-files with default options the paths returned were relative to the current working direction. Now with 1.0.4 the paths returned are instead absolute. I'm not sure if this is by design, or due to a bug, but I wouldn't expect such changes from a bump of just the semver patch version. This broke our build process.
I'm having a dependency entry like "some-name": "ssh://[email protected]:443/user/reponame.git#~2.3.1-1234"
in bower.json
. With it, it fails with SyntaxError: unexpected string
, without all goes fine.
The line is a valid entry.
Full msg:
SyntaxError: Unexpected string
at Object.parse (native)
at Object.PackageCollection.collectPackages (/app/node_modules/main-bower-files/lib/package_collection.js:72:30)
at Object.PackageCollection (/app/node_modules/main-bower-files/lib/package_collection.js:29:10)
at module.exports (/app/node_modules/main-bower-files/lib/index.js:60:22)
at Object.<anonymous> (/app/test.coffee:2:9)
at Object.<anonymous> (/app/test.coffee:1:1)
at Module._compile (module.js:456:26)
Full (coffee) code to test it:
mainBowerFiles = require 'main-bower-files'
files = mainBowerFiles()
util = require 'util'
console.log util.inspect files
The order is really important if I am including files like the following
I would like to make sure angular is in the list before ui bootstrap. Is there a way I can do that?
Thanks.
Can't get gulp-sourcemaps to work with this.
Something is wrong with the paths/globs ... don't know gulp enough to figure it out myself.
Here is a task using mainBowerFiles and sourcemaps:
var gulp = require('gulp');
var mainBowerFiles = require('main-bower-files');
var concat = require('gulp-concat');
var sourcemaps = require( 'gulp-sourcemaps' );
var jsFilter = gulpFilter( '*.js' );
gulp.task( 'bower_js_dev', [ 'bower_install' ], function() {
var scripts = mainBowerFiles();
scripts.push( 'src/main.js' ); // Add local script
return gulp.src( scripts )
.pipe( jsFilter )
.pipe( sourcemaps.init( { loadMaps: true } ) )
.pipe( concat( 'scripts.js' ) )
.pipe( sourcemaps.write( './', { includeContent: true } ) )
.pipe( gulp.dest( 'public/js' ) );
} );
I get the following output during the build:
gulp-sourcemap-write: source file not found:/home/paul/src/bulb/bower_components/jquery/dist/angular.js
gulp-sourcemap-write: source file not found:/home/paul/src/bulb/bower_components/jquery/dist/angular-route.js
gulp-sourcemap-write: source file not found:/home/paul/src/bulb/bower_components/jquery/dist/angular-sanitize.js
gulp-sourcemap-write: source file not found:/home/paul/src/bulb/bower_components/jquery/dist/angular-resource.js
gulp-sourcemap-write: source file not found:/home/paul/src/bulb/bower_components/jquery/dist/jsoneditor.js
gulp-sourcemap-write: source file not found:/home/paul/src/bulb/bower_components/jquery/dist/bootstrap.js
gulp-sourcemap-write: source file not found:/home/paul/src/bulb/bower_components/jquery/dist/main.js
The resulting sourcemap is obviously wrong.
Tell me if you need more data.
Cheers
Pardon my ignorance here. Does this plugin support custom destination files? I know I can override the main and have custom Main package files like:
"overrides": {
"jquery": {
"main": "/dist/jquery."
}
}
This gives me 3 main files all nested under "dist" directory. I want to achieve something similar to "bower-installer" npm module wherein not only I can customize the main files from source package but also destination folder hierarchy. So in this example I can extract all files (3 in this example) under "js" sub-directory instead of "dist".
More easy to use multiple globs with filter
option.
This library wraps all actions
node-globule
I have to separate my bower dependencies in a couple of files, so it would be nice if I could have something like this:
var bower = require('main-bower-files');
gulp.task('lib1', function() {
return gulp.src(bower({whitelist: ['angular','jquery']}))
.pipe(concat('lib1.js'))
// ...
});
gulp.task('lib2', function() {
return gulp.src(bower({whitelist: ['pack1','pack2']}))
.pipe(concat('lib2.js'))
// ...
});
gulp.task('the-rest', function() {
return gulp.src(bower({blacklist: ['angular','jquery','pack1','pack2']}))
.pipe(concat('the-rest.js'))
// ...
});
The bootswatch bower.json does not have a main property, causing this error:
[17:58:37] Error: Main property of package "bootswatch" is missing.
at Object.Package.collectData (/home/user/Projects/myproject/myproject/node_modules/main-bower-files/lib/package.js:75:19)
at Object.Package (/home/user/Projects/myproject/myproject/node_modules/main-bower-files/lib/package.js:31:10)
at Object.PackageCollection.add (/home/user/Projects/myproject/myproject/node_modules/main-bower-files/lib/package_collection.js:53:32)
at Object.PackageCollection.collectPackages (/home/user/Projects/myproject/myproject/node_modules/main-bower-files/lib/package_collection.js:77:18)
at Object.PackageCollection (/home/user/Projects/myproject/myproject/node_modules/main-bower-files/lib/package_collection.js:28:10)
at module.exports (/home/user/Projects/myproject/myproject/node_modules/main-bower-files/lib/index.js:57:22)
at Gulp. (/home/user/Projects/myproject/myproject/gulpfile.js:28:21)
at module.exports (/home/user/Projects/myproject/myproject/node_modules/gulp/node_modules/orchestrator/lib/runTask.js:34:7)
a
Is there a way I can specify it to work on DEV only dependencies as specified in bower.json file?
Also, another one is the "paths" option throwing errors. I have a simple task:
gulp.task('main-bower-files', function () {
return gulp.src(mainBowerFiles({
paths: {
bowerDirectory: './bower_components', bowerrc: '.bowerrc', bowerJson: './bower-local/bower.json'
}
}))
.pipe(gulp.dest('./lib/'))
});
I have bower.json under bower-local folder instead of root.
How about includeSelf
option?
Like includeDev option, sometimes I want to include the main file of current project.
If you prefer that, I can create a PR :)
I used main-bower-files just fine in a previous angular project.. and now i was trying to use ionic.. so i started off using this start-up skeleton. Initially they saved all the bower components into the ./www/lib directory.. so i changed the contents of .bowerrc to
{
"directory": "bower_components"
}
instead.. and so after running bower install all the bower folders got installed in the ./bower_components directory
for reference this is the contents of my bower.json file:
{
"name": "HelloIonic",
"private": "true",
"devDependencies": {
"ionic": "driftyco/ionic-bower#1.0.0-beta.10",
"jquery": "~1.10.x",
"angular": "1.2.18",
"angular-sanitize": "1.2.5",
"angular-route": "1.2.5",
"angular-cookies": "1.2.5",
"angular-resource": "1.2.5",
"restangular": "1.4.0",
"angular-animate": "~1.2.x",
"angular-ui-slider": "~0.0.2",
"angular-google-maps": "https://github.com/nlaplante/angular-google-maps/archive/1832e420bd60d6f42c860f44ae40ccaf6e66aec8.zip",
"angular-easyfb": "~1.1.0",
"bootstrap-multiselect": "~0.9.x"
},
"resolutions": {
"angular-sanitize": "1.2.5",
"angular": "1.2.18",
"jquery": "~1.10.x"
}
}
I got this in my gulpfile.coffee
gulp.task 'bower_js', (done) ->
gulp.src(mainBowerFiles({debugging: true}), {base: './bower_components'})
but then I get this error when running gulp bower_js
:
[18:52:42] Using gulpfile ~/dev/js/beit_ionic/gulpfile.js
[18:52:42] Starting 'bower_js'...
[18:52:42] 'bower_js' errored after 1.12 ms
[18:52:42] Error: Invalid glob argument:
at Gulp.src (~/dev/js/beit_ionic/node_modules/gulp/node_modules/vinyl-fs/lib/src/index.js:19:11)
at Gulp.gulp.task.gulp.src.pipe.$.ngClassify.appName (/Users/abdullah/dev/js/beit_ionic/gulpfile.coffee:46:8)
at module.exports (/Users/abdullah/dev/js/beit_ionic/node_modules/gulp/node_modules/orchestrator/lib/runTask.js:34:7)
at Gulp.Orchestrator._runTask (/Users/abdullah/dev/js/beit_ionic/node_modules/gulp/node_modules/orchestrator/index.js:273:3)
at Gulp.Orchestrator._runStep (/Users/abdullah/dev/js/beit_ionic/node_modules/gulp/node_modules/orchestrator/index.js:214:10)
at Gulp.Orchestrator.start (/Users/abdullah/dev/js/beit_ionic/node_modules/gulp/node_modules/orchestrator/index.js:134:8)
at /usr/local/lib/node_modules/gulp/bin/gulp.js:121:20
at process._tickCallback (node.js:415:13)
at Function.Module.runMain (module.js:499:11)
at startup (node.js:119:16)
at node.js:902:3
the thing is i don't even get any debugging output before it crashes although i put the debbuging:true
flag.. any ideas why?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.