-
Notifications
You must be signed in to change notification settings - Fork 11
/
Justfile
52 lines (43 loc) · 1.62 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
# This file contains some helpful aliases you can use for development. These are
# run using `just`, a Rust task runner. To use them, you may need to install Just,
# which you can do by running `cargo install just`.
# List available targets
default:
just --list
# Fetch data used in tests
test-data: test-data-info test-data-crates
# Fetch crate responses
test-data-info:
curl -sSL https://crates.io/api/v1/crates/log -o data/log.json
curl -sSL https://crates.io/api/v1/crates/serde -o data/serde.json
curl -sSL https://crates.io/api/v1/crates/axum -o data/axum.json
curl -sSL https://crates.io/api/v1/crates/reqwest -o data/reqwest.json
# Fetch crate sources
test-data-crates:
curl -sSL https://crates.io/api/v1/crates/log/0.4.15/download -o data/log-0.4.15.crate
curl -sSL https://crates.io/api/v1/crates/log/0.4.16/download -o data/log-0.4.16.crate
curl -sSL https://crates.io/api/v1/crates/log/0.4.17/download -o data/log-0.4.17.crate
# Install dependencies needed to run
setup:
rustup target add wasm32-unknown-unknown
rustup toolchain add nightly
cargo install trunk cargo-deny
# Format code
format:
cargo +nightly fmt
# Launch local debug server
serve:
trunk serve
# Run checks (same as in CI)
check:
cargo +nightly fmt --check
cargo clippy -- -D warnings
cargo deny check
cargo test
trunk build
# generate a build, like we do in CI (including compression)
build:
trunk clean
trunk build --release
find dist -not -name '*.gz' -not -name '*.br' -type f -exec gzip -vk {} \;
find dist -not -name '*.gz' -not -name '*.br' -type f -exec brotli -vk {} \;