build: split taskfiles into be+fe concerns

This commit is contained in:
Marc 2023-08-10 00:26:33 -04:00 committed by Marc Cataford
parent 002b6cdc68
commit 24d31f2d9c
5 changed files with 87 additions and 57 deletions

41
Taskfile.backend.yml Normal file
View file

@ -0,0 +1,41 @@
version: '3'
tasks:
bootstrap:
internal: true
cmds:
- . script/bootstrap
dir: backend
lint:
desc: "Lints /backend using black + pylint."
deps: [bootstrap]
cmds:
- black . --check
- pylint
dir: backend
lintfix:
desc: "Lints and fixes /backend using black + pylint."
deps: [bootstrap]
cmds:
- black .
- pylint rotini
dir: backend
start:
desc: "Starts the backend application."
deps: [bootstrap]
cmds:
- source ../.venv/bin/activate && source ../.env && python -m uvicorn main:app
dir: backend/rotini
migrate:
desc: "Applies migrations. Usage: be:migrate -- <up|down>"
deps: [bootstrap]
cmds:
- source ../../.venv/bin/activate && source ../../.env && python migrate.py {{.CLI_ARGS}}
dir: backend/rotini/migrations
lock-deps:
desc: "Locks production and development dependencies"
deps: [bootstrap]
cmds:
- source .venv/bin/activate && . script/requirements-lock
dir: backend

38
Taskfile.frontend.yml Normal file
View file

@ -0,0 +1,38 @@
version: '3'
tasks:
bootstrap:
internal: true
cmds:
- . script/bootstrap
dir: frontend
start:
desc: "Starts the frontend application."
deps: [bootstrap]
cmds:
- yarn start
dir: frontend
test:
desc: "Runs the frontend test suite."
deps: [bootstrap]
cmds:
- yarn test
dir: frontend
lint:
desc: "Checks lint and formatting."
deps: [bootstrap]
cmds:
- yarn lint
dir: frontend
lintfix:
desc: "Fixes lint and formatting."
deps: [bootstrap]
cmds:
- yarn lint:fix
dir: frontend
typecheck:
desc: "Validates types."
deps: [bootstrap]
cmds:
- yarn typecheck
dir: frontend

View file

@ -1,57 +1,7 @@
version: '3'
tasks:
be.bootstrap:
internal: true
cmds:
- . script/bootstrap
dir: backend
be.lint:
desc: "Lints /backend using black + pylint."
deps: [be.bootstrap]
cmds:
- black . --check
- pylint
dir: backend
be.lintfix:
desc: "Lints and fixes /backend using black + pylint."
deps: [be.bootstrap]
cmds:
- black .
- pylint rotini
dir: backend
be.start:
desc: "Starts the backend application."
deps: [be.bootstrap]
cmds:
- source ../.venv/bin/activate && source ../.env && python -m uvicorn main:app
dir: backend/rotini
be.migrate:
desc: "Applies migrations. Usage: be.migrate -- <up|down>"
deps: [be.bootstrap]
cmds:
- source ../../.venv/bin/activate && source ../../.env && python migrate.py {{.CLI_ARGS}}
dir: backend/rotini/migrations
be.lock-deps:
desc: "Locks production and development dependencies"
deps: [be.bootstrap]
cmds:
- source .venv/bin/activate && . script/requirements-lock
dir: backend
fe.bootstrap:
internal: true
cmds:
- . script/bootstrap
dir: frontend
fe.start:
desc: "Starts the frontend application."
deps: [fe.bootstrap]
cmds:
- yarn start
dir: frontend
fe.test:
desc: "Runs the frontend test suite."
deps: [fe.bootstrap]
cmds:
- yarn test
dir: frontend
# See environment-specific taskfiles for commands about
# that environment.
includes:
be: ./Taskfile.backend.yml
fe: ./Taskfile.frontend.yml

View file

@ -14,7 +14,8 @@
"build": "parcel build src/index.html",
"lint": "rome check tests src *.js --verbose && rome format tests src *.js --verbose",
"lint:fix": "rome check tests src ./*.js --apply --verbose && rome format tests src ./*.js --write --verbose",
"test": "yarn jest"
"test": "yarn jest",
"typecheck": "yarn tsc --noEmit"
},
"devDependencies": {
"@parcel/core": "^2.9.3",

View file

@ -3,7 +3,7 @@
"target": "ESNext",
"jsx": "react-jsx",
"module": "commonjs",
"rootDir": "./src",
"rootDir": ".",
"moduleResolution": "node",
"allowJs": false,
"esModuleInterop": true,