Skip to content

Commit d581257

Browse files
committed
Docs: Initial changelog generator, see #574
1 parent ab3e236 commit d581257

File tree

3 files changed

+131
-39
lines changed

3 files changed

+131
-39
lines changed

CHANGELOG.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# [6.3.0](https://github.com/dcodeIO/protobuf.js/releases/tag/6.3.0)
2+
3+
## Breaking
4+
[:hash:](https://github.com/dcodeIO/protobuf.js/commit/22a64c641d4897965035cc80e92667bd243f182f) Removed dead parts of the Reader API<br />
5+
[:hash:](https://github.com/dcodeIO/protobuf.js/commit/964f65a9dd94ae0a18b8be3d9a9c1b0b1fdf6424) Refactored BufferReader/Writer to their own files and removed unnecessary operations (node always has FloatXXArray and browser buffer uses ieee anyway)<br />
6+
[:hash:](https://github.com/dcodeIO/protobuf.js/commit/bfac0ea9afa3dbaf5caf79ddf0600c3c7772a538) Stripped out fallback encoder/decoder/verifier completely (even IE8 supports codegen), significantly reduces bundle size, can use static codegen elsewhere<br />
7+
8+
## Fixed
9+
[:hash:](https://github.com/dcodeIO/protobuf.js/commit/7fac9d6a39bf42d316c1676082a2d0804bc55934) Properly check Buffer.prototype.set with node v4<br />
10+
[:hash:](https://github.com/dcodeIO/protobuf.js/commit/3ad8108eab57e2b061ee6f1fddf964abe3f4cbc7) Prevent NRE and properly annotate verify signature in tsd-jsdoc, fixed [#572](https://github.com/dcodeIO/protobuf.js/issues/572)<br />
11+
[:hash:](https://github.com/dcodeIO/protobuf.js/commit/6c2415d599847cbdadc17dee3cdf369fc9facade) Fix directly using Buffer instead of util.Buffer<br />
12+
[:hash:](https://github.com/dcodeIO/protobuf.js/commit/ea7ba8b83890084d61012cb5386dc11dadfb3908) Fixed release links in README files [ci skip]<br />
13+
14+
## New
15+
[:hash:](https://github.com/dcodeIO/protobuf.js/commit/ef43acff547c0cd84cfb7a892fe94504a586e491) Added Namespace#getEnum and changed #lookupEnum to the same behavior, see [#576](https://github.com/dcodeIO/protobuf.js/issues/576)<br />
16+
[:hash:](https://github.com/dcodeIO/protobuf.js/commit/1fcfdfe21c1b321d975a8a96d133a452c9a9c0d8) Added a heap of coverage comments for usually unused code paths to open things up<br />
17+
[:hash:](https://github.com/dcodeIO/protobuf.js/commit/c234de7f0573ee30ed1ecb15aa82b74c0f994876) Added codegen test to determine if any ancient browsers don't actually support it<br />
18+
[:hash:](https://github.com/dcodeIO/protobuf.js/commit/fed2000e7e461efdb1c3a1a1aeefa8b255a7c20b) Added legacy groups support to pbjs, see [#568](https://github.com/dcodeIO/protobuf.js/issues/568)<br />
19+
[:hash:](https://github.com/dcodeIO/protobuf.js/commit/974a1321da3614832aa0a5b2e7c923f66e4ba8ae) Initial support for legacy groups + test case, see [#568](https://github.com/dcodeIO/protobuf.js/issues/568)<br />
20+
21+
## CLI
22+
[:hash:](https://github.com/dcodeIO/protobuf.js/commit/3e7e4fc59e6d2d6c862410b4b427fbedccdb237b) Removed type/ns alias comment in static target to not confuse jsdoc unnecessarily<br />
23+
[:hash:](https://github.com/dcodeIO/protobuf.js/commit/99ad9cc08721b834a197d4bbb67fa152d7ad79aa) Made pbjs use loadSync for deterministic outputs, see [#573](https://github.com/dcodeIO/protobuf.js/issues/573)<br />
24+
25+
## Docs
26+
[:hash:](https://github.com/dcodeIO/protobuf.js/commit/7939a4bd8baca5f7e07530fc93f27911a6d91c6f) Updated README and bundler according to dynamic require calls<br />
27+
28+
## Other
29+
[:hash:](https://github.com/dcodeIO/protobuf.js/commit/ab3e236a967a032a98267a648f84d129fdb4d4a6) Enums can't be map key types<br />
30+
[:hash:](https://github.com/dcodeIO/protobuf.js/commit/8ef6975b0bd372b79e9b638f43940424824e7176) Use custom require (now a micromodule) for all optional modules, see [#571](https://github.com/dcodeIO/protobuf.js/issues/571)<br />
31+
[:hash:](https://github.com/dcodeIO/protobuf.js/commit/19e906c2a15acc6178b3bba6b19c2f021e681176) Reverted aliases frequently used in codegen for better gzip ratio<br />
32+
[:hash:](https://github.com/dcodeIO/protobuf.js/commit/47b51ec95a540681cbed0bac1b2f02fc4cf0b73d) Shrinked bundle size - a bit<br />
33+
[:hash:](https://github.com/dcodeIO/protobuf.js/commit/f8451f0058fdf7a1fac15ffc529e4e899c6b343c) Can finally run with --trace-deopt again without crashes<br />
34+
[:hash:](https://github.com/dcodeIO/protobuf.js/commit/9c9a66bf393d9d6927f35a9c18abf5d1c31db912) Other minor optimizations<br />

scripts/changelog.js

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
var gitSemverTags = require("git-semver-tags"),
2+
gitRawCommits = require("git-raw-commits");
3+
4+
var pkg = require("../package.json");
5+
6+
var breakingFallback = /removed|stripped|dropped/i;
7+
8+
// categories to be used in the future and regexes for lazy / older subjects
9+
var validCategories = {
10+
"Breaking": null,
11+
"Fixed": /fix|properly|prevent/i,
12+
"New": /added|initial/i,
13+
"CLI": /pbjs|pbts/,
14+
"Docs": /README/i,
15+
"Other": null
16+
};
17+
18+
var repo = "https://github.com/dcodeIO/protobuf.js";
19+
20+
gitSemverTags(function(err, tags) {
21+
if (err)
22+
throw err;
23+
24+
var categories = {};
25+
Object.keys(validCategories).forEach(function(category) {
26+
categories[category] = [];
27+
});
28+
29+
var commits = gitRawCommits({
30+
from: tags[0],
31+
to: 'HEAD',
32+
merges: false,
33+
format: "%B%n#%H"
34+
});
35+
36+
commits.on("error", function(err) {
37+
throw err;
38+
});
39+
40+
commits.on("data", function(chunk) {
41+
chunk.toString("utf8").trim().split(";").forEach(function(message) {
42+
if (/^(Merge pull request |Post\-merge)/.test(message))
43+
return;
44+
var match = /#([0-9a-f]{40})$/.exec(message);
45+
var hash;
46+
if (match) {
47+
message = message.substring(0, message.length - match[1].length).trim();
48+
hash = match[1];
49+
}
50+
match = /^(\w+):/i.exec(message = message.trim());
51+
var category;
52+
if (match && match[1] in validCategories) {
53+
category = match[1];
54+
message = message.substring(match[1].length + 1).trim();
55+
} else {
56+
var keys = Object.keys(validCategories);
57+
for (var i = 0; i < keys.length; ++i) {
58+
var re = validCategories[keys[i]];
59+
if (re && re.test(message)) {
60+
category = keys[i];
61+
break;
62+
}
63+
}
64+
message = message.replace(/^(\w+):/i, "").trim();
65+
}
66+
if (!category) {
67+
if (breakingFallback.test(message))
68+
category = "Breaking";
69+
else
70+
category = "Other";
71+
}
72+
var nl = message.indexOf("\n");
73+
if (nl > -1)
74+
message = message.substring(0, nl).trim();
75+
if (!hash || message.length < 12)
76+
return;
77+
categories[category].push({
78+
text: message,
79+
hash: hash
80+
});
81+
});
82+
});
83+
84+
commits.on("end", function() {
85+
console.log("# [" + pkg.version + "](" + repo + "/releases/tag/" + pkg.version + ")");
86+
Object.keys(categories).forEach(function(category) {
87+
var messages = categories[category];
88+
if (!messages.length)
89+
return;
90+
console.log("\n## " + category);
91+
messages.forEach(function(message) {
92+
var text = message.text.replace(/#(\d+)/g, "[#$1](" + repo + "/issues/$1)");
93+
console.log("[:hash:](" + repo + "/commit/" + message.hash + ") " + text + "<br />");
94+
});
95+
});
96+
});
97+
});

scripts/release.js

Lines changed: 0 additions & 39 deletions
This file was deleted.

0 commit comments

Comments
 (0)