2022-08-25 14:51:07 +00:00
|
|
|
# https://taskfile.dev
|
|
|
|
|
|
|
|
version: '3'
|
|
|
|
|
2023-04-21 18:01:12 +00:00
|
|
|
vars:
|
|
|
|
PARENT_BRANCH: main
|
|
|
|
|
2022-08-25 14:51:07 +00:00
|
|
|
tasks:
|
2023-03-06 17:16:17 +00:00
|
|
|
build: tsc
|
|
|
|
|
|
|
|
checks:
|
2023-04-21 18:01:12 +00:00
|
|
|
deps: [lint, test, build]
|
|
|
|
|
|
|
|
integrate:
|
|
|
|
deps: [checks]
|
|
|
|
cmds:
|
|
|
|
- git is-clean
|
|
|
|
# did we had tests?
|
|
|
|
- git diff-ls {{.PARENT_BRANCH}} | grep test
|
|
|
|
- git checkout {{.PARENT_BRANCH}}
|
|
|
|
- git weld -
|
2023-03-06 17:16:17 +00:00
|
|
|
|
2023-03-02 17:32:27 +00:00
|
|
|
test: vitest run src
|
|
|
|
test:dev: vitest src
|
|
|
|
|
2022-08-25 14:51:07 +00:00
|
|
|
lint:fix:delta:
|
|
|
|
vars:
|
|
|
|
FILES:
|
|
|
|
sh: git diff-ls --diff-filter=d main | grep -v .vitebook
|
|
|
|
deps:
|
|
|
|
- task: 'lint:fix'
|
|
|
|
vars:
|
|
|
|
CLI_ARGS: '{{.FILES | catLines }}'
|
|
|
|
|
|
|
|
lint:
|
|
|
|
cmds:
|
|
|
|
- npx prettier --check {{.CLI_ARGS | default "." }}
|
|
|
|
- npx eslint {{.CLI_ARGS | default "." }}
|
|
|
|
|
|
|
|
lint:fix:
|
|
|
|
cmds:
|
|
|
|
- npx prettier --write {{.CLI_ARGS | default "." }}
|
|
|
|
- npx eslint --fix --quiet {{.CLI_ARGS | default "." }}
|
|
|
|
|
2022-08-30 15:00:00 +00:00
|
|
|
lint:delta:
|
|
|
|
cmds:
|
2022-08-30 18:16:29 +00:00
|
|
|
- task: 'lint:prettier:delta'
|
|
|
|
- task: 'lint:eslint:delta'
|
2022-08-30 15:00:00 +00:00
|
|
|
|
|
|
|
lint:prettier:delta:
|
|
|
|
vars:
|
|
|
|
FILES:
|
|
|
|
sh: git diff-ls --diff-filter=d {{.ROOT_BRANCH | default "main"}} | grep -v .vitebook
|
|
|
|
cmds:
|
2022-08-30 18:16:29 +00:00
|
|
|
- npx prettier --check {{.FILES | catLines }}
|
2022-08-30 15:00:00 +00:00
|
|
|
|
2022-08-25 14:51:07 +00:00
|
|
|
lint:eslint:delta:
|
|
|
|
vars:
|
|
|
|
FILES:
|
2022-08-30 15:00:00 +00:00
|
|
|
sh: git diff-ls --diff-filter=d {{.ROOT_BRANCH | default "main"}} | grep -v .vitebook
|
2022-08-25 14:51:07 +00:00
|
|
|
cmds:
|
|
|
|
- npx eslint --format=unix {{.FILES | catLines }}
|
|
|
|
|
|
|
|
lint:eslint:
|
|
|
|
cmds:
|
|
|
|
- npx eslint {{.FILES | default "src/**" }}
|