-
Notifications
You must be signed in to change notification settings - Fork 1
/
justfile
73 lines (56 loc) · 1.58 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
export DATABASE_URL := "postgresql://postgres:postgres@localhost:45432/nittei"
export RUST_BACKTRACE := "1"
# Install minimal tools
install_tools:
cargo install sqlx-cli
cargo install cargo-pretty-test
cargo install cargo-watch
# Install all tools
install_all_tools: install_tools
cargo install cargo-outdated
cargo install cargo-udeps
# Setup
setup: _setup_db _setup_client_node
# Setup database + execute migrations
_setup_db:
docker compose -f integrations/docker-compose.yml up -d
cd crates/infra && sqlx migrate run
# Setup Javascript client - run `pnpm install`
_setup_client_node:
cd clients/javascript && pnpm install
# Dev
dev: _setup_db
cargo watch -- cargo run
# Prepare offline SQLx
prepare_sqlx:
cd crates/infra && cargo sqlx prepare
# Generate TS types
generate-ts-types:
bash ./scripts/generate_ts_types.sh
# Run the tests on a temporary DB container
test test_name="":
bash ./scripts/run_tests_backend.sh {{test_name}}
# Run only the JS tests - this assumes that the backend is running
test-js:
cd clients/javascript && pnpm run test
# Run the load tests on a temporary DB container
loadtest:
INCLUDE_LOAD_TESTS=true bash ./scripts/run_tests_backend.sh loadtests
# Run all tests (backend + frontend)
test-all:
bash ./scripts/run_tests.sh
# Lint
lint: _setup_db
cargo +nightly fmt --all -- --check
cargo clippy --verbose
# Format
format:
cargo +nightly fmt --all -- --check
pnpm run format
# Check unused dependencies
check-unused: _setup_db
cargo udeps --all-targets
# Check for outdated dependencies
check-update: _setup_db
cargo outdated -wR
cargo update --dry-run