Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Reformat jshint errors to be readable; make post-compile.js write dir…

…ectly to jquery.min.js; update required Node version
  • Loading branch information...
commit f724bc6c921378b82d9d6fa17329b6451fbb7a51 1 parent 4534db1
Rick Waldron rwaldron authored timmywil committed
2  Makefile
@@ -97,7 +97,7 @@ ${JQ_MIN}: ${JQ}
97 97 @@if test ! -z ${JS_ENGINE}; then \
98 98 echo "Minifying jQuery" ${JQ_MIN}; \
99 99 ${COMPILER} ${JQ} > ${JQ_MIN}.tmp; \
100   - ${POST_COMPILER} ${JQ_MIN}.tmp > ${JQ_MIN}; \
  100 + ${POST_COMPILER} ${JQ_MIN}.tmp; \
101 101 rm -f ${JQ_MIN}.tmp; \
102 102 else \
103 103 echo "You must have NodeJS installed in order to minify jQuery."; \
2  README.md
Source Rendered
@@ -15,7 +15,7 @@ In the spirit of open source software development, jQuery always encourages comm
15 15 What you need to build your own jQuery
16 16 --------------------------------------
17 17
18   -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.
  18 +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.
19 19 (Earlier versions might work OK, but are not tested.)
20 20
21 21 Windows users have two options:
58 build/jshint-check.js
... ... @@ -1,34 +1,36 @@
1   -var JSHINT = require("./lib/jshint").JSHINT,
2   - print = require("sys").print,
3   - src = require("fs").readFileSync("dist/jquery.js", "utf8");
  1 +var jshint = require("./lib/jshint").JSHINT,
  2 + src = require("fs").readFileSync("dist/jquery.js", "utf8"),
  3 + config = {
  4 + evil: true,
  5 + undef: false,
  6 + browser: true,
  7 + wsh: true,
  8 + eqnull: true,
  9 + expr: true,
  10 + curly: true,
  11 + trailing: true,
  12 + predef: [
  13 + "define",
  14 + "DOMParser"
  15 + ],
  16 + maxerr: 100
  17 + };
4 18
5   -JSHINT(src, {
6   - evil: true,
7   - undef: false,
8   - browser: true,
9   - wsh: true,
10   - eqnull: true,
11   - expr: true,
12   - curly: true,
13   - trailing: true,
14   - predef: [
15   - "define",
16   - "DOMParser"
17   - ],
18   - maxerr: 100
19   -});
  19 +if ( jshint( src, config ) ) {
  20 + console.log("JSHint check passed.");
  21 +} else {
20 22
21   -var e = JSHINT.errors, found = e.length, i = 0, w;
  23 + console.log( "JSHint found errors." );
22 24
23   -for ( ; i < e.length; i++ ) {
24   - w = e[i];
  25 + jshint.errors.forEach(function( e ) {
  26 + if ( !e ) { return; }
25 27
26   - print( "\n" + w.evidence + "\n" );
27   - print( " Problem at line " + w.line + " character " + w.character + ": " + w.reason );
28   -}
  28 + var str = e.evidence ? e.evidence : "";
29 29
30   -if ( found > 0 ) {
31   - print( "\n" + found + " Error(s) found.\n" );
32   -} else {
33   - print( "JSHint check passed.\n" );
  30 + if ( str ) {
  31 + str = str.replace( /\t/g, " " ).trim();
  32 +
  33 + console.log( " [L" + e.line + ":C" + e.character + "] " + e.reason + "\n " + str + "\n");
  34 + }
  35 + });
34 36 }
5 build/post-compile.js
... ... @@ -1,7 +1,6 @@
1 1 #!/usr/bin/env node
2 2
3   -var print = require( "sys" ).print,
4   - fs = require( "fs" ),
  3 +var fs = require( "fs" ),
5 4 src = fs.readFileSync( process.argv[2], "utf8" ),
6 5 version = fs.readFileSync( "version.txt", "utf8" ),
7 6 // License Template
@@ -17,4 +16,4 @@ license = license.replace( "@VERSION", version );
17 16 // Replace license block with minimal license
18 17 src = src.replace( /\/\/.*?\/?\*.+?(?=\n|\r|$)|\/\*[\s\S]*?\/\/[\s\S]*?\*\//, license );
19 18
20   -print( src );
  19 +fs.writeFileSync( "dist/jquery.min.js", src, "utf8" );

0 comments on commit f724bc6

Please sign in to comment.
Something went wrong with that request. Please try again.