-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjustfile
More file actions
424 lines (341 loc) · 11.2 KB
/
Copy pathjustfile
File metadata and controls
424 lines (341 loc) · 11.2 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
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
default:
@just --list
# Install typos.
[group('setup')]
setup_typos:
@cargo install typos-cli
# Install `uv`.
[group('setup')]
setup_uv:
curl -LsSf https://astral.sh/uv/install.sh | sh
# Install the dev environment.
[parallel]
[group('setup')]
setup: setup_typos setup_uv
# Install git hooks via lefthook.
install_hooks:
lefthook install
lefthook:
lefthook run pre-commit
# Run all pre-commit checks
pre-commit: lefthook
# Run typos check
typos:
typos --format=brief
# Fix typos in-place
typos_fix:
typos --write-changes
# Format all code
fmt:
cargo fmt --all
# Run clippy with warnings as errors
clippy:
cargo clippy --all --all-targets -- -D warnings
[group('lint')]
[parallel]
lint: typos fmt clippy
# Run all cargo benchmarks
bench:
cargo bench --all
# Run zo-runtime concurrency benchmarks (fan-out,
# ping-pong, producer/consumer, cost-decomposition).
bench_runtime:
cargo bench -p zo-runtime
# Run both test suites in parallel
[group('test')]
test_all: test zo_test zo_test_runner
# Run all tests
[group('test')]
test:
cargo nextest run --workspace --all-features
# Run tests for a specific crate
[group('test')]
test_crate crate:
cargo nextest run -p {{crate}}
# Run a specific test by name
[group('test')]
test_filter filter:
cargo nextest run -E 'test({{filter}})'
# test: Update insta snapshots in place
[group('test')]
snapshots:
INSTA_UPDATE=always cargo test -p zo-parser -p zo-tokenizer
# test: Check insta snapshots are current (fail on drift)
[group('test')]
snapshots_check:
INSTA_UPDATE=no cargo test -p zo-parser -p zo-tokenizer
# Build all targets
build:
cargo build --all
# zo: Build both runtime flavors (core + ui) for a profile
[group('zo')]
build_runtime_profile profile="debug":
#!/usr/bin/env sh
set -eu
if [ "{{profile}}" = "release" ]; then flag="--release"; else flag=""; fi
out="target/{{profile}}"
# Full UI flavor (default features) — superset dylib.
cargo build -p zo-runtime $flag
cp "$out/libzo_runtime.dylib" "$out/libzo_runtime_ui.dylib"
# Lean core flavor (no UI/render/web tree).
cargo build -p zo-runtime $flag --no-default-features
cp "$out/libzo_runtime.dylib" "$out/libzo_runtime_core.dylib"
# zo: Rebuild both runtime flavors (debug + release)
[group('zo')]
build_runtime: (build_runtime_profile "debug") (build_runtime_profile "release")
# zo: Regenerate the precompiled preload blob
[group('zo')]
zo_preload_blob:
cargo build --bin zo
ZO_WRITE_PRELOAD_BLOB=1 cargo run --bin zo -- build crates/compiler/zo-benches/benches/hello/hello.zo --out-dir target/tmp-preload-blob
rm -rf target/tmp-preload-blob
# Clean build artifacts
clean:
cargo clean
# Check a specific crate (faster than build)
check crate:
cargo check -p {{crate}}
# Install/upgrade zo via the install script
[group('zo')]
zo_install:
sh tasks/zo-install.sh
# Build the zo compiler binary
[group("zo")]
zo_build_compiler:
cargo build --bin zo
# Build a zo program
[group("zo")]
zo_build program:
cargo run --bin zo -- build {{program}}
# Run a zo program
[group("zo")]
zo_run program:
cargo run --bin zo -- run {{program}}
# zo: Cross-build the iOS Simulator runtime (in-repo dev prerequisite)
[group("zo")]
build_ios_runtime:
cargo build -p zo-runtime --target aarch64-apple-ios-sim
# zo: Run a zo program in the iOS Simulator (device auto-selects when omitted)
[group("zo")]
zo_run_ios program device="": build_ios_runtime
cargo run --bin zo -- run "{{program}}" --target ios --device "{{device}}"
# zo: Cross-build the watchOS Simulator runtime (in-repo dev prerequisite)
[group("zo")]
build_watchos_runtime:
cargo build -p zo-runtime --target aarch64-apple-watchos-sim -Zbuild-std=std,panic_abort
# zo: Run a zo program in the watchOS Simulator (device auto-selects when omitted)
[group("zo")]
zo_run_watchos program device="": build_watchos_runtime
cargo run --bin zo -- run "{{program}}" --target watchos --device "{{device}}"
# Run all zo crates tests
[group('zo')]
[group('test')]
zo_test:
cargo nextest run --workspace -E 'package(/^zo/)' --all-features
# lsp: Run the zo language server.
[group("zo")]
zo_lsp:
cargo run -p zo-lsp
# zo: Generate provider FFI bindings from a Rust shim
[group("zo")]
bind lib:
cargo run -p zo-binder -- {{lib}}
# Run zo program integration tests
[group("zo")]
[group('test')]
zo_test_runner:
cargo run --bin zo-test-runner
# zo: Run integration tests + launch every windowed program (dev only)
[group("zo")]
[group('test')]
zo_test_runner_all:
cargo run --bin zo-test-runner -- --all
# Run zo program tests (quick — skip build-pass)
[group("zo")]
[group('test')]
zo_test_quick:
cargo run --bin zo-test-runner -- --quick
# Run zo compiler benchmark
[group('zo')]
zo_bench program:
cargo build --release --bin zo && cargo run --release -p zo-benches -- {{program}}
# Run zo benchmark with regression check (strict — fails on regression)
[group('zo')]
zo_bench_check program:
cargo build --release --bin zo && cargo run --release -p zo-benches -- {{program}} --strict
# Quick zo benchmark for pre-commit (hello only, 3 runs, zo only)
[group('zo')]
zo_bench_quick:
cargo build --release --bin zo && cargo run --release -p zo-benches -- hello --quick --strict
# Update zo benchmark baseline
[group('zo')]
zo_bench_update:
cargo build --release --bin zo && cargo run --release -p zo-benches -- all --update-baseline
# group: Bench concurrent prime sieve (RSS + wall time) at scale N (default 10)
[group('zo')]
zo_bench_sieve n="10":
cargo build --release --bin zo && cargo run --release -p zo-benches -- concurrency_pike_sieve --runs 3 --with-runtime --with-rss --argv "{{n}}"
# Run all eazy crates tests
[group('eazy')]
[group('test')]
eazy_test:
cargo nextest run --workspace -E 'package(/^eazy/)' --all-features
# Run `eazy` bench
[group('eazy')]
eazy_run_bench:
cargo bench -p eazy
# Bump all eazy-* crates together
[group('eazy')]
bump_eazy bump:
#!/usr/bin/env sh
for crate in $(cargo ws list | grep '^eazy-'); do
cargo set-version -p "$crate" --bump {{bump}}
done
cargo set-version -p eazy --bump {{bump}}
# Dry-run publish all eazy-* crates
[group('eazy')]
eazy_publish_dry:
cargo publish -p eazy-core --dry-run
cargo publish -p eazy-derive --dry-run
cargo publish -p eazy-tweener --dry-run
cargo publish -p eazy-keyframe --dry-run
cargo publish -p eazy --dry-run
# Cross-platform testing (requires Docker)
# Run all checks in Linux container
test_linux:
docker run --rm -v {{justfile_directory()}}:/workspace -w /workspace rust:latest \
sh -c "apt-get update && apt-get install -y libglib2.0-dev libgtk-3-dev libatk1.0-dev libwebkit2gtk-4.1-dev libsoup-3.0-dev && \
cargo fmt --all -- --check && \
cargo clippy --all --all-targets -- -D warnings && \
cargo test --all"
# Build for Linux (quick compile check)
build_linux:
docker run --rm -v {{justfile_directory()}}:/workspace -w /workspace rust:latest \
sh -c "apt-get update && apt-get install -y libglib2.0-dev libgtk-3-dev libatk1.0-dev libwebkit2gtk-4.1-dev libsoup-3.0-dev && \
cargo build --all"
# Cross-compile check for Windows (no tests, just build)
build_windows:
docker run --rm -v {{justfile_directory()}}:/workspace -w /workspace rust:latest \
sh -c "rustup target add x86_64-pc-windows-gnu && \
apt-get update && apt-get install -y mingw-w64 && \
cargo build --all --target x86_64-pc-windows-gnu"
# Run full CI simulation locally
[parallel]
ci: fmt clippy test test_linux
@echo "Full CI simulation passed!"
# Version Management (cargo-workspaces)
# Bump patch version (0.1.0 -> 0.1.1) for all crates
release_patch:
cargo ws version patch --no-git-push --yes
# Bump minor version (0.1.0 -> 0.2.0) for all crates
release_minor:
cargo ws version minor --no-git-push --yes
# Bump major version (0.1.0 -> 1.0.0) for all crates
release_major:
cargo ws version major --no-git-push --yes
# Set exact version for a crate: just set_version eazy 0.2.0
set_version crate version:
cargo set-version -p {{crate}} {{version}}
# Bump a specific crate: just bump_crate eazy patch
bump_crate crate bump:
cargo set-version -p {{crate}} --bump {{bump}}
# Bump all swisskit-* crates together
bump_swisskit bump:
#!/usr/bin/env sh
for crate in $(cargo ws list | grep '^swisskit-'); do
cargo set-version -p "$crate" --bump {{bump}}
done
cargo set-version -p swisskit --bump {{bump}}
# Bump zo + fret (one ecosystem, one version)
[group('zo')]
bump bump:
cargo set-version -p zo --bump {{bump}}
# List all workspace crates and their versions
list_versions:
cargo ws list -l
# Show what would change without applying
release_dry_run bump="patch":
cargo ws version {{bump}} --no-git-push --dry-run
# Publish a single crate: just publish eazy
publish crate:
cargo publish -p {{crate}}
# Dry-run publish (verify without uploading)
publish_dry crate:
cargo publish -p {{crate}} --dry-run
# Publish all eazy-* crates (in dependency order)
publish_eazy:
cargo publish -p eazy-core
cargo publish -p eazy-derive
cargo publish -p eazy-tweener
cargo publish -p eazy-keyframe
cargo publish -p eazy
# Publish all swisskit-* crates (in dependency order)
publish_swisskit:
cargo publish -p swisskit-core
cargo publish -p swisskit-renderer
cargo publish -p swisskit
# Dry-run publish all fret-* crates
fret_publish_dry:
cargo publish -p fret-tokens --dry-run
cargo publish -p fret-types --dry-run
cargo publish -p fret-tokenizer --dry-run
cargo publish -p fret-parser --dry-run
cargo publish -p fret-pipeline --dry-run
cargo publish -p fret-driver --dry-run
cargo publish -p fret --dry-run
# Publish all fret-* crates (in dependency order)
publish_fret:
cargo publish -p fret-tokens
cargo publish -p fret-types
cargo publish -p fret-tokenizer
cargo publish -p fret-parser
cargo publish -p fret-pipeline
cargo publish -p fret-driver
cargo publish -p fret
# Create a release tag: just release 0.1.0
release version:
git tag -a {{version}} -m "zo {{version}}"
git push origin {{version}}
# Delete a tag (if you made a mistake): just delete_tag 0.1.0
delete_tag version:
git tag -d {{version}}
git push origin :refs/tags/{{version}}
# List all tags
list_tags:
git tag -l --sort=-v:refname
# site: Install dependencies
[group('site')]
site_install:
cd apps/site && npm install
# site: Audit dependencies
[group('site')]
site_audit:
cd apps/site && npm audit
# site: Wipe build caches
[group('site')]
site_clean:
cd apps/site && rm -rf node_modules/.vite .astro dist .vercel
# site: Install dependencies
[group('site')]
site_prebuild:
cd apps/site && npm run prebuild
# site: Run the development environment
[group('site')]
site_dev:
cd apps/site && npm run dev
# site: Build the website
[group('site')]
site_build:
cd apps/site && npm run build
# fret: Build the website
[group('fret')]
fret_zo_init Args:
cargo run --bin fret -- init {{Args}}
# fret: Build the website
[group('fret')]
fret_zo_build *Args:
cargo run --bin fret -- build {{Args}}
# fret: Build the website
[group('fret')]
fret_zo_run *Args:
cargo run --bin fret -- run {{Args}}