@bufbuild/protoc-gen-es 2.0.0 → 2.1.0

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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bufbuild/protoc-gen-es",
3
- "version": "2.0.0",
3
+ "version": "2.1.0",
4
4
  "license": "Apache-2.0",
5
5
  "description": "Protocol Buffers code generator for ECMAScript",
6
6
  "keywords": [
@@ -30,11 +30,11 @@
30
30
  },
31
31
  "preferUnplugged": true,
32
32
  "dependencies": {
33
- "@bufbuild/protobuf": "^2.0.0",
34
- "@bufbuild/protoplugin": "2.0.0"
33
+ "@bufbuild/protobuf": "^2.1.0",
34
+ "@bufbuild/protoplugin": "2.1.0"
35
35
  },
36
36
  "peerDependencies": {
37
- "@bufbuild/protobuf": "2.0.0"
37
+ "@bufbuild/protobuf": "2.1.0"
38
38
  },
39
39
  "peerDependenciesMeta": {
40
40
  "@bufbuild/protobuf": {
@@ -351,7 +351,7 @@ function generateEnumShape(f, enumeration) {
351
351
  }
352
352
  // prettier-ignore
353
353
  function generateEnumJsonShape(f, enumeration, target) {
354
- f.print(f.jsDoc(`JSON type for the ${enumeration.toString()}.`));
354
+ f.print(f.jsDoc(enumeration));
355
355
  const declaration = target == "ts" ? "type" : "declare type";
356
356
  const values = [];
357
357
  if (enumeration.typeName == "google.protobuf.NullValue") {
@@ -412,11 +412,11 @@ function generateMessageShape(f, message, target) {
412
412
  // prettier-ignore
413
413
  function generateMessageJsonShape(f, message, target) {
414
414
  const exp = f.export(target == "ts" ? "type" : "declare type", f.importJson(message).name);
415
- f.print(f.jsDoc(`JSON type for the ${message.toString()}.`));
415
+ f.print(f.jsDoc(message));
416
416
  switch (message.typeName) {
417
417
  case "google.protobuf.Any":
418
418
  f.print(exp, " = {");
419
- f.print(` "@type"?: string`);
419
+ f.print(` "@type"?: string;`);
420
420
  f.print("};");
421
421
  break;
422
422
  case "google.protobuf.Timestamp":
@@ -449,7 +449,7 @@ function generateMessageJsonShape(f, message, target) {
449
449
  for (const field of message.fields) {
450
450
  switch (field.kind) {
451
451
  default:
452
- f.print(f.jsDoc(`@generated from field: ${(0, protoplugin_1.getDeclarationString)(field)};`, " "));
452
+ f.print(f.jsDoc(field, " "));
453
453
  // eslint-disable-next-line no-case-declarations
454
454
  let jsonName = field.jsonName;
455
455
  if (jsonName === ""
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bufbuild/protoc-gen-es",
3
- "version": "2.0.0",
3
+ "version": "2.1.0",
4
4
  "license": "Apache-2.0",
5
5
  "description": "Protocol Buffers code generator for ECMAScript",
6
6
  "keywords": [
@@ -30,11 +30,11 @@
30
30
  },
31
31
  "preferUnplugged": true,
32
32
  "dependencies": {
33
- "@bufbuild/protobuf": "^2.0.0",
34
- "@bufbuild/protoplugin": "2.0.0"
33
+ "@bufbuild/protobuf": "^2.1.0",
34
+ "@bufbuild/protoplugin": "2.1.0"
35
35
  },
36
36
  "peerDependencies": {
37
- "@bufbuild/protobuf": "2.0.0"
37
+ "@bufbuild/protobuf": "2.1.0"
38
38
  },
39
39
  "peerDependenciesMeta": {
40
40
  "@bufbuild/protobuf": {