Comparing version 0.1.7 to 0.1.8
@@ -1,2 +0,16 @@ | ||
exports.COA = require('coa').Cmd() | ||
function beautifiersOpt() { | ||
this.opt() | ||
.name('beautifiers').title('Local or global path to beautifier module, can be used many times') | ||
.short('b').long('beautifier') | ||
.arr() | ||
.req() | ||
.val(function(b) { | ||
return typeof b == 'string' | ||
? require(b.match(/^\./) ? require('path').resolve(b) : b).KrasotaJS | ||
: b | ||
}) | ||
.end() | ||
} | ||
var COA = exports.COA = require('coa').Cmd() | ||
.name('krasota').helpful() | ||
@@ -22,11 +36,3 @@ .opt() | ||
.end() | ||
.opt() | ||
.name('beautifiers').title('Local or global path to beautifier module, can be used many times') | ||
.short('b').long('beautifier') | ||
.arr() | ||
.req() | ||
.val(function(b) { | ||
return require(b.match(/^\./) ? require('path').resolve(b) : b).KrasotaJS | ||
}) | ||
.end() | ||
.apply(beautifiersOpt) | ||
.act(function(options) { | ||
@@ -43,8 +49,12 @@ var K = require('./krasota'), | ||
output.write(K.matchTop( | ||
K.KrasotaJSSerializer, | ||
K.KrasotaJSBeautify( | ||
options.beautifiers, | ||
K.matchTop(K.KrasotaJSParser, input.join(''), 'tree')), | ||
'serialize')); | ||
try { | ||
output.write(K.matchTop( | ||
K.KrasotaJSSerializer, | ||
K.KrasotaJSBeautify( | ||
options.beautifiers, | ||
K.matchTop(K.KrasotaJSParser, input.join(''), 'tree')), | ||
'serialize')); | ||
} catch(e) { | ||
console.log(e); | ||
} | ||
@@ -61,1 +71,27 @@ output === process.stdout ? | ||
}); | ||
COA.cmd() | ||
.name('recursive').helpful() | ||
.apply(beautifiersOpt) | ||
.opt() | ||
.name('backup').title('Saving backups with the specified extension. If a zero-length extension is given, no backup will be saved.') | ||
.long('backup') | ||
.req() | ||
.end() | ||
.opt() | ||
.name('ignore').title('Ignore mask (.gitignore-style).') | ||
.long('ignore').short('i') | ||
.arr() | ||
.end() | ||
.opt() | ||
.name('ignoreFile').title('File name for looking ignore masks (in addition with .krasotaignore).') | ||
.long('ignore-file') | ||
.arr() | ||
.end() | ||
.arg() | ||
.name('directory') | ||
//.arr() | ||
.def(process.cwd()) | ||
.end() | ||
.act(require('./recursive')(COA)) | ||
.end(); |
@@ -626,3 +626,3 @@ var ometajs_ = require("ometajs"); | ||
return this._atomic(function() { | ||
return this._match("g") || this._match("i") || this._match("m"); | ||
return this._rule("reFlags", false, [], null, this["reFlags"]); | ||
}); | ||
@@ -632,2 +632,6 @@ }) && (f = this._getIntermediate(), true) && this._exec([ "re", c, f ]); | ||
KrasotaJSParser.prototype["reFlags"] = function $reFlags() { | ||
return this._match("g") || this._match("i") || this._match("m"); | ||
}; | ||
KrasotaJSParser.prototype["block"] = function $block() { | ||
@@ -634,0 +638,0 @@ var c; |
{ | ||
"name": "krasota", | ||
"description": "Syntactic transformations of JavaScript code, with taking care of whitespaces and comments.", | ||
"version": "0.1.7", | ||
"version": "0.1.8", | ||
"homepage": "http://github.com/veged/krasota.js", | ||
"author": "Sergey Berezhnoy <veged@ya.ru> (http://github.com/veged)", | ||
"contributors": [ | ||
], | ||
"contributors": [], | ||
"repository": { | ||
@@ -24,3 +23,4 @@ "type": "git", | ||
"ometajs": "3.2.x", | ||
"eyes": "0.1.x" | ||
"eyes": "0.1.x", | ||
"ignore": "2.2.8" | ||
}, | ||
@@ -27,0 +27,0 @@ "devDependencies": { |
@@ -27,8 +27,7 @@ var UTIL = require('util'), | ||
input != serialize && | ||
FS.writeFileSync(testPrefix + '.result', serialize) | ||
OkOrNot( | ||
fileContent(testPrefix + '.expect', input) == serialize, | ||
testFile); | ||
input != serialize && | ||
FS.writeFileSync(testPrefix + '.result', serialize) | ||
}); | ||
@@ -69,4 +68,4 @@ | ||
str, | ||
'\033[m', | ||
'\033[m' | ||
].join(''); | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
213984
167
3576
0
5
17
+ Addedignore@2.2.8
+ Addedignore@2.2.8(transitive)