Skip to content

Commit

Permalink
1.0.8
Browse files Browse the repository at this point in the history
  • Loading branch information
PG Herveou authored Aug 13, 2020
1 parent 354c8f5 commit 4e8050f
Show file tree
Hide file tree
Showing 49 changed files with 2,008 additions and 679 deletions.
8 changes: 7 additions & 1 deletion cli/package.json
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
{"version": "1.0.3"}
{
"version": "1.0.8",
"dependencies": {
"espree": "^7.1.0",
"tmp": "^0.2.1"
}
}
4 changes: 2 additions & 2 deletions cli/package.standalone.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "protobufjs-cli",
"description": "Translates between file formats and generates static code as well as TypeScript definitions.",
"version": "1.0.3",
"version": "1.0.8",
"author": "Daniel Wirtz <[email protected]>",
"repository": {
"type": "git",
Expand All @@ -15,7 +15,7 @@
"pbts": "bin/pbts"
},
"peerDependencies": {
"@pgherveou/protobufjs": "~1.0.3"
"@pgherveou/protobufjs": "~1.0.8"
},
"dependencies": {
"chalk": "^3.0.0",
Expand Down
5 changes: 2 additions & 3 deletions cli/pbjs.js
Original file line number Diff line number Diff line change
Expand Up @@ -194,9 +194,8 @@ exports.main = function main(args, callback) {
return resolved;
};

// Use es6 syntax if not explicitly specified on the command line and the es6 wrapper is used
if (argv.wrap === "es6" || argv.es6) {
argv.wrap = "es6";
// `--wrap es6` implies `--es6` but not the other way around. You can still use e.g. `--es6 --wrap commonjs`
if (argv.wrap === "es6") {
argv.es6 = true;
}

Expand Down
5 changes: 4 additions & 1 deletion cli/targets/static.js
Original file line number Diff line number Diff line change
Expand Up @@ -682,7 +682,10 @@ function buildEnum(ref, enm) {
comment.push((config.forceEnumString ? "@property {string} " : "@property {number} ") + key + "=" + val + " " + (enm.comments[key] || key + " value"));
});
pushComment(comment);
push(escapeName(ref) + "." + escapeName(enm.name) + " = (function() {");
if (!ref && config.es6)
push("export const " + escapeName(enm.name) + " = " + escapeName(ref) + "." + escapeName(enm.name) + " = (() => {");
else
push(escapeName(ref) + "." + escapeName(enm.name) + " = (function() {");
++indent;
push((config.es6 ? "const" : "var") + " valuesById = {}, values = Object.create(valuesById);");
var aliased = [];
Expand Down
200 changes: 166 additions & 34 deletions dist/light/protobuf.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/light/protobuf.js.map

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions dist/light/protobuf.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/light/protobuf.min.js.map

Large diffs are not rendered by default.

Loading

0 comments on commit 4e8050f

Please sign in to comment.