Thank you for your interest in contributing to monaco-ghost! This document provides guidelines and instructions for contributing to the project.
- Node.js (LTS version recommended)
- npm or yarn
- Git
- Fork the repository
- Clone your fork:
git clone https://github.com/YOUR_USERNAME/monaco-ghost.git cd monaco-ghost - Install dependencies:
npm install
- Start Storybook for development:
npm run storybook
-
Create a new branch for your feature/fix:
git checkout -b feature/your-feature-name
or
git checkout -b fix/your-fix-name
-
Make your changes following our coding standards
-
Test your changes thoroughly
-
Commit your changes with clear, descriptive messages
-
Push to your fork and submit a pull request
- Use TypeScript for all new code
- Maintain strict type safety
- Avoid using
anytype - Document complex types with JSDoc comments
- Use ESLint and Prettier for code formatting
- Follow existing code patterns and structure
- Keep functions small and focused
- Use meaningful variable and function names
- Add comments for complex logic
- Write unit tests for new features
- Maintain or improve code coverage
- Test edge cases thoroughly
- Include integration tests when needed
# Run all tests
npm run test
# Run tests with coverage
npm run test:coverage
# Run specific test file
npm run test -- path/to/test/file.test.ts- Add JSDoc comments for public APIs
- Document complex algorithms
- Include usage examples in comments
- Keep documentation up-to-date with code changes
- Update README.md for new features
- Add examples for new functionality
- Document breaking changes
- Keep the API documentation current
-
Before Submitting
- Ensure all tests pass
- Update documentation if needed
- Add tests for new features
- Check code coverage
-
PR Description
- Clearly describe the changes
- Link related issues
- List breaking changes
- Include screenshots for UI changes
-
Review Process
- Address review comments
- Keep the PR focused and small
- Rebase if needed
- Be responsive to feedback
When filing a bug report, please include:
- Clear description of the issue
- Steps to reproduce
- Expected vs actual behavior
- Code examples if applicable
- Environment details
When proposing new features:
- Describe the problem you're solving
- Explain your proposed solution
- Include example use cases
- Consider edge cases
monaco-ghost/
├── src/ # Source code
│ ├── components/ # React components
│ ├── hooks/ # React hooks
│ ├── types/ # TypeScript types
│ └── utils/ # Utility functions
├── tests/ # Test files
├── stories/ # Storybook stories
└── docs/ # Documentation
The project uses a hybrid build system:
- TypeScript (tsc) for type checking and declaration files
- esbuild for fast, optimized builds
# Type checking
npm run type-check
# Build type declarations
npm run build:types
# Build CommonJS version
npm run build:cjs
# Build ES Modules version
npm run build:esm
# Full build
npm run build- Use debouncing for API calls
- Implement efficient caching
- Clean up resources properly
- Consider memory usage
- Profile performance impacts
- Review dependencies regularly
- Follow security best practices
- Report security issues privately
- Use secure API endpoints
- Validate user inputs
By contributing, you agree that your contributions will be licensed under the Apache-2.0 License.