protobufjs 6.11.3 → 7.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (65) hide show
  1. package/README.md +7 -174
  2. package/dist/light/protobuf.js +77 -29
  3. package/dist/light/protobuf.js.map +1 -1
  4. package/dist/light/protobuf.min.js +3 -3
  5. package/dist/light/protobuf.min.js.map +1 -1
  6. package/dist/minimal/protobuf.js +27 -10
  7. package/dist/minimal/protobuf.js.map +1 -1
  8. package/dist/minimal/protobuf.min.js +3 -3
  9. package/dist/minimal/protobuf.min.js.map +1 -1
  10. package/dist/protobuf.js +163 -61
  11. package/dist/protobuf.js.map +1 -1
  12. package/dist/protobuf.min.js +3 -3
  13. package/dist/protobuf.min.js.map +1 -1
  14. package/index.d.ts +9 -7
  15. package/package.json +12 -31
  16. package/scripts/postinstall.js +0 -3
  17. package/src/converter.js +12 -4
  18. package/src/decoder.js +4 -3
  19. package/src/enum.js +24 -7
  20. package/src/field.js +6 -3
  21. package/src/namespace.js +3 -3
  22. package/src/parse.js +55 -16
  23. package/src/roots.js +1 -1
  24. package/src/tokenize.js +31 -16
  25. package/src/util/minimal.js +24 -7
  26. package/src/wrappers.js +2 -2
  27. package/tsconfig.json +2 -1
  28. package/CHANGELOG.md +0 -1027
  29. package/bin/pbjs +0 -6
  30. package/bin/pbts +0 -6
  31. package/cli/LICENSE +0 -33
  32. package/cli/README.md +0 -174
  33. package/cli/bin/pbjs +0 -6
  34. package/cli/bin/pbts +0 -6
  35. package/cli/index.d.ts +0 -3
  36. package/cli/index.js +0 -3
  37. package/cli/lib/tsd-jsdoc/LICENSE +0 -21
  38. package/cli/lib/tsd-jsdoc/README.md +0 -23
  39. package/cli/lib/tsd-jsdoc/plugin.js +0 -21
  40. package/cli/lib/tsd-jsdoc/publish.js +0 -705
  41. package/cli/lib/tsd-jsdoc.json +0 -18
  42. package/cli/package.json +0 -8
  43. package/cli/package.standalone.json +0 -32
  44. package/cli/pbjs.d.ts +0 -9
  45. package/cli/pbjs.js +0 -330
  46. package/cli/pbts.d.ts +0 -9
  47. package/cli/pbts.js +0 -197
  48. package/cli/targets/json-module.js +0 -38
  49. package/cli/targets/json.js +0 -8
  50. package/cli/targets/proto.js +0 -326
  51. package/cli/targets/proto2.js +0 -10
  52. package/cli/targets/proto3.js +0 -10
  53. package/cli/targets/static-module.js +0 -29
  54. package/cli/targets/static.js +0 -711
  55. package/cli/util.js +0 -183
  56. package/cli/wrappers/amd.js +0 -7
  57. package/cli/wrappers/closure.js +0 -7
  58. package/cli/wrappers/commonjs.js +0 -7
  59. package/cli/wrappers/default.js +0 -15
  60. package/cli/wrappers/es6.js +0 -5
  61. package/dist/README.md +0 -31
  62. package/dist/light/README.md +0 -31
  63. package/dist/minimal/README.md +0 -31
  64. package/package-lock.json +0 -7870
  65. package/scripts/changelog.js +0 -150
@@ -1,150 +0,0 @@
1
- "use strict";
2
-
3
- var path = require("path"),
4
- fs = require("fs");
5
-
6
- var gitSemverTags = require("git-semver-tags"),
7
- gitRawCommits = require("git-raw-commits"),
8
- minimist = require("minimist");
9
-
10
- var basedir = path.join(__dirname, "..");
11
- var pkg = require(basedir + "/package.json");
12
-
13
- var argv = minimist(process.argv, {
14
- alias: {
15
- tag : "t",
16
- write : "w"
17
- },
18
- string: [ "tag" ],
19
- boolean: [ "write" ],
20
- default: {
21
- tag: null,
22
- write: false
23
- }
24
- });
25
-
26
- // categories to be used in the future and regexes for lazy / older subjects
27
- var validCategories = {
28
- "Breaking": null,
29
- "Fixed": /fix|properly|prevent|correctly/i,
30
- "New": /added|initial/i,
31
- "CLI": /pbjs|pbts|CLI/,
32
- "Docs": /README/i,
33
- "Other": null
34
- };
35
- var breakingFallback = /removed|stripped|dropped/i;
36
-
37
- var repo = "https://github.com/protobufjs/protobuf.js";
38
-
39
- gitSemverTags(function(err, tags) {
40
- if (err)
41
- throw err;
42
-
43
- var categories = {};
44
- Object.keys(validCategories).forEach(function(category) {
45
- categories[category] = [];
46
- });
47
- var output = [];
48
-
49
- var from = tags[0];
50
- var to = "HEAD";
51
- var tag;
52
- if (argv.tag) {
53
- var idx = tags.indexOf(argv.tag);
54
- if (idx < 0)
55
- throw Error("no such tag: " + argv.tag);
56
- from = tags[idx + 1];
57
- tag = to = tags[idx];
58
- } else
59
- tag = pkg.version;
60
-
61
- var commits = gitRawCommits({
62
- from: from,
63
- to: to,
64
- merges: false,
65
- format: "%B%n#%H"
66
- });
67
-
68
- commits.on("error", function(err) {
69
- throw err;
70
- });
71
-
72
- commits.on("data", function(chunk) {
73
- var message = chunk.toString("utf8").trim();
74
- var match = /##([0-9a-f]{40})$/.exec(message);
75
- var hash;
76
- if (match) {
77
- message = message.substring(0, message.length - match[1].length).trim();
78
- hash = match[1];
79
- }
80
- message.split(";").forEach(function(message) {
81
- if (/^(Merge pull request |Post-merge)/.test(message))
82
- return;
83
- var match = /^(\w+):/i.exec(message = message.trim());
84
- var category;
85
- if (match && match[1] in validCategories) {
86
- category = match[1];
87
- message = message.substring(match[1].length + 1).trim();
88
- } else {
89
- var keys = Object.keys(validCategories);
90
- for (var i = 0; i < keys.length; ++i) {
91
- var re = validCategories[keys[i]];
92
- if (re && re.test(message)) {
93
- category = keys[i];
94
- break;
95
- }
96
- }
97
- message = message.replace(/^(\w+):/i, "").trim();
98
- }
99
- if (!category) {
100
- if (breakingFallback.test(message))
101
- category = "Breaking";
102
- else
103
- category = "Other";
104
- }
105
- var nl = message.indexOf("\n");
106
- if (nl > -1)
107
- message = message.substring(0, nl).trim();
108
- if (!hash || message.length < 12)
109
- return;
110
- message = message.replace(/\[ci skip\]/, "").trim();
111
- categories[category].push({
112
- text: message,
113
- hash: hash
114
- });
115
- });
116
- });
117
-
118
- commits.on("end", function() {
119
- output.push("## [" + tag + "](" + repo + "/releases/tag/" + tag + ")\n");
120
- Object.keys(categories).forEach(function(category) {
121
- var messages = categories[category];
122
- if (!messages.length)
123
- return;
124
- output.push("\n### " + category + "\n");
125
- messages.forEach(function(message) {
126
- var text = message.text.replace(/#(\d+)/g, "[#$1](" + repo + "/issues/$1)");
127
- output.push("[:hash:](" + repo + "/commit/" + message.hash + ") " + text + "<br />\n");
128
- });
129
- });
130
- var current;
131
- try {
132
- current = fs.readFileSync(basedir + "/CHANGELOG.md").toString("utf8");
133
- } catch (e) {
134
- current = "";
135
- }
136
- var re = new RegExp("^## \\[" + tag + "\\]");
137
- if (re.test(current)) { // regenerated, replace
138
- var pos = current.indexOf("## [", 1);
139
- if (pos > -1)
140
- current = current.substring(pos).trim();
141
- else
142
- current = "";
143
- }
144
- var contents = output.join("") + "\n" + current;
145
- if (argv.write)
146
- fs.writeFileSync(basedir + "/CHANGELOG.md", contents, "utf8");
147
- else
148
- process.stdout.write(contents);
149
- });
150
- });