|
| 1 | +# Contributing to T-Ruby WASM |
| 2 | + |
| 3 | +> [한국어 문서](./CONTRIBUTING.ko.md) |
| 4 | +
|
| 5 | +Thank you for your interest in contributing to T-Ruby WASM! This document provides guidelines and information for contributors. |
| 6 | + |
| 7 | +## Code of Conduct |
| 8 | + |
| 9 | +Please be respectful and constructive in all interactions. We welcome contributors of all backgrounds and experience levels. |
| 10 | + |
| 11 | +## Getting Started |
| 12 | + |
| 13 | +1. Fork the repository |
| 14 | +2. Clone your fork: |
| 15 | + ```bash |
| 16 | + git clone https://github.com/YOUR_USERNAME/t-ruby-wasm.git |
| 17 | + cd t-ruby-wasm |
| 18 | + ``` |
| 19 | +3. Install dependencies: |
| 20 | + ```bash |
| 21 | + npm install |
| 22 | + ``` |
| 23 | +4. Create a branch for your changes: |
| 24 | + ```bash |
| 25 | + git checkout -b feature/your-feature-name |
| 26 | + ``` |
| 27 | + |
| 28 | +## Development Guidelines |
| 29 | + |
| 30 | +### Code Style |
| 31 | + |
| 32 | +- Use TypeScript for all source files |
| 33 | +- Follow the existing code style |
| 34 | +- Each file should have a single export |
| 35 | +- Keep files under 100 lines (including comments) |
| 36 | +- Write comprehensive JSDoc comments |
| 37 | + |
| 38 | +### SOLID Principles |
| 39 | + |
| 40 | +We follow SOLID principles: |
| 41 | + |
| 42 | +- **S**ingle Responsibility: Each class/module has one responsibility |
| 43 | +- **O**pen/Closed: Open for extension, closed for modification |
| 44 | +- **L**iskov Substitution: Subtypes must be substitutable |
| 45 | +- **I**nterface Segregation: Keep interfaces small and focused |
| 46 | +- **D**ependency Inversion: Depend on abstractions |
| 47 | + |
| 48 | +### DRY Principle |
| 49 | + |
| 50 | +Don't Repeat Yourself. Extract common logic into reusable utilities. |
| 51 | + |
| 52 | +## Testing |
| 53 | + |
| 54 | +### Test-Driven Development (TDD) |
| 55 | + |
| 56 | +We use TDD methodology: |
| 57 | + |
| 58 | +1. Write a failing test first |
| 59 | +2. Write the minimum code to pass the test |
| 60 | +3. Refactor while keeping tests green |
| 61 | + |
| 62 | +### Running Tests |
| 63 | + |
| 64 | +```bash |
| 65 | +# Run tests |
| 66 | +npm test |
| 67 | + |
| 68 | +# Run tests in watch mode |
| 69 | +npm run test:watch |
| 70 | + |
| 71 | +# Run tests with coverage |
| 72 | +npm run test:coverage |
| 73 | +``` |
| 74 | + |
| 75 | +## Pull Request Process |
| 76 | + |
| 77 | +1. Ensure all tests pass |
| 78 | +2. Update documentation if needed |
| 79 | +3. Add tests for new functionality |
| 80 | +4. Keep commits atomic and well-described |
| 81 | +5. Reference any related issues |
| 82 | + |
| 83 | +### Commit Message Format |
| 84 | + |
| 85 | +``` |
| 86 | +type: short description |
| 87 | +
|
| 88 | +Longer description if needed. |
| 89 | +
|
| 90 | +Fixes #123 |
| 91 | +``` |
| 92 | + |
| 93 | +Types: `feat`, `fix`, `docs`, `style`, `refactor`, `test`, `chore` |
| 94 | + |
| 95 | +## Project Structure |
| 96 | + |
| 97 | +``` |
| 98 | +t-ruby-wasm/ |
| 99 | +├── src/ |
| 100 | +│ ├── types/ # Type definitions (one per file) |
| 101 | +│ ├── vm/ # Ruby VM related code |
| 102 | +│ ├── utils/ # Utility functions |
| 103 | +│ ├── TRuby.ts # Main TRuby class |
| 104 | +│ ├── createTRuby.ts # Factory function |
| 105 | +│ ├── VirtualFileSystem.ts |
| 106 | +│ └── index.ts # Public exports |
| 107 | +├── tests/ # Test files |
| 108 | +├── scripts/ # Build scripts |
| 109 | +└── dist/ # Build output |
| 110 | +``` |
| 111 | + |
| 112 | +## Questions? |
| 113 | + |
| 114 | +Feel free to open an issue for questions or discussions. |
0 commit comments