Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
145 lines (125 loc) · 4.21 KB
/
Copy pathMakefile
File metadata and controls
145 lines (125 loc) · 4.21 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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
# Default target - show help
.DEFAULT_GOAL := help
# Variables
NODE_BIN := pnpm
BUILD_DIR := .next
OUT_DIR := out
NODE_MODULES := node_modules
LOCK_FILE := pnpm-lock.yaml
# Phony targets (not actual files)
.PHONY: help install dev build start lint clean clean-build clean-all reinstall typecheck export setup
# ========================================
# Help & Information
# ========================================
## help: Show this help message
help:
@echo "BPP Marketing Website - Available Commands"
@echo "=========================================="
@echo ""
@echo "Setup & Installation:"
@echo " make setup - First-time project setup"
@echo " make install - Install dependencies"
@echo " make reinstall - Clean install (removes node_modules first)"
@echo ""
@echo "Development:"
@echo " make dev - Run development server (http://localhost:3000)"
@echo " make lint - Run linter"
@echo " make typecheck - Run TypeScript type checking"
@echo ""
@echo "Production:"
@echo " make build - Build for production"
@echo " make start - Start production server"
@echo " make export - Build static export (requires config)"
@echo ""
@echo "Cleanup:"
@echo " make clean - Remove node_modules and lock file"
@echo " make clean-build - Remove build artifacts (.next, out)"
@echo " make clean-all - Remove everything (full reset)"
@echo ""
@echo "Use 'make <target>' to run a specific command"
# ========================================
# Setup & Installation
# ========================================
## setup: First-time project setup
setup:
@echo "Setting up BPP marketing website..."
@if [ ! -f .env.local ]; then \
echo "Creating .env.local file..."; \
echo "# EmailJS Configuration" > .env.local; \
echo "EMAILJS_SERVICE_ID=" >> .env.local; \
echo "EMAILJS_TEMPLATE_ID=" >> .env.local; \
echo "EMAILJS_PUBLIC_KEY=" >> .env.local; \
echo ""; \
echo "✅ Created .env.local - Please add your EmailJS credentials"; \
else \
echo "✓ .env.local already exists"; \
fi
@echo "Installing dependencies..."
@$(NODE_BIN) install
@echo ""
@echo "✅ Setup complete! Next steps:"
@echo " 1. Add your EmailJS credentials to .env.local"
@echo " 2. Run 'make dev' to start the development server"
## install: Install dependencies
install:
@echo "Installing dependencies with $(NODE_BIN)..."
@$(NODE_BIN) install
## reinstall: Clean install (removes node_modules first)
reinstall: clean install
@echo "✅ Clean installation complete"
# ========================================
# Development
# ========================================
## dev: Run development server
dev:
@echo "Starting development server..."
@echo "Server will be available at http://localhost:3000"
@$(NODE_BIN) run dev
## lint: Run linter
lint:
@echo "Running linter..."
@$(NODE_BIN) run lint
## typecheck: Run TypeScript type checking
typecheck:
@echo "Running TypeScript type checking..."
@npx tsc --noEmit
# ========================================
# Production Build & Deployment
# ========================================
## build: Build for production
build:
@echo "Building for production..."
@$(NODE_BIN) run build
@echo "✅ Production build complete"
## start: Start production server
start:
@echo "Starting production server..."
@$(NODE_BIN) run start
## export: Build static export (requires next.config.js modification)
export:
@echo "Building static export..."
@echo "⚠️ Note: Ensure next.config.js has 'output: \"export\"' configured"
@$(NODE_BIN) run build
@if [ -d "$(OUT_DIR)" ]; then \
echo "✅ Static export complete in '$(OUT_DIR)' directory"; \
else \
echo "❌ Static export failed - check next.config.js configuration"; \
fi
# ========================================
# Cleanup
# ========================================
## clean: Remove node_modules and lock file
clean:
@echo "Cleaning node_modules and lock file..."
@rm -rf $(NODE_MODULES)
@rm -f $(LOCK_FILE)
@echo "✅ Clean complete"
## clean-build: Remove build artifacts
clean-build:
@echo "Removing build artifacts..."
@rm -rf $(BUILD_DIR)
@rm -rf $(OUT_DIR)
@echo "✅ Build artifacts removed"
## clean-all: Remove everything (full reset)
clean-all: clean clean-build
@echo "✅ Full cleanup complete"