Thank you for your interest in contributing to ngxsmk-datepicker! This document provides guidelines and instructions for contributing.
Last updated: March 24, 2026 · Current stable: v2.2.11
By participating in this project, you agree to maintain a respectful and inclusive environment for all contributors.
- Node.js 20.19+ or 22.12+ (see
enginesin package.json) - npm 10.x or higher
- Angular 17+ knowledge
-
Fork the repository
-
Clone your fork:
git clone https://github.com/YOUR_USERNAME/ngxsmk-datepicker.git cd ngxsmk-datepicker -
Install dependencies:
npm install
-
Run the demo app:
npm start
-
Run tests:
npm test
feature/- New featuresfix/- Bug fixesdocs/- Documentation updatesrefactor/- Code refactoringtest/- Test additions/updates
We follow Conventional Commits:
feat:- New featurefix:- Bug fixdocs:- Documentation changesstyle:- Code style changes (formatting, etc.)refactor:- Code refactoringtest:- Test additions/changeschore:- Build process or auxiliary tool changesperf:- Performance improvementsci:- CI/CD configuration changes (GitHub Actions workflows)
Example:
feat: add keyboard navigation support
fix: resolve date range selection issue
docs: update README with SSR examples
- Create a feature branch from
mainordevelop - Make your changes
- Ensure all tests pass:
npm test - Ensure the build succeeds:
npm run build:optimized- This automatically removes source maps from production builds
- Use
npm run build:analyzeto check bundle size
- Update documentation if needed
- Create a pull request with a clear description
- Code follows the project's style guidelines
- Tests added/updated and passing
- Documentation updated
- No breaking changes (or clearly documented)
- Build succeeds (
npm run build:optimized) - Bundle size checked (
npm run build:analyze) - Linter passes (if configured)
- Use TypeScript strict mode
- Prefer
interfaceovertypefor public APIs - Use meaningful variable names
- Add JSDoc comments for public APIs
- Use standalone components
- Prefer
inject()over constructor injection - Use
OnPushchange detection strategy - Guard browser-only APIs with platform checks
- Write unit tests for new features
- Maintain or improve test coverage
- Test edge cases and error scenarios
- Test SSR compatibility when applicable
projects/ngxsmk-datepicker/
├── src/
│ ├── lib/
│ │ ├── components/ # Reusable components
│ │ ├── utils/ # Utility functions
│ │ ├── issues/ # Issue-specific tests
│ │ └── styles/ # CSS files
│ └── public-api.ts # Public API exports
├── docs/ # Documentation
└── package.json
Breaking changes require:
- Major version bump (semver)
- Migration guide in
MIGRATION.md - Clear documentation in CHANGELOG.md
- Deprecation notice (if applicable) in previous version
- Update
public-api.tsif exporting new types/components - Add tests
- Update README.md with examples
- Add JSDoc comments
We follow a clear deprecation strategy to ensure smooth upgrades:
- Deprecation Period: Deprecated features remain available for at least 2 major versions before removal
- Deprecation Warnings:
@deprecatedJSDoc tags in code- Console warnings in development mode (when applicable)
- Clear documentation in CHANGELOG.md
- Migration Path:
- Migration guides provided in
MIGRATION.md - Code examples for upgrading
- Alternative APIs documented
- Migration guides provided in
- Breaking Changes:
- Only occur in major version releases
- Clearly documented in CHANGELOG.md
- Migration guides provided for all breaking changes
- Version X.0.0: Feature marked as deprecated with
@deprecatedtag - Version X+1.0.0: Feature still available, deprecation warnings continue
- Version X+2.0.0: Feature removed, breaking change documented
# Run all tests (library + demo app)
npm test
# Run library tests only
npx ng test ngxsmk-datepicker --no-watch --browsers=ChromeHeadless
# Run tests in watch mode
npm test -- --watch
# Run specific test file
npx ng test ngxsmk-datepicker --include="**/issue-13.spec.ts"Note: The library tests require Zone.js polyfills, which are automatically configured in angular.json. If tests fail, ensure the test configuration includes the polyfills.
Test Status: All 353+ tests should pass. The test suite covers:
- Component functionality and edge cases
- Utility functions (date, calendar, timezone, performance)
- RTL support and locale detection
- Touch gestures and swipe handling
- Calendar views (year, decade, timeline, time-slider)
- Recurring dates and pattern matching
- SSR compatibility
- Keyboard navigation
- Use Jasmine/Karma
- Test both happy paths and edge cases
- Test SSR compatibility when applicable
- Test accessibility features
- Ensure tests work with OnPush change detection
- Test zone-less operation when applicable
- Use
.toEqual()instead of.toBe()for Date objects and arrays - Properly mock browser APIs (TouchEvent, document.dir) when testing
- Ensure change detection is called with
fixture.detectChanges()where needed - Verify component state after initialization before testing interactions
- Update README.md for user-facing changes
- Add examples for new features
- Update compatibility table if needed
- Add JSDoc comments for public APIs
- Document parameters and return types
- Include usage examples in comments
npm run build- Development buildnpm run build:optimized- Production build with optimizations:- Removes source maps automatically
- Optimized TypeScript compilation
- Enhanced tree-shaking
npm run build:analyze- Analyze bundle size (excludes source maps)
- Main bundle target: ~127KB (excluding source maps)
- Source maps are automatically excluded from published package
- Use
npm run build:analyzeto verify bundle size before PR
The npm package ngxsmk-datepicker is published from dist/ngxsmk-datepicker after an ng-packagr production build. The dist/ folder is not committed (/dist is gitignored), so publishing without building produces broken tarballs (see issue #230).
- Merge release-worthy commits to
mainusing Conventional Commits (semantic-release uses them for versioning). - Ensure the repository has an
NPM_TOKENsecret (npm Automation token). - The Release workflow runs
semantic-release, which builds the library inpreparethen publishes fromdist/ngxsmk-datepicker.
- Run tests:
npm test -- --watch=false --browsers=ChromeHeadless - Run
npm run publish:patch(orpublish:beta) — this runsbuild:optimized, copies root docs intodist/ngxsmk-datepicker, thennpm publishfrom that directory.
Do not run npm publish from the workspace root (that package is ngxsmk-datepicker-workspace, not the library). Do not publish from dist/ngxsmk-datepicker unless you have just run npm run build:optimized && npm run prepublish:copy-assets and node scripts/assert-dist-lib-ready.cjs succeeds.
Look for issues labeled with good-first-issue - these are perfect for new contributors:
- Documentation improvements
- Small bug fixes
- Test additions
- Example code additions
Issues labeled with help-wanted need community assistance:
- Feature implementations
- Performance optimizations
- Integration examples
- Documentation enhancements
Check the Roadmap to see planned features and improvements. Issues linked to the roadmap are great candidates for contribution!
- Open an issue for questions (use the Question template)
- Check existing issues/PRs
- Review the documentation
- Check the roadmap for planned features
By contributing, you agree that your contributions will be licensed under the MIT License.