-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJustfile
More file actions
155 lines (116 loc) · 4.33 KB
/
Copy pathJustfile
File metadata and controls
155 lines (116 loc) · 4.33 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
# List available recipes
default:
@just --list --list-submodules
mod golden-typescript 'just/golden-typescript.just'
mod golden-go 'just/golden-go.just'
mod golden-rust 'just/golden-rust.just'
mod golden-python 'just/golden-python.just'
mod golden-java 'just/golden-java.just'
mod golden-kotlin 'just/golden-kotlin.just'
# ---------- Build ----------
# Build the project
build:
cargo build
# Build release
build-release:
cargo build --release
# Check (compile without running)
check:
cargo check
# Check all targets
check-all:
cargo check --all-targets --all-features
# Check MSRV (1.90)
msrv:
cargo +1.90.0 check
# ---------- Lint ----------
# Apply formatting
fmt:
cargo fmt --all
# Check formatting
fmt-check:
cargo fmt --all -- --check
# Run clippy with warnings as errors
clippy:
cargo clippy --workspace --all-targets --all-features -- -D warnings
# Run all lint checks (fmt-check + clippy)
lint: fmt-check clippy
# ---------- Test ----------
# Run tests with nextest
test:
cargo nextest run --workspace
# Run doctests only
test-doc:
cargo test --doc --workspace
# Run all tests (nextest + doctests)
test-all: test test-doc
# Run a specific test by name
test-specific TEST_NAME:
cargo test {{ TEST_NAME }}
# ---------- Coverage ----------
# Show coverage summary table
coverage:
cargo llvm-cov clean --workspace
cargo llvm-cov nextest --no-report
cargo llvm-cov report --summary-only
# Generate HTML coverage report and open in browser
coverage-html:
mkdir -p coverage/html
cargo llvm-cov clean --workspace
cargo llvm-cov nextest --html --output-dir coverage/html
open coverage/html/index.html 2>/dev/null || xdg-open coverage/html/index.html 2>/dev/null || true
# Generate LCOV output for CI/editors
coverage-lcov:
mkdir -p coverage
cargo llvm-cov nextest --workspace --lcov --output-path coverage/lcov.info
# ---------- Docs ----------
# Build and open rustdoc
doc:
cargo doc --no-deps --open
# Build rustdoc without opening (CI mode)
doc-check:
RUSTDOCFLAGS="-Dwarnings" cargo doc --workspace --no-deps
# Build the mdbook
book:
mdbook build docs
# Serve the mdbook with live reload
book-serve:
mdbook serve docs --open
# ---------- Generate ----------
# Generate TypeScript from a spec file
generate-typescript INPUT OUTPUT:
cargo run --bin openapi-nexus -- generate --input {{ INPUT }} --output {{ OUTPUT }} --generators typescript-fetch
# Generate Go from a spec file
generate-go INPUT OUTPUT:
cargo run --bin openapi-nexus -- generate --input {{ INPUT }} --output {{ OUTPUT }} --generators go-http
# Generate Java from a spec file
generate-java INPUT OUTPUT:
cargo run --bin openapi-nexus -- generate --input {{ INPUT }} --output {{ OUTPUT }} --generators java-okhttp
# Generate Kotlin from a spec file
generate-kotlin INPUT OUTPUT:
cargo run --bin openapi-nexus -- generate --input {{ INPUT }} --output {{ OUTPUT }} --generators kotlin-okhttp
# Generate all languages from a spec file
generate-all INPUT OUTPUT:
cargo run --bin openapi-nexus -- generate --input {{ INPUT }} --output {{ OUTPUT }} --generators typescript-fetch,go-http,java-okhttp,kotlin-okhttp
# Check TypeScript compilation in output directory
check-ts OUTPUT_DIR:
cd {{ OUTPUT_DIR }} && npx tsc --noEmit
# ---------- Golden (top-level convenience) ----------
# Run all golden tests (verify generated output matches .golden files)
golden-check:
cargo test --test golden_tests_typescript_fetch
cargo test --test golden_tests_go_http
cargo test --test golden_tests_rust_reqwest
cargo test --test golden_tests_rust_ureq
cargo test --test golden_tests_rust_aioduct
cargo test --test golden_tests_python_httpx
cargo test --test golden_tests_python_requests
cargo test --test golden_tests_java_okhttp
cargo test --test golden_tests_kotlin_okhttp
# Update .golden files for all generators
golden-update: golden-typescript::update golden-go::update golden-rust::update golden-python::update golden-java::update golden-kotlin::update
# Compile-check all goldens
golden-build-all: golden-typescript::build golden-go::build golden-rust::build golden-python::build golden-java::build golden-kotlin::build
# ---------- CI (run everything locally) ----------
# Run the full CI pipeline locally
ci: fmt-check clippy doc-check book msrv test-all coverage-lcov golden-check