Skip to content

Commit

Permalink
fix(nice-grpc-server-reflection): replace ts-proto with `google-pro…
Browse files Browse the repository at this point in the history
…tobuf` to fix proto2 serialization
  • Loading branch information
aikoven committed Jun 29, 2021
1 parent cea7174 commit 463e9d4
Show file tree
Hide file tree
Showing 4 changed files with 153 additions and 202 deletions.
4 changes: 2 additions & 2 deletions packages/nice-grpc-server-reflection/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Add `ServerReflection` service implementation to gRPC server:
```ts
import {createServer} from 'nice-grpc';
import {
ServerReflectionDefinition,
ServerReflectionService,
ServerReflection,
} from 'nice-grpc-server-reflection';
import * as fs from 'fs';
Expand All @@ -37,7 +37,7 @@ server.add(MyService, myServiceImpl);

// add server reflection service
server.add(
ServerReflectionDefinition,
ServerReflectionService,
ServerReflection(
fs.readFileSync(path.join('path', 'to', 'protoset.bin')),
// specify fully-qualified names of exposed services
Expand Down
15 changes: 7 additions & 8 deletions packages/nice-grpc-server-reflection/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,25 +19,24 @@
"scripts": {
"clean": "rimraf lib",
"test": "jest --passWithNoTests",
"build": "tsc -P tsconfig.build.json",
"build": "tsc -P tsconfig.build.json && cpr src/proto lib/proto",
"prepublishOnly": "npm test && npm run clean && npm run build",
"prepare:proto": "mkdirp ./src/proto && grpc_tools_node_protoc --ts_proto_out=./src/proto --ts_proto_opt=outputServices=generic-definitions,outputJsonMethods=false,oneof=unions -I ./proto proto/grpc/reflection/v1alpha/reflection.proto",
"prepare:proto": "mkdirp ./src/proto && grpc_tools_node_protoc --js_out=import_style=commonjs,binary:./src/proto --grpc_out=grpc_js:./src/proto --ts_out=grpc_js:./src/proto -I ./proto proto/grpc/reflection/v1alpha/reflection.proto",
"prepare": "npm run prepare:proto"
},
"author": "Daniel Lytkin <aikoven@deeplay.io>",
"license": "MIT",
"devDependencies": {
"@tsconfig/node12": "^1.0.8",
"cpr": "^3.0.1",
"grpc-tools": "^1.11.0",
"grpc_tools_node_protoc_ts": "^5.1.3",
"mkdirp": "^1.0.4",
"rimraf": "^3.0.2",
"ts-proto": "^1.82.0"
"rimraf": "^3.0.2"
},
"dependencies": {
"long": "^4.0.0",
"nice-grpc": "^1.0.1",
"protobufjs": "^6.11.2",
"ts-proto-descriptors": "^1.3.1"
"@types/google-protobuf": "^3.7.4",
"google-protobuf": "^3.15.6",
"nice-grpc": "^1.0.1"
}
}
Loading

0 comments on commit 463e9d4

Please # to comment.