-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathTaskfile.yml
More file actions
119 lines (99 loc) · 2.9 KB
/
Taskfile.yml
File metadata and controls
119 lines (99 loc) · 2.9 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
version: '3'
vars:
CONFIG: config.dev.toml
MIGRATIONS: pkg/storage/db/migrations
CSS_IN: pkg/ui/css/global.css
CSS_OUT: pkg/static/public/css/global.css
JS_IN: pkg/ui/js
JS_OUT: pkg/static/public/js
tasks:
setup:config:
desc: "Copy the base config.toml to the development config file."
cmds:
- cp config.toml {{.CONFIG}}
setup:tooling:
desc: "Install necessary Go tools and dependencies."
cmds:
- go mod download
- go mod tidy
air:
desc: "Run the Air live reload server."
deps:
- task: setup:tooling
cmds:
- go tool air
gen:sqlc:
desc: "Generate Go code from SQL queries using sqlc."
cmds:
- go tool sqlc generate
gen:templ:
desc: "Generate code from templates using templ."
cmds:
- go tool templ generate
gen:tailwind:
desc: "Process CSS files with Tailwind CSS in watch mode with minification."
cmds:
- ./tmp/tailwindcss -i {{.CSS_IN}} -o {{.CSS_OUT}} --watch --minify
gen:tailwind-safelist:
desc: "Generate tailwind safelist file using html content in the database."
cmds:
- go run . tailwind --config {{.CONFIG}}
gen:esbuild:
desc: "Build the ui JavaScript files with esbuild."
deps:
- task: gen:esbuild:file
vars: { IN: '{{.JS_IN}}/htmx.js', OUT: '{{.JS_OUT}}/htmx.js' }
gen:esbuild:file:
desc: "Build a single file with esbuild."
vars:
IN: '{{default "" .IN}}'
OUT: '{{default "" .OUT}}'
cmds:
- go tool esbuild {{.IN}} --bundle --outfile={{.OUT}} --minify --watch
migrate:add:
desc: "Create a new database migration file."
vars:
SEQ: '{{default "initial" .SEQ}}'
cmds:
- go tool migrate create -ext sql -dir {{.MIGRATIONS}} -seq "{{.SEQ}}"
migrate:up:
desc: "Apply all migrations to the database."
cmds:
- go run . migrate --config {{.CONFIG}} up
migrate:down:
desc: "Revert all migrations to the database."
cmds:
- go run . migrate --config {{.CONFIG}} down
dev:fmt:
desc: "Format Go code according to the standard Go style."
cmds:
- go tool templ fmt .
- gofmt -l -w .
dev:vet:
desc: "Examine Go source code and report suspicious constructs."
cmds:
- go vet ./...
dev:static:
desc: "Perform advanced static analysis using staticcheck."
cmds:
- go tool staticcheck ./...
dev:lintci:
desc: "Run golangci-lint to execute multiple linters."
cmds:
- go tool golangci-lint run ./...
dev:vuln:
desc: "Scan for known vulnerabilities in dependencies using govulncheck."
cmds:
- go tool govulncheck ./...
dev:sec:
desc: "Check for common security issues with gosec."
cmds:
- go tool gosec ./...
dev:lint:
desc: "Run all linting and security analysis tools."
cmds:
- task: dev:vet
- task: dev:static
- task: dev:lintci
- task: dev:vuln
- task: dev:sec