Files
walkies/Taskfile.yml
James Griffin 668397104a
All checks were successful
CI / Go tests & lint (push) Successful in 1m34s
CI / Frontend tests & type-check (push) Successful in 1m15s
Adopt @lavamoat/allow-scripts to gate npm install scripts
Disables dependency lifecycle scripts by default via .npmrc
(ignore-scripts=true) so arbitrary packages cannot execute code at
install time. An explicit allowlist in web/package.json opts specific
packages back in, and CI/Docker/Taskfile now run allow-scripts after
npm install to apply it.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-17 11:29:08 -03:00

133 lines
3.5 KiB
YAML

version: '3'
vars:
BINARY: walkies
WEB_DIR: web
STATIC_DIR: "{{.WEB_DIR}}/dist"
tasks:
default:
desc: List available tasks
cmd: task --list
# ── Frontend ────────────────────────────────────────────────────────────────
web:install:
desc: Install frontend dependencies
dir: "{{.WEB_DIR}}"
cmds:
- npm install
- npm exec -- allow-scripts
sources:
- package.json
generates:
- node_modules/.package-lock.json
web:build:
desc: Build frontend for production
dir: "{{.WEB_DIR}}"
deps: [web:install]
cmd: npm run build
sources:
- src/**/*
- public/**/*
- package.json
- tsconfig.json
- vite.config.ts
- index.html
generates:
- dist/**/*
web:dev:
desc: Start frontend dev server (hot reload on :3000)
dir: "{{.WEB_DIR}}"
deps: [web:install]
cmd: npm run dev
web:test:
desc: Run frontend tests
dir: "{{.WEB_DIR}}"
deps: [web:install]
cmd: npm test
# ── Backend ─────────────────────────────────────────────────────────────────
go:build:
desc: Build Go binary
cmd: go build -o {{.BINARY}} ./cmd/server
sources:
- "**/*.go"
- go.mod
- go.sum
generates:
- "{{.BINARY}}"
go:run:
desc: Run Go server (requires built frontend)
deps: [web:build]
cmd: go run ./cmd/server
env:
STATIC_DIR: "{{.STATIC_DIR}}"
go:test:
desc: Run all Go tests
cmd: go test ./...
go:test:verbose:
desc: Run Go tests with verbose output
cmd: go test -v ./...
go:lint:
desc: Run go vet
cmd: go vet ./...
# ── Dev workflow ─────────────────────────────────────────────────────────────
dev:backend:
desc: Run backend with live reload via 'air' (install with 'go install github.com/air-verse/air@latest')
cmd: air
env:
STATIC_DIR: "{{.STATIC_DIR}}"
dev:
desc: Start both frontend and backend dev servers concurrently
deps: [web:build]
cmds:
- echo "Starting backend on :8080 and frontend dev server on :3000"
# Run backend and frontend in parallel
# Use 'task dev:backend' and 'task web:dev' in separate terminals for full hot reload
# ── Build & Docker ───────────────────────────────────────────────────────────
build:
desc: Build frontend and backend
deps: [web:build, go:build]
docker:build:
desc: Build Docker image
cmd: docker build -t walkies .
docker:up:
desc: Build and start with docker compose
cmd: docker compose up --build
docker:down:
desc: Stop docker compose services
cmd: docker compose down
docker:logs:
desc: Tail docker compose logs
cmd: docker compose logs -f
# ── Utilities ────────────────────────────────────────────────────────────────
clean:
desc: Remove build artifacts
cmds:
- rm -f {{.BINARY}}
- rm -rf {{.WEB_DIR}}/dist
tidy:
desc: Tidy Go modules
cmd: go mod tidy