Skip to content

Commit

Permalink
Added script to generate TS web clients
Browse files Browse the repository at this point in the history
As you are doing this you probably want to have a look at these:
https://github.com/grpc/grpc-web
grpc/grpc-web#704 (comment)
  • Loading branch information
Panagiotis Petridis committed Aug 22, 2022
1 parent e526dec commit 0ab0b75
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 0 deletions.
3 changes: 3 additions & 0 deletions services/chat-client/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,6 @@ yarn-error.log*
# typescript
*.tsbuildinfo
next-env.d.ts

#grpc
grpc-clients/*
4 changes: 4 additions & 0 deletions services/chat-client/build-clients.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash

protoc -I=./../../protos ../../protos/*.proto \
--grpc-web_out=import_style=typescript,mode=grpcweb:./grpc-clients
11 changes: 11 additions & 0 deletions services/chat-client/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions services/chat-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@
"private": true,
"scripts": {
"dev": "next dev",
"build-grpc-clients": "sh build-clients.sh",
"build": "next build",
"start": "next start",
"lint": "next lint"
},
"dependencies": {
"grpc-web": "^1.3.1",
"next": "12.2.5",
"react": "18.2.0",
"react-dom": "18.2.0"
Expand Down

0 comments on commit 0ab0b75

Please sign in to comment.