-
Notifications
You must be signed in to change notification settings - Fork 23
Expand file tree
/
Copy pathMakefile
More file actions
160 lines (135 loc) · 4.82 KB
/
Makefile
File metadata and controls
160 lines (135 loc) · 4.82 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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
.PHONY: all install build dev preview start deploy clean help mocks mocks-bulk version release-patch release-minor release-major test test-unit test-integration check-main tauri-dev tauri-build tauri-build-debug
# Default target
all: build
# Install dependencies
install:
npm install
# Build everything with Vite
build:
npm run build
# Development mode with HMR
dev:
npm run dev
# Preview production build
preview:
npm run preview
# Build and preview (alias for common workflow)
start: build preview
# Build for GitHub Pages and deploy
deploy:
npm run deploy
# Build for GitHub Pages without deploying
build-gh-pages:
npm run build-gh-pages
# Clean build artifacts
clean:
rm -rf dist .gh-pages
# Deep clean (including node_modules)
clean-all: clean
rm -rf node_modules
# Generate mock email files
mocks:
python3 script/generate_mock_emails.py
# Generate bulk mock email files (usage: make mocks-bulk COUNT=100)
COUNT ?= 100
mocks-bulk:
python3 script/generate_bulk_emails.py $(COUNT)
# Reinstall everything from scratch
reinstall: clean-all install build
# Run all tests
test:
npm test
# Run only unit tests (faster)
test-unit:
npm test -- --testPathIgnorePatterns="tests/integration"
# Run only integration tests
test-integration:
npm test -- --testPathPattern="tests/integration"
# Show current version
version:
@git describe --tags --always 2>/dev/null || echo "No tags found"
# Check if on main branch (used by release targets)
check-main:
@BRANCH=$$(git rev-parse --abbrev-ref HEAD); \
if [ "$$BRANCH" != "main" ]; then \
echo "Error: Releases must be created from main branch (current: $$BRANCH)"; \
exit 1; \
fi
# Release helpers - bump version, create tag and push
release-patch: check-main test
@CURRENT=$$(git describe --tags --abbrev=0 2>/dev/null | sed 's/^v//'); \
if [ -z "$$CURRENT" ]; then \
echo "No existing tags found. Creating v0.0.1"; \
NEW="0.0.1"; \
else \
MAJOR=$$(echo $$CURRENT | cut -d. -f1); \
MINOR=$$(echo $$CURRENT | cut -d. -f2); \
PATCH=$$(echo $$CURRENT | cut -d. -f3); \
NEW="$$MAJOR.$$MINOR.$$((PATCH + 1))"; \
fi; \
echo "Bumping version: v$$CURRENT -> v$$NEW"; \
git tag -a "v$$NEW" -m "Release v$$NEW"; \
echo "Pushing tag v$$NEW..."; \
git push origin "v$$NEW"
release-minor: check-main test
@CURRENT=$$(git describe --tags --abbrev=0 2>/dev/null | sed 's/^v//'); \
if [ -z "$$CURRENT" ]; then \
echo "No existing tags found. Creating v0.1.0"; \
NEW="0.1.0"; \
else \
MAJOR=$$(echo $$CURRENT | cut -d. -f1); \
MINOR=$$(echo $$CURRENT | cut -d. -f2); \
NEW="$$MAJOR.$$((MINOR + 1)).0"; \
fi; \
echo "Bumping version: v$$CURRENT -> v$$NEW"; \
git tag -a "v$$NEW" -m "Release v$$NEW"; \
echo "Pushing tag v$$NEW..."; \
git push origin "v$$NEW"
release-major: check-main test
@CURRENT=$$(git describe --tags --abbrev=0 2>/dev/null | sed 's/^v//'); \
if [ -z "$$CURRENT" ]; then \
echo "No existing tags found. Creating v1.0.0"; \
NEW="1.0.0"; \
else \
MAJOR=$$(echo $$CURRENT | cut -d. -f1); \
NEW="$$((MAJOR + 1)).0.0"; \
fi; \
echo "Bumping version: v$$CURRENT -> v$$NEW"; \
git tag -a "v$$NEW" -m "Release v$$NEW"; \
echo "Pushing tag v$$NEW..."; \
git push origin "v$$NEW"
# Tauri development mode (opens app with hot-reload)
tauri-dev:
npm run tauri:dev
# Tauri production build
tauri-build:
npm run tauri:build
# Tauri debug build (with DevTools)
tauri-build-debug:
npm run tauri:build:debug
# Show help
help:
@echo "Available targets:"
@echo " make install - Install npm dependencies"
@echo " make build - Build with Vite (production)"
@echo " make dev - Development mode with HMR"
@echo " make preview - Preview production build"
@echo " make start - Build and preview"
@echo " make deploy - Build and deploy to GitHub Pages"
@echo " make build-gh-pages- Build for GH Pages without deploying"
@echo " make clean - Remove build artifacts"
@echo " make clean-all - Remove build artifacts and node_modules"
@echo " make mocks - Generate mock email files (scenarios)"
@echo " make mocks-bulk - Generate bulk emails (COUNT=100)"
@echo " make reinstall - Clean all and reinstall from scratch"
@echo " make test - Run all tests"
@echo " make test-unit - Run only unit tests (faster)"
@echo " make test-integration - Run only integration tests"
@echo " make version - Show current version"
@echo " make release-patch - Bump patch version and push (1.0.0 -> 1.0.1)"
@echo " make release-minor - Bump minor version and push (1.0.0 -> 1.1.0)"
@echo " make release-major - Bump major version and push (1.0.0 -> 2.0.0)"
@echo " make tauri-dev - Tauri dev mode (opens app with hot-reload)"
@echo " make tauri-build - Tauri production build"
@echo " make tauri-build-debug - Tauri debug build (with DevTools)"
@echo " make help - Show this help"