diff options
author | Dave Methvin <dave.methvin@gmail.com> | 2013-01-14 21:58:09 -0500 |
---|---|---|
committer | Dave Methvin <dave.methvin@gmail.com> | 2013-01-14 22:10:39 -0500 |
commit | e7a2e3c72f0c9833214b17ca81f76e0a9da62495 (patch) | |
tree | db7fa9d3488f63d5de754c55860a11f459812f34 | |
parent | 348e1a75c87d13a0c87c6cc58b82bf9746e7eb9c (diff) | |
download | jquery-e7a2e3c72f0c9833214b17ca81f76e0a9da62495.tar.gz jquery-e7a2e3c72f0c9833214b17ca81f76e0a9da62495.zip |
Simplify release notes generator script.
-rw-r--r-- | build/release-notes.js | 39 | ||||
-rw-r--r-- | build/release-notes.txt | 27 |
2 files changed, 22 insertions, 44 deletions
diff --git a/build/release-notes.js b/build/release-notes.js index 87710815b..dff2c11c6 100644 --- a/build/release-notes.js +++ b/build/release-notes.js @@ -5,21 +5,20 @@ var fs = require("fs"), http = require("http"), - tmpl = require("mustache"), - extract = /<a href="\/ticket\/(\d+)" title="View ticket">(.*?)<[^"]+"component">\s*(\S+)/g; + extract = /<a href="\/ticket\/(\d+)" title="View ticket">(.*?)<[^"]+"component">\s*(\S+)/g, + categories = [], + version = process.argv[2]; -var opts = { - version: "1.9 Beta 1", - short_version: "1.9b1", - final_version: "1.9", - categories: [] -}; +if ( !/^\d+\.\d+/.test( version ) ) { + console.error( "Invalid version number: " + version ); + process.exit( 1 ); +} http.request({ host: "bugs.jquery.com", port: 80, method: "GET", - path: "/query?status=closed&resolution=fixed&max=400&component=!web&order=component&milestone=" + opts.final_version + path: "/query?status=closed&resolution=fixed&max=400&component=!web&order=component&milestone=" + version }, function (res) { var data = []; @@ -36,19 +35,25 @@ http.request({ if ( "#" + match[1] !== match[2] ) { var cat = match[3]; - if ( !cur || cur.name !== cat ) { - cur = { name: match[3], niceName: match[3].replace(/^./, function(a){ return a.toUpperCase(); }), bugs: [] }; - opts.categories.push( cur ); + if ( !cur || cur !== cat ) { + if ( cur ) { + console.log("</ul>"); + } + cur = cat; + console.log( "<h2>" + cat.charAt(0).toUpperCase() + cat.slice(1) + "</h2>" ); + console.log("<ul>"); } - cur.bugs.push({ ticket: match[1], title: match[2] }); + console.log( + " <li><a href=\"http://bugs.jquery.com/ticket/" + match[1] + "\">#" + + match[1] + ": " + match[2] + "</a></li>" + ); } } + if ( cur ) { + console.log("</ul>"); + } - buildNotes(); }); }).end(); -function buildNotes() { - console.log( tmpl.to_html( fs.readFileSync("release-notes.txt", "utf8"), opts ) ); -} diff --git a/build/release-notes.txt b/build/release-notes.txt deleted file mode 100644 index 1d0ae7460..000000000 --- a/build/release-notes.txt +++ /dev/null @@ -1,27 +0,0 @@ -<h2>jQuery {{version}} Released</h2> - -<p>This is a preview release of jQuery. We're releasing it so that everyone can start testing the code in their applications, making sure that there are no major problems.</p> - -<p>You can get the code from the jQuery CDN:</p> - -<ul> -<li><a href="http://code.jquery.com/jquery-{{short_version}}.js">http://code.jquery.com/jquery-{{short_version}}.js</a></li> -</ul> - -<p>You can help us by dropping that code into your existing application and letting us know that if anything no longer works. Please <a href="http://bugs.jquery.com/">file a bug</a> and be sure to mention that you're testing against jQuery {{version}}.</p> - -<p>We want to encourage everyone from the community to try and <a href="http://docs.jquery.com/Getting_Involved">get involved</a> in contributing back to jQuery core. We've set up a <a href="http://docs.jquery.com/Getting_Involved">full page</a> of information dedicated towards becoming more involved with the team. The team is here and ready to help you help us!</p> - -<h2>jQuery {{version}} Change Log</h2> - -<p>The current change log of the {{version}} release.</p> - -{{#categories}} -<h3>{{niceName}}</h3> - -<ul> -{{#bugs}} - <li><a href="http://bugs.jquery.com/ticket/{{ticket}}">#{{ticket}}</a>: {{title}}</li> -{{/bugs}} -</ul> -{{/categories}} |