refactor: improve task management and logging

This commit is contained in:
2025-06-02 09:48:26 -07:00
parent d18afa8989
commit 837fe7c4ab
36 changed files with 219 additions and 115 deletions

View File

@@ -6,9 +6,8 @@ vars:
GIT_ROOT:
sh: git rev-parse --show-toplevel
tasks:
db-init:
initialize:
cmds:
- task: accounts:up
- task: credentials:up
@@ -42,6 +41,23 @@ tasks:
- task: fear_greed_index
- task: crypto_listings
reset:
cmds:
- task: accounts:down
- task: credentials:down
- task: profiles:down
- task: vaults:down
- task: assets:down
- task: prices:down
- task: price_conversions:down
- task: blockchains:down
- task: services:down
- task: activities:down
- task: health:down
- task: global_market:down
- task: fear_greed_index:down
- task: crypto_listings:down
# ---------------
# Main Tasks
# ---------------

View File

@@ -7,41 +7,25 @@ vars:
sh: git rev-parse --show-toplevel
tasks:
worker:
dir: "{{.GIT_ROOT}}/cmd/worker"
env:
GOOS: js
GOARCH: wasm
cmds:
- go build -ldflags="-s -w" -o ./build/app.wasm .
# ---------------
# Main Tasks
# ---------------
# ---------------
# Internal Helpers
# ---------------
logi-*:
info-*:
internal: true
vars:
TEXT: "{{index .MATCH 0}}"
cmd: gum log -l info {{.TEXT}}
logw-*:
warn-*:
internal: true
vars:
TEXT: "{{index .MATCH 0}}"
cmd: gum log -l warn {{.TEXT}}
loge-*:
error-*:
internal: true
vars:
TEXT: "{{index .MATCH 0}}"
cmd: gum log -l error {{.TEXT}}
logd-*:
debug-*:
internal: true
vars:
TEXT: "{{index .MATCH 0}}"

View File

@@ -8,9 +8,16 @@ tasks:
worker:
dir: "{{.GIT_ROOT}}/cmd/worker"
cmd: make build
sources:
- "main.go"
generates:
- build/app.wasm
radar:
dir: "{{.GIT_ROOT}}/cmd/radar"
cmd: make build
sources:
- "main.go"
generates:
- build/app.wasm