ts-proto 1.156.7 → 1.157.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.
package/build/enums.js CHANGED
@@ -39,11 +39,13 @@ function generateEnum(ctx, fullName, enumDesc, sourceInfo) {
39
39
  else {
40
40
  chunks.push((0, ts_poet_1.code) `}`);
41
41
  }
42
- if (options.outputJsonMethods || (options.stringEnums && options.outputEncodeMethods)) {
42
+ if (options.outputJsonMethods === true ||
43
+ options.outputJsonMethods === "from-only" ||
44
+ (options.stringEnums && options.outputEncodeMethods)) {
43
45
  chunks.push((0, ts_poet_1.code) `\n`);
44
46
  chunks.push(generateEnumFromJson(ctx, fullName, enumDesc));
45
47
  }
46
- if (options.outputJsonMethods) {
48
+ if (options.outputJsonMethods === true || options.outputJsonMethods === "to-only") {
47
49
  chunks.push((0, ts_poet_1.code) `\n`);
48
50
  chunks.push(generateEnumToJson(ctx, fullName, enumDesc));
49
51
  }
package/build/main.js CHANGED
@@ -67,8 +67,10 @@ function generateFile(ctx, fileDesc) {
67
67
  });
68
68
  // If nestJs=true export [package]_PACKAGE_NAME and [service]_SERVICE_NAME const
69
69
  if (options.nestJs) {
70
- const prefix = (0, case_1.camelToSnake)(fileDesc.package.replace(/\./g, "_"));
71
- chunks.push((0, ts_poet_1.code) `export const ${prefix}_PACKAGE_NAME = '${fileDesc.package}';`);
70
+ if (options.exportCommonSymbols) {
71
+ const prefix = (0, case_1.camelToSnake)(fileDesc.package.replace(/\./g, "_"));
72
+ chunks.push((0, ts_poet_1.code) `export const ${prefix}_PACKAGE_NAME = '${fileDesc.package}';`);
73
+ }
72
74
  if (options.useDate === options_1.DateOption.DATE &&
73
75
  fileDesc.messageType.find((message) => message.field.find((field) => field.typeName === ".google.protobuf.Timestamp"))) {
74
76
  chunks.push(makeProtobufTimestampWrapper());
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ts-proto",
3
- "version": "1.156.7",
3
+ "version": "1.157.0",
4
4
  "description": "",
5
5
  "main": "build/plugin.js",
6
6
  "repository": "github:stephenh/ts-proto",