ts-proto 1.92.1 → 1.92.2

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/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ ## [1.92.2](https://github.com/stephenh/ts-proto/compare/v1.92.1...v1.92.2) (2021-12-08)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * noImplicitReturns error in Value.unwrap ([#436](https://github.com/stephenh/ts-proto/issues/436)) ([2d7a5d0](https://github.com/stephenh/ts-proto/commit/2d7a5d04c72ace58fa3a6745c3857f6cc0468543)), closes [#432](https://github.com/stephenh/ts-proto/issues/432)
7
+
1
8
  ## [1.92.1](https://github.com/stephenh/ts-proto/compare/v1.92.0...v1.92.1) (2021-12-02)
2
9
 
3
10
 
package/README.markdown CHANGED
@@ -9,25 +9,29 @@
9
9
 
10
10
  ## Table of contents
11
11
 
12
+ - [ts-proto](#ts-proto)
13
+ - [Table of contents](#table-of-contents)
14
+ - [Overview](#overview)
12
15
  - [QuickStart](#quickstart)
13
16
  - [Goals](#goals)
14
17
  - [Example Types](#example-types)
15
18
  - [Highlights](#highlights)
16
19
  - [Auto-Batching / N+1 Prevention](#auto-batching--n1-prevention)
17
20
  - [Usage](#usage)
18
- - [Supported options](#supported-options)
19
- - [Only Types](#only-types)
20
- - [NestJS Support](NESTJS.markdown)
21
+ - [Supported options](#supported-options)
22
+ - [Only Types](#only-types)
23
+ - [NestJS Support](#nestjs-support)
24
+ - [Watch Mode](#watch-mode)
25
+ - [Sponsors](#sponsors)
21
26
  - [Development](#development)
22
27
  - [Assumptions](#assumptions)
23
28
  - [Todo](#todo)
24
29
  - [OneOf Handling](#oneof-handling)
25
- - [Default Values and Unset Fields](#default-values-and-unset-fields)
30
+ - [Default values and unset fields](#default-values-and-unset-fields)
26
31
  - [Well-Known Types](#well-known-types)
27
32
  - [Wrapper Types](#wrapper-types)
28
33
  - [JSON Types (Struct Types)](#json-types-struct-types)
29
34
  - [Timestamp](#timestamp)
30
- - [Wrapper Types](#wrapper-types)
31
35
  - [Number Types](#number-types)
32
36
  - [Current Status of Optional Values](#current-status-of-optional-values)
33
37
 
@@ -354,6 +358,15 @@ If you're looking for `ts-proto` to generate only types for your Protobuf types
354
358
 
355
359
  We have a great way of working together with [nestjs](https://docs.nestjs.com/microservices/grpc). `ts-proto` generates `interfaces` and `decorators` for you controller, client. For more information see the [nestjs readme](NESTJS.markdown).
356
360
 
361
+ ### Watch Mode
362
+
363
+ If you want to run `ts-proto` on every change of a proto file, you'll need to use a tool like [chokidar-cli](https://www.npmjs.com/package/chokidar-cli) and use it as a script in `package.json`:
364
+
365
+ ```json
366
+ "proto:generate": "protoc --ts_proto_out=. ./<proto_path>/<proto_name>.proto --ts_proto_opt=esModuleInterop=true",
367
+ "proto:watch": "chokidar \"**/*.proto\" -c \"npm run proto:generate\""
368
+ ```
369
+
357
370
  # Sponsors
358
371
 
359
372
  Kudos to our sponsors:
package/build/main.js CHANGED
@@ -1222,19 +1222,20 @@ function generateUnwrap(fullProtoTypeName) {
1222
1222
  }
1223
1223
  if (types_1.isAnyValueTypeName(fullProtoTypeName)) {
1224
1224
  chunks.push(ts_poet_1.code `unwrap(message: Value): string | number | boolean | Object | null | Array<any> | undefined {
1225
- if (message.stringValue !== undefined) {
1225
+ if (message?.stringValue !== undefined) {
1226
1226
  return message.stringValue;
1227
- } else if (message.numberValue !== undefined) {
1227
+ } else if (message?.numberValue !== undefined) {
1228
1228
  return message.numberValue;
1229
- } else if (message.boolValue !== undefined) {
1229
+ } else if (message?.boolValue !== undefined) {
1230
1230
  return message.boolValue;
1231
- } else if (message.structValue !== undefined) {
1231
+ } else if (message?.structValue !== undefined) {
1232
1232
  return message.structValue;
1233
- } else if (message.listValue !== undefined) {
1233
+ } else if (message?.listValue !== undefined) {
1234
1234
  return message.listValue;
1235
- } else if (message.nullValue !== undefined) {
1235
+ } else if (message?.nullValue !== undefined) {
1236
1236
  return null;
1237
1237
  }
1238
+ return undefined;
1238
1239
  }`);
1239
1240
  }
1240
1241
  if (types_1.isListValueTypeName(fullProtoTypeName)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ts-proto",
3
- "version": "1.92.1",
3
+ "version": "1.92.2",
4
4
  "description": "",
5
5
  "main": "build/plugin.js",
6
6
  "repository": "github:stephenh/ts-proto",