-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjustfile
More file actions
311 lines (255 loc) · 15.6 KB
/
justfile
File metadata and controls
311 lines (255 loc) · 15.6 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
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
# tui-vfx justfile
# Run `just --list` to see all available commands
# Default recipe: show available commands
default:
@just --list
# ═══════════════════════════════════════════════════════════════════════════════
# DOCUMENTATION GENERATION
# ═══════════════════════════════════════════════════════════════════════════════
#
# The documentation pipeline merges two sources:
# 1. Rustdoc comments in source code (technical details)
# 2. docs/templates/capabilities.toml (editorial/semantic details)
#
# These combine to generate:
# - docs/generated/CAPABILITIES.md (human-readable reference)
# - docs/generated/ai-context.md (condensed AI prompt)
# - docs/generated/capabilities.json (machine-readable)
# - docs/generated/effect_schemas.json (full ConfigSchema metadata)
#
# See docs/design/CAPABILITY_MANIFEST_*.md for architecture details.
# ═══════════════════════════════════════════════════════════════════════════════
# Generate all documentation from rustdoc + TOML sources
docs-generate:
@echo "Generating documentation from rustdoc + templates/capabilities.toml..."
cargo xtask docs generate
# Check that generated docs are up-to-date (for CI)
# Fails if regenerating would change any files
docs-check:
@echo "Checking documentation freshness..."
cargo xtask docs check
# Generate only the AI context prompt (condensed ~50 line version)
docs-ai-context:
@echo "Generating AI context prompt..."
cargo xtask docs ai-context
# Generate only CAPABILITIES.md
docs-markdown:
@echo "Generating CAPABILITIES.md..."
cargo xtask docs markdown
# Extract rustdoc JSON (requires nightly)
# This is called internally by docs-generate, but can be run standalone for debugging
docs-rustdoc-json:
@echo "Extracting rustdoc JSON (requires nightly)..."
cargo +nightly rustdoc \
-p tui-vfx-compositor \
-p tui-vfx-style \
-p tui-vfx-content \
-p tui-vfx-shadow \
-- -Z unstable-options --output-format json
@echo "JSON output in target/doc/*.json"
# Validate capabilities.toml against code (ensures all variants documented)
docs-validate:
@echo "Validating templates/capabilities.toml coverage..."
cargo xtask docs validate
# Generate TOML stubs for undocumented effects (prints to stdout)
docs-scaffold:
@echo "Scaffolding TOML stubs for undocumented effects..."
cargo xtask docs scaffold
# Generate TOML stubs and write directly to capabilities.toml
docs-scaffold-write:
@echo "Writing TOML stubs to templates/capabilities.toml..."
cargo xtask docs scaffold --write
# Validate recipes against capabilities.json (pass --recipes-dir)
recipes-validate recipes_dir:
@echo "Validating recipes..."
cargo xtask recipes validate --recipes-dir {{recipes_dir}}
# ═══════════════════════════════════════════════════════════════════════════════
# API DOCUMENTATION GENERATION
# ═══════════════════════════════════════════════════════════════════════════════
#
# The API documentation pipeline merges two sources:
# 1. Code metadata (ConfigSchema, syn parsing, runtime introspection)
# 2. docs/templates/api_docs.toml (editorial: structure, examples, usage notes)
#
# This generates docs/generated/API.md (complete technical API reference).
#
# QA baseline: docs/API_HAND.md (original hand-maintained version)
# See docs/design/API_DOC_GENERATION_PLAN.md for architecture details.
# ═══════════════════════════════════════════════════════════════════════════════
# Generate API.md from code + api_docs.toml
docs-api:
@echo "Generating API.md from code + templates/api_docs.toml..."
cargo xtask docs api
# Check that API.md is up-to-date (for CI)
docs-api-check:
@echo "Checking API.md freshness..."
cargo xtask docs api-check
# Validate api_docs.toml against code (ensures all public types documented)
docs-api-validate:
@echo "Validating templates/api_docs.toml coverage..."
cargo xtask docs api-validate
# Generate TOML stubs for undocumented API types (prints to stdout)
docs-api-scaffold:
@echo "Scaffolding templates/api_docs.toml stubs for undocumented types..."
cargo xtask docs api-scaffold
# Generate TOML stubs and write directly to api_docs.toml
docs-api-scaffold-write:
@echo "Writing TOML stubs to templates/api_docs.toml..."
cargo xtask docs api-scaffold --write
# Diff generated API.md against hand-maintained baseline (QA check)
docs-api-diff:
@echo "Comparing generated API.md against API_HAND.md..."
@diff -u docs/API_HAND.md docs/generated/API.md || echo "Files differ (expected during development)"
# ═══════════════════════════════════════════════════════════════════════════════
# ALL DOCUMENTATION (COMBINED)
# ═══════════════════════════════════════════════════════════════════════════════
# Generate all documentation (CAPABILITIES.md + API.md + ai-context.md + JSON)
docs-all:
@echo "Generating all documentation..."
cargo xtask docs generate
@echo "✓ All documentation generated"
# Check all documentation is up-to-date (for CI)
docs-all-check:
@echo "Checking all documentation freshness..."
cargo xtask docs check
@echo "✓ All documentation up-to-date"
# Validate all TOML manifests against code
docs-all-validate:
@echo "Validating all documentation manifests..."
cargo xtask docs validate
cargo xtask docs api-validate
@echo "✓ All manifests valid"
# ═══════════════════════════════════════════════════════════════════════════════
# STANDARD DEVELOPMENT
# ═══════════════════════════════════════════════════════════════════════════════
# Build all crates
build:
cargo build --workspace
# Build in release mode
build-release:
cargo build --workspace --release
# Run all tests
test:
cargo test --workspace
# Run tests with output shown
test-verbose:
cargo test --workspace -- --nocapture
# Run clippy lints
lint:
cargo clippy --workspace --all-targets -- -D warnings
# Format code
fmt:
cargo fmt --all
# Check formatting without modifying
fmt-check:
cargo fmt --all -- --check
# Run all checks (fmt, lint, test, docs-all-check)
check-all: fmt-check lint test docs-all-check
@echo "All checks passed!"
# ═══════════════════════════════════════════════════════════════════════════════
# DOCUMENTATION (STANDARD RUSTDOC)
# ═══════════════════════════════════════════════════════════════════════════════
# Generate rustdoc HTML documentation
doc:
cargo doc --workspace --no-deps
# Generate and open rustdoc in browser
doc-open:
cargo doc --workspace --no-deps --open
# ═══════════════════════════════════════════════════════════════════════════════
# EXAMPLES
# ═══════════════════════════════════════════════════════════════════════════════
# Run a specific example (usage: just example <name>)
example name:
cargo run --example {{name}}
# List available examples
examples:
@echo "Available examples:"
@find examples -name "*.rs" -exec basename {} .rs \; 2>/dev/null || echo "No examples found"
# ═══════════════════════════════════════════════════════════════════════════════
# MAINTENANCE
# ═══════════════════════════════════════════════════════════════════════════════
# Clean build artifacts
clean:
cargo clean
# Update dependencies
update:
cargo update
# Show outdated dependencies
outdated:
cargo outdated
# ═══════════════════════════════════════════════════════════════════════════════
# XTASK (BUILD TOOLING)
# ═══════════════════════════════════════════════════════════════════════════════
# Run xtask with arbitrary arguments (usage: just xtask <args>)
xtask *args:
cargo xtask {{args}}
# ═══════════════════════════════════════════════════════════════════════════════
# DRAMATIC COLOR-SHADOW ROLLOUT
# ═══════════════════════════════════════════════════════════════════════════════
#
# Phase-specific validation recipes for the dramatic color-graded shadow feature.
# See gt-design/plans/tui-vfx-v1-dramatic-color-shadow-plan.md for the master plan.
# ═══════════════════════════════════════════════════════════════════════════════
# Phase 0 red: shadow contract tests (should fail before implementation)
dramatic-shadow-phase0-red:
cargo test -p tui-vfx-shadow shadow_config_grade_underlying_serde_round_trip -- --nocapture
cargo test -p tui-vfx-shadow shadow_grade_config_dramatic_defaults_are_visible -- --nocapture
cargo test -p tui-vfx-compositor shadow_spec_preserves_grade_underlying_config -- --nocapture
# Phase 0 green: shadow contract + lib tests
dramatic-shadow-phase0-green:
cargo test -p tui-vfx-shadow --lib -- --nocapture
cargo test -p tui-vfx-compositor --lib -- --nocapture
# Phase 0 docs: clippy + rustdoc + format
dramatic-shadow-phase0-docs:
cargo clippy -p tui-vfx-shadow --lib --no-deps -- -D warnings
RUSTDOCFLAGS="-D warnings" cargo doc -p tui-vfx-shadow --no-deps
cargo clippy -p tui-vfx-compositor --lib --no-deps -- -D warnings
RUSTDOCFLAGS="-D warnings" cargo doc -p tui-vfx-compositor --no-deps
cargo fmt --all -- --check
# Phase 1 red: grade-underlying integration tests (should fail before implementation)
dramatic-shadow-phase1-red:
cargo test -p tui-vfx-compositor --test test_pipeline test_shadow_grade_underlying_preserves_destination_glyphs -- --nocapture
cargo test -p tui-vfx-compositor --test test_pipeline test_shadow_grade_underlying_preserves_destination_modifiers -- --nocapture
cargo test -p tui-vfx-compositor --test test_pipeline test_shadow_grade_underlying_is_visibly_dramatic -- --nocapture
# Phase 1 green: full compositor test suite
dramatic-shadow-phase1-green:
cargo test -p tui-vfx-compositor --test test_pipeline -- --nocapture
cargo test -p tui-vfx-compositor --test test_pipeline test_render_pipeline_with_spec -- --nocapture
cargo test -p tui-vfx-shadow --lib -- --nocapture
# Phase 1 docs: clippy + rustdoc
dramatic-shadow-phase1-docs:
cargo clippy -p tui-vfx-compositor --lib --no-deps -- -D warnings
RUSTDOCFLAGS="-D warnings" cargo doc -p tui-vfx-compositor --no-deps
# Phase 2 red: animation and gradient tests (should fail before implementation)
dramatic-shadow-phase2-red:
cargo test -p tui-vfx-compositor --test test_pipeline test_shadow_grade_underlying_progress_controls_visibility -- --nocapture
cargo test -p tui-vfx-compositor --test test_pipeline test_shadow_grade_underlying_gradient_softens_penumbra -- --nocapture
# Phase 2 green: full test suite + spec equivalence (skip pre-existing test_shadow_extends_render_area)
dramatic-shadow-phase2-green:
cargo test -p tui-vfx-compositor --test test_pipeline -- --nocapture --skip test_shadow_extends_render_area
cargo test -p tui-vfx-compositor --test test_pipeline test_render_pipeline_with_spec -- --nocapture
# Phase 2 docs: both crates clippy + rustdoc
dramatic-shadow-phase2-docs:
cargo clippy -p tui-vfx-shadow --lib --no-deps -- -D warnings
RUSTDOCFLAGS="-D warnings" cargo doc -p tui-vfx-shadow --no-deps
cargo clippy -p tui-vfx-compositor --lib --no-deps -- -D warnings
RUSTDOCFLAGS="-D warnings" cargo doc -p tui-vfx-compositor --no-deps
# Full quality gate: all phases green + docs + format + workspace test
dramatic-shadow-full-quality:
cargo fmt --all -- --check
cargo clippy -p tui-vfx-shadow --lib --no-deps -- -D warnings
cargo clippy -p tui-vfx-compositor --lib --no-deps -- -D warnings
RUSTDOCFLAGS="-D warnings" cargo doc -p tui-vfx-shadow --no-deps
RUSTDOCFLAGS="-D warnings" cargo doc -p tui-vfx-compositor --no-deps
cargo test -p tui-vfx-shadow --lib -- --nocapture
cargo test -p tui-vfx-compositor --lib -- --nocapture
cargo test -p tui-vfx-compositor --test test_pipeline -- --nocapture --skip test_shadow_extends_render_area
# ═══════════════════════════════════════════════════════════════════════════════
# CI SIMULATION
# ═══════════════════════════════════════════════════════════════════════════════
# Run the full CI pipeline locally
ci: fmt-check lint test docs-all-check
@echo ""
@echo "══════════════════════════════════════════"
@echo " CI simulation passed!"
@echo "══════════════════════════════════════════"