-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
85 lines (72 loc) · 2.39 KB
/
Makefile
File metadata and controls
85 lines (72 loc) · 2.39 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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
.PHONY: help install build clean dev start test lint
# Default target
help:
@echo "Bookify - Available commands:"
@echo " make install - Install dependencies for all projects"
@echo " make build - Build both client and server"
@echo " make build-client - Build only the client"
@echo " make build-server - Build only the server"
@echo " make dev - Run both client and server in development mode"
@echo " make dev-client - Run only the client in development mode"
@echo " make dev-server - Run only the server in development mode"
@echo " make start - Start production servers"
@echo " make clean - Remove all node_modules and build artifacts"
@echo " make lint - Run linters on both projects"
@echo " make test - Run tests for both projects"
# Install dependencies
install:
@echo "📦 Installing dependencies..."
npm install
cd client && npm install
cd server && npm install
@echo "✅ Dependencies installed successfully!"
# Build all
build: build-server build-client
@echo "🎉 Build completed successfully!"
# Build client
build-client:
@echo "🔨 Building client..."
cd client && npm run build
@echo "✅ Client build completed!"
# Build server
build-server:
@echo "🔨 Building server..."
cd server && npm run build
@echo "✅ Server build completed!"
# Development mode
dev:
@echo "🚀 Starting development servers..."
npm run dev
dev-client:
@echo "🚀 Starting client development server..."
cd client && npm start
dev-server:
@echo "🚀 Starting server development server..."
cd server && npm run dev
# Production start
start:
@echo "🚀 Starting production servers..."
@echo "Note: Start client and server in separate terminals"
@echo "Client: cd client && serve -s build"
@echo "Server: cd server && npm start"
# Clean
clean:
@echo "🧹 Cleaning build artifacts and dependencies..."
rm -rf node_modules package-lock.json
cd client && rm -rf node_modules build package-lock.json
cd server && rm -rf node_modules package-lock.json
@echo "✅ Clean completed!"
# Lint
lint:
@echo "🔍 Running linters..."
cd server && npm run lint
@echo "✅ Linting completed!"
# Test
test:
@echo "🧪 Running tests..."
cd client && npm test -- --watchAll=false
cd server && npm test
@echo "✅ Tests completed!"
# Quick rebuild (clean + install + build)
rebuild: clean install build
@echo "🎉 Rebuild completed successfully!"