-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
89 lines (76 loc) · 2.48 KB
/
Makefile
File metadata and controls
89 lines (76 loc) · 2.48 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
# eferro-picks-site Makefile
# Development and validation commands
.PHONY: help test test-integration test-coverage test-ui lint typecheck build dev validate clean local-setup
# Default target
help:
@echo "Available targets:"
@echo " local-setup - Set up local development environment"
@echo " validate - Run all pre-commit validations (tests + lint + typecheck)"
@echo " test - Run all unit tests with --run flag"
@echo " test-integration - Run integration tests (isolated)"
@echo " test-coverage - Run tests with coverage report"
@echo " test-ui - Open visual test interface"
@echo " lint - Run ESLint validation"
@echo " typecheck - Run TypeScript type checking"
@echo " build - Build production bundle"
@echo " dev - Start development server"
@echo " clean - Clean node_modules and reinstall"
# Core validation commands
test:
@echo "🧪 Running unit tests..."
npm test -- --run
test-integration:
@echo "🧪 Running integration tests..."
npx vitest run --config vitest.integration.config.ts
test-coverage:
@echo "🧪 Running tests with coverage..."
npm run test:coverage
test-ui:
@echo "🧪 Opening test UI..."
npm run test:ui
lint:
@echo "🔍 Running ESLint..."
npm run lint
typecheck:
@echo "📝 Running TypeScript type check..."
npx tsc --noEmit
# Development commands
build:
@echo "🏗️ Building production bundle..."
npm run build
dev:
@echo "🚀 Starting development server..."
npm run dev
# Environment setup
local-setup:
@echo "🔧 Setting up local development environment..."
npm install
@echo "🔒 Checking for security vulnerabilities..."
npm audit fix || echo "⚠️ Manual review of vulnerabilities may be needed"
@echo "✅ Local setup complete! Run 'make validate' to verify everything works."
# Utility commands
clean:
@echo "🧹 Cleaning node_modules..."
rm -rf node_modules package-lock.json
npm install
# Pre-commit validation protocol
validate:
@echo "🚦 Running pre-commit validation protocol..."
@echo ""
@echo "Step 1/4: Unit Test Validation"
@$(MAKE) test
@echo "✅ Unit tests passed!"
@echo ""
@echo "Step 2/4: Integration Test Validation"
@$(MAKE) test-integration
@echo "✅ Integration tests passed!"
@echo ""
@echo "Step 3/4: Linting Validation"
@$(MAKE) lint
@echo "✅ Linting passed!"
@echo ""
@echo "Step 4/4: Type Check"
@$(MAKE) typecheck
@echo "✅ Type check passed!"
@echo ""
@echo "🎉 All validations passed! Code is ready to commit."