-
Notifications
You must be signed in to change notification settings - Fork 0
/
Taskfile.yml
61 lines (53 loc) · 1.36 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
version: "3"
set: [pipefail, errexit, nounset]
vars:
TWIPI_URL: '{{ .TWIPI_URL | default "http://localhost:8080" }}'
PORT: '{{ .PORT | default "3000" }}'
tasks:
default:
deps: [dev]
dev:
deps: [node_modules, generate]
env:
VITE_TWIPI_URL: "{{ .TWIPI_URL }}"
cmds:
- echo "Using $VITE_TWIPI_URL for the Twipi URL."
- vite --clearScreen=false --port="$PORT"
build:
deps: [node_modules, generate]
env:
VITE_TWIPI_URL: https://twipi.libdb.so
cmds:
- vite build
generate:
deps: [generate-ts-proto]
generate-ts-proto:
watch: true
requires:
vars: [PROTO_PATH]
status:
- grep -q "$PROTO_PATH" "$TASK_TEMP_DIR"/proto_path
deps: [node_modules]
cmds:
- for:
var: PROTO_PATH
split: ":"
cmd: |
protoc -I={{ shellQuote .ITEM }} \
--plugin=node_modules/.bin/protoc-gen-ts_proto \
--ts_proto_opt=esModuleInterop=true \
--ts_proto_opt=importSuffix=.js \
--ts_proto_out=src/lib/proto \
{{ shellQuote .ITEM }}/*.proto
- prettier -w src/lib/proto
- echo "$PROTO_PATH" > "$TASK_TEMP_DIR"/proto_path
generates:
- src/lib/proto/*.ts
node_modules:
cmds:
- npm install
sources:
- package.json
- package-lock.json
generates:
- node_modules