-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile.toml
More file actions
120 lines (98 loc) · 2.64 KB
/
Makefile.toml
File metadata and controls
120 lines (98 loc) · 2.64 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
extend = "common.toml"
[config]
load_script = "wget -nc https://raw.githubusercontent.com/cpg314/cargo-make-template/v0.1.3/common.toml"
[env]
VITE_SQLSONNET_VERSION = "${CARGO_MAKE_PROJECT_VERSION}"
[tasks.pestfmt]
command = "pestfmt"
args = ["."]
[tasks.help]
script = '''
#!/usr/bin/env bash
set -euo pipefail
COMMAND="cargo run -q -r --bin sqlsonnet --"
eval $COMMAND --help
'''
[tasks.release]
dependencies = ["update-pages-branch"]
[tasks.cross]
dependencies = ["playground-proxy"]
[tasks.tests]
dependencies = ["docker-compose"]
command = "cargo"
args = ["nextest", "run", "r", "--workspace"]
[tasks.docs]
command = "cargo"
args = ["doc", "--workspace", "--all-features"]
[tasks.checkalot]
dependencies = ["playground-proxy", "docker-compose"]
command = "checkalot"
[tasks.docker-compose]
command = "docker"
args = ["compose", "up", "-d"]
################
# WASM bindings
################
[tasks.wasm]
command = "wasm-pack"
args = ["build", "--target", "web", "bindings/wasm/"]
condition = { files_modified = { input = ["./sqlsonnet/**/*", "./bindings/wasm/src/**/*"], output = ["./bindings/wasm/pkg/*"] } }
[tasks.wasm-dev]
command = "wasm-pack"
args = ["build", "--target", "web", "--dev", "bindings/wasm/"]
[tasks.playground-install]
condition = { files_modified = { input = ["package.json", "package-lock.json"], output = ["node_modules/**/*"] } }
cwd = "playground"
command = "npm"
args = ["install"]
################
# Playground for the clickhouse proxy
################
[tasks.playground-proxy]
dependencies = ["wasm", "playground-install"]
condition = { files_modified = { input = ["src/*", "*.json", "*.ts", "../bindings/wasm/pkg/*"], output = ["dist-proxy/*"] } }
env = { "VITE_PROXY" = "1" }
cwd = "playground"
script = '''
#!/usr/bin/env bash
set -euo pipefail
npm run build --emptyOutDir
rm dist-proxy/assets/*.wasm
tree dist-proxy
'''
[tasks.playground-proxy-run]
dependencies = ["wasm-dev", "playground-install"]
env = { "VITE_PROXY" = "1", "VITE_WEBSOCKET" = "ws://localhost:1234/play/ws" }
cwd = "playground"
command = "npm"
args = ["run", "dev"]
################
# Standalone playground
################
[tasks.playground-wasm]
env = { "VITE_PROXY" = "0" }
script = '''
#!/usr/bin/env bash
set -euo pipefail
pushd playground
npm run build --emptyOutDir
popd
touch docs/.nojekyll
tree -a docs
'''
[tasks.update-pages-branch]
dependencies = ["playground-wasm"]
script = '''
#!/usr/bin/env bash
set -euo pipefail
git branch -f pages main
git checkout pages
git add docs
git commit -m Playground
git push -f origin pages
git checkout main
git --no-pager log pages -n1
'''
[tasks.playground-wasm-run]
extend = "playground-proxy-run"
env = { "VITE_PROXY" = "0" }