mirror of
https://github.com/OpenBMB/ChatDev.git
synced 2026-04-25 11:18:06 +00:00
This PR provides full cross-platform support (Windows/macOS/Linux) for the development environment. Key Changes Makefile: Refactored dev and stop targets using cross-env and kill-port to support PowerShell/CMD. Compatibility: Replaced Unix-specific grep/awk in the help target with a Python one-liner. Bug Fix: Added encoding='utf-8' to tools/sync_vuegraphs.py to prevent charmap decode errors on Windows systems. Dependencies: Added necessary dev-tools to package.json files to ensure a seamless "clone and run" experience.
46 lines
1.6 KiB
Makefile
46 lines
1.6 KiB
Makefile
# ==============================================================================
|
|
# Development Commands
|
|
# ==============================================================================
|
|
|
|
.PHONY: dev
|
|
dev: ## Run both backend and frontend development servers
|
|
@$(MAKE) -j2 server client
|
|
|
|
|
|
.PHONY: server
|
|
server: ## Start the backend server in the background
|
|
@echo "Starting server in background..."
|
|
@uv run python server_main.py --port 6400 --reload &
|
|
|
|
.PHONY: client
|
|
client: ## Start the frontend development server
|
|
@cd frontend && npx cross-env VITE_API_BASE_URL=http://localhost:6400 npm run dev
|
|
|
|
.PHONY: stop
|
|
stop: ## Stop backend and frontend servers cross-platform
|
|
@echo "Stopping backend server (port 6400)..."
|
|
@npx kill-port 6400
|
|
@echo "Stopping frontend server (port 5173)..."
|
|
@npx kill-port 5173
|
|
|
|
# ==============================================================================
|
|
# Tools & Maintenance
|
|
# ==============================================================================
|
|
|
|
.PHONY: sync
|
|
sync: ## Sync Vue graphs to the server database
|
|
@uv run python tools/sync_vuegraphs.py
|
|
|
|
.PHONY: validate-yamls
|
|
validate-yamls: ## Validate all YAML configuration files
|
|
@uv run python tools/validate_all_yamls.py
|
|
|
|
# ==============================================================================
|
|
# Help
|
|
# ==============================================================================
|
|
|
|
.PHONY: help
|
|
help: ## Display this help message
|
|
@python -c "import re; \
|
|
[print(f'{m[0]:<20} {m[1]}') for m in re.findall(r'^([a-zA-Z_-]+):.*?## (.*)$$', open('$(MAKEFILE_LIST)').read(), re.M)]" | sort
|