* update deps
* use double quotes and fix warnings
This commit is contained in:
XhmikosR 2013-07-28 11:20:59 +03:00 committed by Daniel Marjamäki
parent 9ff204f8bc
commit 53bf8308fa
5 changed files with 39 additions and 35 deletions

View File

@ -1,9 +1,7 @@
{ {
"node" : true,
"browser" : false,
"bitwise": true, "bitwise": true,
"boss": true, "boss": true,
"browser": false,
"camelcase": true, "camelcase": true,
"curly": true, "curly": true,
"eqeqeq": true, "eqeqeq": true,
@ -11,8 +9,10 @@
"latedef": true, "latedef": true,
"multistr": true, "multistr": true,
"noarg": true, "noarg": true,
"node": true,
"noempty": true, "noempty": true,
"plusplus": false, "plusplus": false,
"quotmark": "double",
"regexp": true, "regexp": true,
"shelljs": true, "shelljs": true,
"strict": false, "strict": false,

View File

@ -1,5 +1,7 @@
/*! Inspired by: http://aboutcode.net/2010/11/11/list-github-projects-using-javascript.html */ /*! Inspired by: http://aboutcode.net/2010/11/11/list-github-projects-using-javascript.html */
/* jshint quotmark:true, jquery:true */
jQuery.fn.listCommits = function(username, repository, branch) { jQuery.fn.listCommits = function(username, repository, branch) {
this.html('<span>Querying GitHub for recent commits&hellip;</span>'); this.html('<span>Querying GitHub for recent commits&hellip;</span>');
@ -26,7 +28,7 @@ jQuery.fn.listCommits = function(username, repository, branch) {
}); });
function cutLines(message) { function cutLines(message) {
var lineFeed = message.indexOf("\n"); var lineFeed = message.indexOf('\n');
if (lineFeed > -1) { if (lineFeed > -1) {
return message.slice(0, lineFeed); return message.slice(0, lineFeed);

View File

@ -17,13 +17,13 @@
*/ */
(function () { (function () {
'use strict'; "use strict";
require('shelljs/make'); require("shelljs/make");
var fs = require('fs'), var fs = require("fs"),
cleanCSS = require('clean-css'), cleanCSS = require("clean-css"),
UglifyJS = require('uglify-js'), UglifyJS = require("uglify-js"),
ROOT_DIR = __dirname + '/'; // absolute path to project's root ROOT_DIR = __dirname + "/"; // absolute path to project's root
// //
// make minify // make minify
@ -35,9 +35,9 @@
// pack.css // pack.css
var inCss = cat(['css/all.css', var inCss = cat(["css/all.css",
'css/demo.css', "css/demo.css",
'css/normalize.css' "css/normalize.css"
]); ]);
var packCss = cleanCSS.process(inCss, { var packCss = cleanCSS.process(inCss, {
@ -45,16 +45,16 @@
keepSpecialComments: 0 keepSpecialComments: 0
}); });
fs.writeFileSync('css/pack.css', packCss, 'utf8'); fs.writeFileSync("css/pack.css", packCss, "utf8");
echo(); echo();
echo('### Finished' + ' ' + 'css/pack.css' + '.'); echo("### Finished" + " " + "css/pack.css" + ".");
echo(); echo();
echo("### Minifying js files..."); echo("### Minifying js files...");
var inJs = cat(['js/github.js', var inJs = cat(["js/github.js",
'js/picnet.table.filter.min.js']); "js/picnet.table.filter.min.js"]);
var minifiedJs = UglifyJS.minify(inJs, { var minifiedJs = UglifyJS.minify(inJs, {
compress: true, compress: true,
@ -63,10 +63,10 @@
warnings: false warnings: false
}); });
fs.writeFileSync('js/pack.js', minifiedJs.code, 'utf8'); fs.writeFileSync("js/pack.js", minifiedJs.code, "utf8");
echo(); echo();
echo('### Finished' + ' ' + 'js/pack.js' + '.'); echo("### Finished" + " " + "js/pack.js" + ".");
}; };

View File

@ -1,6 +1,6 @@
{ {
"name": "cppcheck-web", "name": "cppcheck-web",
"version": "0.1.1", "version": "0.1.2",
"author": "XhmikosR (https://github.com/XhmikosR)", "author": "XhmikosR (https://github.com/XhmikosR)",
"description": "The dependencies to build cppcheck's website", "description": "The dependencies to build cppcheck's website",
"homepage": "https://github.com/danmar/cppcheck", "homepage": "https://github.com/danmar/cppcheck",
@ -19,9 +19,9 @@
"lint": "node run-tests" "lint": "node run-tests"
}, },
"dependencies": { "dependencies": {
"clean-css": "~1.0.10", "clean-css": "~1.0.12",
"csslint": "~0.9.10", "csslint": "~0.9.10",
"jshint": "~2.1.4", "jshint": "~2.1.5",
"shelljs": "~0.1.4", "shelljs": "~0.1.4",
"uglify-js": "~2.3.6" "uglify-js": "~2.3.6"
}, },

View File

@ -18,25 +18,25 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
require('shelljs/global'); require("shelljs/global");
cd(__dirname); cd(__dirname);
// //
// JSHint // JSHint
// //
JSHINT_BIN = './node_modules/jshint/bin/jshint'; var jshintBin = "./node_modules/jshint/bin/jshint";
if (!test('-f', JSHINT_BIN)) { if (!test("-f", jshintBin)) {
echo('JSHint not found. Run `npm install` in the root dir first.'); echo("JSHint not found. Run `npm install` in the root dir first.");
exit(1); exit(1);
} }
if (exec('node' +' ' + JSHINT_BIN +' ' + 'make.js run-tests.js').code !== 0) { if (exec("node" + " " + jshintBin + " " + "make.js run-tests.js js/github.js").code !== 0) {
echo('*** JSHint failed! (return code != 0)'); echo("*** JSHint failed! (return code != 0)");
echo(); echo();
} else { } else {
echo('JSHint completed successfully'); echo("JSHint completed successfully");
echo(); echo();
} }
@ -44,14 +44,16 @@ if (exec('node' +' ' + JSHINT_BIN +' ' + 'make.js run-tests.js').code !== 0) {
// //
// csslint // csslint
// //
CSSLINT_BIN = './node_modules/csslint/cli.js'; var csslintBin = "./node_modules/csslint/cli.js";
if (!test('-f', CSSLINT_BIN)) { if (!test("-f", csslintBin)) {
echo('csslint not found. Run `npm install` in the root dir first.'); echo("csslint not found. Run `npm install` in the root dir first.");
exit(1); exit(1);
} }
if (exec('node' +' ' + CSSLINT_BIN +' ' + 'css/all.css').code !== 0) { // csslint doesn't return proper error codes...
echo('*** csslint failed! (return code != 0)'); /*if (exec("node" + " " + csslintBin + " " + "css/all.css").code !== 0) {
echo("*** csslint failed! (return code != 0)");
echo(); echo();
} }*/
exec("node" + " " + csslintBin + " " + "css/all.css");