Skip to content
Draft
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
39 changes: 23 additions & 16 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ ci-build: install proto http-api-docs
install: grpc-install api-linter-install buf-install

# Run all linters and compile proto files.
proto: grpc http-api-docs nexus-rpc-yaml
proto: grpc http-api-docs system-nexus-wit
########################################################################

##### Variables ######
Expand All @@ -17,7 +17,9 @@ GOPATH := $(shell go env GOPATH)
endif

GOBIN := $(if $(shell go env GOBIN),$(shell go env GOBIN),$(GOPATH)/bin)
PATH := $(GOBIN):$(PATH)
CARGO_HOME ?= $(HOME)/.cargo
CARGO_BIN := $(CARGO_HOME)/bin
PATH := $(GOBIN):$(CARGO_BIN):$(PATH)
STAMPDIR := .stamp

COLOR := "\e[1;36m%s\e[0m\n"
Expand All @@ -33,6 +35,10 @@ PROTO_PATHS = paths=source_relative:$(PROTO_OUT)
OAPI_OUT := openapi
OAPI3_PATH := .components.schemas.Payload

SYSTEM_NEXUS_WIT := nexus/temporal-system.wit
SYSTEM_NEXUS_SERVICE_PROTO_FILES := $(shell find temporal/api -name "service.proto" | sort)
NEXUS_API_GEN ?= nexus-api-gen

$(PROTO_OUT):
mkdir $(PROTO_OUT)

Expand Down Expand Up @@ -121,21 +127,22 @@ buf-breaking:
@printf $(COLOR) "Run buf breaking changes check against master branch..."
@(cd $(PROTO_ROOT) && buf breaking --against 'https://github.com/temporalio/api.git#branch=master')

nexus-rpc-yaml: nexus-rpc-yaml-install
printf $(COLOR) "Generate nexus/temporal-proto-models-nexusrpc.yaml..."
mkdir -p nexus
##### Compile system Nexus WIT files #####
system-nexus-wit: system-nexus-wit-install nexus-api-gen-install
printf $(COLOR) "Generate system Nexus WIT..."
protoc -I $(PROTO_ROOT) \
--nexus-rpc-yaml_opt=nexus-rpc_langs_out=nexus/temporal-proto-models-nexusrpc.yaml \
--nexus-rpc-yaml_opt=python_package_prefix=temporalio.api \
--nexus-rpc-yaml_opt=typescript_package_prefix=@temporalio/api \
--nexus-rpc-yaml_opt=include_operation_tags=exposed \
--nexus-rpc-yaml_out=. \
temporal/api/workflowservice/v1/* \
temporal/api/operatorservice/v1/*

nexus-rpc-yaml-install:
printf $(COLOR) "Build and install protoc-gen-nexus-rpc-yaml..."
@cd cmd/protoc-gen-nexus-rpc-yaml && go install .
--system-nexus-wit_opt=output=$(SYSTEM_NEXUS_WIT) \
--system-nexus-wit_opt=nexus_api_gen=$(NEXUS_API_GEN) \
--system-nexus-wit_out=. \
$(SYSTEM_NEXUS_SERVICE_PROTO_FILES)

system-nexus-wit-install:
printf $(COLOR) "Build and install protoc-gen-system-nexus-wit..."
@cd cmd/protoc-gen-system-nexus-wit && go install .

nexus-api-gen-install:
printf $(COLOR) "Install nexus-api-gen if missing..."
command -v $(NEXUS_API_GEN) >/dev/null || CARGO_NET_GIT_FETCH_WITH_CLI=true cargo install --git https://github.com/temporalio/nexus-api-gen

##### Clean #####
clean:
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Install as git submodule to the project.
## Contribution

Make your change to the temporal/proto files, and run `make` to update the openapi definitions.
Rust is also required because `make` installs and runs `nexus-api-gen` when regenerating system Nexus WIT files.

## Breaking changes

Expand Down
272 changes: 0 additions & 272 deletions cmd/protoc-gen-nexus-rpc-yaml/generator.go

This file was deleted.

12 changes: 0 additions & 12 deletions cmd/protoc-gen-nexus-rpc-yaml/go.mod

This file was deleted.

10 changes: 0 additions & 10 deletions cmd/protoc-gen-nexus-rpc-yaml/go.sum

This file was deleted.

13 changes: 0 additions & 13 deletions cmd/protoc-gen-nexus-rpc-yaml/main.go

This file was deleted.

Loading
Loading