Talon/Justfile

44 lines
1.3 KiB
Makefile

version := `cargo pkgid | tr '#' '\n' | tail -n 1`
ok: lint test
lint:
cargo fmt --all
cargo clippy --all --all-features -- -D warnings
test:
cargo test --workspace
# Run the Talon server
run:
cargo run -- run -d tmp
# Generate the openapi.json documentation
oai-doc:
cargo run --bin openapi
# Generate the JS API client
oai-client:
openapi-generator-cli generate -i openapi.json -g typescript-fetch -o ui/talon-client -p "npmName=talon-client"
npm-setup:
npm ci --prefix ui/talon-client
npm ci --prefix ui/menu
# Start the dev server for the sidebar menu
menu-dev:
cd ui/menu && npm run dev
# Build the sidebar menu -> ui/menu/dist/talon.js
menu-build:
cd ui/menu && npm run build
release:
if [ -n "$(git status --porcelain)" ]; then echo "Workdir must be clean"; exit 1; fi
if git rev-parse "v{{version}}" >/dev/null 2>&1; then echo "Version tag v{{version}} already exists"; exit 1; fi
if `file CHANGELOG.md`; then git-cliff --tag "v{{version}}" --unreleased --prepend CHANGELOG.md; else git-cliff --tag "v{{version}}" --unreleased --output CHANGELOG.md; fi
git add CHANGELOG.md
git commit -m "chore(release): prepare for v{{version}}"
git-cliff --tag "v{{version}}" --unreleased --strip all | git tag -a -F - --cleanup whitespace "v{{version}}"