Skip to content

Commit f9b35c3

Browse files
authored
Update ts-protoc-gen & add github actions workflow (#9)
* Update ts-protoc-gen to generate server interfaces * Add github actions workflow for running builds * Update packages and README's * Cleanup and use server interface for grpc-web * Install before build * Specify node and java versions * test * Try fix path to proto compiler * Remove debug
1 parent d7eb29a commit f9b35c3

24 files changed

+20714
-4866
lines changed

.github/CODEOWNERS

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* @badsyntax

.github/workflows/test.yml

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Test
2+
3+
on:
4+
push:
5+
branches: [master]
6+
pull_request:
7+
branches: [master]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-20.04
12+
name: Build examples
13+
steps:
14+
- uses: actions/checkout@v1
15+
- uses: actions/setup-node@v1
16+
with:
17+
node-version: 15
18+
- uses: actions/setup-java@v1
19+
with:
20+
java-version: 15
21+
architecture: x64
22+
- name: Build gradle-ts-protoc-gen
23+
run: |
24+
cd examples/gradle-ts-protoc-gen
25+
npm i
26+
npm run build
27+
- name: Build grpc_tools_node_protoc_ts
28+
run: |
29+
cd examples/grpc_tools_node_protoc_ts
30+
npm i
31+
npm run build
32+
- name: Build grpc-proto-loader
33+
run: |
34+
cd examples/grpc-proto-loader
35+
npm i
36+
npm run build
37+
- name: Build grpc-web
38+
run: |
39+
cd examples/grpc-web
40+
npm i
41+
npm run build
42+
- name: Build ts-protoc-gen
43+
run: |
44+
cd examples/ts-protoc-gen
45+
npm i
46+
npm run build

examples/gradle-ts-protoc-gen/README.md

+2-6
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,10 @@
11
# gradle-ts-protoc-gen example
22

3-
This examples shows how to uses [Gradle](https://gradle.org/), the [proto compiler](https://www.npmjs.com/package/grpc-tools), [`ts-protoc-gen`](https://www.npmjs.com/package/ts-protoc-gen) & [`@grpc/grpc-js`](https://www.npmjs.com/package/@grpc/grpc-js) to build a (not quite yet) fully typed gRPC application that runs on Node.js.
3+
This examples shows how to uses [Gradle](https://gradle.org/), the [proto compiler](https://www.npmjs.com/package/grpc-tools), [`ts-protoc-gen`](https://www.npmjs.com/package/ts-protoc-gen) & [`@grpc/grpc-js`](https://www.npmjs.com/package/@grpc/grpc-js) to build a fully typed gRPC application that runs on Node.js.
44

55
The [proto compiler](https://www.npmjs.com/package/grpc-tools) and [`ts-protoc-gen`](https://www.npmjs.com/package/ts-protoc-gen) compiler plugin are used to generate JavaScript & TypeScript files from the proto definitions. The [`protobuf-gradle-plugin`](https://github.com/google/protobuf-gradle-plugin) Gradle plugin is used to run the compiler from Gradle.
66

7-
[`google-protobuf`](https://www.npmjs.com/package/google-protobuf) & [`@grpc/grpc-js`](https://www.npmjs.com/package/@grpc/grpc-js) is used at runtime.
8-
9-
## Issues with this approach
10-
11-
Server type definitions are not generated by `ts-protoc-gen`. See See https://github.com/improbable-eng/ts-protoc-gen/pull/247.
7+
[`google-protobuf`](https://www.npmjs.com/package/google-protobuf) & [`@grpc/grpc-js`](https://www.npmjs.com/package/@grpc/grpc-js) are used at runtime.
128

139
## App layout
1410

examples/gradle-ts-protoc-gen/build.gradle

+5
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ sourceSets {
2424
}
2525

2626
protobuf {
27+
protoc {
28+
path = file(
29+
'./node_modules/.bin/grpc_tools_node_protoc' + (isWindows ? '.cmd' : '')
30+
)
31+
}
2732
plugins {
2833
grpc {
2934
path = file(

0 commit comments

Comments
 (0)