-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathjustfile
More file actions
333 lines (264 loc) · 10.6 KB
/
justfile
File metadata and controls
333 lines (264 loc) · 10.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
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
# vx - Universal Development Tool Manager
# Just command runner recipes
# Set shell for cross-platform compatibility
set shell := ["bash", "-cu"]
set windows-shell := ["pwsh", "-NoProfile", "-Command"]
# Default recipe - show available commands
default:
@just --list
# ============================================
# Documentation
# ============================================
# Install docs dependencies
docs-install:
cd docs && vx node::npm ci
# Build documentation site
docs-build:
cd docs && vx node::npx vitepress build
# Start docs dev server
docs-dev:
cd docs && vx node::npx vitepress dev
# Preview built docs
docs-preview:
cd docs && vx node::npx vitepress preview
# ============================================
# Build
# ============================================
# Build debug version
build:
vx cargo build
# Build release version
build-release:
vx cargo build --release
# Build release version for target
build-release-target TARGET:
vx cargo build --release --target {{TARGET}}
# Build with fast profile
build-fast:
vx cargo build --profile dev-fast
# ============================================
# Test
# ============================================
# Run all tests (use nextest for faster execution)
test:
vx cargo nextest run --workspace --no-fail-fast
# Run tests with verbose output
test-verbose:
vx cargo nextest run --workspace --no-fail-fast --no-capture
# Run tests with cargo test (fallback if nextest not available)
test-cargo:
vx cargo test --workspace --no-fail-fast
# Run fast unit tests only (skip slow integration tests)
test-fast:
vx cargo nextest run --workspace --no-fail-fast -E 'not test(e2e)'
# Run tests for specific packages
# Usage: just test-pkgs "-p vx-provider-* -p vx-cli"
test-pkgs PKGS:
vx cargo nextest run --no-fail-fast {{PKGS}}
# Fast static checks for provider.star logic and provider unit tests
test-providers-static:
vx cargo test -p vx-starlark --test lint_all_providers_test -- --nocapture
vx cargo nextest run --no-fail-fast -p 'vx-provider-*'
# Test all providers in a clean temporary environment
test-providers:
@echo "Building VX first..."
@pwsh -NoProfile -Command "Get-Process vx -ErrorAction SilentlyContinue | Stop-Process -Force -ErrorAction SilentlyContinue"
@vx cargo build
@echo ""
./target/debug/vx test --ci --temp-root --keep-going --detailed
# Test all providers with verbose output
test-providers-verbose:
@echo "Building VX first..."
@pwsh -NoProfile -Command "Get-Process vx -ErrorAction SilentlyContinue | Stop-Process -Force -ErrorAction SilentlyContinue"
@vx cargo build
@echo ""
./target/debug/vx test --ci --temp-root --keep-going --verbose
# Test all providers and output JSON report
test-providers-json:
@echo "Building VX first..."
@vx cargo build
@echo ""
./target/debug/vx test --ci --temp-root --keep-going --json
# Test specific runtimes (comma-separated)
test-runtimes RUNTIMES:
@echo "Building VX first..."
@vx cargo build
@echo ""
./target/debug/vx test --ci --ci-runtimes {{RUNTIMES}} --temp-root --verbose
# Quick CI test with core runtimes only
test-ci-quick:
@echo "Building VX first..."
@vx cargo build
@echo ""
./target/debug/vx test --ci --ci-runtimes node,go,uv,just,cargo,python --temp-root --verbose
# ============================================
# Code Quality
# ============================================
# Run linting checks
lint:
vx cargo clippy --workspace --all-targets -- -D warnings -Aasync-fn-in-trait
# Format code
format:
vx cargo fmt
# Verify workspace-hack is up-to-date (CI check)
hakari-verify:
vx cargo hakari generate --diff
vx cargo hakari manage-deps --dry-run
# Regenerate workspace-hack after dependency changes
hakari-generate:
vx cargo hakari generate
vx cargo hakari manage-deps
# Auto-fix workspace-hack: regenerate and stage changes (run after modifying deps)
hakari-fix:
vx cargo hakari generate
vx cargo hakari manage-deps
@git diff --quiet crates/workspace-hack/Cargo.toml && echo "✓ workspace-hack is already up-to-date" || (git add crates/workspace-hack/Cargo.toml && echo "✓ workspace-hack updated and staged")
# Check code formatting
format-check:
vx cargo fmt --all -- --check
# CI documentation build (no deps download)
ci-docs:
vx cargo doc --all-features --no-deps --document-private-items
# Check for inline tests
check-inline-tests:
./scripts/check-inline-tests.sh
# Validate release version parsing scripts
validate-version-scripts:
./scripts/test-version-extraction.sh && ./scripts/test-winget-version.sh
# Run E2E benchmark tests (local)
benchmark-run:
vx cargo test --release --test e2e_benchmark_tests -- --nocapture
# Run E2E benchmark tests and capture output (CI)
# Note: output redirection is handled by the CI workflow shell, not here,
# because justfile on Windows uses pwsh which doesn't support bash syntax.
benchmark-run-ci:
vx cargo test --release --test e2e_benchmark_tests -- --nocapture
# Security audit (CI)
security-audit-ci:
-vx cargo generate-lockfile
-vx cargo audit --deny warnings
# Coverage (CI)
coverage-ci:
vx cargo llvm-cov --all-features --workspace --lcov --output-path lcov.info
# Cross build (release) — installs cross via cargo, then builds with optimizations
cross-build TARGET:
vx cargo install cross --locked
vx cargo:cross build --release --target {{TARGET}} --no-default-features
# Cross build (CI) — uses `cargo check` to verify compilation for the target
# without code generation or linking. This catches type/borrow/trait errors
# and is much faster than a full build (~5 min vs 30+ min for musl targets).
# Full release builds happen in the release workflow, not PR CI.
cross-build-ci TARGET:
vx cargo install cross --locked
vx cargo:cross check --target {{TARGET}} --no-default-features
# ============================================
# Architecture & Quality Gates
# ============================================
# Check architectural layer dependencies (custom linter)
check-architecture:
bash scripts/check-architecture.sh
# Check file size limits (warns on bloat)
check-file-sizes:
bash scripts/check-file-sizes.sh
# Check file size limits strictly (fails on violations)
check-file-sizes-strict:
bash scripts/check-file-sizes.sh --strict
# Run all architecture checks
check-all: check-architecture check-file-sizes check-inline-tests
@echo "✅ All architecture checks passed"
# Diagnose development environment
doctor:
@echo "🏥 VX Development Environment Diagnosis"
@echo "========================================"
@echo ""
@echo "## Rust Toolchain"
@rustc --version 2>/dev/null || echo "❌ rustc not found"
@cargo --version 2>/dev/null || echo "❌ cargo not found"
@echo ""
@echo "## Build Tools"
@sccache --version 2>/dev/null || echo "⚠️ sccache not found (optional, speeds up builds)"
@cargo nextest --version 2>/dev/null || echo "⚠️ cargo-nextest not found (optional, faster tests)"
@cargo hakari --version 2>/dev/null || echo "⚠️ cargo-hakari not found (optional, workspace-hack)"
@echo ""
@echo "## VX"
@vx --version 2>/dev/null || echo "⚠️ vx not found in PATH"
@echo ""
@echo "## Git"
@git --version 2>/dev/null || echo "❌ git not found"
@echo ""
@echo "## Workspace"
@echo "Crates: $(ls -d crates/vx-*/ 2>/dev/null | wc -l | xargs)"
@echo "Providers: $(ls -d crates/vx-providers/*/ 2>/dev/null | wc -l | xargs)"
@echo "provider.star files: $(find crates/vx-providers -name 'provider.star' 2>/dev/null | wc -l | xargs)"
@echo ""
@echo "========================================"
@echo "🏥 Diagnosis complete"
# Fast pre-merge check (what CI will run on your PR)
pre-merge: format-check lint check-architecture test-fast
@echo "✅ Pre-merge checks passed — ready for PR"
# ============================================
# Development
# ============================================
# Configure git to use project-managed hooks (run once after cloning)
setup-hooks:
git config core.hooksPath .githooks
@echo "✓ Git hooks configured (.githooks/pre-push will auto-regenerate workspace-hack)"
@echo " Install cargo-hakari if not present: cargo install cargo-hakari --locked"
# Quick development cycle: format, lint, test, build
quick: format lint test build
# Quick video workflow: setup, start, build (for testing changes)
video-quick: video-setup video-start
# Video development workflow: clean, build
video-rebuild: video-clean video-build
# Clean build artifacts
clean:
vx cargo clean
# Install vx locally
install:
vx cargo install --path .
# ============================================
# Promotional Video (Remotion)
# ============================================
# Setup and install video dependencies
video-setup:
@echo "Setting up Remotion video project..."
cd vx-promo-video && npm install
# Start Remotion preview server for video development
video-start:
@echo "Starting Remotion preview server..."
cd vx-promo-video && npm start
# Build the promotional video (renders all scenes to MP4)
video-build:
@echo "Building promotional video..."
cd vx-promo-video && npm run build
# Render specific video scene
video-render-scene SCENE:
@echo "Rendering scene: {{SCENE}}..."
cd vx-promo-video && npx remotion render src/Root.tsx {{SCENE}} --out=out/{{SCENE}}.mp4
# Build video for different platforms (square, vertical, etc.)
video-build-platform PLATFORM:
@echo "Building video for platform: {{PLATFORM}}..."
cd vx-promo-video && npx remotion render src/Root.tsx vx-intro --out=out/vx-intro-{{PLATFORM}}.mp4 --size={{PLATFORM}}
# Clean video output directory
video-clean:
@echo "Cleaning video output..."
cd vx-promo-video && rm -rf out/ public/
# Upgrade Remotion dependencies
video-upgrade:
@echo "Upgrading Remotion..."
cd vx-promo-video && npm run upgrade
# Show video-related commands
video-help:
@echo "VX Promotional Video Commands:"
@echo ""
@echo " just video-setup - Install video dependencies"
@echo " just video-start - Start preview server"
@echo " just video-build - Build full video"
@echo " just video-render-scene <SCENE> - Render specific scene"
@echo " just video-build-platform <PLATFORM> - Build for platform"
@echo " just video-clean - Clean video output"
@echo " just video-upgrade - Upgrade Remotion"
@echo ""
@echo "Available scenes: vx-intro, vx-problem, vx-solution, vx-features, vx-cta"
@echo "Available platforms: 1080x1080 (Instagram), 1080x1920 (TikTok)"
@echo ""