|
| 1 | +# Contributing to ReactBits MCP Server |
| 2 | + |
| 3 | +We love your input! We want to make contributing to ReactBits MCP Server as easy and transparent as possible, whether it's: |
| 4 | + |
| 5 | +- Reporting a bug |
| 6 | +- Discussing the current state of the code |
| 7 | +- Submitting a fix |
| 8 | +- Proposing new features |
| 9 | +- Becoming a maintainer |
| 10 | + |
| 11 | +## Development Process |
| 12 | + |
| 13 | +We use GitHub to host code, to track issues and feature requests, as well as accept pull requests. |
| 14 | + |
| 15 | +1. Fork the repo and create your branch from `main`. |
| 16 | +2. If you've added code that should be tested, add tests. |
| 17 | +3. If you've changed APIs, update the documentation. |
| 18 | +4. Ensure the test suite passes. |
| 19 | +5. Make sure your code lints. |
| 20 | +6. Issue that pull request! |
| 21 | + |
| 22 | +## Setting Up Development Environment |
| 23 | + |
| 24 | +```bash |
| 25 | +# Clone your fork |
| 26 | +git clone https://github.com/your-username/reactbits-mcp-server.git |
| 27 | +cd reactbits-mcp-server |
| 28 | + |
| 29 | +# Install dependencies |
| 30 | +npm install |
| 31 | + |
| 32 | +# Run in development mode |
| 33 | +npm run dev |
| 34 | + |
| 35 | +# Build the project |
| 36 | +npm run build |
| 37 | + |
| 38 | +# Run tests |
| 39 | +npm test |
| 40 | +``` |
| 41 | + |
| 42 | +## Project Structure |
| 43 | + |
| 44 | +``` |
| 45 | +reactbits-mcp-server/ |
| 46 | +├── src/ |
| 47 | +│ ├── index.ts # Main server entry point |
| 48 | +│ ├── services/ |
| 49 | +│ │ └── ReactBitsService.ts # Component fetching logic |
| 50 | +│ ├── types/ |
| 51 | +│ │ └── index.ts # TypeScript type definitions |
| 52 | +│ └── utils/ |
| 53 | +│ └── CacheManager.ts # Caching utility |
| 54 | +├── dist/ # Compiled output (git-ignored) |
| 55 | +├── test/ # Test files |
| 56 | +├── docs/ # Documentation |
| 57 | +├── package.json |
| 58 | +├── tsconfig.json |
| 59 | +└── README.md |
| 60 | +``` |
| 61 | + |
| 62 | +## Adding New Components |
| 63 | + |
| 64 | +When ReactBits.dev adds new components, update the component metadata in `src/services/ReactBitsService.ts`: |
| 65 | + |
| 66 | +```typescript |
| 67 | +private componentMetadata: ComponentCategory[] = [ |
| 68 | + { |
| 69 | + name: 'New Category', |
| 70 | + slug: 'new-category', |
| 71 | + components: [ |
| 72 | + { |
| 73 | + name: 'New Component', |
| 74 | + slug: 'new-component', |
| 75 | + category: 'new-category', |
| 76 | + hasCSS: true, |
| 77 | + hasTailwind: true |
| 78 | + }, |
| 79 | + ] |
| 80 | + }, |
| 81 | + // ... existing categories |
| 82 | +]; |
| 83 | +``` |
| 84 | + |
| 85 | +## Code Style |
| 86 | + |
| 87 | +- Use TypeScript for all new code |
| 88 | +- Follow the existing code style |
| 89 | +- Use meaningful variable and function names |
| 90 | +- Add JSDoc comments for public APIs |
| 91 | +- Keep functions small and focused |
| 92 | + |
| 93 | +## Testing |
| 94 | + |
| 95 | +- Write unit tests for new functionality |
| 96 | +- Ensure all tests pass before submitting PR |
| 97 | +- Test with actual MCP clients when possible |
| 98 | + |
| 99 | +## Pull Request Process |
| 100 | + |
| 101 | +1. Update the README.md with details of changes to the interface, if applicable. |
| 102 | +2. Update the package.json version following [SemVer](http://semver.org/). |
| 103 | +3. The PR will be merged once you have the sign-off of at least one maintainer. |
| 104 | + |
| 105 | +## Any contributions you make will be under the MIT Software License |
| 106 | + |
| 107 | +When you submit code changes, your submissions are understood to be under the same [MIT License](LICENSE) that covers the project. |
| 108 | + |
| 109 | +## Report bugs using GitHub's [issues](https://github.com/yourusername/reactbits-mcp-server/issues) |
| 110 | + |
| 111 | +We use GitHub issues to track public bugs. Report a bug by [opening a new issue](https://github.com/yourusername/reactbits-mcp-server/issues/new). |
| 112 | + |
| 113 | +**Great Bug Reports** tend to have: |
| 114 | + |
| 115 | +- A quick summary and/or background |
| 116 | +- Steps to reproduce |
| 117 | + - Be specific! |
| 118 | + - Give sample code if you can |
| 119 | +- What you expected would happen |
| 120 | +- What actually happens |
| 121 | +- Notes (possibly including why you think this might be happening, or stuff you tried that didn't work) |
| 122 | + |
| 123 | +## License |
| 124 | + |
| 125 | +By contributing, you agree that your contributions will be licensed under its MIT License. |
0 commit comments