Skip to content

Commit

Permalink
chore(docs): Update docs (#1705)
Browse files Browse the repository at this point in the history
Add a script to update all relevant query.proto and service.proto files to import and add annotations for swagger docs tags
  • Loading branch information
zale144 authored Jan 13, 2025
1 parent 942c868 commit 8133007
Show file tree
Hide file tree
Showing 6 changed files with 857 additions and 302 deletions.
29 changes: 28 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ proto-gen:
proto-swagger-gen:
@echo "Downloading Protobuf dependencies"
@make proto-download-deps
@make psf
@echo "Generating Protobuf Swagger"
$(protoCosmosImage) sh ./scripts/protoc-swagger-gen.sh

Expand All @@ -193,7 +194,12 @@ proto-lint:
SWAGGER_DIR=./swagger-proto
THIRD_PARTY_DIR=$(SWAGGER_DIR)/third_party

psf:
@echo psf $(SWAGGER_DIR)
./scripts/protoswagfix/bin/psf $(SWAGGER_DIR)

proto-download-deps:
rm -rf $(SWAGGER_DIR)
mkdir -p "$(THIRD_PARTY_DIR)/cosmos_tmp" && \
cd "$(THIRD_PARTY_DIR)/cosmos_tmp" && \
git init && \
Expand Down Expand Up @@ -271,4 +277,25 @@ proto-download-deps:
mkdir -p "$(THIRD_PARTY_DIR)/cosmos/ics23/v1" && \
curl -sSL "https://raw.githubusercontent.com/cosmos/ics23/$(DEPS_COSMOS_ICS23)/proto/cosmos/ics23/v1/proofs.proto" > "$(THIRD_PARTY_DIR)/cosmos/ics23/v1/proofs.proto"

.PHONY: proto-gen proto-swagger-gen proto-format proto-lint proto-download-deps
mkdir -p "$(THIRD_PARTY_DIR)/grpc_gw_tmp" && \
cd "$(THIRD_PARTY_DIR)/grpc_gw_tmp" && \
git init && \
git remote add origin "https://github.com/grpc-ecosystem/grpc-gateway.git" && \
git config core.sparseCheckout true && \
printf "protoc-gen-openapiv2/options\n" > .git/info/sparse-checkout && \
git fetch --depth=1 origin main && \
git checkout FETCH_HEAD && \
mkdir -p "$(THIRD_PARTY_DIR)/protoc-gen-openapiv2/options" && \
mv ./* .. && \
rm -rf "$(THIRD_PARTY_DIR)/grpc_gw_tmp"

# prepare swagger generation
mkdir -p "$(SWAGGER_DIR)/proto"
printf "version: v1\ndirectories:\n - proto\n - third_party" > "$(SWAGGER_DIR)/buf.work.yaml"
printf "version: v1\nname: buf.build/dymensionxyz/dymension\n" > "$(SWAGGER_DIR)/proto/buf.yaml"
cp ./proto/buf.gen.swagger.yaml "$(SWAGGER_DIR)/proto/buf.gen.swagger.yaml"

# copy existing proto files
cp -r ./proto/dymensionxyz "$(SWAGGER_DIR)/proto"

.PHONY: proto-gen proto-swagger-gen proto-format proto-lint proto-download-deps psf
Loading

0 comments on commit 8133007

Please sign in to comment.