-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
No issue: Split make.js into bin/build and bin/changelog
- Loading branch information
Showing
3 changed files
with
66 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/usr/bin/env node | ||
/*jshint shelljs:true */ | ||
|
||
"use strict"; | ||
|
||
var browserify = require("browserify"); | ||
var bundle = browserify("./src/stable/jshint.js"); | ||
var version = require("../package.json").version; | ||
require("shelljs/make"); | ||
|
||
if (!test("-e", "../dist")) | ||
mkdir("../dist"); | ||
|
||
bundle.require("./src/stable/jshint.js", { expose: "jshint" }); | ||
bundle.bundle({}, function (err, src) { | ||
var web = "./dist/jshint-" + version + ".js"; | ||
var rhino = "./dist/jshint-rhino-" + version + ".js"; | ||
|
||
[ "// " + version, | ||
"var JSHINT;", | ||
"(function () {", | ||
"var require;", | ||
src, | ||
"JSHINT = require('jshint').JSHINT;", | ||
"}());" | ||
].join("\n").to(web); | ||
|
||
("#!/usr/bin/env rhino\nvar window = {};\n" + cat(web, "./src/platforms/rhino.js")).to(rhino); | ||
chmod("+x", rhino); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#!/usr/bin/env node | ||
/*jshint shelljs:true, lastsemic:true, -W101*/ | ||
|
||
"use strict"; | ||
|
||
var version = require("../package.json").version; | ||
require("shelljs/make"); | ||
|
||
exec("git log --format='%H|%h|%an|%s' " + version + "..HEAD", { silent: true }, function (code, output) { | ||
if (code !== 0) | ||
return void console.log("git log return code is non-zero"); | ||
|
||
var commits = output.split("\n") | ||
.filter(function (cmt) { return cmt.trim() !== "" }) | ||
.map(function (cmt) { return cmt.split("|") }); | ||
|
||
var html = ""; | ||
var authors = {}; | ||
|
||
commits.forEach(function (cmt) { | ||
var tr = ""; | ||
tr += "<td class='commit'><a href='https://github.com/jshint/jshint/commit/" + cmt[0] + "'>" + cmt[1] + "</a></td>"; | ||
tr += "<td class='desc'>" + cmt[3].replace(/(#(\d+))/, "<a href='https://github.com/jshint/jshint/issues/$2/'>$1</a>") + "</td>"; | ||
html += "<tr>" + tr + "</tr>\n"; | ||
|
||
if (cmt[2] !== "Anton Kovalyov") | ||
authors[cmt[2]] = true; | ||
}); | ||
|
||
echo("<!-- auto-generated -->"); | ||
echo("<table class='changelog'>\n" + html + "</table>\n"); | ||
|
||
if (Object.keys(authors).length) { | ||
echo("<p class='thx'><strong>Thanks</strong> to " + Object.keys(authors).join(", ") + " for sending patches!</p>"); | ||
} | ||
}); |