98 lines
2.2 KiB
YAML
98 lines
2.2 KiB
YAML
# https://taskfile.dev
|
|
|
|
version: '3'
|
|
|
|
vars:
|
|
PARENT_BRANCH: main
|
|
|
|
tasks:
|
|
pack:
|
|
desc: bundle the distro
|
|
deps: [build, checks]
|
|
cmds:
|
|
- npm pack --pack-destination releases
|
|
|
|
build:
|
|
sources:
|
|
- src/**/*.ts
|
|
generates:
|
|
- dist/**/*.js
|
|
cmds:
|
|
- tsc
|
|
|
|
checks:
|
|
deps: [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 -
|
|
|
|
test: vitest run src
|
|
|
|
test:dev: vitest src
|
|
|
|
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 "." }}
|
|
|
|
lint:delta:
|
|
cmds:
|
|
- task: 'lint:prettier:delta'
|
|
- task: 'lint:eslint:delta'
|
|
|
|
lint:prettier:delta:
|
|
vars:
|
|
FILES:
|
|
sh: git diff-ls --diff-filter=d {{.ROOT_BRANCH | default "main"}} | grep -v .vitebook
|
|
cmds:
|
|
- npx prettier --check {{.FILES | catLines }}
|
|
|
|
lint:eslint:delta:
|
|
vars:
|
|
FILES:
|
|
sh: git diff-ls --diff-filter=d {{.ROOT_BRANCH | default "main"}} | grep -v .vitebook
|
|
cmds:
|
|
- npx eslint --format=unix {{.FILES | catLines }}
|
|
|
|
lint:eslint:
|
|
cmds:
|
|
- npx eslint {{.FILES | default "src/**" }}
|
|
|
|
docs:api:
|
|
sources: [src/**.ts]
|
|
generates: [docs/src/content/docs/api/**.md]
|
|
cmds:
|
|
- typedoc
|
|
- contrib/api_grooming.pl docs/src/content/docs/api
|
|
docs:serve:
|
|
cmds:
|
|
- mkdocs serve
|
|
|
|
typedoc:
|
|
cmds:
|
|
- typedoc
|
|
|
|
docsify-install:
|
|
cmds:
|
|
- cp -r node_modules/docsify/lib docs/docsify
|