Welcome to react-intersection-observer
! I'm thrilled that you're interested in
contributing. Here are some guidelines to help you get started.
The codebase is written in TypeScript, and split into two packages using PNPM workspaces:
react-intersection-observer
- The main package, which contains theuseInView
hook and theInView
component.storybook
- A Storybook project that is used to develop and test thereact-intersection-observer
package.
Start by forking the repository, and after cloning it locally you can install the dependencies using PNPM:
pnpm install
Then you can start the Storybook development server with the dev
task:
pnpm dev
react-intersection-observer
follows Semantic Versioning 2.0 as defined at
http://semver.org. This means that releases will be numbered with the following
format:
<major>.<minor>.<patch>
- Breaking changes and new features will increment the major version.
- Backwards-compatible enhancements will increment the minor version.
- Bug fixes and documentation changes will increment the patch version.
Fork the repository and create a branch for your feature/bug fix.
- Add tests for your feature/bug fix.
- Ensure that all tests pass before submitting your pull request.
- Update the README.md file if necessary.
- Ensure that your commits follow the conventions outlined in the next section.
- We use semantic-release to manage releases automatically. To ensure that releases are automatically versioned correctly, we follow the Conventional Commits Conventions. This means that your commit messages should have the following format:
<type>: <subject>
Here's what each part of the commit message means:
<type>
: The type of change that you're committing. Valid types includefeat
for new features,fix
for bug fixes,docs
for documentation changes, andchore
for changes that don't affect the code itself (e.g. updating dependencies).<subject>
: A short description of the change.
react-intersection-observer
uses Biome for code
formatting and linting. Please ensure that your changes are formatted with Biome before
submitting your pull request.
react-intersection-observer
uses Vitest for testing.
Please ensure that your changes are covered by tests, and that all tests pass
before submitting your pull request.
You can run the tests with the test
task:
pnpm test