-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
65 lines (45 loc) · 2.26 KB
/
Copy pathMakefile
File metadata and controls
65 lines (45 loc) · 2.26 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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
.PHONY: help build run test test-pg fmt fmt-check lint clippy clean docker spec validate-spec \
sdks sdks-python sdks-typescript sdks-go check-ts-sdk
CARGO ?= cargo
BIN := queueflow
SPEC_DIR := spec
DOCKER_REGISTRY ?= ghcr.io/queueflow
DOCKER_TAG ?= dev
OPENAPI_IMAGE := openapitools/openapi-generator-cli:v7.10.0
help: ## Show this help
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf " \033[36m%-18s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)
build: ## Build all crates (release)
$(CARGO) build --workspace --release
run: ## Run the server (needs DATABASE_URL)
$(CARGO) run -p queueflow-server -- serve
test: ## Run unit + integration tests (no database needed)
$(CARGO) test --workspace
test-pg: ## Run Postgres integration tests (needs TEST_DATABASE_URL; any plain PostgreSQL 13+)
$(CARGO) test -p queueflow-core --features postgres -- --include-ignored
fmt: ## Format the code
$(CARGO) fmt --all
fmt-check: ## Check formatting
$(CARGO) fmt --all --check
lint: clippy ## Alias for clippy
clippy: ## Lint with clippy (warnings are errors)
$(CARGO) clippy --workspace --all-targets -- -D warnings
clean: ## Remove build artifacts
$(CARGO) clean
docker: ## Build the server docker image
docker build -t $(DOCKER_REGISTRY)/$(BIN):$(DOCKER_TAG) .
## OpenAPI / SDKs
spec: ## Generate the OpenAPI spec from code into ./spec
$(CARGO) run -q -p queueflow-server -- spec --output-dir $(SPEC_DIR)
validate-spec: spec ## Validate the generated spec with openapi-generator
docker run --rm -v "$(CURDIR)/$(SPEC_DIR):/spec:ro" \
$(OPENAPI_IMAGE) validate -i /spec/openapi.json
sdks: validate-spec ## Regenerate the Python + Go SDKs (generated core + injected facade). Rust = native crate; TS = own repo.
./scripts/generate-sdks.sh all
sdks-python: validate-spec ## Regenerate the Python SDK (generated core + facade supporting file)
./scripts/generate-sdks.sh python
sdks-typescript: ## Regenerate the TS core (../queueflow-sdk-nodejs) and build the facade
cd ../queueflow-sdk-nodejs && npm install && npm run generate-core && npm run build
sdks-go: validate-spec ## Regenerate the Go SDK (generated core + facade supporting file)
./scripts/generate-sdks.sh go
check-ts-sdk: spec ## Verify the TS generated core + facade match the spec
node ./scripts/check-ts-sdk.mjs