@bufbuild/protoc-gen-es 1.2.0 → 1.2.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.
package/README.md CHANGED
@@ -35,7 +35,7 @@ Add a new configuration file `buf.gen.yaml`:
35
35
  version: v1
36
36
  plugins:
37
37
  # This will invoke protoc-gen-es and write output to src/gen
38
- - name: es
38
+ - plugin: es
39
39
  out: src/gen
40
40
  opt:
41
41
  # Add more plugin options here
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bufbuild/protoc-gen-es",
3
- "version": "1.2.0",
3
+ "version": "1.2.1",
4
4
  "description": "Protocol Buffers code generator for ECMAScript",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -20,10 +20,10 @@
20
20
  },
21
21
  "preferUnplugged": true,
22
22
  "dependencies": {
23
- "@bufbuild/protoplugin": "1.2.0"
23
+ "@bufbuild/protoplugin": "1.2.1"
24
24
  },
25
25
  "peerDependencies": {
26
- "@bufbuild/protobuf": "1.2.0"
26
+ "@bufbuild/protobuf": "1.2.1"
27
27
  },
28
28
  "peerDependenciesMeta": {
29
29
  "@bufbuild/protobuf": {
@@ -473,7 +473,7 @@ function generateWktMethods(schema, f, message) {
473
473
  f.print(` }`);
474
474
  f.print(` return this.`, (0, ecmascript_1.localName)(ref.paths), `.map(p => {`);
475
475
  f.print(` if (p.match(/_[0-9]?_/g) || p.match(/[A-Z]/g)) {`);
476
- f.print(` throw new Error("cannot decode `, message.typeName, ` from JSON: lowerCamelCase of path name \\"" + p + "\\" is irreversible");`);
476
+ f.print(` throw new Error("cannot encode `, message.typeName, ` to JSON: lowerCamelCase of path name \\"" + p + "\\" is irreversible");`);
477
477
  f.print(` }`);
478
478
  f.print(` return protoCamelCase(p);`);
479
479
  f.print(` }).join(",");`);
@@ -476,7 +476,7 @@ function generateWktMethods(schema, f, message) {
476
476
  f.print(` }`);
477
477
  f.print(` return this.`, (0, ecmascript_1.localName)(ref.paths), `.map(p => {`);
478
478
  f.print(` if (p.match(/_[0-9]?_/g) || p.match(/[A-Z]/g)) {`);
479
- f.print(` throw new Error("cannot decode `, message.typeName, ` from JSON: lowerCamelCase of path name \\"" + p + "\\" is irreversible");`);
479
+ f.print(` throw new Error("cannot encode `, message.typeName, ` to JSON: lowerCamelCase of path name \\"" + p + "\\" is irreversible");`);
480
480
  f.print(` }`);
481
481
  f.print(` return protoCamelCase(p);`);
482
482
  f.print(` }).join(",");`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bufbuild/protoc-gen-es",
3
- "version": "1.2.0",
3
+ "version": "1.2.1",
4
4
  "description": "Protocol Buffers code generator for ECMAScript",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -20,10 +20,10 @@
20
20
  },
21
21
  "preferUnplugged": true,
22
22
  "dependencies": {
23
- "@bufbuild/protoplugin": "1.2.0"
23
+ "@bufbuild/protoplugin": "1.2.1"
24
24
  },
25
25
  "peerDependencies": {
26
- "@bufbuild/protobuf": "1.2.0"
26
+ "@bufbuild/protobuf": "1.2.1"
27
27
  },
28
28
  "peerDependenciesMeta": {
29
29
  "@bufbuild/protobuf": {
package/src/javascript.ts CHANGED
@@ -359,7 +359,7 @@ function generateWktMethods(schema: Schema, f: GeneratedFile, message: DescMessa
359
359
  f.print(` text += "." + nanosStr;`)
360
360
  f.print(" if (this.", localName(ref.nanos), " < 0 && this.", localName(ref.seconds), " === ", protoInt64, ".zero) {");
361
361
  f.print(` text = "-" + text;`);
362
- f.print(` }`);
362
+ f.print(` }`);
363
363
  f.print(" }")
364
364
  f.print(` return text + "s";`)
365
365
  f.print("};");
@@ -486,7 +486,7 @@ function generateWktMethods(schema: Schema, f: GeneratedFile, message: DescMessa
486
486
  f.print(` }`)
487
487
  f.print(` return this.`, localName(ref.paths), `.map(p => {`)
488
488
  f.print(` if (p.match(/_[0-9]?_/g) || p.match(/[A-Z]/g)) {`)
489
- f.print(` throw new Error("cannot decode `, message.typeName, ` from JSON: lowerCamelCase of path name \\"" + p + "\\" is irreversible");`)
489
+ f.print(` throw new Error("cannot encode `, message.typeName, ` to JSON: lowerCamelCase of path name \\"" + p + "\\" is irreversible");`)
490
490
  f.print(` }`)
491
491
  f.print(` return protoCamelCase(p);`)
492
492
  f.print(` }).join(",");`)
package/src/typescript.ts CHANGED
@@ -384,7 +384,7 @@ function generateWktMethods(schema: Schema, f: GeneratedFile, message: DescMessa
384
384
  f.print(` text += "." + nanosStr;`)
385
385
  f.print(" if (this.", localName(ref.nanos), " < 0 && this.", localName(ref.seconds), " === ", protoInt64, ".zero) {");
386
386
  f.print(` text = "-" + text;`);
387
- f.print(` }`);
387
+ f.print(` }`);
388
388
  f.print(" }")
389
389
  f.print(` return text + "s";`)
390
390
  f.print(" }")
@@ -513,7 +513,7 @@ function generateWktMethods(schema: Schema, f: GeneratedFile, message: DescMessa
513
513
  f.print(` }`)
514
514
  f.print(` return this.`, localName(ref.paths), `.map(p => {`)
515
515
  f.print(` if (p.match(/_[0-9]?_/g) || p.match(/[A-Z]/g)) {`)
516
- f.print(` throw new Error("cannot decode `, message.typeName, ` from JSON: lowerCamelCase of path name \\"" + p + "\\" is irreversible");`)
516
+ f.print(` throw new Error("cannot encode `, message.typeName, ` to JSON: lowerCamelCase of path name \\"" + p + "\\" is irreversible");`)
517
517
  f.print(` }`)
518
518
  f.print(` return protoCamelCase(p);`)
519
519
  f.print(` }).join(",");`)