mirror of
https://github.com/jquery/jquery.git
synced 2025-01-10 18:24:24 +00:00
Reformat jshint errors to be readable; make post-compile.js write directly to jquery.min.js; update required Node version
This commit is contained in:
parent
4534db196b
commit
f724bc6c92
2
Makefile
2
Makefile
@ -97,7 +97,7 @@ ${JQ_MIN}: ${JQ}
|
||||
@@if test ! -z ${JS_ENGINE}; then \
|
||||
echo "Minifying jQuery" ${JQ_MIN}; \
|
||||
${COMPILER} ${JQ} > ${JQ_MIN}.tmp; \
|
||||
${POST_COMPILER} ${JQ_MIN}.tmp > ${JQ_MIN}; \
|
||||
${POST_COMPILER} ${JQ_MIN}.tmp; \
|
||||
rm -f ${JQ_MIN}.tmp; \
|
||||
else \
|
||||
echo "You must have NodeJS installed in order to minify jQuery."; \
|
||||
|
@ -15,7 +15,7 @@ In the spirit of open source software development, jQuery always encourages comm
|
||||
What you need to build your own jQuery
|
||||
--------------------------------------
|
||||
|
||||
In order to build jQuery, you need to have GNU make 3.8 or later, Node.js 0.2 or later, and git 1.7 or later.
|
||||
In order to build jQuery, you need to have GNU make 3.8 or later, Node.js 0.4.12 or later, and git 1.7 or later.
|
||||
(Earlier versions might work OK, but are not tested.)
|
||||
|
||||
Windows users have two options:
|
||||
|
@ -1,34 +1,36 @@
|
||||
var JSHINT = require("./lib/jshint").JSHINT,
|
||||
print = require("sys").print,
|
||||
src = require("fs").readFileSync("dist/jquery.js", "utf8");
|
||||
var jshint = require("./lib/jshint").JSHINT,
|
||||
src = require("fs").readFileSync("dist/jquery.js", "utf8"),
|
||||
config = {
|
||||
evil: true,
|
||||
undef: false,
|
||||
browser: true,
|
||||
wsh: true,
|
||||
eqnull: true,
|
||||
expr: true,
|
||||
curly: true,
|
||||
trailing: true,
|
||||
predef: [
|
||||
"define",
|
||||
"DOMParser"
|
||||
],
|
||||
maxerr: 100
|
||||
};
|
||||
|
||||
JSHINT(src, {
|
||||
evil: true,
|
||||
undef: false,
|
||||
browser: true,
|
||||
wsh: true,
|
||||
eqnull: true,
|
||||
expr: true,
|
||||
curly: true,
|
||||
trailing: true,
|
||||
predef: [
|
||||
"define",
|
||||
"DOMParser"
|
||||
],
|
||||
maxerr: 100
|
||||
});
|
||||
|
||||
var e = JSHINT.errors, found = e.length, i = 0, w;
|
||||
|
||||
for ( ; i < e.length; i++ ) {
|
||||
w = e[i];
|
||||
|
||||
print( "\n" + w.evidence + "\n" );
|
||||
print( " Problem at line " + w.line + " character " + w.character + ": " + w.reason );
|
||||
}
|
||||
|
||||
if ( found > 0 ) {
|
||||
print( "\n" + found + " Error(s) found.\n" );
|
||||
if ( jshint( src, config ) ) {
|
||||
console.log("JSHint check passed.");
|
||||
} else {
|
||||
print( "JSHint check passed.\n" );
|
||||
|
||||
console.log( "JSHint found errors." );
|
||||
|
||||
jshint.errors.forEach(function( e ) {
|
||||
if ( !e ) { return; }
|
||||
|
||||
var str = e.evidence ? e.evidence : "";
|
||||
|
||||
if ( str ) {
|
||||
str = str.replace( /\t/g, " " ).trim();
|
||||
|
||||
console.log( " [L" + e.line + ":C" + e.character + "] " + e.reason + "\n " + str + "\n");
|
||||
}
|
||||
});
|
||||
}
|
@ -1,7 +1,6 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
var print = require( "sys" ).print,
|
||||
fs = require( "fs" ),
|
||||
var fs = require( "fs" ),
|
||||
src = fs.readFileSync( process.argv[2], "utf8" ),
|
||||
version = fs.readFileSync( "version.txt", "utf8" ),
|
||||
// License Template
|
||||
@ -17,4 +16,4 @@ license = license.replace( "@VERSION", version );
|
||||
// Replace license block with minimal license
|
||||
src = src.replace( /\/\/.*?\/?\*.+?(?=\n|\r|$)|\/\*[\s\S]*?\/\/[\s\S]*?\*\//, license );
|
||||
|
||||
print( src );
|
||||
fs.writeFileSync( "dist/jquery.min.js", src, "utf8" );
|
||||
|
Loading…
Reference in New Issue
Block a user