-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjustfile
More file actions
786 lines (644 loc) · 22.7 KB
/
Copy pathjustfile
File metadata and controls
786 lines (644 loc) · 22.7 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
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
# Justfile for the id project.
#
# Just is a command runner (like make but simpler).
# Install: cargo install just
# Usage: just <recipe>
#
# Run `just` with no arguments to see available recipes.
#
# NOTE: Commands marked [bun] need Bun installed (use `nix develop`).
# NOTE: Every just command should have a corresponding `nix run .#<cmd>` in flake.nix.
#
# Naming conventions:
# - Simple command names (build, serve, check) default to web variant
# - Use -lib suffix for library-only variant (no web/bun required)
# - Use -force suffix to bypass freshness checks
mod? root '../../root.just'
# Default recipe — kill existing server and serve with web UI [bun]
default: kill-serve
# WARNING: default recipe cannot be an alias
# Show available recipes
list:
@just --list
# =============================================================================
# Quality Checks
# =============================================================================
# Run all checks (with auto-fix first) [bun]
[group('check')]
check: fix ci
@echo "✓ All checks passed!"
alias check-all := check
# CI-safe checks (read-only, no modifications) [bun]
[group('check')]
ci: cargo-fmt-check web-fmt-check cargo-check clippy-lint web-lint test-sandbox test-web-unit test-web-typecheck doc build release
@echo "✓ CI checks passed!"
# Auto-fix formatting and lint issues
[group('check')]
fix *args: strip-whitespace lockfiles (fmt args) lint-fix
@echo "✓ Fixed what could be fixed"
# =============================================================================
# Formatting
# =============================================================================
# Run treefmt (cached, finds nearest treefmt.toml from pwd)
[group('format')]
treefmt *args:
#!/usr/bin/env bash
set -euo pipefail
dir="$(pwd)"
while [ "$dir" != "/" ] && [ ! -f "$dir/treefmt.toml" ]; do dir="$(dirname "$dir")"; done
if [ ! -f "$dir/treefmt.toml" ]; then echo "error: no treefmt.toml found" >&2; exit 1; fi
unset TREEFMT_TREE_ROOT TREEFMT_TREE_ROOT_CMD TREEFMT_TREE_ROOT_FILE
# Translate --check to --fail-on-change (treefmt v2 renamed the flag)
translated_args=()
for arg in {{args}}; do
case "$arg" in
--check) translated_args+=(--fail-on-change) ;;
*) translated_args+=("$arg") ;;
esac
done
exec treefmt --config-file "$dir/treefmt.toml" --tree-root "$dir" "${translated_args[@]}"
# Run treefmt without cache (finds nearest treefmt.toml from pwd)
[group('format')]
treefmt-no-cache *args:
#!/usr/bin/env bash
set -euo pipefail
dir="$(pwd)"
while [ "$dir" != "/" ] && [ ! -f "$dir/treefmt.toml" ]; do dir="$(dirname "$dir")"; done
if [ ! -f "$dir/treefmt.toml" ]; then echo "error: no treefmt.toml found" >&2; exit 1; fi
unset TREEFMT_TREE_ROOT TREEFMT_TREE_ROOT_CMD TREEFMT_TREE_ROOT_FILE
# Translate --check to --fail-on-change (treefmt v2 renamed the flag)
translated_args=()
for arg in {{args}}; do
case "$arg" in
--check) translated_args+=(--fail-on-change) ;;
*) translated_args+=("$arg") ;;
esac
done
exec treefmt --config-file "$dir/treefmt.toml" --tree-root "$dir" --no-cache "${translated_args[@]}"
alias treefmt-uncached := treefmt-no-cache
# Strip trailing whitespace from all tracked text files
[group('format')]
strip-whitespace:
#!/usr/bin/env bash
set -euo pipefail
git grep -rl '[[:space:]]$' -- \
':!*.patch' ':!*.min.*' ':!*.lock' ':!*.map' ':!*.generated.*' ':!*.pb.*' ':!*.g.dart' \
':!*.exe' ':!*.dll' ':!*.so' ':!*.dylib' ':!*.a' ':!*.o' ':!*.obj' \
':!*.png' ':!*.jpg' ':!*.jpeg' ':!*.gif' ':!*.bmp' ':!*.ico' ':!*.webp' ':!*.svg' ':!*.tiff' ':!*.tif' ':!*.avif' \
':!*.mp4' ':!*.mkv' ':!*.avi' ':!*.mov' ':!*.wmv' ':!*.flv' ':!*.webm' \
':!*.mp3' ':!*.wav' ':!*.flac' ':!*.aac' ':!*.ogg' ':!*.wma' ':!*.m4a' ':!*.opus' \
':!*.zip' ':!*.tar' ':!*.gz' ':!*.bz2' ':!*.xz' ':!*.zst' ':!*.7z' ':!*.rar' \
':!*.pdf' ':!*.woff' ':!*.woff2' ':!*.ttf' ':!*.otf' ':!*.eot' \
2>/dev/null | while IFS= read -r f; do
case "$f" in
*/node_modules/*|*/dist/*|*/target/*|*/vendor/*|*/vendored/*|*/release/*|*/bin/*) continue ;;
*/build/*|*/out/*|*/output/*|*/_build/*|*/pkg/*|*/.next/*|*/.nuxt/*|*/.output/*) continue ;;
*/_site/*|*/.cache/*|*/__pycache__/*|*/.tox/*|*/_generated/*) continue ;;
*/third_party/*|*/third-party/*|*/external/*|*/deps/*|*/Pods/*|*/.bundle/*) continue ;;
*/bower_components/*|*/.pnp/*|*/.eggs/*|*.egg-info/*|*/site-packages/*) continue ;;
*/.gradle/*|*/.mvn/*|*/Packages/*) continue ;;
esac
case "$(file -b --mime-encoding "$f")" in binary) continue ;; esac
sed -i 's/[[:space:]]*$//' "$f"
done || true
# Format all code (via treefmt)
[group('format')]
fmt *args: (treefmt args)
# Check all formatting (no changes)
[group('format')]
fmt-check: cargo-fmt-check web-fmt-check
# Format Rust code
[group('format')]
cargo-fmt:
cargo fmt
# Check Rust formatting (no changes)
[group('format')]
cargo-fmt-check:
cargo fmt -- --check
# [biome] Format web code (TypeScript + CSS)
[group('format')]
web-fmt:
biome format --write web/src/ web/scripts/ e2e/
# [biome] Check web formatting (no changes)
[group('format')]
web-fmt-check:
biome format web/src/ web/scripts/ e2e/
# =============================================================================
# Linting
# =============================================================================
# Run all linters (Rust + web)
[group('lint')]
lint: clippy-lint web-lint
# Run all linters with auto-fix
[group('lint')]
lint-fix: clippy-lint-fix web-lint-fix
# Run cargo check (type checking, all targets and features)
[group('lint')]
cargo-check:
cargo check --all-targets --all-features
# Run clippy linting
[group('lint')]
clippy-lint:
cargo clippy --all-targets --all-features
# Run clippy with auto-fix
[group('lint')]
clippy-lint-fix:
cargo clippy --all-targets --all-features --fix --allow-dirty --allow-staged
# [biome] Lint web code (TypeScript + CSS)
[group('lint')]
web-lint:
biome lint web/src/ web/scripts/ e2e/
# [biome] Lint web code with auto-fix
[group('lint')]
web-lint-fix:
biome lint --write web/src/ web/scripts/ e2e/
# =============================================================================
# Lockfiles
# =============================================================================
# Regenerate all lockfiles (bun2nix + just-recipes.json)
[group('deps')]
lockfiles: bun2nix bun2nix-e2e just-recipes
# Regenerate web/bun.nix from web/bun.lock for offline nix builds
[group('deps')]
bun2nix:
bun2nix --lock-file web/bun.lock --output-file web/bun.nix
# Regenerate e2e/bun.nix from e2e/bun.lock for offline nix builds
[group('deps')]
bun2nix-e2e:
bun2nix --lock-file e2e/bun.lock --output-file e2e/bun.nix
# Regenerate just-recipes.json from justfile for dynamic nix app generation
[group('deps')]
just-recipes:
just --dump --dump-format json > just-recipes.json
biome format --write --config-path . just-recipes.json
# =============================================================================
# Testing
# =============================================================================
# Run all Rust tests
[group('test')]
test-rust:
cargo test --all-features
alias test-cargo := test-rust
# Run all fast tests (Rust + TypeScript unit + typecheck)
[group('test')]
test: test-rust test-web-unit test-web-typecheck
@echo "✓ All fast tests passed (Rust + TypeScript)!"
# Run all Rust tests (sandbox-safe: excludes tests requiring network)
[group('test')]
test-sandbox:
cargo test --all-features -- --skip serve_tests
# Run unit tests only (fast)
[group('test')]
test-unit:
cargo test --all-features --lib
alias test-lib := test-unit
# Run integration tests only
[group('test')]
test-integration:
cargo test --all-features --test cli_integration
alias test-int := test-integration
# Run integration tests (sandbox-safe: excludes serve_tests requiring network)
[group('test')]
test-int-sandbox:
cargo test --all-features --test cli_integration -- --skip serve_tests
# Run tests with output shown
[group('test')]
test-verbose:
cargo test --all-features -- --nocapture
# Run a specific test by name
[group('test')]
test-one NAME:
cargo test --all-features {{NAME}}
# [bun] Run web tests (Rust + TypeScript unit tests + type checking)
[group('test')]
test-web: test-rust test-web-unit test-web-typecheck
@echo "✓ All web tests passed!"
alias web-typecheck := test-web
# [bun] Run web tests (sandbox-safe: excludes serve_tests requiring network)
[group('test')]
test-web-sandbox: test-sandbox test-web-unit test-web-typecheck
@echo "✓ All web tests passed (sandbox)!"
# [bun] Run TypeScript unit tests only
[group('test')]
test-web-unit:
cd web && bun run test
# [bun] Run TypeScript type checking only
[group('test')]
test-web-typecheck:
cd web && bun run typecheck
# Run nix flake check (27 sandboxed checks: lint, test, E2E, NixOS VM tests, VM Playwright)
[group('test')]
test-nix:
nix flake check
@echo "✓ nix flake check passed (27 checks — runs everything)"
alias test-full := test-nix
alias check-nix := test-nix
alias nix-check := test-nix
# =============================================================================
# E2E Tests (Playwright - requires built web variant + network)
# =============================================================================
# [bun] Run Playwright E2E tests (both chromium and firefox)
[group('e2e')]
test-e2e: build
cd e2e && bun install --frozen-lockfile && bunx playwright test
# [bun] Run Playwright E2E tests (chromium only)
[group('e2e')]
test-e2e-chromium: build
cd e2e && bun install --frozen-lockfile && bunx playwright test --project=chromium
# [bun] Run Playwright E2E tests (firefox only)
[group('e2e')]
test-e2e-firefox: build
cd e2e && bun install --frozen-lockfile && bunx playwright test --project=firefox
# [bun] Show Playwright test report
[group('e2e')]
test-e2e-report:
cd e2e && bunx playwright show-report
# =============================================================================
# Documentation & Coverage
# =============================================================================
# Build Rust documentation
[group('docs')]
doc:
cargo doc --no-deps --document-private-items
# Build and open Rust documentation in browser
[group('docs')]
doc-open:
cargo doc --no-deps --document-private-items --open
# Generate code coverage report
[group('docs')]
coverage:
cargo llvm-cov --html
# Generate and open coverage report in browser
[group('docs')]
coverage-open:
cargo llvm-cov --html --open
# Generate coverage summary to stdout
[group('docs')]
coverage-summary:
cargo llvm-cov
# =============================================================================
# Build Commands
# =============================================================================
# Build with web UI (default) [bun]
[group('build')]
build:
./scripts/build.sh web debug
alias build-web := build
# Build library only (no web/bun required)
[group('build')]
build-lib:
./scripts/build.sh lib debug
# Build release with web UI [bun]
[group('build')]
release:
./scripts/build.sh web release
alias build-release := release
alias build-web-release := release
# Build release binary without web UI
[group('build')]
release-lib:
./scripts/build.sh lib release
alias build-lib-release := release-lib
# Force rebuild debug binary with web UI [bun]
[group('build')]
build-web-force: web build-web-cargo mark-variant-web
alias build-force := build-web-force
# Force rebuild debug binary without web UI
[group('build')]
build-lib-force: build-lib-cargo mark-variant-lib
# Force rebuild release binary with web UI [bun]
[group('build')]
release-web-force: web release-web-cargo mark-variant-release-web
alias release-force := release-web-force
# Force rebuild release binary without web UI
[group('build')]
release-lib-force: release-lib-cargo mark-variant-release-lib
# Run cargo build with web feature (debug)
[group('build')]
build-web-cargo:
cargo build --features web
alias build-cargo := build-web-cargo
# Run cargo build without web feature (debug)
[group('build')]
build-lib-cargo:
cargo build
# Run cargo build with web feature (release)
[group('build')]
release-web-cargo:
cargo build --release --features web
# Run cargo build without web feature (release)
[group('build')]
release-lib-cargo:
cargo build --release
# Internal: variant tracking
[private]
mark-variant-web:
@mkdir -p target && echo "web" > target/.build-variant
[private]
mark-variant-lib:
@mkdir -p target && echo "lib" > target/.build-variant
[private]
mark-variant-release-web:
@mkdir -p target && echo "web" > target/.build-variant-release
[private]
mark-variant-release-lib:
@mkdir -p target && echo "lib" > target/.build-variant-release
# Clean all build artifacts
[group('build')]
clean:
cargo clean
# =============================================================================
# Web Assets [bun]
# =============================================================================
# [bun] Build web frontend assets
[group('web')]
web: web-assets
alias web-build := web
# [bun] Build web frontend assets (via build script)
[group('web')]
web-assets:
./scripts/build.sh assets
alias assets := web-assets
# [bun] Force rebuild web assets (bypass freshness checks)
[group('web')]
web-assets-force:
cd web && bun install && bun run build
alias web-force := web-assets-force
# [bun] Watch and rebuild web assets on changes
[group('web')]
web-assets-dev:
cd web && bun install && bun run dev
alias web-dev := web-assets-dev
# =============================================================================
# Run Commands
# =============================================================================
# Run CLI with arguments (lib variant)
[group('run')]
run *ARGS:
cargo run -- {{ARGS}}
# Serve with web UI (default) [bun]
[group('run')]
serve *ARGS: web (serve-web ARGS)
# Serve with web UI (skip asset build, requires pre-built assets)
[group('run')]
serve-web *ARGS:
cargo run --features web -- serve --web {{ARGS}}
# Serve without web UI
[group('run')]
serve-lib *ARGS:
cargo run -- serve {{ARGS}}
# Serve a new instance with web UI and auto-assigned port (creates .iroh/<name>/) [bun]
[group('run')]
serve-new NAME="" *ARGS: web (serve-new-web NAME ARGS)
# Serve a new instance with web UI (skip asset build, requires pre-built assets)
[group('run')]
serve-new-web NAME="" *ARGS:
cargo run --features web -- {{ if NAME != "" { "--new=" + NAME } else { "--new=" } }} serve --web --port 0 {{ARGS}}
# Serve a new instance without web UI and auto-assigned port
[group('run')]
serve-new-lib NAME="" *ARGS:
cargo run -- {{ if NAME != "" { "--new=" + NAME } else { "--new=" } }} serve --port 0 {{ARGS}}
# Build then serve with web UI [bun]
[group('run')]
build-serve *ARGS: build (serve ARGS)
# Kill any running 'id serve' processes
[group('run')]
kill:
-pkill -xf ".*/id serve.*"
# Sleep for specified seconds (default 0.6)
[group('run')]
sleep SECONDS="0.6":
sleep {{SECONDS}}
# Kill and restart serve with web UI [bun] [alias: default]
[group('run')]
kill-serve *ARGS: kill sleep (serve ARGS)
# WARNING: default recipe cannot be an alias
# Run the REPL
[group('run')]
repl:
cargo run -- repl
# =============================================================================
# Watch Commands
# =============================================================================
# Watch and run tests on changes
[group('watch')]
watch-test:
cargo watch -x test
# Watch and run clippy on changes
[group('watch')]
watch-lint:
cargo watch -x clippy
# Watch and rebuild on changes
[group('watch')]
watch:
cargo watch -x build
alias watch-build := watch
# =============================================================================
# Dependency Management
# =============================================================================
# Check for outdated dependencies
[group('deps')]
outdated:
cargo outdated
# Audit dependencies for security vulnerabilities
[group('deps')]
audit:
cargo audit
# Find unused dependencies
[group('deps')]
machete:
cargo machete
# Update Cargo.lock
[group('deps')]
update:
cargo update
# Show dependency tree
[group('deps')]
tree:
cargo tree
# =============================================================================
# Utilities
# =============================================================================
# Count lines of code
[group('util')]
loc:
tokei
# Recursively chown all files (including hidden) to current user:group (requires sudo)
[group('util')]
chown:
#!/usr/bin/env bash
set -euxo pipefail
id
user="$(id -u)"
group="$(id -g)"
sudo chown -R "$user:$group" .
# =============================================================================
# Flake Input Management
# =============================================================================
# Update a list of flake inputs by name (lock-only, no build)
[group('flake')]
update-input +inputs:
#!/usr/bin/env bash
set -euo pipefail
for input in {{inputs}}; do
echo "--- Updating $input ---"
nix flake update "$input"
done
alias update-inputs := update-input
# Update all flake inputs (lock-only, no build)
[group('flake')]
update-inputs-all:
nix flake update
alias update-all-inputs := update-inputs-all
# Helpers to parse flake.lock via nix for NixOS/nixpkgs inputs
[private]
_nixpkgs-inputs ref="":
#!/usr/bin/env bash
if [ -z "{{ref}}" ]; then
nix eval --raw --impure --expr 'import ./nix/nixpkgs-inputs.nix {}'
else
nix eval --raw --impure --expr "import ./nix/nixpkgs-inputs.nix { ref = \"{{ref}}\"; }"
fi
# Update all direct NixOS/nixpkgs inputs (any branch)
[group('flake')]
update-nixpkgs-all:
./scripts/update-nixpkgs-inputs.sh
# Update NixOS/nixpkgs inputs on master (or no explicit branch)
[group('flake')]
update-nixpkgs-master:
./scripts/update-nixpkgs-inputs.sh master
# Update NixOS/nixpkgs inputs on nixos-unstable branch
[group('flake')]
update-nixpkgs-unstable:
./scripts/update-nixpkgs-inputs.sh nixos-unstable
# Update all NixOS/nixpkgs inputs by branch category (master then unstable, combined summary)
[group('flake')]
update-nixpkgs:
./scripts/update-nixpkgs-inputs.sh master nixos-unstable
# Update all NixOS/nixpkgs inputs by name only (no URL discovery, just pass names through)
[group('flake')]
update-nixpkgs-all-only:
#!/usr/bin/env bash
set -euo pipefail
inputs=$(just _nixpkgs-inputs)
if [ -z "$inputs" ]; then
echo "No NixOS/nixpkgs inputs found in flake.lock"
exit 0
fi
just update-input $inputs
# Update NixOS/nixpkgs master inputs by name only
[group('flake')]
update-nixpkgs-master-only:
#!/usr/bin/env bash
set -euo pipefail
inputs=$(just _nixpkgs-inputs master)
if [ -z "$inputs" ]; then
echo "No NixOS/nixpkgs master inputs found in flake.lock"
exit 0
fi
just update-input $inputs
# Update NixOS/nixpkgs nixos-unstable inputs by name only
[group('flake')]
update-nixpkgs-unstable-only:
#!/usr/bin/env bash
set -euo pipefail
inputs=$(just _nixpkgs-inputs nixos-unstable)
if [ -z "$inputs" ]; then
echo "No NixOS/nixpkgs nixos-unstable inputs found in flake.lock"
exit 0
fi
just update-input $inputs
# =============================================================================
# Nix Checks (individual flake checks — prefer test-nix for full suite)
# =============================================================================
# Run a single nix flake check by name (e.g. just check-one test-unit)
[group('nix')]
check-one NAME:
nix build -L .#checks.x86_64-linux.{{NAME}}
# Build nix package — web variant (nix build)
[group('nix')]
build-nix:
nix build
# Build nix package — lib variant, no web (nix build .#id-lib)
[group('nix')]
build-nix-lib:
nix build .#id-lib
# --- NixOS VM tests (require KVM, Linux only) ---
# Run NixOS VM serve integration test
[group('nix')]
test-nixos-serve:
nix build -L .#checks.x86_64-linux.nixos-serve
# Run NixOS VM E2E browser test (Chromium --dump-dom)
[group('nix')]
test-nixos-e2e:
nix build -L .#checks.x86_64-linux.nixos-e2e
# Run NixOS 4-VM Playwright E2E test (both browsers, ~3 min)
[group('nix')]
test-nixos-playwright-e2e:
nix build -L .#checks.x86_64-linux.nixos-playwright-e2e
# Run NixOS VM integration tests (serve_tests + full test binary)
[group('nix')]
test-nixos-integration:
nix build -L .#checks.x86_64-linux.nixos-integration
# Run all NixOS VM tests (requires KVM, Linux only)
[group('nix')]
test-nixos: test-nixos-serve test-nixos-e2e test-nixos-playwright-e2e test-nixos-integration
# --- Sandbox format checks (individual) ---
# Run Playwright E2E in nix sandbox (Firefox only — Chromium crashes in sandbox)
[group('nix')]
check-test-e2e:
nix build -L .#checks.x86_64-linux.test-e2e
# Run nix-fmt-check in sandbox (nixfmt --check on all .nix files)
[group('nix')]
check-nix-fmt:
nix build -L .#checks.x86_64-linux.nix-fmt-check
# Run treefmt in sandbox (all formatters via treefmt.toml)
[group('nix')]
check-treefmt:
nix build -L .#checks.x86_64-linux.treefmt-check
# Run biome check in sandbox (JS/TS/CSS linting)
[group('nix')]
check-biome:
nix build -L .#checks.x86_64-linux.biome-check
# Run rustfmt check in sandbox (Rust formatting)
[group('nix')]
check-rustfmt:
nix build -L .#checks.x86_64-linux.rustfmt-check
# Run statix check in sandbox (Nix linting)
[group('nix')]
check-statix:
nix build -L .#checks.x86_64-linux.statix-check
# Run shfmt check in sandbox (shell script formatting)
[group('nix')]
check-shfmt:
nix build -L .#checks.x86_64-linux.shfmt-check
# Run shellcheck in sandbox (shell script linting)
[group('nix')]
check-shellcheck:
nix build -L .#checks.x86_64-linux.shellcheck-check
# Run taplo check in sandbox (TOML formatting)
[group('nix')]
check-taplo:
nix build -L .#checks.x86_64-linux.taplo-check
# Run prettier check in sandbox (Markdown/YAML/JSON formatting)
[group('nix')]
check-prettier:
nix build -L .#checks.x86_64-linux.prettier-check
# =============================================================================
# Combined Commands
# =============================================================================
# Check and serve with web UI [bun]
[group('workflow')]
check-serve *ARGS: check (serve ARGS)
# Build and check [bun]
[group('workflow')]
build-check: build check
# Build, check, and serve with web UI [bun]
[group('workflow')]
build-check-serve *ARGS: build check (serve ARGS)
# Build, check, and serve without web UI
[group('workflow')]
build-check-serve-lib: build-lib ci serve-lib
# Build and serve without web UI
[group('workflow')]
build-serve-lib: build-lib serve-lib