-
Notifications
You must be signed in to change notification settings - Fork 0
/
justfile
86 lines (68 loc) · 2 KB
/
justfile
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
# just manual: https://github.com/casey/just/#readme
_default:
@just --list
# Format source code
fmt:
cargo fmt --all
cd frontend && cargo fmt
fmt-check:
cargo fmt --all -- --check
cd frontend && cargo fmt -- --check
# Run the server in debug mode
run: frontend
RUST_LOG=debug cargo run
# Build the frontend in debug mode
frontend: css
cd frontend && trunk build
# Build the frontend in release mode
frontend-release: css-release
cd frontend && trunk build --release
# Serve and watch frontend
frontend-watch:
cd frontend && trunk serve
# Install NPM packages (required for tailwind)
frontend-install-npm-packages:
cd frontend && npm install
# Build CSS file
css: frontend-install-npm-packages
cd frontend && tailwindcss -i src/style.css -o target/style.css
# Build and minify CSS file
css-release: frontend-install-npm-packages
cd frontend && tailwindcss -i src/style.css -o target/style.css --minify
# Build the server in debug mode
build: frontend
cargo build
# Serve playground
serve-playground:
cd frontend && trunk serve
# Build the server in release mode (musl)
build-release: fmt-check test frontend-release
cargo zigbuild --release --target x86_64-unknown-linux-musl
# Set up (and update) tooling
setup: frontend-install-npm-packages
# Ignore rustup failures, because not everyone might use it
rustup self update || true
cargo install \
wasm-pack \
cargo-edit \
trunk
# Upgrade (and update) dependencies and tools
upgrade:
cargo upgrade --incompatible
cargo update
cd frontend && cargo upgrade --incompatible
cd frontend && cargo update
# Run code checks
clippy:
cargo clippy --workspace --locked --all-targets --all-features
cd frontend && cargo clippy --locked --all-targets --all-features
# Fix lint warnings
fix:
cargo fix --workspace --all-targets
cargo clippy --workspace --all-targets --fix
cd frontend && cargo fix --all-targets
cd frontend && cargo clippy --all-targets --fix
# Run tests
test:
cargo test --workspace
cd frontend && cargo test