Skip to content

Commit

Permalink
feat: adding protobuf to typescript generation (#21)
Browse files Browse the repository at this point in the history
  • Loading branch information
holtgrewe authored Jan 26, 2024
1 parent 1104401 commit 26aa8c5
Show file tree
Hide file tree
Showing 9 changed files with 9,218 additions and 5 deletions.
18 changes: 18 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ help:
@echo " test Run tests (no watch)"
@echo " test-ci Run tests (no watch) for CI (with coverage, single-threaded)"
@echo " test-nocov Run tests (no watch) without coverage"
@echo " proto-fetch Fetch protobuf files"
@echo " proto-ts Generate .ts from .proto files"
@echo " proto Fetch, generate, and format .ts from .proto files"
@echo " test-w Run tests (watch)"
@echo " ci Install dependencies, run lints and tests"
@echo " serve Run the Storybook server"
Expand Down Expand Up @@ -61,3 +64,18 @@ serve:
.PHONY: serve-public
serve-public:
npm run storybook -- --host=0.0.0.0

PROTO_BASE := https://raw.githubusercontent.com/varfish-org/annonars/main

.PHONY: proto-fetch
proto-fetch:
mkdir -p protos/annonars/genes
wget -O protos/annonars/genes/base.proto $(PROTO_BASE)/protos/annonars/genes/base.proto

.PHONY: proto-ts
proto-ts:
mkdir -p src/pbs
npx protoc --ts_out src/pbs --proto_path protos protos/annonars/genes/base.proto

.PHONY: proto
proto: proto-fetch proto-ts format lint
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,11 @@ npm ci
make serve
# hack away!
```

## Generating TS for Protobuf

Fetch protobuf files from main, and re-generate the TS files, and format them.

```
make proto
```
Loading

0 comments on commit 26aa8c5

Please sign in to comment.