-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjustfile
More file actions
147 lines (108 loc) · 5.35 KB
/
justfile
File metadata and controls
147 lines (108 loc) · 5.35 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
# stream
set dotenv-load := true
# Default: list available recipes
[private]
help:
@just --list --unsorted
# ─── Setup ───────────────────────────────────────────────────────────
# Install all development dependencies
setup:
@echo "Checking development dependencies..."
@command -v rustc >/dev/null || (echo "❌ rust not found — install via https://rustup.rs" && exit 1)
@command -v ffmpeg >/dev/null || (echo "❌ ffmpeg not found — install via: brew install ffmpeg (macOS) / apt install ffmpeg (Linux)" && exit 1)
@command -v cargo-nextest >/dev/null || (echo "Installing cargo-nextest..." && cargo install cargo-nextest)
@command -v cargo-deny >/dev/null || (echo "Installing cargo-deny..." && cargo install cargo-deny)
@command -v git-cliff >/dev/null || (echo "Installing git-cliff..." && cargo install git-cliff)
@command -v prek >/dev/null || (echo "Installing prek..." && cargo install prek)
@echo "✅ All dependencies installed"
# ─── Environment ──────────────────────────────────────────────────────
# Print environment info
env:
@echo "rustc: $(rustc --version)"
@echo "cargo: $(cargo --version)"
@echo "just: $(just --version)"
# ─── Format ───────────────────────────────────────────────────────────
# Format all code
fmt:
cargo +nightly fmt --all
# Check formatting (CI)
fmt-check:
cargo +nightly fmt --all --check
# ─── Lint ─────────────────────────────────────────────────────────────
[doc("run `cargo check`")]
[group("👆 Code Quality")]
check:
@echo "🔨 Running compilation check..."
cargo check --all --all-targets
alias c := check
# Run clippy
clippy:
cargo clippy --all-targets --all-features -- -D warnings
# Run all lints (clippy + doc + deny)
lint: clippy
cargo doc --no-deps --document-private-items 2>&1 | (! grep -E "^warning:" || (echo "Doc warnings found" && exit 1))
cargo deny check
# ─── Test ─────────────────────────────────────────────────────────────
# Run tests
test *ARGS:
cargo nextest run {{ ARGS }}
# ─── Build ────────────────────────────────────────────────────────────
# Build debug binary
build:
cargo build
mkdir -p bin
cp target/debug/stream-app bin/stream
# Build release binary
build-release:
cargo build --release
mkdir -p bin
cp target/release/stream-app bin/stream
# ─── Pre-commit ──────────────────────────────────────────────────────
# Run all pre-commit checks
pre-commit: fmt-check lint test
# Install git hooks via prek
setup-hooks:
prek install
# ─── Changelog & Release ─────────────────────────────────────────────
# Generate changelog (unreleased)
changelog:
git cliff --unreleased --strip header
# Generate full changelog
changelog-all:
git cliff
# Show what the next tag would be (based on conventional commits)
release-info:
@echo "Latest tag: $(git describe --tags --abbrev=0 2>/dev/null || echo 'none')"
@echo "Commits since tag: $(git rev-list $(git describe --tags --abbrev=0 2>/dev/null || git rev-list --max-parents=0 HEAD)..HEAD --count)"
# ─── Web ─────────────────────────────────────────────────────────
# Build WASM client
wasm:
cd crates/client-wasm && wasm-pack build --target web --release --out-dir ../../web/src/lib/wasm-pkg
# Install frontend dependencies
web-install:
cd web && bun install
# Start frontend dev server
web: wasm web-install
cd web && bun run dev
# ─── Docs ────────────────────────────────────────────────────────────
# Serve mdbook locally with live reload
book:
mdbook serve docs --open
# Build mdbook
book-build:
mdbook build docs
# ─── Misc ─────────────────────────────────────────────────────────────
# Count lines of code
cloc:
tokei .
# Clean build artifacts
clean:
cargo clean
rm -rf bin
# ─── Docker ──────────────────────────────────────────────────────────
# Build and start with docker compose
up:
docker compose up --build
# Stop containers
down:
docker compose down