-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTaskfile.yaml
More file actions
121 lines (104 loc) · 2.54 KB
/
Taskfile.yaml
File metadata and controls
121 lines (104 loc) · 2.54 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"
tasks:
setup:
desc: First time project setup
cmds:
- cp .env.sample .env
- mkdir -p data
build:
desc: Build backend server
sources:
- "**/*.go"
cmds:
- go mod tidy
- go build -o bin/app .
deps:
- templ
- sqlc
run:
desc: Build and run project
cmds:
- go run .
deps:
- templ
- sqlc
watch:
desc: Run project with live reload
env:
PORT: 3001
cmds:
- templ generate --watch --proxybind="0.0.0.0" --proxyport="3000" --proxy="http://localhost:3001" --cmd="go run ." --open-browser=false
deps:
- sqlc
templ:
desc: Build templ files
sources:
- "app/views/**/*.templ"
cmds:
- templ generate
assets:
desc: Build frontend assets
sources:
- "app/views/**/*.templ"
- "assets/**/*.css"
- "assets/**/*.js"
cmds:
- npm run build
assets-watch:
desc: Build frontend assets and watch for changes
cmds:
- npm run build:watch
vite:
desc: Run Vite development server
cmds:
- npm run dev
clean:
desc: Clean build artifacts
cmds:
- rm -f bin/app
- rm -rf dist/.vite dist/assets
- find app/views -type f -name "*_templ.go" -delete
- rm -f app/db/db.go
- rm -f app/db/models.go
- find app/db -type f -name "*.queries.sql.go" -delete
sqlc:
desc: Generate code from SQL files
sources:
- "sql/schema.sql"
- "sql/queries/**/*.sql"
cmds:
- sqlc generate
migrate:
desc: Run migrations (create database if does not exists)
cmds:
- dbmate migrate
seed:
desc: Load seed data for local development
cmds:
- sqlite3 data/app.sqlite < ./sql/seed.sql
drop:
desc: Delete database
prompt: This will delete the database. Are you sure?
cmds:
- dbmate drop
reset:
desc: Resets database and seeds data
cmds:
- task: drop
- task: migrate
- task: seed
i18n-extract:
desc: Extract messages from Go source files to the default `active.en.toml` file
cmds:
- goi18n extract -outdir locales app
deps:
- templ
i18n-translate:
desc: Generate updated `translate.*.toml` files to be translated
cmds:
- goi18n merge -outdir locales locales/active.*.toml
i18n-merge:
desc: Merge translated messages back into `active.*.toml` files and clean up translation files
cmds:
- goi18n merge -outdir locales locales/active.*.toml locales/translate.*.toml
- rm locales/translate.*.toml