-
Notifications
You must be signed in to change notification settings - Fork 2
/
Taskfile.yml
96 lines (95 loc) · 2.56 KB
/
Taskfile.yml
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
# https://taskfile.dev
version: '3'
vars:
DATABASE_URL: ./data/shorty.db
dotenv:
- .env
tasks:
default:
cmds:
- task --list-all
silent: true
dev:
desc: Run hot-loading dev server
cmds:
- air
web:
desc: Run hot-loading dev server
cmds:
- air
db:migration:up:
desc: Run migrations (all of them)
cmds:
- goose -dir ./assets/migrations sqlite {{.DATABASE_URL}} up
db:migration:down:
desc: Drop all migrations
cmds:
- goose -dir ./assets/migrations sqlite {{.DATABASE_URL}} down
db:migration:down:to:
desc: Run migrations back to a specific version
summary: |
Rollback to a specific version of the local migrations. Must provide the version
as an argument.
Example,
task db:migration:down:to -- 0001
cmds:
- goose -dir ./assets/migrations sqlite {{.DATABASE_URL}} down-to {{.CLI_ARGS}}
db:migration:create:
desc: Create a new migration. The migration name is the value after --
summary: |
Create a new migrations file using the following syntax
task db:migration:create -- my-new-migration
cmds:
- goose -dir ./assets/migrations sqlite {{.DATABASE_URL}} create {{.CLI_ARGS}} sql
- goose -dir ./assets/migrations sqlite {{.DATABASE_URL}} fix
db:migration:redo:
desc: Rollback the latest migration, the reapply
cmds:
- goose -dir ./assets/migrations sqlite {{.DATABASE_URL}} redo
db:migration:status:
desc: Get the migration status of the local sqlite database
summary: |
Example usage
task db:migration:status
cmds:
- goose -dir ./assets/migrations sqlite {{.DATABASE_URL}} status
pnpm:
desc: Install javascript dependencies
cmds:
- pnpm install
tailwind:
desc: Install tailwind dependencies
cmds:
- pnpm run tailwind
audit:
desc: Run linters and betteralign
cmds:
- betteralign -apply ./...
- golangci-lint run ./... {{.CLI_ARGS}}
alpine:
desc: Install Alpine.js dependencies
cmds:
- pnpm run alpine
assets:
desc: Run all javascript related tasks in one go
cmds:
- task: pnpm
- task: tailwind
- task: alpine
watchassets:
desc: Watch assets and re-build on change
cmds:
- fd . assets | entr task assets
golines:
desc: run golines . -w
cmds:
- golines . -w
templgen:
desc: run 'templ generate'
cmds:
- templ fmt .
- templ generate
templautogen:
desc: run 'templ generate' when a .templ file changes
cmds:
- fd . 'assets/view' | entr task templgen