Thank you for your interest in contributing to Schemantic! This document provides guidelines and information for contributors.
By participating in this project, you agree to abide by our Code of Conduct:
- Be respectful and inclusive
- Welcome newcomers and help them learn
- Focus on constructive feedback
- Respect different viewpoints and experiences
- Node.js 16+ (recommended: Node.js 18+)
- npm 7+ or yarn
- Git
- Basic knowledge of TypeScript and OpenAPI
-
Fork and Clone
git clone https://github.com/YOUR_USERNAME/schemantic.git cd schemantic -
Install Dependencies
npm install
-
Build the Project
npm run build
-
Run Tests
npm test -
Test with Local Applications
# Start the FastAPI test server cd local-test/fast-api-app python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate pip install -r requirements.txt python start.py # In another terminal, test type generation cd ../../ npx schemantic generate --url http://localhost:8000/openapi.json --output ./test-output
- Fix issues listed in GitHub Issues
- Include tests that demonstrate the fix
- Update documentation if behavior changes
- Discuss major features in GitHub Discussions first
- Follow the existing architecture patterns
- Include comprehensive tests
- Update documentation and examples
- Improve existing documentation
- Add examples and tutorials
- Fix typos and clarify confusing sections
- Translate documentation (future)
- Add test coverage for untested code
- Create integration tests for real-world scenarios
- Add performance benchmarks
- Create new generators for different output formats
- Add support for new frameworks
- Extend the plugin API
- Follow the existing TypeScript style
- Use ESLint configuration:
npm run lint - Fix linting issues:
npm run lint:fix - Format code consistently
- Modular Design: Keep components separate and focused
- Plugin Architecture: New functionality should be pluggable
- Type Safety: Maintain strong typing throughout
- Error Handling: Provide clear, actionable error messages
- Performance: Consider performance implications of changes
- Unit Tests: All new functions and classes
- Integration Tests: End-to-end scenarios with real schemas
- Performance Tests: For changes affecting generation speed
- Error Cases: Test error conditions and edge cases
- Code Comments: Complex logic should be documented
- API Documentation: Public methods need JSDoc comments
- User Documentation: Update guides for user-facing changes
- Examples: Include practical examples
-
Branch Naming
git checkout -b feature/short-description git checkout -b fix/issue-number-short-description git checkout -b docs/area-being-improved
-
Commit Messages Use conventional commits format:
type(scope): description feat(generators): add support for enum descriptions fix(cli): handle missing output directory docs(readme): update installation instructions test(integration): add FastAPI authentication tests -
Pull Request Template
- Clear description of changes
- Link to related issues
- Testing checklist completed
- Documentation updated
- Breaking changes noted
- Automated checks must pass (CI/CD, tests, linting)
- At least one maintainer review required
- Address review feedback promptly
- Squash commits before merging (if requested)
schemantic/
├── src/ # Source code
│ ├── cli/ # Command-line interface
│ ├── core/ # Core generation logic
│ ├── generators/ # Type generators
│ ├── parsers/ # Schema parsers
│ ├── plugins/ # Plugin system
│ └── types/ # TypeScript type definitions
├── docs/ # Documentation
├── local-test/ # Test applications
│ ├── fast-api-app/ # FastAPI test server
│ └── react-app/ # React test client
├── __tests__/ # Test files
└── dist/ # Built output
- Core: Main Schemantic class and configuration
- Generators: Convert schema objects to TypeScript code
- Parsers: Parse OpenAPI schemas into internal format
- Plugins: Extensible system for custom functionality
- CLI: Command-line interface and commands
- Unit Tests:
src/__tests__/*.test.ts - Integration Tests:
src/__tests__/integration/*.test.ts - CLI Tests: Test command-line functionality
- Performance Tests:
.github/workflows/performance.yml
- Real-world OpenAPI schemas in
local-test/ - Generated test schemas for edge cases
- Large schemas for performance testing
# All tests
npm test
# Watch mode
npm run test:watch
# Coverage report
npm run test:coverage
# Integration tests only
npm test -- --testPathPattern=integration
# Performance tests
npm run test:perf # If implemented- Follow Semantic Versioning (semver)
- Update CHANGELOG.md with notable changes
- Tag releases in Git
- Update version in package.json
- Update CHANGELOG.md
- Run full test suite
- Build and test distribution
- Create GitHub release
- Publish to npm (automated via CI/CD)
- General Questions: GitHub Discussions
- Technical Issues: GitHub Issues
- Real-time Chat: Discord (link in README)
- Mentorship: Tag @maintainers in discussions
- Code Reviews: Use GitHub review tools
- Release Management: Follow documented process
- Community Management: Foster welcoming environment
Contributors are recognized in:
- GitHub contributors list
- CHANGELOG.md acknowledgments
- Annual contributor highlights
- VS Code with TypeScript extension
- Postman for API testing
- OpenAPI Generator for comparison
Thank you for contributing to Schemantic! 🚀