This repository was archived by the owner on Aug 10, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTaskfile.yml
More file actions
162 lines (144 loc) · 5.04 KB
/
Copy pathTaskfile.yml
File metadata and controls
162 lines (144 loc) · 5.04 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
version: "3"
vars:
TEMPL_CMD: go run github.com/a-h/templ/cmd/templ@v0.3.1001
TEMPLUI_CMD: go run github.com/templui/templui/cmd/templui@v1.9.5
TAILWIND_CMD: pnpm exec tailwindcss
ESBUILD_CMD: pnpm exec esbuild
tasks:
default:
desc: Show available tasks
silent: true
cmds:
- task --list
setup:
desc: Install dependencies and run code generation
cmds:
- task: setup:check
- pnpm install
- task: go:generate
setup:check:
desc: Check for required tools (go, node, pnpm + at least one agent CLI)
silent: true
cmds:
- |
missing=0
check() {
if command -v "$1" &>/dev/null; then
printf " ✓ %-12s %s\n" "$1" "$(eval "$2" 2>/dev/null || echo 'found')"
else
printf " ✗ %-12s %s\n" "$1" "$3"
missing=$((missing + 1))
fi
}
echo "Checking required tools..."
echo ""
check "go" "go version | sed 's/go version //'" "https://go.dev/dl/"
check "node" "node --version" "https://nodejs.org/"
check "pnpm" "pnpm --version" "npm install -g pnpm"
echo ""
echo "At least one agent CLI is required (or set agent.command to a custom script):"
echo ""
check "claude" "claude --version 2>&1 | head -1" "https://docs.claude.com/claude-code"
check "codex" "codex --version 2>&1 | head -1" "https://github.com/openai/codex"
echo ""
if [ "$missing" -gt 0 ]; then
echo "$missing tool(s) missing — install them or configure agent.command."
exit 1
fi
echo "All checked tools available."
# ---------------------------------------------------------------------------
# Go
# ---------------------------------------------------------------------------
go:generate:
desc: Run all code generation (templ + tailwind + esbuild)
deps: [go:templ, go:tailwind, ts:build]
go:templ:
desc: Generate Go code from templ templates
cmds:
- "{{.TEMPL_CMD}} generate ./internal/ui/templates/ ./internal/ui/components/"
sources:
- internal/ui/templates/**/*.templ
- internal/ui/components/**/*.templ
generates:
- internal/ui/templates/**/*_templ.go
- internal/ui/components/**/*_templ.go
go:tailwind:
desc: Build Tailwind CSS
cmds:
- "{{.TAILWIND_CMD}} -i internal/ui/static/input.css -o internal/ui/static/dist/styles.css --minify"
sources:
- internal/ui/static/input.css
- internal/ui/templates/**/*.templ
- internal/ui/components/**/*.templ
generates:
- internal/ui/static/dist/styles.css
go:build:
desc: Build the fettle binary into bin/
deps: [go:generate]
cmds:
- go build -o bin/fettle ./cmd/fettle
go:install:
desc: Install fettle to GOPATH/bin
deps: [go:generate]
cmds:
- go install ./cmd/fettle
go:test:
desc: Run Go tests
deps: [go:generate]
cmds:
- go test ./...
go:lint:
desc: Run go vet
cmds:
- go vet ./...
go:check:
desc: Build, lint, and test everything
cmds:
- task: go:build
- task: go:lint
- task: go:test
# ---------------------------------------------------------------------------
# TypeScript
# ---------------------------------------------------------------------------
ts:build:
desc: Bundle TypeScript
cmds:
- "{{.ESBUILD_CMD}} internal/ui/ts/app.ts --bundle --minify --format=esm --target=es2020 --outfile=internal/ui/static/dist/app.js"
sources:
- internal/ui/ts/**/*.ts
generates:
- internal/ui/static/dist/app.js
ts:check:
desc: Type-check TypeScript (no emit)
cmds:
- pnpm exec tsc --noEmit -p internal/ui/ts/tsconfig.json
ts:watch:
desc: Watch and rebuild TypeScript
cmds:
- "{{.ESBUILD_CMD}} internal/ui/ts/app.ts --bundle --format=esm --target=es2020 --outfile=internal/ui/static/dist/app.js --watch"
# ---------------------------------------------------------------------------
# Dev environment
# ---------------------------------------------------------------------------
dev:ui:
desc: Start the UI server pointed at examples/self-scan
deps: [go:build]
cmds:
- bin/fettle --dir examples/self-scan ui {{.CLI_ARGS}}
# ---------------------------------------------------------------------------
# Dogfooding
# ---------------------------------------------------------------------------
selfscan:
desc: Scan fettle's own Go source via examples/self-scan (extra args via -- ARGS)
deps: [go:build]
cmds:
- bin/fettle --dir examples/self-scan run find {{.CLI_ARGS}}
# ---------------------------------------------------------------------------
# Utilities
# ---------------------------------------------------------------------------
clean:
desc: Remove build artifacts and self-scan runs
cmds:
- rm -rf bin/
- rm -rf examples/self-scan/.fettle/runs/
- rm -f internal/ui/static/dist/styles.css
- rm -f internal/ui/static/dist/app.js