Thank you for your interest in contributing to JSAR Runtime! This document provides guidelines and information to help you contribute effectively to this revolutionary browser engine library designed for The Spatial Web.
- Getting Started
- Development Workflow
- Coding Standards
- Building and Testing
- Commit Message Conventions
- Pull Request Process
- Code of Conduct
- License
Before you begin, ensure you have the following installed:
- Node.js v18.16.1
- Rust v1.86.0 or later (with nightly toolchain)
- Platform-specific tools:
- macOS: Xcode Command Line Tools
- Linux: GCC or Clang
- Windows: Visual Studio Build Tools
Add the required Rust targets based on your development needs:
# For Android development
rustup target add aarch64-linux-android
# For macOS development
rustup target add aarch64-apple-darwin
rustup target add x86_64-apple-darwin
# For Windows development
rustup target add x86_64-pc-windows-msvc- Fork the repository on GitHub
- Clone your fork locally:
git clone https://github.com/YOUR_USERNAME/jsar-runtime.git cd jsar-runtime - Add the upstream remote:
git remote add upstream https://github.com/M-CreativeLab/jsar-runtime.git
- Install dependencies:
npm install
-
Sync with upstream:
git checkout main git pull upstream main git push origin main
-
Create a feature branch:
git checkout -b feature/your-feature-name # or git checkout -b fix/issue-number-description
- Make your changes following the coding standards
- Build and test your changes locally
- Commit your changes with descriptive messages
- Push to your fork:
git push origin feature/your-feature-name
JSAR Runtime follows specific style guides for different languages. Please refer to our Coding Style Guides for detailed information:
- TypeScript: Google TypeScript Style Guide
- Rust: Rustfmt Style Guide
- C/C++: Google C++ Style Guide
- C#: Microsoft C# Style Guide
- ShaderLab: Unity ShaderLab Style Guide
Indentation Standard: Use 2 spaces for indentation across all source files. This is enforced by the automated formatting tools and configured in the project's formatting configuration files.
The project includes automated formatting tools:
- TypeScript/JavaScript: ESLint
- Rust: rustfmt
- C/C++: clang-format
Run the linter before committing:
make lint-
Build JavaScript bundle:
make jsbundle
-
Build for your target platform:
# For macOS (universal binary) make darwin # For Android make android # For Windows make windows
-
Clean build (if needed):
make darwin CLEAN=yes
CLEAN=yes: Clean the build directory before buildingRELEASE=yes: Build the release versionINSPECTOR=yes: Enable the inspectorVERBOSE=yes: Print detailed build commands
# Run Rust tests
cargo test
# Run JavaScript/TypeScript tests
npm test
# Run the full test suite
make testWe follow Angular's Commit Message Guidelines to maintain a clear project history:
<type>(<scope>): <description>
<BLANK LINE>
[optional body]
<BLANK LINE>
[optional footer(s)]
The header(<type>(<scope>): <description>) is mandatory and the scope of the header is optional.
Any line of the commit message cannot be longer than 100 characters! This allows the message to be easier to read on GitHub as well as in various git tools.
The footer should contain a closing reference to an issue if any.
<type>(<scope>): <short summary>
│ │ │
│ │ └─⫸ Summary in present tense. Not capitalized. No period at the end.
│ │
│ └─⫸ Commit Scope: common|runtime|renderer|parser|graphics|input|network|xr|
│ client|bindings|web-content|elements|layout|dom|css|html|canvas|
│ animations|window|media|scripting|webxr|webgl|
│ changelog|website|tests|examples|docs-infra|
| browser|android|darwin|
│ inspector|devtools
│
└─⫸ Commit Type: build|ci|docs|feat|fix|perf|refactor|test
feat: A new featurefix: A bug fixdocs: Documentation only changesstyle: Changes that do not affect the meaning of the coderefactor: A code change that neither fixes a bug nor adds a featureperf: A code change that improves performancetest: Adding missing tests or correcting existing testsbuild: Changes that affect the build system or external dependenciesci: Changes to CI configuration files and scripts
The following are good commit message examples:
docs(changelog): update changelog to beta.5feat(webxr): add hand tracking support for spatial interactionsfix(rendering): resolve memory leak in texture managementdocs(contributing): add comprehensive development guidelinestest(dom): add unit tests for HTML element creationfix(release): need to depend on latest rxjs and zone.js
The version in our package.json gets copied to the one we publish, and users need the latest of these.- Ensure your code builds without errors
- Run tests and verify they pass
- Run the linter and fix any style issues
- Update documentation if your changes affect APIs or behavior
- Rebase your branch on the latest main if needed
- Create a pull request from your feature branch to
main - Provide a clear title following commit message conventions
- Write a detailed description including:
- What changes were made
- Why the changes were necessary
- Any breaking changes
- Screenshots (for UI changes)
- Related issue numbers (e.g., "Closes #123")
- Automated checks must pass (CI/CD pipeline)
- Code review by maintainers
- Address feedback and update your PR as needed
- Final approval and merge by maintainers
- Keep PRs focused and atomic (one feature/fix per PR)
- Avoid large PRs when possible
- Respond to review feedback promptly
- Be open to suggestions and improvements
We are committed to providing a welcoming and inclusive environment for all contributors. Please be respectful and professional in all interactions.
Key principles:
- Be respectful and considerate
- Welcome newcomers and help them learn
- Focus on constructive feedback
- Assume positive intent
By contributing to JSAR Runtime, you agree that your contributions will be licensed under the Apache License 2.0.
If you need help or have questions:
- Check existing GitHub Issues
- Create a new issue with the "question" label
- Review the documentation in the
docs/directory
Thank you for contributing to JSAR Runtime! 🚀