forked from starfederation/datastar
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Taskfile.yml
159 lines (142 loc) · 3.27 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
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
# https://taskfile.dev
version: "3"
interval: 100ms
vars:
NAME: "site"
BIN_NAME: "{{.NAME}}_bin"
VERSION:
sh: cat packages/library/package.json| jq -r .version
tasks:
tools:
cmds:
- go install github.com/a-h/templ/cmd/templ@latest
- go install github.com/go-task/task/v3/cmd/task@latest
version:
cmds:
- echo {{.VERSION}}
libpub:
dir: packages/library
deps:
- library
cmds:
- git push origin
- git tag v{{.VERSION}}
- git push origin --tags
- npm publish --access public
- git push --tags
- GOPROXY=proxy.golang.org go list -m github.com/delaneyj/datastar@v{{.VERSION}}
- task: deploy
library:
vars:
BACKEND_STATIC_DIR: "../../backends/go/{{.NAME}}/static/library"
dir: packages/library
generates:
- "dist/**/*"
sources:
- "src/**/*.ts"
- "package.json"
cmds:
# - echo "{{.BACKEND_STATIC_DIR}}"
- pnpm i
# - pnpm vitest --watch=false
- pnpm prettier --log-level silent -w .
- pnpm build
- rsync -av dist/ {{.BACKEND_STATIC_DIR}}
- rsync -av package.json {{.BACKEND_STATIC_DIR}}
inspector:
library:
vars:
BACKEND_STATIC_DIR: "../../backends/go/{{.NAME}}/static/inspector"
dir: packages/inspector
generates:
- "dist/**/*"
sources:
- "src/**/*.ts"
- "package.json"
cmds:
# - echo "{{.BACKEND_STATIC_DIR}}"
- pnpm i
# - pnpm vitest --watch=false
- pnpm prettier -w .
- pnpm build
- rsync -av dist/ {{.BACKEND_STATIC_DIR}}
- rsync -av package.json {{.BACKEND_STATIC_DIR}}
inspector:
library:
vars:
BACKEND_STATIC_DIR: "../../backends/go/{{.NAME}}/static/inspector"
dir: packages/inspector
generates:
- "dist/**/*"
sources:
- "src/**/*.ts"
- "package.json"
cmds:
# - echo "{{.BACKEND_STATIC_DIR}}"
- pnpm i
# - pnpm vitest --watch=false
- pnpm prettier -w . --log-level silent
- pnpm build
- rsync -av dist/ {{.BACKEND_STATIC_DIR}}
- rsync -av package.json {{.BACKEND_STATIC_DIR}}
css:
dir: backends/go/site/css
generates:
- "../static/css/site.css"
sources:
- "../**/*.md"
# - "../**/*.go"
- "../**/*.templ"
cmds:
- pnpm tailwindcss build -o ../static/css/site.css
templ:
env:
TEMPL_EXPERIMENT: rawgo
generates:
- "**/*_templ.go"
sources:
- "**/*.templ"
cmds:
- templ generate .
kill:
cmds:
- killall -q {{.BIN_NAME}} || echo "Process was not running."
tests:
dir: playwright
cmds:
- pnpm i
- pnpm playwright
hot:
desc: Server hot reload
dir: backends/go
env:
ENV: dev
sources:
- "**/*.go"
- "**/*.md"
- "{{.NAME}}/static/**/*"
deps:
- library
- kill
- templ
# - css
cmds:
- go mod tidy
- go build -o ./{{.BIN_NAME}} cmd/{{.NAME}}/main.go
- ./{{.BIN_NAME}}
test:
dir: playwright
cmds:
- curl -o - -I http://localhost:8080
- pnpm i
- pnpm playwright install
- pnpm playwright test --ui
deploy:
deps:
- library
cmds:
- fly deploy --local-only
default:
deps:
- hot
silent: true