forked from
nonbinary.computer/jacquard
A better Rust ATProto crate
1default:
2 @just --list
3
4# Run pre-commit hooks on all files, including autoformatting
5pre-commit-all:
6 pre-commit run --all-files
7
8# Run tests with default features
9test *ARGS:
10 cargo nextest run {{ARGS}}
11
12# Run tests across the full feature matrix
13test-all:
14 @echo "── default ──"
15 cargo nextest run
16 @echo ""
17 @echo "── scope-check ──"
18 cargo nextest run --features scope-check
19 @echo ""
20 @echo "── streaming ──"
21 cargo nextest run --features streaming
22 @echo ""
23 @echo "── websocket ──"
24 cargo nextest run --features websocket
25
26# Run tests with a specific feature set
27test-feature FEATURE *ARGS:
28 cargo nextest run --features {{FEATURE}} {{ARGS}}
29
30# Check that jacquard-common compiles for wasm32
31check-wasm:
32 cargo build --target wasm32-unknown-unknown -p jacquard-common --features websocket,reqwest-client
33
34# Run 'cargo run' on the project
35run *ARGS:
36 cargo run {{ARGS}}
37
38# Run 'bacon' to run the project (auto-recompiles)
39watch *ARGS:
40 bacon --job run -- -- {{ ARGS }}
41
42update-api:
43 cargo run -p jacquard-lexgen --bin lex-fetch -- -v
44
45generate-api:
46 cargo run -p jacquard-lexgen --bin jacquard-codegen -- -i crates/jacquard-api/lexicons -o crates/jacquard-api/src
47
48lex-gen *ARGS:
49 cargo run -p jacquard-lexgen --bin lex-fetch -- {{ARGS}}
50
51lex-fetch *ARGS:
52 cargo run -p jacquard-lexgen --bin lex-fetch -- --no-codegen {{ARGS}}
53
54codegen *ARGS:
55 cargo run -p jacquard-lexgen --bin jacquard-codegen -- {{ARGS}}
56
57# Package binaries for distribution (creates tar.xz archives)
58package-binaries:
59 ./scripts/package-binaries.sh
60
61# List all available examples
62examples:
63 #!/usr/bin/env bash
64 echo "jacquard examples:"
65 for file in "examples"/*.rs; do
66 name=$(basename "$file" .rs)
67 echo " - $name"
68 done
69 echo ""
70 echo "jacquard-axum examples:"
71 cargo metadata --format-version=1 --no-deps | \
72 jq -r '.packages[] | select(.name == "jacquard-axum") | .targets[] | select(.kind[] == "example") | .name' | \
73 sed 's/^/ - /'
74 echo ""
75 echo "Usage: just example <name> [ARGS...]"
76
77# Run an example by name (auto-detects package)
78example NAME *ARGS:
79 #!/usr/bin/env bash
80 if [ -f "examples/{{NAME}}.rs" ]; then
81 cargo run -p jacquard --features=api_bluesky,streaming --example {{NAME}} -- {{ARGS}}
82 elif cargo metadata --format-version=1 --no-deps | \
83 jq -e '.packages[] | select(.name == "jacquard-axum") | .targets[] | select(.kind[] == "example" and .name == "{{NAME}}")' > /dev/null; then
84 cargo run -p jacquard-axum --example {{NAME}} -- {{ARGS}}
85 else
86 echo "Example '{{NAME}}' not found."
87 echo ""
88 echo "jacquard examples:"
89 for file in "examples"/*.rs; do
90 name=$(basename "$file" .rs)
91 echo " - $name"
92 done
93 echo ""
94 echo "jacquard-axum examples:"
95 cargo metadata --format-version=1 --no-deps | \
96 jq -r '.packages[] | select(.name == "jacquard-axum") | .targets[] | select(.kind[] == "example") | .name' | \
97 sed 's/^/ - /'
98 exit 1
99 fi