Contributing to Teskooano
Thank you for your interest in contributing to Teskooano! This guide will help you get started with the development environment and explain our contribution workflow.
Development Environment Setup
Prerequisites
- Node.js: Version 18.x or higher
- Git: For version control
- proto: For dependency management
- moon: For monorepo management
Getting Started
Fork the repository on GitHub
Clone your fork:
bashgit clone https://github.com/YOUR_USERNAME/teskooano.git cd teskooano
Set up proto and moon:
bash# Install proto if you don't have it curl -fsSL https://moonrepo.dev/install/proto.sh | bash # Use proto to set up the local development environment proto use
Install dependencies and start the development server:
bashmoon run teskooano:dev
The application will be available at http://localhost:3000.
Project Structure
Teskooano is organized as a monorepo with the following structure:
teskooano/
├── apps/ # Frontend applications
│ ├── teskooano/ # Main simulation application
│ └── homepage/ # Documentation website
├── packages/ # Shared libraries
│ ├── core/ # Core engine components
│ │ ├── math/ # Mathematical utilities
│ │ ├── physics/ # Physics simulation
│ │ └── state/ # State management
│ ├── data/ # Data definitions
│ │ └── types/ # TypeScript types
│ ├── systems/ # Domain-specific systems
│ │ ├── celestial/ # Celestial object definitions
│ │ └── procedural-generation/ # Procedural generation
│ └── renderer/ # Rendering libraries
│ ├── threejs/ # Main Three.js renderer
│ ├── threejs-core/ # Core Three.js setup
│ └── ... # Other renderer packages
└── services/ # Backend services (if any)
Development Workflow
Creating a New Feature
Create a branch for your feature:
bashgit checkout -b feature/your-feature-name
Implement your changes following the code style and architectural guidelines
Write tests for your changes (we follow a TDD approach)
Run tests to ensure everything works:
bashmoon run :test
Commit your changes using the Conventional Commits format:
bashgit commit -m "feat: add new celestial body type"
Push your branch to your fork:
bashgit push origin feature/your-feature-name
Create a Pull Request on GitHub
Code Style Guidelines
We follow strict TypeScript coding standards:
- Use TypeScript's strict mode
- Write proper JSDoc comments for public APIs
- Follow consistent naming conventions:
PascalCase
for classes, interfaces, and typescamelCase
for variables, properties, and functionsUPPER_CASE
for constants
- Keep files focused on a single responsibility
- Aim for files to be under 300-400 lines
- Use proper import ordering
- Use meaningful variable and function names
Testing Guidelines
We use a Test-Driven Development (TDD) approach:
- Write a test that defines the expected behavior
- Run the test to see it fail
- Implement the minimal code needed to make the test pass
- Refactor while keeping the test passing
All major functionality should have corresponding tests:
- Unit Tests: For individual functions and classes
- Integration Tests: For checking how components work together
- Visual Regression Tests: For UI components (when applicable)
Package Development
When developing packages within the monorepo:
- Follow the modular architecture - respect separation of concerns
- Export types - ensure proper TypeScript type definitions
- Minimize external dependencies - think carefully before adding new dependencies
- Document public APIs - use JSDoc comments
- Consider performance - Teskooano handles complex physics calculations
Adding a New Package
- Use the provided templates or copy an existing package structure
- Update the
package.json
with appropriate dependencies - Create a
moon.yml
file with the required tasks - Add proper TypeScript configuration
- Document the package purpose in a README.md file
Core Concepts to Understand
Before contributing, familiarize yourself with these core concepts:
- N-Body Physics: How gravitational interactions are calculated between multiple bodies
- Orbital Mechanics: Kepler's laws, orbital elements, and trajectory calculations
- ThreeJS Rendering: How 3D rendering works with Three.js
- State Management: How Nanostores are used for application state
- Scaling and Units: How real-world physical units are scaled for visualization
Pull Request Process
- Update documentation if you're changing behavior
- Add or update tests for your changes
- Ensure all tests pass before submitting
- Make sure the code builds without errors
- Fill out the PR template completely
- Request a review from maintainers
Need Help?
- GitHub Issues: For bug reports and feature requests
- Discussions: For general questions and discussions
Thank you for contributing to Teskooano! Together, we can create an amazing tool for exploring and understanding celestial physics.