-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTaskfile.yml
More file actions
128 lines (112 loc) · 3.18 KB
/
Taskfile.yml
File metadata and controls
128 lines (112 loc) · 3.18 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
version: "3"
env:
NATS_PORT: 4222
STATIC_DIR: "web/static"
ORISUN_LOGGING_LEVEL: INFO
ORISUN_PG_PASSWORD: "password@1"
ORISUN_PG_SSLMODE: "disable"
ORISUN_NATS_STORE_DIR: "./data/orisun/nats"
tasks:
tools:
cmds:
- go install github.com/a-h/templ/cmd/templ@latest
- go install github.com/air-verse/air@latest
- go install github.com/go-delve/delve/cmd/dlv@1.25.2
- go install github.com/go-task/task/v3/cmd/task@latest
# The `build:` tasks below are used together for production builds of a project
build:templ:
cmds:
- templ generate
sources:
- "**/*.templ"
generates:
- "**/*_templ.go"
build:styles:
cmds:
- pnpm exec tailwindcss -c tailwind.config.js -i web/styles/styles.css -o $STATIC_DIR/index.css
sources:
- "./web/**/*.html"
- "./web/**/*.ts"
- "./web/**/*.templ"
- "./web/**/*.go"
generates:
- "{{.STATIC_DIR}}/index.js"
build:esbuild:
cmds:
- pnpm exec esbuild web/libs/datastar/index.ts --bundle --outdir=$STATIC_DIR
sources:
- "web/libs/datastar/index.ts"
generates:
- "{{.STATIC_DIR}}/index.js"
build:lit-html:
cmds:
- pnpm -r --filter=lit-html build
sources:
- "web/libs/lit-html/src/**/*.ts"
generates:
- "{{.STATIC_DIR}}/lit-html*"
build:
cmds:
- go build -tags dev -o tmp/bin/main ./cmd
deps:
# - build:lit-html
# - build:templ
# - build:esbuild
# - build:styles
# Use this task to debug with the delve debugger
debug:
cmds:
- dlv exec ./tmp/bin/main --check-go-version=false
deps:
- build
# The `live:` tasks below are used together for development builds and will live-reload the entire project
live:templ:
cmds:
- templ generate --watch --proxy="http://localhost:8080" --open-browser=false
live:styles:
cmds:
- pnpm exec tailwindcss -c tailwind.config.js -i web/styles/styles.css -o $STATIC_DIR/index.css --watch
live:esbuild:
cmds:
- pnpm exec esbuild web/libs/datastar/index.ts --sourcemap --bundle --outdir=$STATIC_DIR --watch
live:lit-html:
cmds:
- pnpm -r --filter=lit-html build:dev
live:server:
cmds:
- |
air \
-build.cmd "go build -tags dev -o tmp/bin/main ./cmd" \
-build.bin "tmp/bin/main" \
-build.delay "100" \
-build.exclude_dir "data,node_modules,web/libs/datastar/node_modules,web/libs/lit-html/node_modules" \
-build.include_ext "go" \
-build.stop_on_error "false" \
-build.send_interrupt "true" \
-build.kill_delay "200" \
-misc.clean_on_exit "true"
live:reload:
cmds:
- |
air \
-build.cmd "templ generate --notify-proxy" \
-build.bin "true" \
-build.delay "300" \
-build.exclude_dir "" \
-build.include_dir "$STATIC_DIR" \
-build.include_ext "js,css" \
-build.send_interrupt "true" \
-build.kill_delay "200"
live:
deps:
- live:templ
# - live:styles
# - live:lit-html
# - live:esbuild
- live:server
- live:reload
run:
cmds:
- ./bin/cmd/main
deps:
- build