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.8.3 to 0.9.0

9

History.md
0.9.0 / 2013-07-19
==================
* add support for building templates as strings
* add css transpiler example
* replace `fs-extra` with `cp`
* change Function()-evaled code to actually include newlines
* fix absolute path lookup problem #91
0.8.3 / 2013-06-06

@@ -3,0 +12,0 @@ ==================

46

lib/builder.js

@@ -6,5 +6,6 @@ /**

var fs = require('fs')
, cp = require('fs-extra').copy
, cp = require('cp')
, path = require('path')
, join = path.join
, resolve = path.resolve
, dirname = path.dirname

@@ -20,3 +21,4 @@ , Batch = require('batch')

, dirname = path.dirname
, basename = path.basename;
, basename = path.basename
, strtojs = require('string-to-js');

@@ -55,3 +57,4 @@ /**

images: [],
fonts: []
fonts: [],
templates: []
};

@@ -234,3 +237,3 @@

} else {
this.addLookup(join(this.dir, path));
this.addLookup(resolve(this.dir, path));
}

@@ -253,3 +256,3 @@

} else {
this.lookupPaths.push(join(this.dir, path));
this.lookupPaths.push(resolve(this.dir, path));
}

@@ -461,2 +464,3 @@

batch.push(this.buildScripts.bind(this));
batch.push(this.buildTemplates.bind(this));
batch.push(this.buildAliases.bind(this));

@@ -469,4 +473,11 @@ batch.push(this.buildStyles.bind(this));

if (err) return fn(err);
var scripts = res.shift();
var require = res.shift();
var templates = res.shift();
var custom = self._js;
var js = [scripts, require, templates, custom].filter(empty).join('\n')
fn(null, {
js: res.shift() + '\n' + res.shift() + '\n' + self._js,
js: js,
css: res.shift(),

@@ -565,7 +576,7 @@ images: res.shift(),

aliases = aliases.join('');
aliases = aliases.join('\n');
builder.buildAliases(function(err, str){
if (err) return done(err);
done(null, aliases + str);
done(null, aliases + '\n' + str);
});

@@ -605,3 +616,3 @@ });

return 'require.alias("' + name + '/' + b + '", "' + a + '");\n';
return 'require.alias("' + name + '/' + b + '", "' + a + '");';
};

@@ -819,2 +830,15 @@

/**
* Build templates and invoke `fn(err, str)`
*
* @param {Function} fn
* @api private
*/
Builder.prototype.buildTemplates = function(fn){
this.buildType('templates', fn, function(builder, file, str){
return register(builder, file, strtojs(str));
});
};
/**
* Build styles and invoke `fn(err, css)`.

@@ -921,4 +945,6 @@ *

if (builder.sourceUrls) {
js = JSON.stringify(js + '//@ sourceURL=' + file);
js = js.replace(/\\n/g, '\\n\\\n');
return 'require.register("' + file + '", Function("exports, require, module",\n'
+ JSON.stringify(js + '//@ sourceURL=' + file)
+ js
+ '\n));';

@@ -925,0 +951,0 @@ } else {

{
"name": "component-builder",
"version": "0.8.3",
"version": "0.9.0",
"description": "Component build tool",

@@ -16,3 +16,4 @@ "keywords": [

"better-assert": "~0.1.0",
"fs-extra": "~0.6.0"
"cp": "~0.1.0",
"string-to-js": "0.0.1"
},

@@ -22,3 +23,4 @@ "devDependencies": {

"should": "*",
"ejs": "~0.8.3"
"ejs": "~0.8.3",
"styl": "0.2.2"
},

@@ -25,0 +27,0 @@ "repository": {

@@ -65,3 +65,3 @@ # builder.js

## Hooks
### Builder#hook(name, fn)

@@ -72,2 +72,6 @@ A build "hook" is like an event that lets you manipulate the build in process. For

CSS pre-processors such as [rework](https://github.com/visionmedia/rework).
Available hooks are:
- `before scripts`
- `before styles`

@@ -74,0 +78,0 @@ ## Examples

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