Talon/Justfile
2023-04-01 23:51:44 +02:00

45 lines
1.4 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: && npm-setup
rm -rf ui/menu/node_modules/talon-client
openapi-generator-cli generate -i openapi.json -g typescript-fetch -o ui/talon-client -p "npmName=talon-client"
npm-setup:
npm install --prefix ui/talon-client
npm install --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 [ -f "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}}"