-
Notifications
You must be signed in to change notification settings - Fork 168
Expand file tree
/
Copy pathjustfile
More file actions
188 lines (142 loc) · 4.32 KB
/
justfile
File metadata and controls
188 lines (142 loc) · 4.32 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
#!/usr/bin/env just --justfile
# Using Just: https://github.com/casey/just?tab=readme-ov-file#installation
mod demo
mod cdn
# Shortcuts to avoid `demo::` prefix.
mod boy 'demo/boy'
mod pub 'demo/pub'
mod relay 'demo/relay'
mod sub 'demo/sub'
mod web 'demo/web'
# Run the demo by default.
default:
just demo
# Alias for `just demo`.
dev:
just demo
# Install any dependencies.
install:
bun install
cargo install --locked cargo-shear cargo-sort cargo-upgrades cargo-edit cargo-sweep cargo-semver-checks release-plz
# Run the CI checks
check *args:
#!/usr/bin/env bash
set -euo pipefail
# Run the Javascript checks.
bun install --frozen-lockfile
if tty -s; then
bun run --filter='*' --elide-lines=0 check
else
bun run --filter='*' check
fi
bun biome check
# Run the Markdown checks.
bun remark . --quiet --frail
# Run the (slower) Rust checks.
cargo check --all-targets {{ args }}
cargo clippy --all-targets {{ args }} -- -D warnings
cargo fmt --all --check
# Check documentation warnings (default-members only, not dependencies)
RUSTDOCFLAGS="-D warnings" cargo doc --no-deps {{ args }}
# requires: cargo install cargo-shear
cargo shear
# requires: cargo install cargo-sort
cargo sort --workspace --check
# Run comprehensive CI checks including feature edge cases
ci:
#!/usr/bin/env bash
set -euo pipefail
# Run the standard checks first, including non-default workspace members
just check --workspace
# Run the Python checks.
uv run ruff check py/
uv run ruff format --check py/
# Sync moq-lite's dev group (pytest) first, then override moq-ffi with a source build;
# --no-sync on the pyright invocation keeps uv from reinstalling the registry moq-ffi.
uv sync --package moq-lite
uv run maturin develop -m rs/moq-ffi/Cargo.toml --uv
uv run --package moq-lite --no-sync pyright
# Run the tofu checks.
(cd cdn && just check)
# Run the nix checks.
nix flake check
# Run the unit tests with all features to exercise all QUIC backends
just test --all-features
# Make sure everything builds
just build
# Check feature edge cases for all crates
cargo check --workspace --no-default-features
cargo check --workspace --all-features
# Dry-run publish to verify packaging
cargo publish --dry-run
# Check semver compatibility against crates.io (default-members only)
# requires: cargo install cargo-semver-checks
semver:
cargo semver-checks check-release
# Update versions and changelogs via release-plz
bump:
release-plz update
# Create release PRs and publish crates
release:
release-plz release-pr --git-token "$GITHUB_TOKEN"
release-plz release --git-token "$GITHUB_TOKEN"
# Run the unit tests
test *args:
#!/usr/bin/env bash
set -euo pipefail
# Run the Javascript tests.
bun install --frozen-lockfile
if tty -s; then
bun run --filter='*' --elide-lines=0 test
else
bun run --filter='*' test
fi
cargo test --all-targets {{ args }}
# Run the Python tests.
if command -v uv &> /dev/null; then
uv sync --package moq-lite
uv run maturin develop -m rs/moq-ffi/Cargo.toml --uv
uv run --package moq-lite --no-sync pytest py/moq-lite/tests/
fi
# Automatically fix some issues.
fix:
# Fix the Javascript dependencies.
bun install
bun biome check --write
# Fix the Markdown issues.
bun remark . --quiet --output
# Fix the Rust issues.
cargo clippy --fix --allow-staged --allow-dirty --all-targets
cargo fmt --all
# requires: cargo install cargo-shear
cargo shear --fix
# requires: cargo install cargo-sort
cargo sort --workspace
# Fix the Python issues.
if command -v uv &> /dev/null; then uv run ruff check --fix py/ && uv run ruff format py/; fi
if command -v tofu &> /dev/null; then (cd cdn && just fix); fi
# Remove old build artifacts to save disk space.
if command -v cargo-sweep &> /dev/null; then cargo sweep --time 3; fi
# Upgrade any tooling
update:
bun update
bun outdated
# Update any patch versions
cargo update
# Requires: cargo install cargo-upgrades cargo-edit
cargo upgrade --incompatible
# Update the Nix flake.
nix flake update
# Build the packages
build:
#!/usr/bin/env bash
set -euo pipefail
bun run --filter='*' build
cargo build
# Build moq-ffi from source into py/moq-lite's venv.
if command -v uv &> /dev/null; then
(cd py/moq-lite && uv run maturin develop -m ../../rs/moq-ffi/Cargo.toml --uv)
fi
# Serve the documentation locally.
doc:
cd doc && bun run dev