MCPcopy
hub / github.com/Famous/famous-angular / writeChangelog

Function writeChangelog

changelog.js:138–175  ·  view source on GitHub ↗
(stream, commits, version)

Source from the content-addressed store, hash-verified

136
137
138var writeChangelog = function(stream, commits, version) {
139 var sections = {
140 fix: {},
141 feat: {},
142 perf: {},
143 docs: {},
144 breaks: {}
145 };
146
147 sections.breaks[EMPTY_COMPONENT] = [];
148
149 commits.forEach(function(commit) {
150 var section = sections[commit.type];
151 var component = commit.component || EMPTY_COMPONENT;
152
153 if(section) {
154 section[component] = section[component] || [];
155 section[component].push(commit);
156 }
157
158 if(commit.breaking) {
159 sections.breaks[component] = sections.breaks[component] || [];
160 sections.breaks[component].push({
161 subject: util.format("due to %s,\n %s", linkToCommit(commit.hash), commit.breaking),
162 hash: commit.hash,
163 closes: []
164 });
165 }
166 ;
167 });
168
169 stream.write(util.format(HEADER_TPL, version, version, currentDate()));
170 printSection(stream, 'Bug Fixes', sections.fix);
171 printSection(stream, 'Features', sections.feat);
172 printSection(stream, 'Performance Improvements', sections.perf);
173 printSection(stream, 'Documentation', sections.docs);
174 printSection(stream, 'Breaking Changes', sections.breaks, false);
175}
176
177
178var getPreviousTag = function() {

Callers 1

generateFunction · 0.85

Calls 3

linkToCommitFunction · 0.85
currentDateFunction · 0.85
printSectionFunction · 0.85

Tested by

no test coverage detected