Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @badsyntax
46 changes: 46 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Test

on:
push:
branches: [master]
pull_request:
branches: [master]

jobs:
test:
runs-on: ubuntu-20.04
name: Build examples
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: 15
- uses: actions/setup-java@v1
with:
java-version: 15
architecture: x64
- name: Build gradle-ts-protoc-gen
run: |
cd examples/gradle-ts-protoc-gen
npm i
npm run build
- name: Build grpc_tools_node_protoc_ts
run: |
cd examples/grpc_tools_node_protoc_ts
npm i
npm run build
- name: Build grpc-proto-loader
run: |
cd examples/grpc-proto-loader
npm i
npm run build
- name: Build grpc-web
run: |
cd examples/grpc-web
npm i
npm run build
- name: Build ts-protoc-gen
run: |
cd examples/ts-protoc-gen
npm i
npm run build
8 changes: 2 additions & 6 deletions examples/gradle-ts-protoc-gen/README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
# gradle-ts-protoc-gen example

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.
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.

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.

[`google-protobuf`](https://www.npmjs.com/package/google-protobuf) & [`@grpc/grpc-js`](https://www.npmjs.com/package/@grpc/grpc-js) is used at runtime.

## Issues with this approach

Server type definitions are not generated by `ts-protoc-gen`. See See https://github.com/improbable-eng/ts-protoc-gen/pull/247.
[`google-protobuf`](https://www.npmjs.com/package/google-protobuf) & [`@grpc/grpc-js`](https://www.npmjs.com/package/@grpc/grpc-js) are used at runtime.

## App layout

Expand Down
5 changes: 5 additions & 0 deletions examples/gradle-ts-protoc-gen/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ sourceSets {
}

protobuf {
protoc {
path = file(
'./node_modules/.bin/grpc_tools_node_protoc' + (isWindows ? '.cmd' : '')
)
}
plugins {
grpc {
path = file(
Expand Down
Loading