-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathjustfile
More file actions
130 lines (94 loc) · 2.75 KB
/
justfile
File metadata and controls
130 lines (94 loc) · 2.75 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
#!/usr/bin/env -S just --justfile
set dotenv-load
export DATABASE_URL := env("DATABASE_URL", "postgres://turbo:turbo_dev_password@localhost:5432/turbo_cache")
export JWT_SECRET := env("JWT_SECRET", "dev-secret-do-not-use-in-production")
export SQLX_OFFLINE := "true"
_default:
@just --list -u
# --- Setup ---
# Install dev tooling (cargo-watch, typos, etc.)
init:
cargo binstall cargo-watch typos-cli -y
bun install
# --- Dev ---
# Start PostgreSQL via docker compose
db:
docker compose up -d db
# Stop PostgreSQL
db-down:
docker compose down
# Run backend (auto-reload on changes)
dev-be:
cargo watch -x run
# Run frontend dev server (Vite, port 5173, proxies /api + /v8 to :4000)
dev-fe:
bun run --filter turbo-remote-cache-dashboard dev
# Run both backend + frontend in parallel
dev: db mailpit
just dev-be & just dev-fe & wait
# Start MailPit dev email server (UI at http://localhost:8025)
mailpit:
docker compose up -d mailpit
# Build frontend for production
build-fe:
bun run --filter turbo-remote-cache-dashboard build
# Build backend in release mode
build-be:
SQLX_OFFLINE=true cargo build --release
# Build everything
build: build-fe build-be
# --- Quality ---
# Format all code (Rust + frontend)
fmt:
cargo fmt
bun run --filter turbo-remote-cache-dashboard format
# Check formatting without writing
fmt-check:
cargo fmt -- --check
bun run --filter turbo-remote-cache-dashboard format:check
# Lint Rust (clippy)
lint-be:
SQLX_OFFLINE=true cargo clippy -- -D warnings
# Lint frontend (ESLint + typecheck)
lint-fe:
bun run --filter turbo-remote-cache-dashboard lint
bun run --filter turbo-remote-cache-dashboard typecheck
# Lint everything
lint: lint-be lint-fe
# Run Rust tests
test:
SQLX_OFFLINE=true cargo test
# Check for typos in the codebase
typos:
typos
# Full CI-style check: format, lint, test, typos
check: fmt-check lint test typos
# Same as check but also auto-format first
ready: fmt lint test typos
# --- Docker ---
# Build Docker image
docker-build:
docker build -t turbo-remote-cache-rs .
# Run full stack via docker compose
docker-up:
docker compose up --build
# --- Utilities ---
# Watch and re-run tests on changes
watch-test:
cargo watch -x test
# Watch and re-run clippy on changes
watch-lint:
cargo watch -x 'clippy -- -D warnings'
# Upgrade all Rust dependencies
upgrade:
cargo upgrade --incompatible
# --- Turbo CLI ---
# Turbo CLI: login to local server
turbo-login:
cd test-turbo-app && npx turbo login --api http://localhost:4000 --login http://localhost:4000
# Turbo CLI: link repo to team
turbo-link:
cd test-turbo-app && npx turbo link --api http://localhost:4000
# Turbo CLI: test build with remote cache
turbo-build:
cd test-turbo-app && npx turbo build --api http://localhost:4000