homebox/Taskfile.yml
Hayden 31b34241e0
feat: item-attachments CRUD (#22)
* change /content/ -> /homebox/

* add cache to code generators

* update env variables to set data storage

* update env variables

* set env variables in prod container

* implement attachment post route (WIP)

* get attachment endpoint

* attachment download

* implement string utilities lib

* implement generic drop zone

* use explicit truncate

* remove clean dir

* drop strings composable for lib

* update item types and add attachments

* add attachment API

* implement service context

* consolidate API code

* implement editing attachments

* implement upload limit configuration

* improve error handling

* add docs for max upload size

* fix test cases
2022-09-24 11:33:38 -08:00

74 lines
1.9 KiB
YAML

version: "3"
tasks:
generate:
desc: |
Generates collateral files from the backend project
including swagger docs and typescripts type for the frontend
cmds:
- |
cd backend && ent generate ./ent/schema \
--template=ent/schema/templates/has_id.tmpl
- cd backend/app/api/ && swag fmt
- cd backend/app/api/ && swag init --dir=./,../../internal,../../pkgs
- |
npx swagger-typescript-api \
--no-client \
--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
sources:
- "./backend/app/api/**/*"
- "./backend/app/internal/types/**/*"
- "./scripts/process-types.py"
generates:
- "./frontend/lib/api/types/data-contracts.ts"
- "./backend/app/api/docs/swagger.json"
- "./backend/app/api/docs/swagger.yaml"
api:
desc: Starts the backend api server (depends on generate task)
deps:
- generate
cmds:
- cd backend && go run ./app/api/ {{ .CLI_ARGS }}
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 ./...
api:coverage:
cmds:
- cd backend && go test -race -coverprofile=coverage.out -covermode=atomic ./app/... ./internal/... ./pkgs/... -v -cover
silent: true
test:ci:
cmds:
- cd backend && go build ./app/api
- backend/api &
- sleep 5
- cd frontend && pnpm run test:ci
silent: true
frontend:watch:
desc: Starts the vitest test runner in watch mode
cmds:
- cd frontend && pnpm vitest --watch
frontend:
desc: Run frontend development server
cmds:
- cd frontend && pnpm dev