|
1 | | -# Contributing Guideline |
| 1 | +# Contribution Guidelines |
| 2 | + |
| 3 | +## Reporting Issues |
| 4 | + |
| 5 | +- Search existing issues before opening a new one to avoid duplicates. |
| 6 | +- When reporting a bug, include steps to reproduce, expected behavior, and actual behavior. |
| 7 | +- For feature requests, describe the motivation and potential use cases. |
| 8 | +- Use clear, descriptive titles and provide as much relevant information as possible. |
| 9 | + |
| 10 | +## Developing |
2 | 11 |
|
3 | 12 | Before contributing, please familiarize yourself with the [Design principles](README.md#design-principles) and [Architecture](README.md#architecture) sections to understand the project's core philosophy and structure. |
4 | 13 |
|
5 | | -TBA |
| 14 | +### Coding Standards |
| 15 | + |
| 16 | +- Most styles are enforced by Prettier and ESLint. |
| 17 | +- JSDoc/TSDoc is mandatory for public interfaces; it's advised to write them for private ones anyway. |
| 18 | +- Write clear, concise comments where necessary. |
| 19 | +- Use descriptive variable and function names. |
| 20 | + |
| 21 | +### Testing Requirements |
| 22 | + |
| 23 | +- All new features and bug fixes must include appropriate unit and/or integration tests. |
| 24 | +- Use the existing test framework (vitest) and ensure all tests pass before submitting a PR. |
| 25 | +- Test files should be placed alongside source files with `.test.ts` or `.test.tsx` extension (e.g., `foo.ts` and `foo.test.ts`). |
| 26 | +- Coverage rate is enforced by Codecov. |
| 27 | + |
| 28 | +### Submitting Pull Requests |
| 29 | + |
| 30 | +1. Fork the repository and create a new branch for your feature or bugfix. |
| 31 | +2. Make your changes, ensuring you follow the coding standards and add/update tests as needed. |
| 32 | +3. Run all tests locally and ensure they pass. |
| 33 | +4. Update documentation if your changes affect the public API or behavior. |
| 34 | +5. Submit a pull request with a clear description of your changes and reference any related issues. |
| 35 | +6. Use self-review comments to provide additional context or highlight specific areas for reviewer attention. |
| 36 | +7. Be responsive to feedback and make requested changes promptly. |
| 37 | + |
| 38 | +<details><summary>Checklist to reduce the burden on reviewers</summary> |
| 39 | + |
| 40 | +Please ensure you cover the points in the following checklist: |
| 41 | + |
| 42 | +- **Information Quality** |
| 43 | + - [ ] The title and description (Why & What) clearly explain the background and purpose of the proposal. |
| 44 | + - The goal is to help reviewers efficiently understand the details by providing an overview first. You don't need to explain every detail. |
| 45 | + - Example: Include the implementation purpose, PR goals (acceptance criteria), what was done, and what was deferred. |
| 46 | + - Example: Link to the original discussion issue if one exists. |
| 47 | + - [ ] Necessary information for understanding the implementation is provided. |
| 48 | + - Anticipate questions and proactively answer them in comments. Keep communication concise to maintain velocity. |
| 49 | + - Example: Link to reference articles and quote relevant content. |
| 50 | + - Example: List patterns that need to be considered. For complex combinations, create a matrix. |
| 51 | + - [ ] Summarize your research and findings so the thought process is clear. |
| 52 | + - Make it possible for others to follow what you investigated, which sites you referenced, what others are saying, and what conclusions you reached. |
| 53 | +- **Handling the Unknown** |
| 54 | + - [ ] Explain unclear code or terminology. |
| 55 | + - Spatial unknowns: Things requiring knowledge not visible in the diff. |
| 56 | + - Example: Explain unusual library functions being used and link to their documentation. |
| 57 | + - Example: When removing existing code, explain why it existed originally and justify why it's safe to remove. |
| 58 | + - Temporal unknowns: Things requiring imagination about the future. |
| 59 | + - Explain future extensibility or constraints. |
| 60 | + - Example: Is it properly abstracted? Will it become technical debt? |
| 61 | + - Example: Will it perform efficiently as data volume grows? |
| 62 | +- **Accuracy and Communication** |
| 63 | + - [ ] All necessary considerations have been addressed. |
| 64 | + - Example: Pattern coverage, race conditions, null pointer exceptions, division by zero, etc. |
| 65 | + - [ ] Point out any ambiguities in scope or specifications. |
| 66 | + - Example: "I don't think we've discussed when this situation occurs yet - what should we do?" |
| 67 | + |
| 68 | +</details> |
| 69 | + |
| 70 | +## [Maintainer Only] Publishing Packages |
6 | 71 |
|
7 | | -## [Maintainer Only] Publishing dev version |
| 72 | +### Dev version |
8 | 73 |
|
9 | | -To test a build in your app, use [publish-dev](https://github.com/creasty/mobx-sentinel/actions/workflows/publish-dev.yml). |
| 74 | +To test a build in your app, use [publish-dev](https://github.com/creasty/mobx-sentinel/actions/workflows/publish-dev.yml).\ |
10 | 75 | Run on any branch, it will publish a dev version to npm with the corresponding commit hash (`vX.Y.Z-dev-HHHHHHHH`). |
11 | 76 |
|
12 | | -## [Maintainer Only] Publishing prod version |
| 77 | +### Production version |
13 | 78 |
|
14 | 79 | To publish a production build, please follow these steps (apologies for the manual process): |
15 | 80 |
|
|
0 commit comments