-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
127 lines (108 loc) · 3.09 KB
/
Makefile
File metadata and controls
127 lines (108 loc) · 3.09 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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
# SIROS Documentation Makefile
# ============================
.PHONY: help install build start stop restart serve clean typecheck lint deploy watch
# Default target
help:
@echo "SIROS Documentation"
@echo "==================="
@echo ""
@echo "Usage: make <target>"
@echo ""
@echo "Development:"
@echo " install Install dependencies"
@echo " start Start development server (port 3000)"
@echo " stop Stop development server"
@echo " restart Restart development server"
@echo " watch Start dev server in background and tail logs"
@echo ""
@echo "Building:"
@echo " build Build production site"
@echo " serve Serve production build locally"
@echo " clean Clear build cache and output"
@echo ""
@echo "Quality:"
@echo " typecheck Run TypeScript type checking"
@echo " lint Check for broken links (via build)"
@echo ""
@echo "Deployment:"
@echo " deploy Deploy to GitHub Pages"
@echo ""
# Configuration
PORT ?= 3000
HOST ?= 0.0.0.0
# Install dependencies
install:
pnpm install
# Start development server
start:
@echo "Starting development server on http://$(HOST):$(PORT)"
npx docusaurus start --host $(HOST) --port $(PORT)
# Start development server in background
start-bg:
@echo "Starting development server in background..."
@nohup npx docusaurus start --host $(HOST) --port $(PORT) > .docusaurus.log 2>&1 &
@sleep 2
@echo "Server started. View logs with: tail -f .docusaurus.log"
# Stop development server
stop:
@echo "Stopping development server..."
@pkill -f "docusaurus start" 2>/dev/null || true
@pkill -f "node.*docusaurus" 2>/dev/null || true
@echo "Server stopped."
# Restart development server
restart: stop
@sleep 1
$(MAKE) start
# Watch mode - start in background and tail logs
watch: stop
@$(MAKE) start-bg
@tail -f .docusaurus.log
# Build production site
build:
@echo "Building production site..."
npm run build
@echo "Build complete. Output in ./build/"
# Serve production build
serve: build
@echo "Serving production build on http://localhost:3000"
npm run serve
# Clear cache and build output
clean:
@echo "Clearing cache and build output..."
npm run clear
rm -rf build/
rm -rf .docusaurus/
rm -f .docusaurus.log
@echo "Clean complete."
# TypeScript type checking
typecheck:
@echo "Running TypeScript type check..."
npm run typecheck
# Check for broken links (runs build with strict mode)
lint: build
@echo "Link checking completed (part of build process)"
# Deploy to GitHub Pages
deploy:
@echo "Deploying to GitHub Pages..."
npm run deploy
# Show server status
status:
@if pgrep -f "docusaurus start" > /dev/null; then \
echo "✅ Development server is running"; \
pgrep -fa "docusaurus start"; \
else \
echo "❌ Development server is not running"; \
fi
# Open in browser (macOS/Linux)
open:
@if command -v xdg-open > /dev/null; then \
xdg-open http://localhost:$(PORT); \
elif command -v open > /dev/null; then \
open http://localhost:$(PORT); \
else \
echo "Open http://localhost:$(PORT) in your browser"; \
fi
# Quick development cycle
dev: install start
# Full rebuild
rebuild: clean build