-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtaskfile.yaml
More file actions
61 lines (51 loc) · 1.33 KB
/
taskfile.yaml
File metadata and controls
61 lines (51 loc) · 1.33 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
version: "3"
tasks:
prepare-metrics:
dir: ".scratch-metrics"
cmds:
- git clone https://github.com/VictoriaMetrics/metricsql.git metricsql
- cd metricsql && git reset --hard a271ee257023dd183d444ec7e1b363c64a3db0e3
- cd metricsql && git apply ../../metrics.patch
- mkdir -p metricsql/main
- |
cat << EOF > metricsql/main/main.go
package main
import (
"github.com/VictoriaMetrics/metricsql"
"syscall/js"
)
func main() {
c := make(chan struct{}, 0)
js.Global().Set("prettify", js.FuncOf(PrettifyWrap))
<-c
}
func PrettifyWrap(this js.Value, inputs []js.Value) interface{} {
prettify, err := metricsql.Prettify(inputs[0].String())
if err != nil {
return nil
}
return prettify
}
EOF
build-metrics:
dir: ".scratch-metrics/metricsql"
cmds:
- task: prepare-metrics
- GOOS=js GOARCH=wasm go build -o ../../public/metricsql.wasm main/main.go
clean-metrics:
cmds:
- rm -rf .scratch-metrics
build-vite:
cmds:
- npm run build
clean-vite:
cmds:
- rm -r dist
build:
cmds:
- task: build-metrics
- task: build-vite
clean:
deps:
- clean-metrics
- clean-vite