First off, thank you for considering contributing to react-resize-detector-context! 🎉
The following is a set of guidelines for contributing to this project. These are mostly guidelines, not rules. Use your best judgment, and feel free to propose changes to this document in a pull request.
This project and everyone participating in it is governed by our Code of Conduct. By participating, you are expected to uphold this code.
Before creating bug reports, please check the existing issues as you might find out that you don't need to create one. When you are creating a bug report, please include as many details as possible using our bug report template.
Great Bug Reports tend to have:
- A quick summary and/or background
- Steps to reproduce
- What you expected would happen
- What actually happens
- Notes (possibly including why you think this might be happening, or stuff you tried that didn't work)
Enhancement suggestions are tracked as GitHub issues. When creating an enhancement suggestion, please use our feature request template and include:
- A clear and descriptive title
- A detailed description of the proposed feature
- Examples of how the feature would be used
- Why this enhancement would be useful
- Fork the repo and create your branch from
main. - If you've added code that should be tested, add tests.
- If you've changed APIs, update the documentation.
- Ensure the test suite passes.
- Make sure your code lints.
- Issue that pull request!
- Fork and clone the repository
git clone https://github.com/your-username/react-resize-detector-context.git
cd react-resize-detector-context- Install dependencies
pnpm install- Run development mode
pnpm devThis will start:
- Build watch mode
- Storybook on http://localhost:6006
- Test watch mode
pnpm test # Run tests in watch mode
pnpm test:ci # Run tests once with coveragepnpm lint # Run ESLint and fix issues
pnpm format # Format code with Prettierpnpm build # Build the packagepnpm storybook # Run Storybook locally- Use TypeScript for all new code
- Ensure proper typing (avoid
anywhen possible) - Follow the existing code style
- Use functional components with hooks
- Follow React best practices
- Keep components focused and composable
- Write tests for new features
- Ensure existing tests pass
- Aim for high test coverage
- Use JSDoc comments for public APIs
- Keep the README updated
- Document breaking changes
We use conventional commits. Please follow this format:
<type>(<scope>): <subject>
<body>
<footer>
Types:
feat: A new featurefix: A bug fixdocs: Documentation only changesstyle: Changes that don't affect code meaningrefactor: Code change that neither fixes a bug nor adds a featureperf: Performance improvementtest: Adding missing testschore: Changes to build process or auxiliary tools
Example:
feat(provider): add devMode prop for console logging control
Added optional devMode prop to BreakpointProvider to control when
console errors are displayed. Defaults to NODE_ENV !== 'production'.
Releases are managed by maintainers using:
pnpm releaseThis will:
- Build the package
- Update version
- Create git tag
- Push to GitHub
- Create GitHub release
- Publish to npm (if configured)
Feel free to open an issue with your question or reach out to the maintainers.
Thank you for contributing! 🚀✨