mirror of
https://github.com/koala73/worldmonitor.git
synced 2026-04-25 17:14:57 +02:00
- Bump SEBUF_VERSION to v0.11.1, pulling in the OpenAPI fix for repeated scalar query params (SebastienMelki/sebuf#161). `repeated string` fields now emit `type: array` + `items.type: string` + `style: form` + `explode: true` instead of `type: string`, so SDK generators consuming the unified bundle produce correct array clients. - Regenerate all 12 OpenAPI specs (unified bundle + Aviation, Economic, Infrastructure, Market, Trade per-service). TS client/server codegen is byte-identical to v0.11.0 — only the OpenAPI emitter was out of sync. - Update three tests that asserted the pre-v0.11 comma-joined wire format (`symbols=AAPL,MSFT`) to match the current repeated-param form (`symbols=AAPL&symbols=MSFT`) produced by `params.append(...)`: - tests/market-service-symbol-casing.test.mjs (2 cases: getAll) - tests/stock-analysis-history.test.mts - tests/stock-backtest.test.mts Locally: test:data 6619/6619 pass, typecheck clean, lint exit 0. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
73 lines
2.4 KiB
Makefile
73 lines
2.4 KiB
Makefile
.PHONY: help lint generate breaking format check clean deps install install-buf install-plugins install-npm install-playwright
|
|
.DEFAULT_GOAL := help
|
|
|
|
# Variables
|
|
PROTO_DIR := proto
|
|
GEN_CLIENT_DIR := src/generated/client
|
|
GEN_SERVER_DIR := src/generated/server
|
|
DOCS_API_DIR := docs/api
|
|
|
|
# Go install settings
|
|
GO_PROXY := GOPROXY=direct
|
|
GO_PRIVATE := GOPRIVATE=github.com/SebastienMelki
|
|
GO_INSTALL := $(GO_PROXY) $(GO_PRIVATE) go install
|
|
|
|
# Required tool versions
|
|
BUF_VERSION := v1.64.0
|
|
SEBUF_VERSION := v0.11.1
|
|
|
|
help: ## Show this help message
|
|
@echo 'Usage: make [target]'
|
|
@echo ''
|
|
@echo 'Targets:'
|
|
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf " %-20s %s\n", $$1, $$2}' $(MAKEFILE_LIST)
|
|
|
|
install: install-buf install-plugins install-npm install-playwright deps ## Install everything (buf, sebuf plugins, npm deps, proto deps, browsers)
|
|
|
|
install-buf: ## Install buf CLI
|
|
@if command -v buf >/dev/null 2>&1; then \
|
|
echo "buf already installed: $$(buf --version)"; \
|
|
else \
|
|
echo "Installing buf..."; \
|
|
$(GO_INSTALL) github.com/bufbuild/buf/cmd/buf@$(BUF_VERSION); \
|
|
echo "buf installed!"; \
|
|
fi
|
|
|
|
install-plugins: ## Install sebuf protoc plugins (requires Go)
|
|
@echo "Installing sebuf protoc plugins $(SEBUF_VERSION)..."
|
|
@$(GO_INSTALL) github.com/SebastienMelki/sebuf/cmd/protoc-gen-ts-client@$(SEBUF_VERSION)
|
|
@$(GO_INSTALL) github.com/SebastienMelki/sebuf/cmd/protoc-gen-ts-server@$(SEBUF_VERSION)
|
|
@$(GO_INSTALL) github.com/SebastienMelki/sebuf/cmd/protoc-gen-openapiv3@$(SEBUF_VERSION)
|
|
@echo "Plugins installed!"
|
|
|
|
install-npm: ## Install npm dependencies
|
|
npm install
|
|
|
|
install-playwright: ## Install Playwright browsers for e2e tests
|
|
npx playwright install chromium
|
|
|
|
deps: ## Install/update buf proto dependencies
|
|
cd $(PROTO_DIR) && buf dep update
|
|
|
|
lint: ## Lint protobuf files
|
|
cd $(PROTO_DIR) && buf lint
|
|
|
|
generate: clean ## Generate code from proto definitions
|
|
@mkdir -p $(GEN_CLIENT_DIR) $(GEN_SERVER_DIR) $(DOCS_API_DIR)
|
|
cd $(PROTO_DIR) && buf generate
|
|
@echo "Code generation complete!"
|
|
|
|
breaking: ## Check for breaking changes against main
|
|
cd $(PROTO_DIR) && buf breaking --against '.git#branch=main,subdir=proto'
|
|
|
|
format: ## Format protobuf files
|
|
cd $(PROTO_DIR) && buf format -w
|
|
|
|
check: lint generate ## Run all checks (lint + generate)
|
|
|
|
clean: ## Clean generated files
|
|
@rm -rf $(GEN_CLIENT_DIR)
|
|
@rm -rf $(GEN_SERVER_DIR)
|
|
@rm -rf $(DOCS_API_DIR)
|
|
@echo "Clean complete!"
|