-
-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathjustfile
More file actions
137 lines (110 loc) · 3.36 KB
/
Copy pathjustfile
File metadata and controls
137 lines (110 loc) · 3.36 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
131
132
133
134
135
136
137
set dotenv-load
client_dir := "client"
# List available recipes
default:
@just --list
# Install Python and Node dependencies
install:
pip install -r requirements.txt
cd {{client_dir}} && npm install
# Build frontend assets with Vite
build:
@echo "Building assets with Vite..."
cd {{client_dir}} && npm run build
@echo "Build complete!"
# Run dev server (Redis, RQ, Vite, Flask)
[no-exit-message]
serve:
#!/usr/bin/env bash
RQ_PID=""
VITE_PID=""
cleanup() {
echo ""
echo "Shutting down..."
{ kill $VITE_PID $RQ_PID 2>/dev/null; wait $VITE_PID $RQ_PID 2>/dev/null; redis-cli shutdown; } 2>/dev/null
echo "Done."
}
trap cleanup EXIT
# Clean up any orphans from previous runs
pkill -f "rq worker" 2>/dev/null || true
redis-cli shutdown 2>/dev/null || true
sleep 1
echo "Starting Redis server..."
redis-server --daemonize yes
sleep 2
echo "Starting RQ worker..."
rq worker lurnby-tasks &
RQ_PID=$!
echo "Starting Vite dev server..."
cd {{client_dir}} && npm start &
VITE_PID=$!
sleep 2
echo "Starting Flask server..."
FLASK_DEBUG=1 flask run
# Run production server (builds assets first)
[no-exit-message]
serve-prod: build
#!/usr/bin/env bash
RQ_PID=""
cleanup() {
echo ""
echo "Shutting down..."
{ kill $RQ_PID 2>/dev/null; wait $RQ_PID 2>/dev/null; redis-cli shutdown; } 2>/dev/null
echo "Done."
}
trap cleanup EXIT
pkill -f "rq worker" 2>/dev/null || true
redis-cli shutdown 2>/dev/null || true
sleep 1
echo "Starting Redis server..."
redis-server --daemonize yes
sleep 2
echo "Starting RQ worker..."
rq worker lurnby-tasks &
RQ_PID=$!
echo "Starting Flask server in production mode..."
FLASK_DEBUG=0 flask run
# Format all code (Python + client)
format: format-client format-python
# Format Python files with Black
format-python:
@echo "Running Black formatter on Python files..."
black .
@echo "Python formatting complete!"
# Format client files with Biome
format-client:
@echo "Running Biome formatter on client files..."
cd {{client_dir}} && npm run format
@echo "Client formatting complete!"
# Lint all code (Python + client)
lint: lint-client lint-python
# Lint Python files with Flake8
lint-python:
@echo "Running Flake8 linter on Python files..."
flake8 --count --select=E9,F63,F7,F82 --show-source --statistics
@echo "Checking for style warnings..."
flake8 --exit-zero
@echo "Python linting complete!"
# Lint client files with Biome
lint-client:
@echo "Running Biome linter on client files..."
cd {{client_dir}} && npm run lint
@echo "Client linting complete!"
# Run all tests (Python + client)
test: test-python test-client
# Run Python tests with pytest
test-python:
@echo "Running Python tests with pytest..."
pytest --durations=0 --durations-min=0.29
@echo "Python tests complete!"
# Run client tests with Vitest
test-client:
@echo "Running frontend tests with Vitest..."
cd {{client_dir}} && npm run test:run
@echo "Frontend tests complete!"
# Remove build artifacts
clean:
rm -rf app/static/dist
rm -rf {{client_dir}}/node_modules/.vite
find . -type d -name __pycache__ -exec rm -rf {} + 2>/dev/null || true
find . -type f -name "*.pyc" -delete 2>/dev/null || true