Skip to content

Commit c2184ac

Browse files
committed
docs: add templates for bug reports, feature requests, and pull requests
Created markdown templates to standardize bug reports, feature requests, and pull requests, enhancing contribution guidelines and improving project collaboration.
1 parent 44ba058 commit c2184ac

File tree

4 files changed

+249
-0
lines changed

4 files changed

+249
-0
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: '[BUG] '
5+
labels: bug
6+
assignees: ''
7+
---
8+
9+
## Bug Description
10+
A clear and concise description of what the bug is.
11+
12+
## To Reproduce
13+
Steps to reproduce the behavior:
14+
1. Set up BreakpointProvider with '...'
15+
2. Use component '...'
16+
3. Resize window to '...'
17+
4. See error
18+
19+
## Expected Behavior
20+
A clear and concise description of what you expected to happen.
21+
22+
## Code Example
23+
```tsx
24+
// Minimal code example that reproduces the issue
25+
```
26+
27+
## Screenshots
28+
If applicable, add screenshots to help explain your problem.
29+
30+
## Environment
31+
- react-resize-detector-context version: [e.g. 0.1.2]
32+
- React version: [e.g. 18.3.1]
33+
- Browser: [e.g. Chrome 120]
34+
- OS: [e.g. macOS 14.2]
35+
- Node version: [e.g. 18.19.0]
36+
37+
## Additional Context
38+
Add any other context about the problem here.
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: '[FEATURE] '
5+
labels: enhancement
6+
assignees: ''
7+
---
8+
9+
## Is your feature request related to a problem? Please describe.
10+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
11+
12+
## Describe the solution you'd like
13+
A clear and concise description of what you want to happen.
14+
15+
## Describe alternatives you've considered
16+
A clear and concise description of any alternative solutions or features you've considered.
17+
18+
## Code Example
19+
```tsx
20+
// Example of how the feature would be used
21+
```
22+
23+
## Additional context
24+
Add any other context or screenshots about the feature request here.

.github/pull_request_template.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Pull Request
2+
3+
## Description
4+
Please include a summary of the changes and which issue is fixed. Include relevant motivation and context.
5+
6+
Fixes # (issue)
7+
8+
## Type of change
9+
- [ ] Bug fix (non-breaking change which fixes an issue)
10+
- [ ] New feature (non-breaking change which adds functionality)
11+
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
12+
- [ ] Documentation update
13+
14+
## Checklist
15+
- [ ] My code follows the style guidelines of this project
16+
- [ ] I have performed a self-review of my code
17+
- [ ] I have commented my code, particularly in hard-to-understand areas
18+
- [ ] I have made corresponding changes to the documentation
19+
- [ ] My changes generate no new warnings
20+
- [ ] I have added tests that prove my fix is effective or that my feature works
21+
- [ ] New and existing unit tests pass locally with my changes
22+
- [ ] Any dependent changes have been merged and published
23+
24+
## Screenshots (if appropriate)
25+
Add screenshots to help reviewers understand the changes visually.
26+
27+
## Additional Notes
28+
Add any additional notes or context about the pull request here.

CONTRIBUTING.md

Lines changed: 159 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,159 @@
1+
# Contributing to react-resize-detector-context
2+
3+
First off, thank you for considering contributing to react-resize-detector-context! 🎉
4+
5+
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.
6+
7+
## Code of Conduct
8+
9+
This project and everyone participating in it is governed by our Code of Conduct. By participating, you are expected to uphold this code.
10+
11+
## How Can I Contribute?
12+
13+
### Reporting Bugs
14+
15+
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.
16+
17+
**Great Bug Reports** tend to have:
18+
- A quick summary and/or background
19+
- Steps to reproduce
20+
- What you expected would happen
21+
- What actually happens
22+
- Notes (possibly including why you think this might be happening, or stuff you tried that didn't work)
23+
24+
### Suggesting Enhancements
25+
26+
Enhancement suggestions are tracked as GitHub issues. When creating an enhancement suggestion, please use our feature request template and include:
27+
- A clear and descriptive title
28+
- A detailed description of the proposed feature
29+
- Examples of how the feature would be used
30+
- Why this enhancement would be useful
31+
32+
### Pull Requests
33+
34+
1. Fork the repo and create your branch from `main`.
35+
2. If you've added code that should be tested, add tests.
36+
3. If you've changed APIs, update the documentation.
37+
4. Ensure the test suite passes.
38+
5. Make sure your code lints.
39+
6. Issue that pull request!
40+
41+
## Development Setup
42+
43+
1. Fork and clone the repository
44+
```bash
45+
git clone https://github.com/your-username/react-resize-detector-context.git
46+
cd react-resize-detector-context
47+
```
48+
49+
2. Install dependencies
50+
```bash
51+
pnpm install
52+
```
53+
54+
3. Run development mode
55+
```bash
56+
pnpm dev
57+
```
58+
59+
This will start:
60+
- Build watch mode
61+
- Storybook on http://localhost:6006
62+
- Test watch mode
63+
64+
## Development Workflow
65+
66+
### Running Tests
67+
```bash
68+
pnpm test # Run tests in watch mode
69+
pnpm test:ci # Run tests once with coverage
70+
```
71+
72+
### Linting and Formatting
73+
```bash
74+
pnpm lint # Run ESLint and fix issues
75+
pnpm format # Format code with Prettier
76+
```
77+
78+
### Building
79+
```bash
80+
pnpm build # Build the package
81+
```
82+
83+
### Storybook
84+
```bash
85+
pnpm storybook # Run Storybook locally
86+
```
87+
88+
## Coding Guidelines
89+
90+
### TypeScript
91+
- Use TypeScript for all new code
92+
- Ensure proper typing (avoid `any` when possible)
93+
- Follow the existing code style
94+
95+
### React
96+
- Use functional components with hooks
97+
- Follow React best practices
98+
- Keep components focused and composable
99+
100+
### Testing
101+
- Write tests for new features
102+
- Ensure existing tests pass
103+
- Aim for high test coverage
104+
105+
### Comments and Documentation
106+
- Use JSDoc comments for public APIs
107+
- Keep the README updated
108+
- Document breaking changes
109+
110+
## Commit Messages
111+
112+
We use conventional commits. Please follow this format:
113+
114+
```
115+
<type>(<scope>): <subject>
116+
117+
<body>
118+
119+
<footer>
120+
```
121+
122+
Types:
123+
- `feat`: A new feature
124+
- `fix`: A bug fix
125+
- `docs`: Documentation only changes
126+
- `style`: Changes that don't affect code meaning
127+
- `refactor`: Code change that neither fixes a bug nor adds a feature
128+
- `perf`: Performance improvement
129+
- `test`: Adding missing tests
130+
- `chore`: Changes to build process or auxiliary tools
131+
132+
Example:
133+
```
134+
feat(provider): add devMode prop for console logging control
135+
136+
Added optional devMode prop to BreakpointProvider to control when
137+
console errors are displayed. Defaults to NODE_ENV !== 'production'.
138+
```
139+
140+
## Release Process
141+
142+
Releases are managed by maintainers using:
143+
```bash
144+
pnpm release
145+
```
146+
147+
This will:
148+
1. Build the package
149+
2. Update version
150+
3. Create git tag
151+
4. Push to GitHub
152+
5. Create GitHub release
153+
6. Publish to npm (if configured)
154+
155+
## Questions?
156+
157+
Feel free to open an issue with your question or reach out to the maintainers.
158+
159+
Thank you for contributing! 🚀✨

0 commit comments

Comments
 (0)