grunt-wiredep
Advanced tools
Comparing version 1.7.1 to 1.8.0
{ | ||
"name": "grunt-wiredep", | ||
"description": "Inject your Bower dependencies right into your HTML from Grunt.", | ||
"version": "1.7.1", | ||
"version": "1.8.0", | ||
"homepage": "http://stephenplusplus.github.io/grunt-wiredep", | ||
@@ -29,3 +29,2 @@ "author": { | ||
], | ||
"main": "Gruntfile.js", | ||
"engines": { | ||
@@ -39,5 +38,4 @@ "node": ">=0.8.0", | ||
"dependencies": { | ||
"wiredep": "~1.5.0", | ||
"bower-config": "~0.5.0" | ||
"wiredep": "^1.5.0" | ||
} | ||
} |
'use strict'; | ||
var bowerConfig = require('bower-config'); | ||
var fs = require('fs'); | ||
var path = require('path'); | ||
function wiredep(grunt) { | ||
grunt.registerMultiTask('wiredep', 'Inject all components in your HTML file.', function () { | ||
grunt.registerMultiTask('wiredep', 'Inject Bower components into your source code.', function () { | ||
this.requiresConfig(['wiredep', this.target, 'src']); | ||
var cwd = this.data.cwd || '.'; | ||
var options = this.data; | ||
options.bowerJson = _findBowerJSON(cwd); | ||
options.directory = _findBowerDirectory(cwd); | ||
options.src = grunt.file.expand(options.src); | ||
require('wiredep')(options); | ||
require('wiredep')(this.data); | ||
}); | ||
function _findBowerJSON(cwd) { | ||
var bowerJSON; | ||
var config = bowerConfig.read(cwd); | ||
['bower.json', 'component.json'].map(function (configFile) { | ||
return path.join(config.cwd, configFile); | ||
}).forEach(function (configFile) { | ||
if (!bowerJSON && fs.lstatSync(configFile).isFile()) { | ||
bowerJSON = JSON.parse(fs.readFileSync(configFile)); | ||
} | ||
}); | ||
return bowerJSON; | ||
} | ||
function _findBowerDirectory(cwd) { | ||
var config = bowerConfig.read(cwd); | ||
var directory = path.join(config.cwd, config.directory); | ||
if (!directory || !fs.lstatSync(directory).isDirectory()) { | ||
console.log( | ||
'Cannot find where you keep your Bower packages.' + | ||
'\n' + | ||
'\nWe tried looking for a `.bowerrc` file, but couldn\'t find a custom' + | ||
'\n`directory` property defined. We then tried `bower_components`, but' + | ||
'\nit looks like that doesn\'t exist either. As a last resort, we tried' + | ||
'\nthe pre-1.0 `components` directory, but that also couldn\'t be found.' + | ||
'\n' + | ||
'\nUnfortunately, we can\'t proceed without knowing where the Bower' + | ||
'\npackages you have installed are.' + | ||
'\n' | ||
); | ||
grunt.fail.fatal('No Bower components found.'); | ||
} | ||
return directory; | ||
} | ||
} | ||
module.exports = wiredep; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Trivial Package
Supply chain riskPackages less than 10 lines of code are easily copied into your own project and may not warrant the additional supply chain risk of an external dependency.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
2
1
5233
9802
8
1
+ Addedansi-regex@0.2.1(transitive)
+ Addedansi-styles@1.1.0(transitive)
+ Addedbalanced-match@1.0.2(transitive)
+ Addedbrace-expansion@1.1.11(transitive)
+ Addedchalk@0.5.1(transitive)
+ Addedconcat-map@0.0.1(transitive)
+ Addedescape-string-regexp@1.0.5(transitive)
+ Addedglob@4.5.3(transitive)
+ Addedhas-ansi@0.1.0(transitive)
+ Addedinflight@1.0.6(transitive)
+ Addedminimatch@2.0.10(transitive)
+ Addedminimist@1.2.8(transitive)
+ Addedonce@1.4.0(transitive)
+ Addedpropprop@0.3.1(transitive)
+ Addedstrip-ansi@0.3.0(transitive)
+ Addedsupports-color@0.2.0(transitive)
+ Addedthrough2@0.6.5(transitive)
+ Addedwiredep@1.8.6(transitive)
+ Addedwrappy@1.0.2(transitive)
+ Addedxtend@4.0.2(transitive)
- Removedbower-config@~0.5.0
- Removedansi-styles@0.1.2(transitive)
- Removedchalk@0.1.1(transitive)
- Removedhas-color@0.1.7(transitive)
- Removedlodash@1.3.1(transitive)
- Removedobject-keys@0.4.0(transitive)
- Removedthrough2@0.4.2(transitive)
- Removedwiredep@1.5.0(transitive)
- Removedxtend@2.1.2(transitive)
Updatedwiredep@^1.5.0