component-builder
Advanced tools
Comparing version 0.0.2 to 0.0.3
0.0.3 / 2012-09-05 | ||
================== | ||
* add `devDependencies` support. Closes #10 | ||
0.0.2 / 2012-09-01 | ||
@@ -3,0 +8,0 @@ ================== |
@@ -50,2 +50,40 @@ | ||
/** | ||
* Enable "devDependencies" in the build. | ||
* | ||
* @api public | ||
*/ | ||
Builder.prototype.development = function(){ | ||
debug('dev dependencies enabled'); | ||
this.dev = true; | ||
}; | ||
/** | ||
* Check if this build has deps. | ||
* | ||
* @return {Boolean} | ||
* @api private | ||
*/ | ||
Builder.prototype.hasDependencies = function(){ | ||
var conf = this.conf; | ||
if (conf.dependencies) return true; | ||
if (this.dev && conf.devDependencies) return true; | ||
}; | ||
/** | ||
* Return dependencies. | ||
* | ||
* @return {Object} | ||
* @api private | ||
*/ | ||
Builder.prototype.dependencies = function(){ | ||
var conf = this.conf; | ||
var deps = conf.dependencies || {}; | ||
if (this.dev) merge(deps, conf.devDependencies || {}); | ||
return deps; | ||
}; | ||
/** | ||
* Lookup component `name` using `.paths` | ||
@@ -234,4 +272,4 @@ * and invoke `fn(err, dir)`. | ||
if (conf.dependencies) { | ||
Object.keys(conf.dependencies).forEach(function(dep){ | ||
if (self.hasDependencies()) { | ||
Object.keys(self.dependencies()).forEach(function(dep){ | ||
batch.push(function(done){ | ||
@@ -291,4 +329,4 @@ dep = dep.replace('/', '-'); | ||
// build dependencies | ||
if (conf.dependencies) { | ||
Object.keys(conf.dependencies).forEach(function(dep){ | ||
if (self.hasDependencies()) { | ||
Object.keys(self.dependencies()).forEach(function(dep){ | ||
dep = dep.replace('/', '-'); | ||
@@ -308,2 +346,3 @@ | ||
var builder = new Builder(dir, self); | ||
if (self.dev) builder.development(); | ||
builder.ignored = self.ignored; | ||
@@ -395,1 +434,15 @@ self.emit('dependency', builder); | ||
}; | ||
/** | ||
* Merge `b` into `a`. | ||
* | ||
* @param {Object} a | ||
* @param {Object} b | ||
* @return {Object} a | ||
* @api private | ||
*/ | ||
function merge(a, b) { | ||
for (var key in b) a[key] = b[key]; | ||
return a; | ||
} |
{ | ||
"name": "component-builder", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"description": "Component build tool", | ||
@@ -5,0 +5,0 @@ "keywords": ["component", "build"], |
@@ -1,2 +0,1 @@ | ||
# builder.js | ||
@@ -22,2 +21,6 @@ | ||
### Builder#development() | ||
Include development dependencies. | ||
### Builder#ignore(name, [type]) | ||
@@ -41,3 +44,3 @@ | ||
Copyright (c) 2012 TJ Holowaychuk <tj@vision-media.caa> | ||
Copyright (c) 2012 TJ Holowaychuk <tj@vision-media.ca> | ||
@@ -44,0 +47,0 @@ Permission is hereby granted, free of charge, to any person obtaining |
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
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
12193
388
62