-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTaskfile.yml
More file actions
96 lines (83 loc) · 2.91 KB
/
Copy pathTaskfile.yml
File metadata and controls
96 lines (83 loc) · 2.91 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
# Taskfile for eventx — orchestrates the three dev processes:
# - agent-server (sibling repo at ../../agent-server, single-tenant per app)
# - eventx-backend (this repo, src/backend)
# - eventx-frontend (this repo, src/frontend, Vite)
#
# https://taskfile.dev
#
# Usage:
# task up # bring everything up (agent-server + backend + frontend)
# task agent-server # just agent-server
# task backend # just eventx-backend
# task frontend # just eventx-frontend
# task openapi # regenerate agent-server openapi.json + eventx-backend types
# task build # build everything
# task install # install deps in both repos
# task reset # wipe local data (DB + sessions)
#
# Process management: `task up` runs the three processes in parallel via
# Taskfile's `deps` mechanism. Ctrl-C kills the task tree. If something
# wedges, `lsof -i :3001 -i :4001 -i :5173` will find stragglers.
version: "3"
vars:
AGENT_SERVER_DIR: "{{.TASKFILE_DIR}}/../../agent-server"
EVENTX_DIR: "{{.TASKFILE_DIR}}"
AGENT_SERVER_PORT: "4001"
BACKEND_PORT: "3001"
env:
# Shared across the three processes. Override by exporting in your shell.
AGENT_SERVER_URL: "http://127.0.0.1:{{.AGENT_SERVER_PORT}}"
AGENT_SERVER_PORT: "{{.AGENT_SERVER_PORT}}"
APPX_PORT: "{{.BACKEND_PORT}}"
APPX_BACKEND_PORT: "{{.BACKEND_PORT}}"
PROJECT_DIR: "{{.EVENTX_DIR}}"
tasks:
default:
desc: "List available tasks."
cmds:
- task --list
install:
desc: "Install npm deps in both repos."
cmds:
- cd {{.AGENT_SERVER_DIR}} && npm install
- cd {{.EVENTX_DIR}} && npm install
test:
desc: "Run all tests (agent-server + eventx-backend)."
deps: [openapi]
cmds:
- cd {{.AGENT_SERVER_DIR}} && npm test
- cd {{.EVENTX_DIR}} && npm test -w eventx-backend
openapi:
desc: "Regenerate agent-server openapi.json + eventx-backend TS types."
cmds:
- cd {{.AGENT_SERVER_DIR}} && npm run openapi
- cd {{.EVENTX_DIR}} && npm run codegen -w eventx-backend
build:
desc: "Build agent-server, eventx-backend, eventx-frontend."
deps: [openapi]
cmds:
- cd {{.AGENT_SERVER_DIR}} && npm run build
- cd {{.EVENTX_DIR}} && npm run build
agent-server:
desc: "Run agent-server in watch mode on :{{.AGENT_SERVER_PORT}}."
dir: "{{.AGENT_SERVER_DIR}}"
cmds:
- npm run dev
backend:
desc: "Run eventx-backend in watch mode on :{{.BACKEND_PORT}}."
dir: "{{.EVENTX_DIR}}"
cmds:
- npm run dev -w eventx-backend
frontend:
desc: "Run Vite dev server on :5173."
dir: "{{.EVENTX_DIR}}"
cmds:
- npm run dev -w eventx-frontend
up:
desc: "Bring up agent-server + eventx-backend + eventx-frontend in parallel."
deps: [agent-server, backend, frontend]
reset:
desc: "Wipe local data (DB rows + session files; keeps PREFERENCES.md)."
dir: "{{.EVENTX_DIR}}"
cmds:
- npm run reset:data