homebox/Taskfile.yml

62 lines
1.5 KiB
YAML
Raw Normal View History

2022-08-30 02:30:36 +00:00
version: "3"
tasks:
generate:
2022-08-30 02:30:36 +00:00
cmds:
- |
cd backend && ent generate ./ent/schema \
--template=ent/schema/templates/has_id.tmpl
2022-08-30 02:30:36 +00:00
- cd backend/app/api/ && swag fmt
- cd backend/app/api/ && swag init --dir=./,../../internal,../../pkgs
- |
npx swagger-typescript-api \
--no-client \
--clean-output \
--modular \
--path ./backend/app/api/docs/swagger.json \
--output ./frontend/lib/api/types
python3 ./scripts/process-types.py ./frontend/lib/api/types/data-contracts.ts
api:
cmds:
- task: generate
2022-09-14 05:15:01 +00:00
- cd backend && go run ./app/api/ {{.CLI_ARGS}} ./config.yml
2022-08-30 02:30:36 +00:00
silent: false
api:build:
cmds:
- cd backend && go build ./app/api/
silent: true
api:test:
cmds:
- cd backend && go test ./app/api/
silent: true
api:watch:
cmds:
- cd backend && gotestsum --watch ./...
2022-08-30 02:30:36 +00:00
api:coverage:
cmds:
- cd backend && go test -race -coverprofile=coverage.out -covermode=atomic ./app/... ./internal/... ./pkgs/... -v -cover
silent: true
2022-09-09 19:34:19 +00:00
test:ci:
2022-08-30 02:30:36 +00:00
cmds:
- cd backend && go build ./app/api
- backend/api &
2022-08-30 02:30:36 +00:00
- sleep 5
2022-09-04 02:42:03 +00:00
- cd frontend && pnpm run test:ci
2022-08-30 02:30:36 +00:00
silent: true
frontend:watch:
desc: Starts the vitest test runner in watch mode
2022-08-30 02:30:36 +00:00
cmds:
- cd frontend && pnpm vitest --watch
2022-08-30 02:30:36 +00:00
frontend:
desc: Run frontend development server
2022-08-30 02:30:36 +00:00
cmds:
- cd frontend && pnpm dev