Thank you for your interest in contributing to Angular Perfect Select! This document provides guidelines and instructions for contributing.
Please be respectful and considerate in all interactions. We want to foster an inclusive and welcoming environment for everyone.
Before creating a bug report, please check existing issues to avoid duplicates.
When creating a bug report, include:
- Clear title and description
- Steps to reproduce the issue
- Expected behavior vs actual behavior
- Environment details (Angular version, browser, OS)
- Code examples or screenshots if applicable
- Error messages or console output
Enhancement suggestions are tracked as GitHub issues. When creating an enhancement suggestion, include:
- Clear title and description
- Use case - why this enhancement would be useful
- Proposed solution - how you envision it working
- Alternatives considered
- Examples from other libraries if applicable
- Fork the repository and create your branch from
main - Follow the coding standards (see below)
- Write tests for new features or bug fixes
- Update documentation if you're changing APIs or adding features
- Ensure tests pass before submitting
- Create a Pull Request with a clear title and description
- Update the README.md with details of changes if applicable
- Update the CHANGELOG.md following the existing format
- The PR will be merged once you have the approval of maintainers
- Node.js (v18 or higher)
- npm, yarn, or pnpm
- Angular CLI (
npm install -g @angular/cli)
-
Clone your fork
git clone https://github.com/YOUR_USERNAME/angular-perfect-select.git cd angular-perfect-select -
Install dependencies
# Install library dependencies npm install # Install demo dependencies cd demo npm install cd ..
-
Run the demo app
cd demo npm start # or npm run dev
The demo will be available at
http://localhost:4200 -
Build the library
npm run build
-
Run tests
npm test
angular-perfect-select/
├── src/ # Library source code
│ ├── lib/
│ │ ├── components/
│ │ │ └── perfect-select/ # Main component
│ │ ├── models/ # TypeScript interfaces
│ │ ├── constants/ # Theme definitions
│ │ ├── animations/ # Angular animations
│ │ └── directives/ # Custom directives
│ └── public-api.ts # Public exports
├── demo/ # Demo application
│ └── src/
│ ├── app/
│ │ ├── pages/ # Demo pages
│ │ ├── components/ # Demo components
│ │ ├── services/ # Demo services
│ │ └── data/ # Examples and metadata
│ └── styles.scss # Global styles
├── package.json # Library package config
├── angular.json # Angular CLI config
├── README.md # Documentation
└── CHANGELOG.md # Version history
- Use TypeScript strict mode
- Provide type annotations for all public APIs
- Avoid
anytypes when possible - Use interfaces for data structures
- Use enums for fixed sets of values
- Use standalone components
- Prefer signals over RxJS observables for simple state
- Use OnPush change detection when possible
- Follow Angular style guide: https://angular.io/guide/styleguide
- Follow the existing code style
- Use meaningful variable and function names
- Add comments for complex logic
- Keep functions small and focused
- Use destructuring where appropriate
- Indent with 2 spaces
- Use single quotes for strings
- Add trailing commas in multi-line objects/arrays
- Max line length: 100 characters (preferred)
- Use semicolons
Follow the Conventional Commits specification:
<type>: <description>
[optional body]
[optional footer]
Types:
feat: New featurefix: Bug fixdocs: Documentation changesstyle: Code style changes (formatting, etc.)refactor: Code refactoringperf: Performance improvementstest: Adding or updating testschore: Maintenance tasks
Examples:
feat: Add support for custom badge colors
fix: Resolve keyboard navigation issue in RTL mode
docs: Update README with reactive forms example
- Write unit tests for new features
- Ensure existing tests pass
- Aim for >85% code coverage
- Test edge cases and error conditions
# Run all tests
npm test
# Run tests in watch mode
npm test -- --watch
# Run tests with coverage
npm test -- --code-coverageWhen adding new features or changing APIs:
- Update the README.md
- Add TypeScript doc comments (JSDoc)
- Update examples in the demo app
- Add entries to CHANGELOG.md
(For maintainers only)
- Update version in
package.json - Update CHANGELOG.md
- Create a git tag
- Push to GitHub
- Publish to npm
- Create a GitHub release
If you have questions, please:
- Check existing issues and discussions
- Read the documentation
- Create a new issue with the "question" label
By contributing, you agree that your contributions will be licensed under the MIT License.