From 3b893e224266154ca2cb275226fd7dd96043d119 Mon Sep 17 00:00:00 2001 From: Hayden <64056131+hay-kot@users.noreply.github.com> Date: Wed, 14 Sep 2022 19:03:53 -0800 Subject: [PATCH] add cache to code generators --- Taskfile.yml | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/Taskfile.yml b/Taskfile.yml index 903fb2c..9ef0129 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -2,6 +2,9 @@ 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 \ @@ -17,10 +20,21 @@ tasks: --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: - - task: generate - - cd backend && go run ./app/api/ {{.CLI_ARGS}} ./config.yml + - cd backend && go run ./app/api/ {{ .CLI_ARGS }} silent: false api:build: