Skip to content

Commit 945b608

Browse files
jongearclaude
andauthored
feat: add Makefile with comprehensive development commands (#101)
Adds convenient Make shortcuts for common development tasks: Development: - make install/dev/build/serve - Standard workflow commands Code Quality: - make lint/lint-fix/test - Linting and testing Maintenance: - make clean/clean-all/fresh/rebuild - Cleanup utilities Dependencies: - make audit/audit-fix/upgrade - Dependency management Utilities: - make version/info/help - Project information All commands include color-coded output for better UX. Updated README with comprehensive Makefile documentation. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent bfc4fce commit 945b608

2 files changed

Lines changed: 133 additions & 0 deletions

File tree

Makefile

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
.PHONY: help install dev build lint serve clean test audit
2+
3+
# Default target
4+
.DEFAULT_GOAL := help
5+
6+
# Colors for output
7+
CYAN := \033[0;36m
8+
GREEN := \033[0;32m
9+
YELLOW := \033[0;33m
10+
RED := \033[0;31m
11+
NC := \033[0m # No Color
12+
13+
help: ## Show this help message
14+
@echo "$(CYAN)Available commands:$(NC)"
15+
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf " $(GREEN)%-15s$(NC) %s\n", $$1, $$2}'
16+
17+
install: ## Install dependencies
18+
@echo "$(CYAN)Installing dependencies...$(NC)"
19+
npm install
20+
21+
ci-install: ## Clean install for CI/CD (uses package-lock.json)
22+
@echo "$(CYAN)Running clean install...$(NC)"
23+
npm ci
24+
25+
dev: ## Start development server
26+
@echo "$(CYAN)Starting development server...$(NC)"
27+
npm run dev
28+
29+
start: dev ## Alias for dev
30+
31+
build: ## Build production site
32+
@echo "$(CYAN)Building production site...$(NC)"
33+
npm run build
34+
35+
lint: ## Run ESLint
36+
@echo "$(CYAN)Running linter...$(NC)"
37+
npm run lint
38+
39+
lint-fix: ## Run ESLint with auto-fix
40+
@echo "$(CYAN)Running linter with auto-fix...$(NC)"
41+
npm run lint:fix
42+
43+
serve: ## Serve production build locally
44+
@echo "$(CYAN)Serving production build...$(NC)"
45+
npm run serve
46+
47+
clean: ## Clean build artifacts and node_modules
48+
@echo "$(CYAN)Cleaning build artifacts...$(NC)"
49+
rm -rf public .cache
50+
@echo "$(GREEN)Build artifacts cleaned!$(NC)"
51+
52+
clean-all: clean ## Clean everything including node_modules
53+
@echo "$(CYAN)Removing node_modules...$(NC)"
54+
rm -rf node_modules package-lock.json
55+
@echo "$(GREEN)All artifacts cleaned!$(NC)"
56+
57+
audit: ## Run npm security audit
58+
@echo "$(CYAN)Running security audit...$(NC)"
59+
npm audit
60+
61+
audit-fix: ## Fix npm security issues automatically
62+
@echo "$(CYAN)Fixing security issues...$(NC)"
63+
npm audit fix
64+
65+
test: lint build ## Run all tests (lint + build)
66+
@echo "$(GREEN)All tests passed!$(NC)"
67+
68+
fresh: clean-all install ## Fresh install (clean + install)
69+
@echo "$(GREEN)Fresh install complete!$(NC)"
70+
71+
rebuild: clean build ## Clean rebuild
72+
@echo "$(GREEN)Rebuild complete!$(NC)"
73+
74+
upgrade: ## Update all dependencies to latest versions
75+
@echo "$(YELLOW)Updating dependencies...$(NC)"
76+
npm update
77+
@echo "$(GREEN)Dependencies updated!$(NC)"
78+
79+
version: ## Show current version from package.json
80+
@node -p "'v' + require('./package.json').version"
81+
82+
info: ## Show project information
83+
@echo "$(CYAN)Project Information:$(NC)"
84+
@echo " Name: $$(node -p "require('./package.json').name")"
85+
@echo " Version: $$(node -p "require('./package.json').version")"
86+
@echo " Node: $$(node --version)"
87+
@echo " NPM: $$(npm --version)"

README.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,52 @@ The site will be available at `http://localhost:8000`
4848
- `npm run lint` - Run ESLint
4949
- `npm run serve` - Serve the production build locally
5050

51+
### Makefile Commands
52+
53+
For convenience, common tasks are available via Make commands. Run `make help` to see all available commands:
54+
55+
```sh
56+
make help
57+
```
58+
59+
#### Quick Reference
60+
61+
**Development:**
62+
```sh
63+
make install # Install dependencies
64+
make dev # Start development server (alias: make start)
65+
make build # Build production site
66+
make serve # Serve production build locally
67+
```
68+
69+
**Code Quality:**
70+
```sh
71+
make lint # Run ESLint
72+
make lint-fix # Auto-fix linting issues
73+
make test # Run all tests (lint + build)
74+
```
75+
76+
**Maintenance:**
77+
```sh
78+
make clean # Clean build artifacts (.cache, public)
79+
make clean-all # Clean everything including node_modules
80+
make fresh # Fresh install (clean-all + install)
81+
make rebuild # Clean rebuild (clean + build)
82+
```
83+
84+
**Dependencies:**
85+
```sh
86+
make audit # Run npm security audit
87+
make audit-fix # Auto-fix security issues
88+
make upgrade # Update all dependencies
89+
```
90+
91+
**Utilities:**
92+
```sh
93+
make version # Show current version
94+
make info # Show project information
95+
```
96+
5197
## Deployment
5298

5399
My site uses a comprehensive CI/CD pipeline with [GitHub Actions](https://docs.github.com/en/actions) and [Netlify](https://www.netlify.com/):

0 commit comments

Comments
 (0)