mirror of
https://git.quad4.io/RNS-Things/MeshChatX.git
synced 2026-10-22 22:21:32 +00:00
feat(makefile): add development commands for Vite and Python backend, including help instructions and new script for local development
This commit is contained in:
2 files changed
+52
-1
No files matched your search
@@ -1,15 +1,38 @@
|
||||
.PHONY: install run build lint test test-be-perf clean
|
||||
.PHONY: install run dev dev-fe build lint test test-be-perf clean help dist-linux dist-linux-x64
|
||||
|
||||
install:
|
||||
pnpm install
|
||||
poetry install
|
||||
|
||||
# Python backend only. For HMR, use: make dev OR make run in one terminal and pnpm run dev in another.
|
||||
run:
|
||||
poetry run python -m meshchatx.meshchat
|
||||
|
||||
# Vite dev server (live reload) + backend. Open http://localhost:5173 — proxies /api and /ws to MESHCHAT_PORT (default 8000).
|
||||
dev:
|
||||
bash scripts/dev-local.sh
|
||||
|
||||
# Vite only; expects backend already running (e.g. make run on port 8000).
|
||||
dev-fe:
|
||||
pnpm run dev -- --host 127.0.0.1 --port 5173
|
||||
|
||||
build:
|
||||
pnpm run build
|
||||
|
||||
# Linux AppImage + deb (see package.json dist:linux).
|
||||
dist-linux:
|
||||
pnpm run dist:linux
|
||||
|
||||
dist-linux-x64:
|
||||
pnpm run dist:linux-x64
|
||||
|
||||
help:
|
||||
@echo "make dev - Vite HMR + backend (http://localhost:5173)"
|
||||
@echo "make run - backend only"
|
||||
@echo "make dev-fe - Vite only (pair with make run)"
|
||||
@echo "make dist-linux - AppImage + deb (electron-builder)"
|
||||
@echo "Env: MESHCHAT_PORT, E2E_BACKEND_PORT (vite proxy; script sets both), VITE_DEV_HOST, VITE_DEV_PORT"
|
||||
|
||||
lint:
|
||||
pnpm run lint
|
||||
poetry run ruff check .
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
#!/usr/bin/env bash
|
||||
# Vite dev server (HMR) + MeshChat Python backend. Open http://localhost:5173 (or VITE_DEV_PORT).
|
||||
set -euo pipefail
|
||||
|
||||
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
||||
cd "$ROOT"
|
||||
|
||||
export MESHCHAT_PORT="${MESHCHAT_PORT:-8000}"
|
||||
export E2E_BACKEND_PORT="$MESHCHAT_PORT"
|
||||
|
||||
BE_PID=""
|
||||
cleanup() {
|
||||
if [[ -n "$BE_PID" ]] && kill -0 "$BE_PID" 2>/dev/null; then
|
||||
kill "$BE_PID" 2>/dev/null || true
|
||||
wait "$BE_PID" 2>/dev/null || true
|
||||
fi
|
||||
}
|
||||
trap cleanup EXIT INT TERM
|
||||
|
||||
poetry run python -m meshchatx.meshchat &
|
||||
BE_PID=$!
|
||||
|
||||
sleep "${DEV_BACKEND_WAIT:-1}"
|
||||
|
||||
VITE_HOST="${VITE_DEV_HOST:-127.0.0.1}"
|
||||
VITE_PORT="${VITE_DEV_PORT:-5173}"
|
||||
|
||||
pnpm run dev -- --host "$VITE_HOST" --port "$VITE_PORT"
|
||||
Reference in new issue
Block a user