feat: Enhance Makefile with frontend commands, database seeding, and improved serve and clean targets.
This commit is contained in:
40
Makefile
40
Makefile
@@ -1,29 +1,32 @@
|
||||
# zhealth Makefile
|
||||
# Run `make help` to see available commands
|
||||
|
||||
.PHONY: help dev build release lint typecheck test clean serve
|
||||
.PHONY: help build release lint typecheck test clean serve
|
||||
|
||||
# Default target
|
||||
help:
|
||||
@echo "Available commands:"
|
||||
@echo " make dev - Start development servers"
|
||||
@echo " make serve - Start both backend and frontend servers"
|
||||
@echo " make build - Build for development"
|
||||
@echo " make release - Build optimized production bundle"
|
||||
@echo " make migrate - Run database migrations"
|
||||
@echo " make seed - Seed database with initial data"
|
||||
@echo " make lint - Run linters (Clippy + ESLint)"
|
||||
@echo " make typecheck - Type checking (Rust + TypeScript)"
|
||||
@echo " make test - Run all tests"
|
||||
@echo " make serve - Serve production build locally"
|
||||
@echo " make clean - Clean build artifacts"
|
||||
|
||||
# Backend commands
|
||||
.PHONY: backend-dev backend-build backend-release backend-lint backend-test migrate
|
||||
.PHONY: backend-dev backend-build backend-release backend-lint backend-test migrate seed
|
||||
|
||||
migrate:
|
||||
cd backend && ./target/debug/zhealth migrate
|
||||
cd backend && cargo run -- migrate
|
||||
|
||||
seed:
|
||||
cd backend && cargo run -- seed
|
||||
|
||||
backend-dev:
|
||||
cd backend && ./target/debug/zhealth serve
|
||||
cd backend && cargo run -- serve
|
||||
|
||||
backend-build:
|
||||
cd backend && cargo build
|
||||
@@ -37,26 +40,28 @@ backend-lint:
|
||||
backend-test:
|
||||
cd backend && cargo test
|
||||
|
||||
# Frontend commands (placeholder for when frontend is set up)
|
||||
.PHONY: frontend-dev frontend-build frontend-release frontend-lint frontend-test
|
||||
# Frontend commands
|
||||
.PHONY: frontend-dev frontend-build frontend-release frontend-lint frontend-test frontend-install
|
||||
|
||||
frontend-install:
|
||||
cd frontend && npm install
|
||||
|
||||
frontend-dev:
|
||||
@echo "Frontend not yet configured"
|
||||
cd frontend && npm run dev
|
||||
|
||||
frontend-build:
|
||||
@echo "Frontend not yet configured"
|
||||
cd frontend && npm run build
|
||||
|
||||
frontend-release:
|
||||
@echo "Frontend not yet configured"
|
||||
cd frontend && npm run build
|
||||
|
||||
frontend-lint:
|
||||
@echo "Frontend not yet configured"
|
||||
cd frontend && npm run lint
|
||||
|
||||
frontend-test:
|
||||
@echo "Frontend not yet configured"
|
||||
@echo "Frontend tests not yet configured"
|
||||
|
||||
# Combined commands
|
||||
dev: backend-dev
|
||||
|
||||
build: backend-build frontend-build
|
||||
|
||||
@@ -69,8 +74,11 @@ typecheck: backend-lint frontend-lint
|
||||
test: backend-test frontend-test
|
||||
|
||||
serve:
|
||||
cd backend && cargo run --release
|
||||
@echo "Starting backend (port 3000) and frontend (port 5173)..."
|
||||
@cd backend && cargo run -- serve & cd frontend && npm run dev
|
||||
|
||||
clean:
|
||||
cd backend && cargo clean
|
||||
@echo "Cleaned backend artifacts"
|
||||
cd frontend && rm -rf node_modules dist
|
||||
@echo "Cleaned build artifacts"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user