Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'master' into guyzmo-952

  • Loading branch information...
commit e32ae7e3ca3bda6794482deb48cf3dff166a1cfe 2 parents 650fb72 + f2843c5
@valueof valueof authored
Showing with 35 additions and 25 deletions.
  1. +6 −0 .npmignore
  2. +23 −20 make.js
  3. +1 −1  package.json
  4. +5 −4 tests/cli.js
View
6 .npmignore
@@ -0,0 +1,6 @@
+examples
+res
+tests
+.travis.yml
+CONTRIBUTING.MD
+make.js
View
43 make.js
@@ -17,7 +17,6 @@ var TESTS = [
var OPTIONS = JSON.parse(cat("./jshint.json"));
target.all = function () {
- target.build();
target.lint();
target.test();
};
@@ -100,9 +99,7 @@ target.test = function () {
target.build = function () {
var browserify = require("browserify");
- var bundle = browserify({ debug: true });
-
- bundle.addEntry("./src/stable/jshint.js");
+ var bundle = browserify("./src/stable/jshint.js");
if (!test("-e", "./dist")) {
mkdir("./dist");
@@ -110,20 +107,26 @@ target.build = function () {
echo("Building into dist/...", "\n");
- bundle.append("JSHINT = require('/src/stable/jshint.js').JSHINT;");
-
- [ "// " + pkg.version,
- "var JSHINT;",
- bundle.bundle()
- ].join("\n").to("./dist/jshint-" + pkg.version + ".js");
-
- cli.ok("Bundle");
-
- // Rhino
- var rhino = cat("./dist/jshint-" + pkg.version + ".js", "./src/platforms/rhino.js");
- rhino = "#!/usr/bin/env rhino\n\n" + rhino;
- rhino.to("./dist/jshint-rhino-" + pkg.version + ".js");
- exec("chmod +x dist/jshint-rhino-" + pkg.version + ".js");
- cli.ok("Rhino");
- echo("\n");
+ bundle.require("./src/stable/jshint.js", { expose: "jshint" });
+ bundle.bundle({}, function (err, src) {
+ [
+ "//" + pkg.version,
+ "var JSHINT;",
+ "(function () {",
+ "var require;",
+ src,
+ "JSHINT = require('jshint').JSHINT;",
+ "}());"
+ ].join("\n").to("./dist/jshint-" + pkg.version + ".js");
+
+ cli.ok("Bundle");
+
+ // Rhino
+ var rhino = cat("./dist/jshint-" + pkg.version + ".js", "./src/platforms/rhino.js");
+ rhino = "#!/usr/bin/env rhino\n\n" + "var window = {};" + rhino;
+ rhino.to("./dist/jshint-rhino-" + pkg.version + ".js");
+ exec("chmod +x dist/jshint-rhino-" + pkg.version + ".js");
+ cli.ok("Rhino");
+ echo("\n");
+ });
};
View
2  package.json
@@ -33,7 +33,7 @@
"devDependencies": {
"jshint": "1.1.0",
"shelljs": "0.1.x",
- "browserify": "1.16.1",
+ "browserify": "2.12.x",
"coveraje": "0.2.x",
"nodeunit": "0.7.x",
"sinon": "1.6.x",
View
9 tests/cli.js
@@ -205,7 +205,7 @@ exports.group = {
testRcFile: function (test) {
sinon.stub(process, "cwd").returns(__dirname);
- var localRc = __dirname + "/.jshintrc";
+ var localRc = path.normalize(__dirname + "/.jshintrc");
var testStub = sinon.stub(shjs, "test");
var catStub = sinon.stub(shjs, "cat");
@@ -229,7 +229,7 @@ exports.group = {
},
testHomeRcFile: function (test) {
- var homeRc = path.join(process.env.HOME, ".jshintrc");
+ var homeRc = path.join(process.env.HOME || process.env.HOMEPATH, ".jshintrc");
var testStub = sinon.stub(shjs, "test");
var catStub = sinon.stub(shjs, "cat");
@@ -281,8 +281,9 @@ exports.group = {
},
testTargetRelativeRcLookup: function (test) {
- sinon.stub(process, "cwd").returns(process.env.HOME); // working from outside the project
- var projectRc = __dirname + "/.jshintrc";
+ // working from outside the project
+ sinon.stub(process, "cwd").returns(process.env.HOME || process.env.HOMEPATH);
+ var projectRc = path.normalize(__dirname + "/.jshintrc");
var srcFile = __dirname + "/sub/file.js";
var testStub = sinon.stub(shjs, "test");
var catStub = sinon.stub(shjs, "cat");
Please sign in to comment.
Something went wrong with that request. Please try again.