-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathdev.sh
More file actions
executable file
·39 lines (32 loc) · 1.03 KB
/
Copy pathdev.sh
File metadata and controls
executable file
·39 lines (32 loc) · 1.03 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
#!/usr/bin/env bash
set -e
# Install UI deps if needed
if [ ! -d ui/node_modules ]; then
echo "Installing UI dependencies..."
cd ui && npm install && cd ..
fi
# Install backend deps if needed
if [ ! -d node_modules ]; then
echo "Installing backend dependencies..."
npm install
fi
cleanup() {
echo "Shutting down..."
kill "$BACKEND_PID" "$VITE_PID" 2>/dev/null || true
wait "$BACKEND_PID" "$VITE_PID" 2>/dev/null || true
}
trap cleanup INT TERM
# Backend on port 4445 (API + WebSocket)
# --ignore to prevent unnecessary restarts that kill active PTY sessions
NODE_ENV=development npx tsx watch --clear-screen=false --ignore 'ui/**' --ignore 'bench/**' --ignore '*.md' --ignore 'branding-preview.html' src/index.ts --port 4445 --log-level debug &
BACKEND_PID=$!
# Vite dev server on port 4444 (UI + HMR, proxies /api and /ws to backend)
cd ui && npx vite --host 0.0.0.0 --port 4444 &
VITE_PID=$!
cd ..
echo ""
echo " vipershell dev:"
echo " UI: http://localhost:4444"
echo " Backend: http://localhost:4445"
echo ""
wait