UNPKG

genuine-verify-sdk

Version:

Privacy-first human verification widget using React, Next.js, and TensorFlow.js

149 lines (114 loc) โ€ข 4.28 kB
# Contributing to Genuine Verify SDK Thank you for your interest in contributing to Genuine Verify SDK! This document provides guidelines for contributing to the project. ## ๐Ÿš€ Quick Start 1. **Fork** the repository 2. **Clone** your fork: `git clone https://github.com/YOUR_USERNAME/Genuine.git` 3. **Install dependencies**: `npm install` 4. **Build the SDK**: `cd packages/genuine-verify-sdk && npm run build` 5. **Run tests**: `npm test` 6. **Make your changes** 7. **Submit a pull request** ## ๐Ÿ“‹ Development Setup ### Prerequisites - Node.js 16+ - npm or yarn - Git ### Local Development ```bash # Install dependencies npm install # Build SDK cd packages/genuine-verify-sdk npm run build # Run in development mode npm run dev # Run tests npm test ``` ## ๐Ÿงช Testing We use Jest for testing. Run tests with: ```bash npm test ``` ### Test Structure - Unit tests: `src/lib/__tests__/` - Hook tests: `src/lib/hooks/__tests__/` - Integration tests: `src/app/` (demo pages) ## ๐Ÿ“ Code Style ### TypeScript - Use TypeScript for all new code - Follow existing patterns for types and interfaces - Export types from `src/index.ts` ### React Components - Use functional components with hooks - Follow existing prop patterns - Include proper TypeScript types ### Documentation - Update README.md for new features - Add JSDoc comments for public APIs - Include usage examples ## ๐ŸŽฏ Contribution Areas ### High Priority - **Bug fixes** - Critical issues affecting functionality - **Performance improvements** - TensorFlow.js optimization - **Accessibility** - Screen reader support, keyboard navigation - **Browser compatibility** - Edge cases and mobile support ### Medium Priority - **New gesture types** - Additional verification methods - **UI improvements** - Better user experience - **Analytics enhancements** - Better debugging tools - **Documentation** - More examples and guides ### Low Priority - **Styling customization** - Theme support - **Advanced features** - Complex integrations - **Backend examples** - More server implementations ## ๐Ÿ”ง Development Guidelines ### Adding New Features 1. **Create a feature branch**: `git checkout -b feature/your-feature` 2. **Write tests first**: Ensure test coverage 3. **Update documentation**: README.md and inline docs 4. **Test thoroughly**: Multiple browsers and devices 5. **Submit PR**: Include description and screenshots ### Bug Reports When reporting bugs, please include: - **Environment**: OS, browser, version - **Steps to reproduce**: Clear, minimal steps - **Expected vs actual behavior**: What should happen vs what happens - **Console errors**: Any error messages - **Screenshots**: Visual issues ### Pull Request Guidelines - **Descriptive title**: Clear summary of changes - **Detailed description**: What, why, and how - **Tests included**: New tests for new features - **Documentation updated**: README and inline docs - **Screenshots**: For UI changes ## ๐Ÿ—๏ธ Project Structure ``` packages/genuine-verify-sdk/ โ”œโ”€โ”€ src/ โ”‚ โ”œโ”€โ”€ components/ # React components โ”‚ โ”œโ”€โ”€ lib/ # Core utilities โ”‚ โ”‚ โ”œโ”€โ”€ hooks/ # Custom React hooks โ”‚ โ”‚ โ””โ”€โ”€ __tests__/ # Unit tests โ”‚ โ””โ”€โ”€ index.ts # Main exports โ”œโ”€โ”€ dist/ # Built output โ”œโ”€โ”€ README.md # Documentation โ””โ”€โ”€ package.json # Package config ``` ## ๐Ÿ› Common Issues ### Build Issues - **TypeScript errors**: Run `npm run type-check` - **Missing dependencies**: Check `package.json` - **Version conflicts**: Clear `node_modules` and reinstall ### Test Issues - **Jest environment**: Ensure proper setup in `jest.config.js` - **Mock issues**: Check mock implementations - **Async tests**: Use proper async/await patterns ## ๐Ÿ“ž Getting Help - **Issues**: Use GitHub Issues for bugs and feature requests - **Discussions**: Use GitHub Discussions for questions - **Documentation**: Check README.md and inline docs ## ๐Ÿ“„ License By contributing, you agree that your contributions will be licensed under the MIT License. ## ๐Ÿ™ Thank You Thank you for contributing to Genuine Verify SDK! Your contributions help make the web a more secure and user-friendly place.