This document outlines the development practices and guidelines for contributing to the Lovelace Navbar Card project.
Lovelace Navbar Card is a custom card for Home Assistant's Lovelace UI, built with TypeScript and Lit. It provides a customizable navigation bar that enhances the Home Assistant user interface.
- Runtime Environment: Bun - A fast all-in-one JavaScript runtime
- Core Framework: Lit - A simple library for building fast, lightweight web components
- Language: TypeScript - For type-safe JavaScript development
- Testing:
- Vitest - Unit testing framework
- @testing-library/dom - DOM testing utilities
- Documentation: Docusaurus - Documentation website framework
- Code Quality:
- Biome - Linting & formatting with TypeScript support
- TypeScript compiler - Static type checking
main- Stable branch containing production-ready codedevelop- Main development branch where features are integratedfeature/*- Feature branches for new developmentrelease/*- Release preparation branches
- All Pull Requests must target the
developbranch - PRs are merged into
developafter review and testing - For releases, a new
release/*branch is created fromdevelop - After final testing, the release branch is merged into
main
We follow Conventional Commits specification:
<type>[optional scope]: <description>
[optional body]
[optional footer(s)]
Commit messages should be kept short and concise, adding optional body and footer only when needed.
Types:
feat: New featuresfix: Bug fixesdocs: Documentation changesstyle: Code style changes (formatting, etc)refactor: Code refactoringtest: Adding or modifying testschore: Maintenance tasks
Breaking changes will be marked with ! after the type (e.g., feat!: drop support for IE11).
Before committing code, ensure:
-
Tests Pass:
bun run test -
Code is Linted:
bun run lint
-
Code is Formatted:
bun run format
-
Build Succeeds:
bun run build
- Add/update tests for any code changes
- Maintain or improve code coverage
- Test both success and error scenarios
- Run the full test suite before submitting PRs
- Update documentation for any new features or changes
- Include JSDoc comments for public APIs
- Update configuration examples if needed
- Keep the documentation website up-to-date:
bun run docs:build
- Follow TypeScript best practices
- Maintain strict type safety
- Use the Biome configuration for linting/formatting
- Keep components modular and reusable
- Follow Home Assistant's custom card guidelines
bun run build- Build the production bundlebun run test- Run unit testsbun run test:coverage- Run tests with coverage reportbun run lint- Lint and auto-fix codebun run format- Format code with Prettierbun run docs:start- Start documentation development serverbun run docs:build- Build documentation site
- Check existing documentation
- Review test files for component usage examples
- Reach out to maintainers through GitHub issues
Remember that this is a Home Assistant custom card, so all changes should maintain compatibility with Home Assistant's architecture and user experience guidelines.
- Do not introduce new dependencies without approval.
- Follow TypeScript strictness and Lit best practices.
- Ensure changes integrate seamlessly with Home Assistant’s Lovelace UI.
- Always update or add tests when modifying features.
- Update documentation (docs/) if behavior changes.