-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
190 lines (145 loc) · 4.77 KB
/
Makefile
File metadata and controls
190 lines (145 loc) · 4.77 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
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
# Nodus Makefile
# Development workflow automation
.PHONY: help install dev build test clean docker-dev docker-build lint fmt audit kill
# Default target
help:
@echo "Nodus Development Commands"
@echo ""
@echo "Setup:"
@echo " make install Install dependencies"
@echo " make docker-build Build Docker dev environment"
@echo ""
@echo "Development:"
@echo " make dev Start development server"
@echo " make docker-dev Start dev in Docker"
@echo " make test Run all tests"
@echo " make lint Run linters"
@echo " make fmt Format code"
@echo ""
@echo "Build:"
@echo " make build Production build"
@echo " make clean Clean build artifacts"
@echo ""
@echo "Release:"
@echo " make release-patch 0.4.7 -> 0.4.8"
@echo " make release-minor 0.4.7 -> 0.5.0"
@echo " make release-major 0.4.7 -> 1.0.0"
# =============================================================================
# Setup
# =============================================================================
install:
npm install
cd src-tauri && cargo fetch
docker-build:
docker-compose build
# =============================================================================
# Development
# =============================================================================
dev:
npm run tauri dev
docker-dev:
docker-compose up dev
# Run frontend only (no Tauri)
dev-web:
npm run dev
# =============================================================================
# Testing
# =============================================================================
test: test-frontend test-backend
test-frontend:
npm run test
test-backend:
cd src-tauri && cargo test
test-watch:
npm run test -- --watch
test-coverage:
npm run test:coverage
cd src-tauri && cargo tarpaulin --out Html
# Integrity test: concurrent edit simulation
test-integrity:
cd src-tauri && cargo test watcher::tests --nocapture
# =============================================================================
# Linting & Formatting
# =============================================================================
lint: lint-frontend lint-backend
lint-frontend:
npm run lint
lint-backend:
cd src-tauri && cargo clippy -- -D warnings
fmt: fmt-frontend fmt-backend
fmt-frontend:
npm run fmt
fmt-backend:
cd src-tauri && cargo fmt
# =============================================================================
# Security Auditing
# =============================================================================
audit: audit-frontend audit-backend
audit-frontend:
npm audit
audit-backend:
cd src-tauri && cargo audit
audit-fix:
npm audit fix
# =============================================================================
# Build
# =============================================================================
build:
npm run tauri build
build-debug:
npm run tauri build -- --debug
# =============================================================================
# Database
# =============================================================================
db-reset:
rm -f ~/.local/share/nodus/nodus.db
@echo "Database reset. Will be recreated on next run."
db-migrate:
@echo "Migrations run automatically on app start"
# =============================================================================
# Clean
# =============================================================================
clean:
rm -rf dist
rm -rf node_modules
cd src-tauri && cargo clean
clean-build:
rm -rf dist
cd src-tauri && cargo clean --release
# =============================================================================
# Documentation
# =============================================================================
docs:
cd src-tauri && cargo doc --open
# =============================================================================
# Release
# =============================================================================
# Auto-increment and release
release-patch:
@VERSION=$$(./scripts/bump-version.sh patch) && \
git add -A && \
git commit -m "Release v$$VERSION" && \
git tag v$$VERSION && \
git push && git push --tags && \
echo "Released v$$VERSION"
release-minor:
@VERSION=$$(./scripts/bump-version.sh minor) && \
git add -A && \
git commit -m "Release v$$VERSION" && \
git tag v$$VERSION && \
git push && git push --tags && \
echo "Released v$$VERSION"
release-major:
@VERSION=$$(./scripts/bump-version.sh major) && \
git add -A && \
git commit -m "Release v$$VERSION" && \
git tag v$$VERSION && \
git push && git push --tags && \
echo "Released v$$VERSION"
# =============================================================================
# Utilities
# =============================================================================
kill:
pkill -f vite || true
pkill -f "tauri dev" || true
@echo "Dev servers stopped"