.PHONY: install build clean bump-minor bump-patch bump-major index index-full setup fmt lint test check openapi check-openapi publish
build:
cargo build --release
clean:
cargo clean
install:
cargo install --path .
install-crates:
cargo install cflx
index:
@echo "Starting parallel index creation..."
@( \
(echo "[Serena] Creating index..." && uvx --from git+https://github.com/oraios/serena serena project index && echo "[Serena] ✓ Complete" || echo "[Serena] ✗ Failed") & \
(echo "[LEANN] Creating index..." && leann build openspec-spec --docs ./openspec/specs --force && echo "[LEANN] ✓ Complete" || echo "[LEANN] ✗ Failed") & \
(echo "[TLDR] Warming cache..." && tldr warm . --lang rust && echo "[TLDR] ✓ Complete" || echo "[TLDR] ✗ Failed") & \
wait; \
echo ""; \
echo "Fast index creation complete!" \
)
index-full:
@echo "Starting parallel full index creation..."
@( \
(echo "[Serena] Creating index..." && uvx --from git+https://github.com/oraios/serena serena project index && echo "[Serena] ✓ Complete" || echo "[Serena] ✗ Failed") & \
(echo "[LEANN] Creating index..." && leann build openspec-spec --docs ./openspec/specs --force && echo "[LEANN] ✓ Complete" || echo "[LEANN] ✗ Failed") & \
(echo "[TLDR] Warming cache..." && tldr warm . --lang rust && echo "[TLDR warm] ✓ Complete" || echo "[TLDR warm] ✗ Failed") & \
(echo "[TLDR] Creating semantic index (this may take a while)..." && tldr semantic index . --lang rust && echo "[TLDR semantic] ✓ Complete" || echo "[TLDR semantic] ✗ Failed") & \
wait; \
echo ""; \
echo "Full index creation complete!" \
)
setup:
@echo "Setting up development environment..."
@command -v rustfmt >/dev/null 2>&1 || rustup component add rustfmt
@command -v clippy >/dev/null 2>&1 || rustup component add clippy
@command -v cargo-release >/dev/null 2>&1 || cargo install cargo-release
@echo "Development environment setup complete!"
fmt:
@echo "Formatting code..."
cargo fmt
lint:
@echo "Running clippy..."
cargo clippy -- -D warnings
test:
@echo "Running tests..."
cargo test
check: fmt lint test
@echo "All checks passed!"
bump-patch:
@echo "Bumping patch version..."
./scripts/bump.sh patch
@echo "Patch version bumped and tagged successfully"
bump-minor:
@echo "Bumping minor version..."
./scripts/bump.sh minor
@echo "Minor version bumped and tagged successfully"
bump-major:
@echo "Bumping major version..."
./scripts/bump.sh major
@echo "Major version bumped and tagged successfully"
openapi:
@echo "Generating OpenAPI specification..."
@mkdir -p docs
cargo run --bin openapi-gen --features web-monitoring > docs/openapi.yaml
@echo "OpenAPI specification generated at docs/openapi.yaml"
publish: check
@echo "Publishing to crates.io..."
cargo publish
@echo "Published! Install with: cargo install cflx"
publish-dry-run: check
@echo "Running crates.io dry-run..."
cargo publish --dry-run
check-openapi:
@echo "Checking OpenAPI specification..."
@mkdir -p docs
@cargo run --bin openapi-gen --features web-monitoring > /tmp/openapi-check.yaml
@if ! diff -q docs/openapi.yaml /tmp/openapi-check.yaml > /dev/null 2>&1; then \
echo "ERROR: OpenAPI specification is out of date. Run 'make openapi' to update."; \
diff docs/openapi.yaml /tmp/openapi-check.yaml || true; \
rm /tmp/openapi-check.yaml; \
exit 1; \
else \
echo "OpenAPI specification is up to date."; \
rm /tmp/openapi-check.yaml; \
fi