Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

component-builder

Package Overview
Dependencies
Maintainers
1
Versions
61
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

component-builder - npm Package Compare versions

Comparing version 0.0.2 to 0.0.3

5

History.md
0.0.3 / 2012-09-05
==================
* add `devDependencies` support. Closes #10
0.0.2 / 2012-09-01

@@ -3,0 +8,0 @@ ==================

61

lib/builder.js

@@ -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;
}

2

package.json
{
"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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc