Skip to content

Commit

Permalink
Add svelte and dotnet tasks and tidy up
Browse files Browse the repository at this point in the history
  • Loading branch information
myieye committed Jul 7, 2023
1 parent fb2374d commit 3803fb8
Showing 1 changed file with 42 additions and 13 deletions.
55 changes: 42 additions & 13 deletions Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,15 @@ tasks:
- rm sena-3.zip

# docker
up: # e.g. task up -- otel-collector --build
up:
desc: 'E.g.: task up -- otel-collector --build'
cmds:
- docker compose up --wait {{.CLI_ARGS}}
down:
cmds:
- docker compose down
restart: # e.g. task restart -- lexbox-api
restart:
desc: E.g. task restart -- lexbox-api
cmds:
- docker compose restart {{.CLI_ARGS}}

Expand Down Expand Up @@ -69,7 +71,8 @@ tasks:
- dotnet test --filter Category=Integration

# dev
infra-up: # infrastructure for our ui and api
infra-up:
desc: Starts infrastructure for our ui and api
vars:
WAIT: '{{default true .WAIT}}'
cmds:
Expand All @@ -90,17 +93,16 @@ tasks:
interactive: true

# ui
ui-dev: # The single command for ui development
aliases:
- ui
ui-dev:
aliases: [ ui ]
desc: The single command for local ui development
dir: ./frontend
deps: [ backend-up, ui-down ]
interactive: true
cmds:
- task: ui-only
ui-only:
aliases:
- uio
aliases: [ uio ]
dir: ./frontend
deps: [ ui-install ]
interactive: true
Expand All @@ -123,9 +125,9 @@ tasks:
cmds:
- pnpm dlx playwright codegen staging.languagedepot.org
# api
api-dev: # The single command for api development
aliases:
- api
api-dev:
aliases: [ api ]
desc: The single command for local api development
dir: ./backend/LexBoxApi
deps: [ infra-up, api-stop ]
interactive: true
Expand All @@ -145,13 +147,40 @@ tasks:
cmds:
- dotnet run migrate --environment "Development"

# usage: task add-migration -- "migration name"
add-migration:
desc: 'usage: task add-migration -- "migration name". Often followed by `task database-update`.\n'
dir: ./backend/LexBoxApi
cmds:
- dotnet ef migrations add --project ../LexData/LexData.csproj --startup-project LexBoxApi.csproj --context LexData.LexBoxDbContext --output-dir Migrations {{.CLI_ARGS}}
# this will remove the last migration, don't remove migrations that have been pushed to production, but you can remove ones you created locally.

remove-last-migration:
desc: "This will remove the last migration, don't remove migrations that have been pushed to production, but you can remove ones you created locally.\n"
dir: ./backend/LexBoxApi
cmds:
- dotnet ef migrations remove --project ../LexData/LexData.csproj --startup-project LexBoxApi.csproj --context LexData.LexBoxDbContext

db-update:
desc: "Runs any migrations that haven't yet been applied.\n"
dir: ./backend/LexBoxApi
cmds:
- dotnet ef database update --project ../LexData/LexData.csproj --startup-project LexBoxApi.csproj --context LexData.LexBoxDbContext

svelte-check:
desc: "Runs the frontend code checks done in CI. Note: the app must be built.\n"
aliases: [ sc ]
dir: ./frontend
cmds:
- pnpm run check
- pnpm run lint

svelte:
desc: "Directory independent access to pnpm. E.g. `task svelte -- install`\n"
aliases: [ s ]
dir: ./frontend
cmd: pnpm {{.CLI_ARGS}}

dotnet:
desc: "Directory independent access to api dotnet. E.g. `task dotnet -- restore`\n"
aliases: [ dn ]
dir: ./backend/LexBoxApi
cmd: dotnet {{.CLI_ARGS}}

0 comments on commit 3803fb8

Please sign in to comment.