-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathMakefile
More file actions
31 lines (24 loc) · 1.02 KB
/
Makefile
File metadata and controls
31 lines (24 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
SHELL := /usr/bin/env bash -o pipefail
# --- Help ---
.PHONY: help
help: ## Show this help
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-20s\033[0m %s\n", $$1, $$2}'
# --- Code Generation ---
.PHONY: generate
generate: generate-ts generate-py generate-rs ## Generate all SDK clients
.PHONY: generate-ts
generate-ts: ## Generate TypeScript client
apigen -l ts
.PHONY: generate-py
generate-py: ## Generate Python client
apigen -l python
.PHONY: generate-rs
generate-rs: ## Generate Rust client
rm -rf rust/gen/bluefin_api
apigen -l rust
.PHONY: example-rs
example-rs: ## Run the example for the generated Rust client
cd rust; for i in `ls examples/ | grep -v shutdown`; do name=$${i::-3}; echo "$$name"; cargo run --example "$$name"; done
.PHONY: ts-typecheck
ts-typecheck: generate-ts ## Type check the generated TypeScript client
docker run --rm -v "${PWD}:/work" -w /work/ts/sdk node:24 sh -lc "yarn install --frozen-lockfile && yarn build:types && yarn build:example"