-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdev.sh
More file actions
executable file
·24 lines (22 loc) · 1.21 KB
/
Copy pathdev.sh
File metadata and controls
executable file
·24 lines (22 loc) · 1.21 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
#!/bin/sh
# Run server.py + vite as one foreground command. `trap 'kill 0' EXIT INT TERM`
# kills the entire process group when this script exits for any reason
# (including ctrl+c), so we never leave orphaned uvicorn reload workers behind
# regardless of how uv / python / uvicorn forward signals between themselves.
# This replaces the npm `concurrently` wrapper, which relied on each layer
# propagating SIGTERM correctly and occasionally didn't.
trap 'kill 0' EXIT INT TERM
# PERISCOPE_DEV=1 enables uvicorn's reload supervisor so backend edits
# bounce the worker. Production (`uv run server.py`) runs as a single
# process so it's easy to kill and leaves no orphans.
#
# PERISCOPE_PORT=8766 keeps dev OFF the prod port: it never reclaims the
# launchd-managed prod instance (which would respawn and fight back over
# 8765), never binds the MCP socket, and — with the IS_PROD gate — never
# runs the Claude-spending activity worker. vite.config.js proxies to 8766.
PERISCOPE_PORT=8766 PERISCOPE_DEV=1 uv run server.py &
vite &
# Rebuild the committed static/dist/ bundle on every static/src/ change.
# --emptyOutDir false mirrors vite.config.js: never wipe the committed dist.
vite build --watch --emptyOutDir false &
wait