-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTaskfile.yml
More file actions
121 lines (101 loc) · 2.58 KB
/
Copy pathTaskfile.yml
File metadata and controls
121 lines (101 loc) · 2.58 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
version: '3'
vars:
BINARY_NAME: difr
WEB_DIR: web
tasks:
# === Development ===
dev:
desc: "Start development servers (Go + Vite)"
deps: [dev:backend, dev:frontend]
dev:backend:
desc: "Start Go server with Air (hot reload)"
cmds:
- air -c .air.toml
dev:frontend:
desc: "Start Vite dev server"
dir: "{{.WEB_DIR}}"
cmds:
- npm run dev
# === Build ===
build:
desc: "Build production binary"
deps: [build:dist]
cmds:
- go build -ldflags "-s -w" -o {{.BINARY_NAME}} ./cmd/difr
build:dist:
desc: "Rebuild frontend and update committed dist"
deps: [build:frontend]
cmds:
- rm -rf internal/embed/dist
- cp -r {{.WEB_DIR}}/dist internal/embed/dist
build:frontend:
desc: "Build frontend assets"
dir: "{{.WEB_DIR}}"
cmds:
- npm ci
- npm run build
# === Test ===
test:
desc: "Run all tests"
cmds:
- go test -race ./... -v
- cd {{.WEB_DIR}} && npm test
test:backend:
desc: "Run Go tests"
cmds:
- go test -race ./... -v
test:frontend:
desc: "Run frontend tests"
dir: "{{.WEB_DIR}}"
cmds:
- npm test
test:e2e:server:
desc: "Start E2E test server (production build)"
deps: [build:dist]
cmds:
- go run ./cmd/e2e-server --port {{.CLI_ARGS | default "4444"}}
test:e2e:
desc: "Run Playwright E2E tests"
dir: "{{.WEB_DIR}}"
cmds:
- npx playwright test --config=e2e/playwright.config.ts
test:e2e:headed:
desc: "Run Playwright E2E tests (visible browser)"
dir: "{{.WEB_DIR}}"
cmds:
- npx playwright test --config=e2e/playwright.config.ts --headed
test:e2e:ui:
desc: "Open Playwright UI mode"
dir: "{{.WEB_DIR}}"
cmds:
- npx playwright test --config=e2e/playwright.config.ts --ui
playwright:install:
desc: "Install Playwright browsers"
dir: "{{.WEB_DIR}}"
cmds:
- npx playwright install --with-deps chromium
test:coverage:
desc: "Run tests with coverage"
cmds:
- go test -race ./... -coverprofile=coverage.out && go tool cover -html=coverage.out -o coverage.html
- cd {{.WEB_DIR}} && npm test -- --coverage
# === Utilities ===
clean:
desc: "Clean build artifacts"
cmds:
- rm -f {{.BINARY_NAME}}
- rm -rf {{.WEB_DIR}}/dist
lint:
desc: "Run all linters"
cmds:
- go vet ./...
- cd {{.WEB_DIR}} && npm run lint
lint:backend:
desc: "Run Go linters"
cmds:
- go vet ./...
install:
desc: "Install all dependencies"
cmds:
- go mod tidy
- cd {{.WEB_DIR}} && npm install