Contributing
Thank you for helping make React State Timeline better! This guide explains the repository layout, build process, quality checks, and how to contribute effectively.
Project Structure
-
lib/
All source files for the library live here.- Build Process: Any
index.tsorindex.tsxfile is detected and built by Vite (seevite.config.ts). - Exports: The main entry for the package is
lib/index.tsx. Ensure components, hooks, or utilities to be included in the package are exported from this file. - Test Files: Any
*.test.tsfile will be considered as test file and all test will be run bytestcommand.
- Build Process: Any
-
docs/
Documentation is built with Docusaurus.- All documentation markdown files are in
docs/docs/. - Custom pages and demos (e.g., interactive homepage) are in
docs/src/pages/.
- All documentation markdown files are in
Contribution Workflow
-
Fork and Branch
Fork the repository and create a feature or fix branch. -
Make Your Changes
- Change or add code in
lib/. - Export all intended APIs in
lib/index.tsx. - Write or update documentation in
docs/docs/for all new features or changes.
- Change or add code in
-
Test Requirements
- If adding or changing any code, you must write tests (or expand existing ones).
- Our test suite runs automatically as a pre-commit hook; commits will be blocked if any test fails.
- Run tests locally to ensure all pass before committing.
-
Commit Message Convention
- We use Conventional Commits, which help standardize commit messages and automate changelog/version management.
- To make this easy, simply run the
commitcommand in your terminal (powered by Commitizen). You’ll be prompted for commit details and guided through the process, ensuring every message is correctly formatted. - Example flow:
- Run
npm run commit. - Answer the prompts (type, scope, message)
- Run
- Direct
git commitis discouraged; use the guided tool for every commit. - Example commit messages:
feat(hook): add undo shortcut support
fix: handle timeline index bounds in goTo
docs: update usage examples for API improvements
-
Documentation
- Update or create guides in
docs/docs/to reflect your changes. - Every new feature or behavior change should be documented.
- Update or create guides in
-
Pull Request
- Open a PR to
developwith a clear description. - Reference related issues or discussions where appropriate.
- Open a PR to
Best Practices
- Use TypeScript for all code in
lib/. - Keep file and export structure clean; maintain
lib/index.tsxas the "public" API. - Ensure all features are documented before requesting review.
- Write clear, single-purpose commits using the Conventional Commits structure.
If you have questions not answered here, please open an issue or contact a maintainer.
Thanks for contributing and maintaining high quality!