Comparing version
@@ -35,17 +35,22 @@ var fs = require('fs'); | ||
var cp = require('child_process'); | ||
var child = cp.fork(path.resolve(__dirname, '../server/app.js')); | ||
var child = cp.fork(path.resolve(__dirname, '../server/app.js'), [], { | ||
env : { | ||
'NODE_ENV': 'production' | ||
} | ||
}); | ||
var url = 'http://127.0.0.1:8765'; | ||
console.log('正在打开浏览器'); | ||
setTimeout(function () { | ||
switch (os.platform()) { | ||
case 'win32': | ||
console.log('正在打开浏览器'); | ||
cp.exec('start ' + url); | ||
break; | ||
case 'darwin': | ||
console.log('正在打开浏览器'); | ||
cp.exec('open ' + url); | ||
break; | ||
default: | ||
console.log('please open %s in your web broswer', url); | ||
console.log('请在你的浏览器中打开 %s', url); | ||
} | ||
}, 2000) | ||
}, 1000) | ||
@@ -52,0 +57,0 @@ }, |
@@ -31,3 +31,3 @@ var path = require('path'); | ||
} | ||
if (stat.isDirectory()) { | ||
if (stat.isDirectory() && p !== '.svn') { | ||
listdir(abs, callback); | ||
@@ -345,4 +345,4 @@ } else { | ||
var paths = paths.filter(function (p) { | ||
if (excludes){ | ||
for(var i =0; i < excludes.length; i++ ) { | ||
if (excludes) { | ||
for (var i = 0; i < excludes.length; i++ ) { | ||
var reg = excludes[i]; | ||
@@ -363,2 +363,3 @@ if (reg.test && reg.test(p)) { | ||
} | ||
async.forEach(paths, function (filepath, callback) { | ||
@@ -365,0 +366,0 @@ filepath = path.resolve(src_path, filepath); |
@@ -13,3 +13,2 @@ var ModuleComplier = require('tbuild').ModuleComplier; | ||
return function (page, next) { | ||
console.log('plugin:common-module-compiiler'); | ||
var packages = [ | ||
@@ -16,0 +15,0 @@ { |
@@ -18,3 +18,4 @@ var CssCombo = require('css-combo'); | ||
base: '.', | ||
compress: 0 | ||
compress: false, | ||
debug: false | ||
}, config); | ||
@@ -77,3 +78,3 @@ | ||
outputEncoding: page.charseet, | ||
debug: page.debug, | ||
debug: config.debug, | ||
output: path.resolve(buildBase, file), | ||
@@ -80,0 +81,0 @@ compress: config.compress |
@@ -18,2 +18,3 @@ /* | ||
var cssMinReg = /-min\.js$/i; | ||
var fileList = []; | ||
fu.findInDir(dir, cssReg, function (err, files) { | ||
@@ -31,2 +32,3 @@ if (err) { | ||
var dest = path.resolve(dir, file.replace(cssReg, '-min.css')); | ||
fileList.push(file); | ||
@@ -46,3 +48,8 @@ fs.stat(dest, function(err, stat) { | ||
}); | ||
}, callback); | ||
}, function (err) { | ||
if (err) { | ||
return callback(err); | ||
} | ||
callback(null, fileList); | ||
}); | ||
}); | ||
@@ -70,6 +77,7 @@ }; | ||
build_dir(destDir, function (err) { | ||
build_dir(destDir, function (err, files) { | ||
if (err) { | ||
return next(err); | ||
} | ||
reports.files = files; | ||
next(null, reports); | ||
@@ -76,0 +84,0 @@ }); |
@@ -5,3 +5,3 @@ { | ||
"description": "build front project", | ||
"version": "0.4.3", | ||
"version": "0.4.4", | ||
"repository": { | ||
@@ -8,0 +8,0 @@ "type": "git", |
@@ -19,3 +19,3 @@ | ||
app.use(express.favicon()); | ||
app.use(express.logger('dev')); | ||
// app.use(express.logger('dev')); | ||
app.use(express.bodyParser()); | ||
@@ -25,2 +25,3 @@ app.use(express.methodOverride()); | ||
var rootDir = req.param('root'); | ||
if (!rootDir) { | ||
@@ -30,3 +31,3 @@ next(); | ||
} | ||
console.log(rootDir) | ||
App.getApp(rootDir, function (err, app) { | ||
@@ -48,3 +49,2 @@ if (err) { | ||
}); | ||
app.param('pageVersion', function (req, res, next, pageVersion) { | ||
@@ -76,2 +76,3 @@ var fbapp = req.fbapp; | ||
app.post('/add-page', routes.addPage); | ||
app.locals({ | ||
@@ -78,0 +79,0 @@ getUrl: function (path, obj) { |
@@ -1,2 +0,2 @@ | ||
KISSY.add(function (S, Template, fb_tpl, wrap_tpl, plugin_tpl, csslint_tpl, kissy_template_tpl, uglifyjs_tpl) { | ||
KISSY.add(function (S, Template, fb_tpl, wrap_tpl, plugin_tpl, csslint_tpl, kissy_template_tpl, uglifyjs_tpl, cssmin_tpl) { | ||
var $ = S.all; | ||
@@ -39,3 +39,3 @@ | ||
var html = Reporter.template_wrap.render(outputs); | ||
var html = Reporter.wrap_tpl.render(outputs); | ||
@@ -53,9 +53,12 @@ var reports = self.$el.all('.report'); | ||
'csslint': function (report) { | ||
return Reporter.template_csslint.render(report); | ||
return Reporter.csslint_tpl.render(report); | ||
}, | ||
'kissy-template': function (report) { | ||
return Reporter.template_kissy_template.render(report); | ||
return Reporter.kissy_template_tpl.render(report); | ||
}, | ||
'uglifyjs': function (report) { | ||
return Reporter.template_uglifyjs.render(report); | ||
return Reporter.uglifyjs_tpl.render(report); | ||
}, | ||
'cssmin': function (report) { | ||
return Reporter.cssmin_tpl.render(report); | ||
} | ||
@@ -66,3 +69,3 @@ }, | ||
fb: function (report) { | ||
return Reporter.template_fb.render(report); | ||
return Reporter.fb_tpl.render(report); | ||
}, | ||
@@ -73,3 +76,2 @@ | ||
var o = []; | ||
console.log(report); | ||
S.each(report, function (item) { | ||
@@ -79,4 +81,3 @@ var name = item.name; | ||
var content = render ? render(item) : ''; | ||
console.log(name) | ||
o.push(Reporter.template_plugin.render({ | ||
o.push(Reporter.plugin_tpl.render({ | ||
name: name, | ||
@@ -91,8 +92,9 @@ content: content | ||
}, { | ||
'template_fb' : Template(fb_tpl.html), | ||
'template_plugin': Template(plugin_tpl.html), | ||
'template_wrap': Template(wrap_tpl.html), | ||
'template_csslint': Template(csslint_tpl.html), | ||
'template_kissy_template': Template(kissy_template_tpl.html), | ||
'template_uglifyjs': Template(uglifyjs_tpl.html) | ||
'fb_tpl' : Template(fb_tpl.html), | ||
'plugin_tpl': Template(plugin_tpl.html), | ||
'wrap_tpl': Template(wrap_tpl.html), | ||
'csslint_tpl': Template(csslint_tpl.html), | ||
'kissy_template_tpl': Template(kissy_template_tpl.html), | ||
'uglifyjs_tpl': Template(uglifyjs_tpl.html), | ||
'cssmin_tpl': Template(cssmin_tpl.html) | ||
}); | ||
@@ -108,5 +110,6 @@ return Reporter; | ||
'page/template/report-kissy-template.tpl', | ||
'page/template/report-uglifyjs.tpl' | ||
'page/template/report-uglifyjs.tpl', | ||
'page/template/report-cssmin.tpl', | ||
] | ||
}); |
KISSY.add(function(){ | ||
return {"html":"<h4>file list</h4>\n<ul>\n {{#each files as file}}\n <li>\n {{file}}\n </li>\n {{/each}}\n</ul>\n<div class='plugin-build-info'>\n 用时 {{used_time}} ms\n</div>"}; | ||
return {"html":"<h4>处理文件列表:</h4>\n{{#if !files.length}}\n <div>\n 没有文件\n </div>\n{{#else}}\n <ul class=\"plugin-file-list\">\n {{#each files as file}}\n <li>\n <i class=\"icon-file\"></i> {{file}}\n </li>\n {{/each}}\n </ul>\n{{/if}}\n<div class='plugin-build-info'>\n 用时 {{used_time}} ms\n</div>"}; | ||
}); |
KISSY.add(function(){ | ||
return {"html":"<div class=\"report-plugin-item\">\n <div class=\"report-plugin-item-hd\">\n <h4>{{#if content}}<i class=\"icon-file\"></i>{{/if}}{{name}}</h4>\n </div>\n {{#if content}}\n <div class='report-plugin-item-bd'>{{content}}</div>\n {{/if}}\n</div>"}; | ||
return {"html":"<div class=\"report-plugin-item\">\n <div class=\"report-plugin-item-hd{{#if content}} report-plugin-hd-has-content{{/if}}\">\n <h4>{{name}}</h4>\n </div>\n {{#if content}}\n <div class='report-plugin-item-bd'>{{content}}</div>\n {{/if}}\n</div>"}; | ||
}); |
KISSY.add(function(){ | ||
return {"html":"<h4>file list</h4>\n<ul>\n {{#each files as file}}\n <li>\n {{file}}\n </li>\n {{/each}}\n</ul>\n<div class='plugin-build-info'>\n 用时 {{used_time}} ms\n</div>"}; | ||
return {"html":"<h4>处理文件列表:</h4>\n{{#if !files.length}}\n <div>\n 没有文件\n </div>\n{{#else}}\n <ul class=\"plugin-file-list\">\n {{#each files as file}}\n <li>\n <i class=\"icon-file\"></i> {{file}}\n </li>\n {{/each}}\n </ul>\n{{/if}}\n<div class='plugin-build-info'>\n 用时 {{used_time}} ms\n</div>"}; | ||
}); |
{ | ||
"build_version": "1.0", | ||
"build_start_time": "2012-07-31T00:31:15.557Z", | ||
"build_timestamp": 20120722, | ||
"build_used_time": 152 | ||
"build_start_time": "2012-08-02T03:04:35.531Z", | ||
"build_timestamp": "20120722", | ||
"build_used_time": 136 | ||
} |
@@ -1,1 +0,1 @@ | ||
KISSY.add("utils/build-page",function(a){function c(){var c=b(".fb-build-page"),d=this;c.on("click",function(c){c.preventDefault();var e=b(c.target),f=e.siblings(".status"),g=e.siblings("input");f.html("building...");var h=g.val();a.ajax({url:e.attr("href"),data:{timestamp:h},dataType:"json",success:function(a){if(a.err){var b=a.err;f.html("Error:"+b.message);return}f.html("success!"),setTimeout(function(){f.html("")},2e3),a.reports&&d.fire("report",{reports:a.reports})}})})}var b=a.all;return a.extend(c,a.Base),new c}),KISSY.add("utils/calendar-init",function(a,b,c){var d=a.all;return{init:function(e){var f=new c.Popup({width:192});f.render();var g=(new b(f.get("contentEl"))).on("select",function(b){this.targetInput&&d(this.targetInput).val(a.Date.format(b.date,"yyyymmdd")),f.hide()});d(e.triggers).on("click",function(a){f.show();var b=d(a.target);f.align(b,["bl","tl"]),g.targetInput=b}),d("body").on("mousedown",function(a){f.get("contentEl").contains(a.target)||f.hide()})}}},{requires:["calendar","overlay","calendar/assets/base.css"]}),KISSY.add("page/mods/reporter",function(a,b,c,d,e,f,g,h){var i=a.all,j=function(b){var c=this;c.$el=i(b);if(!c.$el||!c.$el.length)throw new Error("container is not found");a.ready(function(){c.init()})};return a.extend(j,a.Base,{init:function(){var a=this;i("body").delegate("click",".report-plugin-item-hd",function(a){var b=i(a.currentTarget).siblings(".report-plugin-item-bd");b&&b.toggle()})},addReport:function(b){var c=this,d={};a.each(b,function(a,b){c.renderer[b]&&a&&(d[b]=c.renderer[b].call(c,a))});var e=j.template_wrap.render(d),b=c.$el.all(".report");b.length>0?i(e).insertBefore(b[0]):i(e).appendTo(c.$el)},pluginRenderer:{csslint:function(a){return j.template_csslint.render(a)},"kissy-template":function(a){return j.template_kissy_template.render(a)},uglifyjs:function(a){return j.template_uglifyjs.render(a)}},renderer:{fb:function(a){return j.template_fb.render(a)},plugins:function(b){var c=this,d=[];return console.log(b),a.each(b,function(a){var b=a.name,e=c.pluginRenderer[b]||null,f=e?e(a):"";console.log(b),d.push(j.template_plugin.render({name:b,content:f}))}),d.join("")}}},{template_fb:b(c.html),template_plugin:b(e.html),template_wrap:b(d.html),template_csslint:b(f.html),template_kissy_template:b(g.html),template_uglifyjs:b(h.html)}),j},{requires:["template","page/template/report-fb.tpl","page/template/report-wrap.tpl","page/template/report-plugin.tpl","page/template/report-csslint.tpl","page/template/report-kissy-template.tpl","page/template/report-uglifyjs.tpl"]}),KISSY.add("page/template/report-fb.tpl",function(){return{html:"<div class=\"report-fb\">\n <div class=\"row-fluid\">\n <dl class='span4'>\n <dt>\u7248\u672c</dt>\n <dd>{{build_version}}</dd>\n </dl>\n <dl class='span4'>\n <dt>\u6253\u5305\u65f6\u95f4\u6233</dt>\n <dd>{{build_timestamp}}</dd>\n </dl>\n <dl class='span4'>\n <dt>\u7528\u65f6</dt>\n <dd>{{build_used_time}}ms</dd>\n </dl>\n </div>\n</div>"}}),KISSY.add("page/template/report-wrap.tpl",function(){return{html:'<div class="report">\n <div class="report-hd">{{fb}}</div>\n <div class="report-bd">{{plugins}}</div>\n</div>'}}),KISSY.add("page/template/report-plugin.tpl",function(){return{html:'<div class="report-plugin-item">\n <div class="report-plugin-item-hd">\n <h4>{{#if content}}<i class="icon-file"></i>{{/if}}{{name}}</h4>\n </div>\n {{#if content}}\n <div class=\'report-plugin-item-bd\'>{{content}}</div>\n {{/if}}\n</div>'}}),KISSY.add("page/template/report-csslint.tpl",function(){return{html:"<div class=\"csslint-list\">\n {{#each lintReport as item}}\n <div class='csslint-list-item'>\n <h4 class='csslint-file'>{{item.file}}</h4>\n <p>{{item.fullpath}}</p>\n <pre>{{item.output}}</pre>\n </div>\n {{/each}}\n</div>\n<div class='plugin-build-info'>\n \u7528\u65f6 {{used_time}} ms\n</div>"}}),KISSY.add("page/template/report-kissy-template.tpl",function(){return{html:"<h4>file list</h4>\n<ul>\n {{#each files as file}}\n <li>\n {{file}}\n </li>\n {{/each}}\n</ul>\n<div class='plugin-build-info'>\n \u7528\u65f6 {{used_time}} ms\n</div>"}}),KISSY.add("page/template/report-uglifyjs.tpl",function(){return{html:"<h4>file list</h4>\n<ul>\n {{#each files as file}}\n <li>\n {{file}}\n </li>\n {{/each}}\n</ul>\n<div class='plugin-build-info'>\n \u7528\u65f6 {{used_time}} ms\n</div>"}}),KISSY.add("page/index",function(a,b,c,d){var e=a.all;a.ready(function(){var a=new d("#reports");b.on("report",function(b){a.addReport(b.reports)}),c.init({triggers:"input.timestamp-input"})})},{requires:["utils/build-page","utils/calendar-init","./mods/reporter"]}); | ||
KISSY.add("utils/build-page",function(a){function c(){var c=b(".fb-build-page"),d=this;c.on("click",function(c){c.preventDefault();var e=b(c.target),f=e.siblings(".status"),g=e.siblings("input");f.html("building...");var h=g.val();a.ajax({url:e.attr("href"),data:{timestamp:h},dataType:"json",success:function(a){if(a.err){var b=a.err;f.html("Error:"+b.message);return}f.html("success!"),setTimeout(function(){f.html("")},2e3),a.reports&&d.fire("report",{reports:a.reports})}})})}var b=a.all;return a.extend(c,a.Base),new c}),KISSY.add("utils/calendar-init",function(a,b,c){var d=a.all;return{init:function(e){var f=new c.Popup({width:192});f.render();var g=(new b(f.get("contentEl"))).on("select",function(b){this.targetInput&&d(this.targetInput).val(a.Date.format(b.date,"yyyymmdd")),f.hide()});d(e.triggers).on("click",function(a){f.show();var b=d(a.target);f.align(b,["bl","tl"]),g.targetInput=b}),d("body").on("mousedown",function(a){f.get("contentEl").contains(a.target)||f.hide()})}}},{requires:["calendar","overlay","calendar/assets/base.css"]}),KISSY.add("page/mods/reporter",function(a,b,c,d,e,f,g,h,i){var j=a.all,k=function(b){var c=this;c.$el=j(b);if(!c.$el||!c.$el.length)throw new Error("container is not found");a.ready(function(){c.init()})};return a.extend(k,a.Base,{init:function(){var a=this;j("body").delegate("click",".report-plugin-item-hd",function(a){var b=j(a.currentTarget).siblings(".report-plugin-item-bd");b&&b.toggle()})},addReport:function(b){var c=this,d={};a.each(b,function(a,b){c.renderer[b]&&a&&(d[b]=c.renderer[b].call(c,a))});var e=k.wrap_tpl.render(d),b=c.$el.all(".report");b.length>0?j(e).insertBefore(b[0]):j(e).appendTo(c.$el)},pluginRenderer:{csslint:function(a){return k.csslint_tpl.render(a)},"kissy-template":function(a){return k.kissy_template_tpl.render(a)},uglifyjs:function(a){return k.uglifyjs_tpl.render(a)},cssmin:function(a){return k.cssmin_tpl.render(a)}},renderer:{fb:function(a){return k.fb_tpl.render(a)},plugins:function(b){var c=this,d=[];return a.each(b,function(a){var b=a.name,e=c.pluginRenderer[b]||null,f=e?e(a):"";d.push(k.plugin_tpl.render({name:b,content:f}))}),d.join("")}}},{fb_tpl:b(c.html),plugin_tpl:b(e.html),wrap_tpl:b(d.html),csslint_tpl:b(f.html),kissy_template_tpl:b(g.html),uglifyjs_tpl:b(h.html),cssmin_tpl:b(i.html)}),k},{requires:["template","page/template/report-fb.tpl","page/template/report-wrap.tpl","page/template/report-plugin.tpl","page/template/report-csslint.tpl","page/template/report-kissy-template.tpl","page/template/report-uglifyjs.tpl","page/template/report-cssmin.tpl"]}),KISSY.add("page/template/report-fb.tpl",function(){return{html:"<div class=\"report-fb\">\n <div class=\"row-fluid\">\n <dl class='span4'>\n <dt>\u7248\u672c</dt>\n <dd>{{build_version}}</dd>\n </dl>\n <dl class='span4'>\n <dt>\u6253\u5305\u65f6\u95f4\u6233</dt>\n <dd>{{build_timestamp}}</dd>\n </dl>\n <dl class='span4'>\n <dt>\u7528\u65f6</dt>\n <dd>{{build_used_time}}ms</dd>\n </dl>\n </div>\n</div>"}}),KISSY.add("page/template/report-wrap.tpl",function(){return{html:'<div class="report">\n <div class="report-hd">{{fb}}</div>\n <div class="report-bd">{{plugins}}</div>\n</div>'}}),KISSY.add("page/template/report-plugin.tpl",function(){return{html:'<div class="report-plugin-item">\n <div class="report-plugin-item-hd{{#if content}} report-plugin-hd-has-content{{/if}}">\n <h4>{{name}}</h4>\n </div>\n {{#if content}}\n <div class=\'report-plugin-item-bd\'>{{content}}</div>\n {{/if}}\n</div>'}}),KISSY.add("page/template/report-csslint.tpl",function(){return{html:"<div class=\"csslint-list\">\n {{#each lintReport as item}}\n <div class='csslint-list-item'>\n <h4 class='csslint-file'>{{item.file}}</h4>\n <p>{{item.fullpath}}</p>\n <pre>{{item.output}}</pre>\n </div>\n {{/each}}\n</div>\n<div class='plugin-build-info'>\n \u7528\u65f6 {{used_time}} ms\n</div>"}}),KISSY.add("page/template/report-kissy-template.tpl",function(){return{html:'<h4>\u5904\u7406\u6587\u4ef6\u5217\u8868:</h4>\n{{#if !files.length}}\n <div>\n \u6ca1\u6709\u6587\u4ef6\n </div>\n{{#else}}\n <ul class="plugin-file-list">\n {{#each files as file}}\n <li>\n <i class="icon-file"></i> {{file}}\n </li>\n {{/each}}\n </ul>\n{{/if}}\n<div class=\'plugin-build-info\'>\n \u7528\u65f6 {{used_time}} ms\n</div>'}}),KISSY.add("page/template/report-uglifyjs.tpl",function(){return{html:'<h4>\u5904\u7406\u6587\u4ef6\u5217\u8868:</h4>\n{{#if !files.length}}\n <div>\n \u6ca1\u6709\u6587\u4ef6\n </div>\n{{#else}}\n <ul class="plugin-file-list">\n {{#each files as file}}\n <li>\n <i class="icon-file"></i> {{file}}\n </li>\n {{/each}}\n </ul>\n{{/if}}\n<div class=\'plugin-build-info\'>\n \u7528\u65f6 {{used_time}} ms\n</div>'}}),KISSY.add("page/template/report-cssmin.tpl",function(){return{html:'<h4>\u5904\u7406\u6587\u4ef6\u5217\u8868:</h4>\n{{#if !files.length}}\n <div>\n \u6ca1\u6709\u6587\u4ef6\n </div>\n{{#else}}\n <ul class="plugin-file-list">\n {{#each files as file}}\n <li>\n <i class="icon-file"></i> {{file}}\n </li>\n {{/each}}\n </ul>\n{{/if}}\n<div class=\'plugin-build-info\'>\n \u7528\u65f6 {{used_time}} ms\n</div>'}}),KISSY.add("page/index",function(a,b,c,d){var e=a.all;a.ready(function(){var a=new d("#reports");b.on("report",function(b){a.addReport(b.reports)}),c.init({triggers:"input.timestamp-input"})})},{requires:["utils/build-page","utils/calendar-init","./mods/reporter"]}); |
@@ -13,2 +13,3 @@ /* | ||
page/template/report-uglifyjs.tpl | ||
page/template/report-cssmin.tpl | ||
page/index | ||
@@ -95,3 +96,3 @@ | ||
requires: ['calendar', 'overlay', 'calendar/assets/base.css'] | ||
});KISSY.add('page/mods/reporter',function (S, Template, fb_tpl, wrap_tpl, plugin_tpl, csslint_tpl, kissy_template_tpl, uglifyjs_tpl) { | ||
});KISSY.add('page/mods/reporter',function (S, Template, fb_tpl, wrap_tpl, plugin_tpl, csslint_tpl, kissy_template_tpl, uglifyjs_tpl, cssmin_tpl) { | ||
var $ = S.all; | ||
@@ -134,3 +135,3 @@ | ||
var html = Reporter.template_wrap.render(outputs); | ||
var html = Reporter.wrap_tpl.render(outputs); | ||
@@ -148,9 +149,12 @@ var reports = self.$el.all('.report'); | ||
'csslint': function (report) { | ||
return Reporter.template_csslint.render(report); | ||
return Reporter.csslint_tpl.render(report); | ||
}, | ||
'kissy-template': function (report) { | ||
return Reporter.template_kissy_template.render(report); | ||
return Reporter.kissy_template_tpl.render(report); | ||
}, | ||
'uglifyjs': function (report) { | ||
return Reporter.template_uglifyjs.render(report); | ||
return Reporter.uglifyjs_tpl.render(report); | ||
}, | ||
'cssmin': function (report) { | ||
return Reporter.cssmin_tpl.render(report); | ||
} | ||
@@ -161,3 +165,3 @@ }, | ||
fb: function (report) { | ||
return Reporter.template_fb.render(report); | ||
return Reporter.fb_tpl.render(report); | ||
}, | ||
@@ -168,3 +172,2 @@ | ||
var o = []; | ||
console.log(report); | ||
S.each(report, function (item) { | ||
@@ -174,4 +177,3 @@ var name = item.name; | ||
var content = render ? render(item) : ''; | ||
console.log(name) | ||
o.push(Reporter.template_plugin.render({ | ||
o.push(Reporter.plugin_tpl.render({ | ||
name: name, | ||
@@ -186,8 +188,9 @@ content: content | ||
}, { | ||
'template_fb' : Template(fb_tpl.html), | ||
'template_plugin': Template(plugin_tpl.html), | ||
'template_wrap': Template(wrap_tpl.html), | ||
'template_csslint': Template(csslint_tpl.html), | ||
'template_kissy_template': Template(kissy_template_tpl.html), | ||
'template_uglifyjs': Template(uglifyjs_tpl.html) | ||
'fb_tpl' : Template(fb_tpl.html), | ||
'plugin_tpl': Template(plugin_tpl.html), | ||
'wrap_tpl': Template(wrap_tpl.html), | ||
'csslint_tpl': Template(csslint_tpl.html), | ||
'kissy_template_tpl': Template(kissy_template_tpl.html), | ||
'uglifyjs_tpl': Template(uglifyjs_tpl.html), | ||
'cssmin_tpl': Template(cssmin_tpl.html) | ||
}); | ||
@@ -203,3 +206,4 @@ return Reporter; | ||
'page/template/report-kissy-template.tpl', | ||
'page/template/report-uglifyjs.tpl' | ||
'page/template/report-uglifyjs.tpl', | ||
'page/template/report-cssmin.tpl', | ||
@@ -212,9 +216,11 @@ ] | ||
});KISSY.add('page/template/report-plugin.tpl',function(){ | ||
return {"html":"<div class=\"report-plugin-item\">\n <div class=\"report-plugin-item-hd\">\n <h4>{{#if content}}<i class=\"icon-file\"></i>{{/if}}{{name}}</h4>\n </div>\n {{#if content}}\n <div class='report-plugin-item-bd'>{{content}}</div>\n {{/if}}\n</div>"}; | ||
return {"html":"<div class=\"report-plugin-item\">\n <div class=\"report-plugin-item-hd{{#if content}} report-plugin-hd-has-content{{/if}}\">\n <h4>{{name}}</h4>\n </div>\n {{#if content}}\n <div class='report-plugin-item-bd'>{{content}}</div>\n {{/if}}\n</div>"}; | ||
});KISSY.add('page/template/report-csslint.tpl',function(){ | ||
return {"html":"<div class=\"csslint-list\">\n {{#each lintReport as item}}\n <div class='csslint-list-item'>\n <h4 class='csslint-file'>{{item.file}}</h4>\n <p>{{item.fullpath}}</p>\n <pre>{{item.output}}</pre>\n </div>\n {{/each}}\n</div>\n<div class='plugin-build-info'>\n 用时 {{used_time}} ms\n</div>"}; | ||
});KISSY.add('page/template/report-kissy-template.tpl',function(){ | ||
return {"html":"<h4>file list</h4>\n<ul>\n {{#each files as file}}\n <li>\n {{file}}\n </li>\n {{/each}}\n</ul>\n<div class='plugin-build-info'>\n 用时 {{used_time}} ms\n</div>"}; | ||
return {"html":"<h4>处理文件列表:</h4>\n{{#if !files.length}}\n <div>\n 没有文件\n </div>\n{{#else}}\n <ul class=\"plugin-file-list\">\n {{#each files as file}}\n <li>\n <i class=\"icon-file\"></i> {{file}}\n </li>\n {{/each}}\n </ul>\n{{/if}}\n<div class='plugin-build-info'>\n 用时 {{used_time}} ms\n</div>"}; | ||
});KISSY.add('page/template/report-uglifyjs.tpl',function(){ | ||
return {"html":"<h4>file list</h4>\n<ul>\n {{#each files as file}}\n <li>\n {{file}}\n </li>\n {{/each}}\n</ul>\n<div class='plugin-build-info'>\n 用时 {{used_time}} ms\n</div>"}; | ||
return {"html":"<h4>处理文件列表:</h4>\n{{#if !files.length}}\n <div>\n 没有文件\n </div>\n{{#else}}\n <ul class=\"plugin-file-list\">\n {{#each files as file}}\n <li>\n <i class=\"icon-file\"></i> {{file}}\n </li>\n {{/each}}\n </ul>\n{{/if}}\n<div class='plugin-build-info'>\n 用时 {{used_time}} ms\n</div>"}; | ||
});KISSY.add('page/template/report-cssmin.tpl',function(){ | ||
return {"html":"<h4>处理文件列表:</h4>\n{{#if !files.length}}\n <div>\n 没有文件\n </div>\n{{#else}}\n <ul class=\"plugin-file-list\">\n {{#each files as file}}\n <li>\n <i class=\"icon-file\"></i> {{file}}\n </li>\n {{/each}}\n </ul>\n{{/if}}\n<div class='plugin-build-info'>\n 用时 {{used_time}} ms\n</div>"}; | ||
});KISSY.add('page/index',function (S, pageBuilder, Calendar, Reporter) { | ||
@@ -221,0 +227,0 @@ var $ = S.all; |
@@ -239,4 +239,12 @@ var fs = require('fs'), | ||
}); | ||
}); | ||
it('should ignore file in .svn directory', function (done) { | ||
fu.findInDir(src, /svn[\/\\]file$/i, function(err, list){ | ||
if (err) { | ||
return done(err); | ||
} | ||
list.length.should.eql(0); | ||
done(); | ||
}); | ||
}); | ||
}); | ||
@@ -243,0 +251,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
939323
0.43%21028
0.11%144
-2.04%