# https://taskfile.dev version: "3" vars: VERSION: sh: cat package.json | jq -r .version PARENT_BRANCH: main FILE_DELTA: sh: git diff-ls --diff-filter=d {{.PARENT_BRANCH}} FIX: false tasks: changelog: sources: [./CHANGELOG.yml] generates: [./CHANGELOG.md] cmds: - changelord print > CHANGELOG.md test: vitest run prettier: cmd: prettier {{if .FIX }}--write{{end}} {{ .FILE_DELTA | catLines | default "." }} checkout-clean: cmds: - sh: git is-clean msg: stuff not commited integrate: deps: [prettier, test, build] cmds: - git diff-ls main | grep .changeset/ - sh: git branch | grep '* {{.PARENT_BRANCH}}' msg: not on target - { task: checkout-clean } - git checkout {{.PARENT_BRANCH}} - git weld - build: sources: ["src/**"] generates: ["esm/**"] deps: [test] cmds: - rm -fr esm/ - tsc -p tsconfig.json prepRelease: deps: [test, changelog, build] preconditions: - sh: git branch | grep '* main' msg: not on main - sh: git is-clean msg: stuff not commited cmds: - npm pack publish: deps: [prepRelease] cmds: - "git tag v{{.VERSION}}" - npm publish --access public - git push - git push --tags