bless-brunch
Advanced tools
Comparing version 0.0.3 to 1.6.0
// Generated by CoffeeScript 1.6.2 | ||
var Bless, BlessCompiler; | ||
var BlessCompiler, bless, fs, sysPath, | ||
__bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }; | ||
Bless = require('bless'); | ||
bless = require('bless'); | ||
sysPath = require('path'); | ||
fs = require('fs'); | ||
module.exports = BlessCompiler = (function() { | ||
@@ -12,35 +17,45 @@ BlessCompiler.prototype.brunchPlugin = true; | ||
function BlessCompiler(config) { | ||
var _ref, _ref1, _ref2; | ||
var defaultOptions, _ref, _ref1, _ref2; | ||
this.config = config; | ||
this.options = (_ref = (_ref1 = this.config) != null ? (_ref2 = _ref1.plugins) != null ? _ref2.bless : void 0 : void 0) != null ? _ref : {}; | ||
this.minify = __bind(this.minify, this); | ||
defaultOptions = { | ||
cacheBuster: true, | ||
cleanup: true, | ||
compress: true, | ||
force: false, | ||
imports: true | ||
}; | ||
this.options = (_ref = (_ref1 = this.config) != null ? (_ref2 = _ref1.plugins) != null ? _ref2.bless : void 0 : void 0) != null ? _ref : defaultOptions; | ||
} | ||
BlessCompiler.prototype.minify = function(data, path, callback) { | ||
var parser; | ||
var parser, | ||
_this = this; | ||
parser = new Bless.Parser({ | ||
parser = new bless.Parser({ | ||
output: path, | ||
options: this.options | ||
}); | ||
return parser.parse(data, function(error, files, numSelectors) { | ||
var msg; | ||
return parser.parse(data, function(err, files, numSelectors) { | ||
var appCssFile, dir, file, filePath, _i, _len; | ||
if (err) { | ||
return callback(error, data); | ||
return callback(err, data); | ||
} else { | ||
msg = "Fount " + numSelectors + " selector"; | ||
if (numSelectors !== 1) { | ||
msg += "s"; | ||
appCssFile = null; | ||
for (_i = 0, _len = files.length; _i < _len; _i++) { | ||
file = files[_i]; | ||
filePath = sysPath.join(__dirname, "../../../" + file.filename); | ||
dir = sysPath.dirname(filePath); | ||
if (sysPath.basename(filePath, '.css') === 'app') { | ||
appCssFile = file; | ||
} else { | ||
if (!fs.existsSync(dir)) { | ||
fs.mkdirSync(dir); | ||
} | ||
fs.writeFileSync(filePath, file.content); | ||
} | ||
} | ||
msg += ", "; | ||
if (files.length > 1) { | ||
msg += "splitting into " + files.length + " files."; | ||
} else { | ||
msg += "not spliting."; | ||
} | ||
console.log(msg); | ||
return files.forEach(function(file) { | ||
return callback(error, file); | ||
}); | ||
return callback(err, appCssFile.content); | ||
} | ||
@@ -47,0 +62,0 @@ }); |
{ | ||
"name": "bless-brunch", | ||
"version": "0.0.3", | ||
"version": "1.6.0", | ||
"description": "Adds bless css support to brunch.", | ||
"author": "Via Response Technologies, Inc. (http://viaresponse.com)", | ||
"license": "BSD", | ||
"license": "MIT", | ||
"repository": { | ||
@@ -8,0 +8,0 @@ "type": "git", |
@@ -1,2 +0,36 @@ | ||
bless-brunch | ||
============ | ||
## bless-brunch | ||
Adds Bless support to [brunch](http://brunch.io). | ||
## Usage | ||
Install the plugin via npm with `npm install --save bless-brunch`. | ||
Or, do manual install: | ||
* Add `"bless-brunch": "x.y.z"` to `package.json` of your brunch app. | ||
Pick a plugin version that corresponds to your minor (y) brunch version. | ||
* If you want to use git version of plugin, add | ||
`"bless-brunch": "git+ssh://git@github.com/ThomasConner/bless-brunch.git"`. | ||
## License | ||
The MIT License (MIT) | ||
Copyright (c) 2012-2013 Paul Miller (http://paulmillr.com) | ||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
The above copyright notice and this permission notice shall be included in | ||
all copies or substantial portions of the Software. | ||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
THE SOFTWARE. |
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
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
Misc. License Issues
License(Experimental) A package's licensing information has fine-grained problems.
Found 1 instance in 1 package
No License Found
License(Experimental) License information could not be found.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
4022
0
0
54
1
36
1