Repository navigation
Expand file tree
/
Copy pathTaskfile.yml
More file actions
147 lines (127 loc) · 4.38 KB
/
Copy pathTaskfile.yml
File metadata and controls
147 lines (127 loc) · 4.38 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
version: '3'
vars:
RACE: ''
tasks:
default:
deps: [build]
silent: true
# ============================================================================
# PREPARE
# ============================================================================
prepare:embed:
desc: Create embed placeholder so go:embed compiles without a full frontend build
internal: true
silent: true
cmds:
- mkdir -p internal/web/frontend/dist
- touch internal/web/frontend/dist/.gitkeep
# ============================================================================
# GENERATE
# ============================================================================
generate:
desc: Run the validation code generator
cmds:
- go run ./cmd/genvalidation
# ============================================================================
# BUILD
# ============================================================================
build:frontend:
desc: Build the React frontend with Vite
deps: [generate]
dir: frontend
cmds:
- npm ci
- npm run build
build:
desc: Build everything (frontend + backend) — default task
deps: [build:frontend]
cmds:
- go build -o notebook{{exeExt}} ./cmd/notebook
build:check:
desc: Compile-check Go without building the frontend
deps: [prepare:embed]
cmds:
- go build ./cmd/... ./internal/...
# ============================================================================
# TEST
# ============================================================================
test:
desc: Run all Go tests
deps: [prepare:embed]
cmds:
- go test {{.RACE}} ./cmd/... ./internal/...
test:integration:
desc: Run integration tests (placeholder)
cmds:
- echo "No integration tests yet"
test:all:
desc: Run unit and integration tests
deps: [test, test:integration]
test:coverage:
desc: Run tests with per-file 80% coverage enforcement
deps: [prepare:embed]
cmds:
- go test {{.RACE}} -coverprofile=coverage.out -covermode=atomic ./cmd/... ./internal/...
- bash scripts/check-coverage.sh coverage.out 80
test:mutation:
desc: Run mutation testing (gremlins) — scope via PACKAGES, default ./internal
deps: [prepare:embed]
cmds:
- gremlins unleash -E 'generated' --threshold-efficacy 75 {{.PACKAGES | default "./internal"}}
# ============================================================================
# LINT
# ============================================================================
lint:frontend:
desc: Run ESLint for the React frontend
dir: frontend
cmds:
- npm ci
- npm run lint
lint:
desc: Run golangci-lint for Go
deps: [prepare:embed]
cmds:
- golangci-lint run --timeout=5m ./cmd/... ./internal/...
# ============================================================================
# VERIFY
# ============================================================================
verify:
desc: Run all verification checks (lint + lint:frontend + test)
deps: [lint, lint:frontend, test]
# ============================================================================
# DEV
# ============================================================================
dev:
desc: Show development mode instructions
silent: true
cmds:
- |
echo "To run in development mode, open two terminals:"
echo ""
echo " Terminal 1 (frontend): task dev:frontend"
echo " Terminal 2 (backend): task dev:backend"
echo ""
echo "Then open http://localhost:5173 in your browser"
dev:backend:
desc: Start the Go backend in development mode
cmds:
- go run ./cmd/notebook --dev-listen :8080 --verbose
dev:frontend:
desc: Start the Vite frontend dev server
dir: frontend
cmds:
- npm run dev
# ============================================================================
# INSTALL / CLEAN
# ============================================================================
install:
desc: Download Go module dependencies
cmds:
- go mod download
clean:
desc: Remove all build artifacts
cmds:
- rm -rf notebook notebook.exe genvalidation genvalidation.exe
- rm -rf internal/web/frontend/dist
- rm -rf frontend/dist frontend/src/generated
- rm -rf tsnet-state coverage.out coverage-report.txt