Skip to content

Commit 1827b39

Browse files
committed
Build: Convert changelog to markdown.
1 parent 9fbbd01 commit 1827b39

File tree

2 files changed

+73
-36
lines changed

2 files changed

+73
-36
lines changed

build/release/changelog-shell

Lines changed: 34 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -10,70 +10,71 @@ Move all commit notes to the appropriate section.
1010
- If there is no ticket number, search Trac for the relevant ticket.
1111
- If there is no ticket, create one (if needed), or leave just the commit link.
1212

13-
Double check that "XXXX" does not appear anywhere in the changelog.
13+
Double check that "TICKETREF" does not appear anywhere in the changelog.
1414

15-
Post this changelog at: CHANGELOG_URL
15+
Add this changelog to jqueryui.com.
1616

1717

1818

1919
DELETE EVERYTHING ABOVE THE FOLLOWING LINE
2020
------------------------------------------
21+
<script>{
22+
"title": "{title}"
23+
}</script>
2124

22-
= Summary =
23-
This is the final release of jQuery UI 1.8.
24-
-- OR --
25-
This is the second maintenance release for [[UI/Changelog/1.8|jQuery UI 1.8]].
25+
## Summary
26+
{summary}
2627

27-
= Build =
28+
## Build
2829

29-
= Core &amp; Utilities =
30+
## Core &amp; Utilities
3031

31-
=== UI Core ===
32+
### UI Core
3233

33-
=== Mouse ===
34+
### Mouse
3435

35-
=== Widget Factory ===
36+
### Widget Factory
3637

37-
=== Position ===
38+
### Position
3839

39-
= Interactions =
40+
## Interactions
4041

41-
=== Draggable ===
42+
### Draggable
4243

43-
=== Droppable ===
44+
### Droppable
4445

45-
=== Resizable ===
46+
### Resizable
4647

47-
=== Selectable ===
48+
### Selectable
4849

49-
=== Sortable ===
50+
### Sortable
5051

51-
= Widgets =
52+
## Widgets
5253

53-
=== Accordion ===
54+
### Accordion
5455

55-
=== Autocomplete ===
56+
### Autocomplete
5657

57-
=== Button ===
58+
### Button
5859

59-
=== Datepicker ===
60+
### Datepicker
6061

61-
=== Dialog ===
62+
### Dialog
6263

63-
=== Progressbar ===
64+
### Progressbar
6465

65-
=== Slider ===
66+
### Slider
6667

67-
=== Tabs ===
68+
### Tabs
6869

69-
= Effects =
70+
## Effects
7071

71-
=== Individual effects ===
72+
### Individual effects
7273

73-
= CSS Framework =
74+
## CSS Framework
7475

75-
= Demos =
76+
## Demos
7677

77-
= Website =
78+
## Website
7879

79-
=== Download Builder ===
80+
### Download Builder

build/release/release.js

Lines changed: 39 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#!/usr/bin/env node
22

3-
var baseDir, repoDir, prevVersion, newVersion, nextVersion, tagTime,
3+
var baseDir, repoDir, majorMinorVersion, patchVersion, prevVersion, newVersion,
4+
nextVersion, tagTime,
45
fs = require( "fs" ),
56
path = require( "path" ),
67
// support: node <0.8
@@ -103,10 +104,14 @@ function getVersions() {
103104
major = parseInt( parts[ 0 ], 10 );
104105
minor = parseInt( parts[ 1 ], 10 );
105106
patch = parseInt( parts[ 2 ], 10 );
107+
106108
// TODO: handle 2.0.0
107109
if ( minor === 0 ) {
108110
abort( "This script is not smart enough to handle the 2.0.0 release." );
109111
}
112+
113+
majorMinorVersion = [ major, minor ].join( "." );
114+
patchVersion = patch;
110115
prevVersion = patch === 0 ?
111116
[ major, minor - 1, 0 ].join( "." ) :
112117
[ major, minor, patch - 1 ].join( "." );
@@ -190,7 +195,14 @@ function generateChangelog() {
190195
var commits,
191196
changelogPath = baseDir + "/changelog",
192197
changelog = cat( "build/release/changelog-shell" ) + "\n",
193-
fullFormat = "* %s (TICKETREF, [http://github.com/jquery/jquery-ui/commit/%H %h])";
198+
fullFormat = "* %s (TICKETREF, [%h](http://github.com/jquery/jquery-ui/commit/%H))";
199+
200+
changelog = changelog
201+
.replace( "{title}", "jQuery UI " + newVersion + " Changelog" )
202+
.replace( "{summary}", patchVersion === 0 ?
203+
"This is the final release of jQuery UI " + majorMinorVersion + "." :
204+
"This is the " + ordinal( patchVersion ) + " maintenance release for " +
205+
"[jQuery UI " + majorMinorVersion + "](/changelog/" + majorMinorVersion + ")." );
194206

195207
echo ( "Adding commits..." );
196208
commits = gitLog( fullFormat );
@@ -205,7 +217,7 @@ function generateChangelog() {
205217
});
206218
return tickets.length ?
207219
commit.replace( "TICKETREF", tickets.map(function( ticket ) {
208-
return "[http://bugs.jqueryui.com/ticket/" + ticket + " #" + ticket + "]";
220+
return "[#" + ticket + "](http://bugs.jqueryui.com/ticket/" + ticket + ")";
209221
}).join( ", " ) ) :
210222
// Leave TICKETREF token in place so it's easy to find commits without tickets
211223
commit;
@@ -318,6 +330,30 @@ function writePackage( pkg ) {
318330
JSON.stringify( pkg, null, "\t" ) + "\n" );
319331
}
320332

333+
function ordinal( number ) {
334+
return number === 1 ? "first" :
335+
number === 2 ? "second" :
336+
number === 3 ? "third" :
337+
number === 4 ? "fourth" :
338+
number === 5 ? "fifth" :
339+
number === 6 ? "sixth" :
340+
number === 7 ? "seventh" :
341+
number === 8 ? "eighth" :
342+
number === 9 ? "ninth" :
343+
number === 10 ? "tenth" :
344+
number === 11 ? "eleventh" :
345+
number === 12 ? "twelfth" :
346+
number === 13 ? "thirteenth" :
347+
number === 14 ? "fourteenth" :
348+
number === 15 ? "fifteenth" :
349+
number === 16 ? "sixteenth" :
350+
number === 17 ? "seventeenth" :
351+
number === 18 ? "eighteenth" :
352+
number === 19 ? "nineteenth" :
353+
number === 20 ? "twentieth" :
354+
"twenty " + ordinal( number - 20 );
355+
}
356+
321357
function bootstrap( fn ) {
322358
console.log( "Determining directories..." );
323359
baseDir = process.cwd() + "/__release";

0 commit comments

Comments
 (0)