-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathMakefile
More file actions
86 lines (77 loc) · 3.11 KB
/
Copy pathMakefile
File metadata and controls
86 lines (77 loc) · 3.11 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
# Makefile für Git-Setup und Commit-Validierung
.PHONY: setup-git lint-commits check-branch clean-branches examples theme-compile minify-assets help
# Git-Template und Hooks einrichten
setup-git:
@echo "🛠️ Richte Git-Template ein..."
git config commit.template .gitmessage
@echo "✅ Git-Template aktiviert (.gitmessage)"
@echo "💡 Verwende 'git commit' (ohne -m) für Template"
@echo ""
@echo "🔧 Optional: Git-Hook für Validierung:"
@echo " cp .github/hooks/commit-msg .git/hooks/commit-msg"
@echo " chmod +x .git/hooks/commit-msg"
# Letzte Commits auf Format prüfen
lint-commits:
@echo "🔍 Prüfe letzte 10 Commit-Messages..."
@git log --oneline -10 | while read line; do \
commit=$$(echo "$$line" | cut -d' ' -f1); \
message=$$(echo "$$line" | cut -d' ' -f2-); \
if echo "$$message" | grep -qE '^(feat|fix|docs|style|refactor|test|chore|perf|ci|build|revert)(\(.+\))?: .{1,50}'; then \
echo "✅ $$commit: $$message"; \
else \
echo "❌ $$commit: $$message"; \
fi; \
done
# Aktueller Branch Status
check-branch:
@echo "📋 Git Status:"
@echo "Branch: $$(git branch --show-current)"
@echo "Commits ahead of main: $$(git rev-list --count main..HEAD)"
@echo "Modified files: $$(git status --porcelain | wc -l | tr -d ' ')"
# Bereinige merged Branches
clean-branches:
@echo "🧹 Bereinige merged Branches..."
git branch --merged main | grep -v main | xargs -n 1 git branch -d || true
@echo "✅ Lokale merged Branches entfernt"
# Zeige Beispiel-Commits
examples:
@echo "📝 Beispiel-Commits:"
@echo ""
@echo "feat(theme): Fügt A11y Theme Editor hinzu"
@echo "fix(inline): Behebt Button-Attribute in Placeholder"
@echo "docs: Aktualisiert README mit neuen Features"
@echo "style(css): Formatiert SCSS-Dateien mit Prettier"
@echo "refactor(api): Extrahiert Cache-Logic in eigene Klasse"
@echo "test: Fügt Unit-Tests für Theme-System hinzu"
@echo "chore: Update dependencies to latest versions"
@echo "perf(inline): Optimiert Thumbnail-Cache Performance"
# Kompiliere SCSS Themes
theme-compile:
@echo "🎨 Kompiliere SCSS Themes..."
@if command -v sass >/dev/null 2>&1; then \
sass scss:assets --style compressed; \
echo "✅ Themes kompiliert"; \
else \
echo "❌ sass nicht installiert. Installiere mit: npm install -g sass"; \
fi
# Minifiziere Frontend JavaScript
minify-assets:
@echo "🧩 Minifiziere Frontend-Assets..."
@if command -v npm >/dev/null 2>&1; then \
npm run minify; \
echo "✅ Frontend-Assets minifiziert"; \
else \
echo "❌ npm nicht installiert. Bitte Node.js/NPM installieren."; \
fi
# Hilfe anzeigen
help:
@echo "📋 Verfügbare Make-Commands:"
@echo ""
@echo "make setup-git 🛠️ Git-Template und Hooks einrichten"
@echo "make lint-commits 🔍 Letzte 10 Commits auf Format prüfen"
@echo "make check-branch 📋 Git Status und Branch-Info anzeigen"
@echo "make clean-branches 🧹 Bereinige merged Branches"
@echo "make theme-compile 🎨 SCSS Themes kompilieren"
@echo "make minify-assets 🧩 Frontend-Assets minifizieren"
@echo "make examples 📝 Zeige Beispiel-Commits"
@echo "make help ❓ Diese Hilfe anzeigen"