Add bower install script and release scripts to jshint and pass lint
[jquery.git] / build / release-notes.js
blob37e9f9a32be34d61d2541542b890dd988429854c
1 #!/usr/bin/env node
2 /*
3  * jQuery Release Note Generator
4  */
6 var http = require("http"),
7         extract = /<a href="\/ticket\/(\d+)" title="View ticket">(.*?)<[^"]+"component">\s*(\S+)/g,
8         version = process.argv[2];
10 if ( !/^\d+\.\d+/.test( version ) ) {
11         console.error( "Invalid version number: " + version );
12         process.exit( 1 );
15 http.request({
16         host: "bugs.jquery.com",
17         port: 80,
18         method: "GET",
19         path: "/query?status=closed&resolution=fixed&max=400&component=!web&order=component&milestone=" + version
20 }, function (res) {
21         var data = [];
23         res.on( "data", function( chunk ) {
24                 data.push( chunk );
25         });
27         res.on( "end", function() {
28                 var match, cur, cat,
29                         file = data.join("");
31                 while ( (match = extract.exec( file )) ) {
32                         if ( "#" + match[1] !== match[2] ) {
33                                 cat = match[3];
35                                 if ( !cur || cur !== cat ) {
36                                         if ( cur ) {
37                                                 console.log("</ul>");
38                                         }
39                                         cur = cat;
40                                         console.log( "<h3>" + cat.charAt(0).toUpperCase() + cat.slice(1) + "</h3>" );
41                                         console.log("<ul>");
42                                 }
44                                 console.log(
45                                         "  <li><a href=\"http://bugs.jquery.com/ticket/" + match[1] + "\">#" +
46                                         match[1] + ": " + match[2] + "</a></li>"
47                                 );
48                         }
49                 }
50                 if ( cur ) {
51                         console.log("</ul>");
52                 }
54         });
55 }).end();