buster-coffee
Advanced tools
Comparing version 0.1.0 to 0.1.1
@@ -0,4 +1,41 @@ | ||
var when = require("when"); | ||
var coffee = require("coffee-script"); | ||
function base64decode(input) { | ||
return new Buffer(input, 'base64').toString('utf-8'); | ||
} | ||
function compileCoffeeResource(resourceSet, coffeePath, jsPath) { | ||
var coffeeResource = resourceSet.get(coffeePath); | ||
resourceSet.addResource({ | ||
path: jsPath, | ||
content: function () { | ||
if (coffeeResource.encoding === 'base64') { | ||
return coffeeResource.content() | ||
.then(base64decode).then(coffee.compile); | ||
} else { | ||
return coffeeResource.content().then(coffee.compile); | ||
} | ||
} | ||
}); | ||
} | ||
module.exports = { | ||
coffee: require("./coffee"), | ||
extension: require("./extension") | ||
name: "buster-coffee", | ||
configure: function (config) { | ||
config.on("load:resources", function (resourceSet) { | ||
var paths = resourceSet.loadPath.paths(); | ||
resourceSet.loadPath.clear(); | ||
paths.forEach(function (path) { | ||
if (/\.coffee$/.test(path)) { | ||
var jsPath = path + ".js"; | ||
compileCoffeeResource(resourceSet, path, jsPath); | ||
resourceSet.loadPath.append(jsPath); | ||
} else { | ||
resourceSet.loadPath.append(path); | ||
} | ||
}); | ||
}); | ||
} | ||
}; |
{ | ||
"name": "buster-coffee", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"description": "Buster extension: Compiles CoffeeScript files before running tests", | ||
@@ -12,2 +12,3 @@ "homepage": "https://github.com/jodal/buster-coffee", | ||
"repository": { | ||
"type": "git", | ||
"url": "git://github.com/jodal/buster-coffee.git" | ||
@@ -14,0 +15,0 @@ }, |
@@ -39,3 +39,3 @@ # buster-coffee | ||
explictly looks for the files it will include on disk. Because of this, | ||
buster-coffee has limited use for Node.js developement in CoffeeScript. | ||
buster-coffee has limited use for Node.js development in CoffeeScript. | ||
@@ -45,2 +45,6 @@ | ||
### 0.1.1 (2012-05-20) | ||
- Use the coffee-script module's API instead of executing the `coffee` command. | ||
### 0.1.0 (2012-05-20) | ||
@@ -47,0 +51,0 @@ |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
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
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
58
0
9000
11
144