Thank you for your interest in contributing to TresJS! We welcome contributions from everyone. This guide will help you get started with contributing to our NX monorepo.
This monorepo contains the following packages and apps:
- @tresjs/core - Core Vue custom renderer for Three.js
- @tresjs/cientos - Collection of helpers and abstractions
- @tresjs/post-processing - Post-processing effects library
- @tresjs/leches - Tasty GUI for Vue controls
- @tresjs/nuxt - Nuxt module integration
- @tresjs/eslint-config - Shared ESLint configuration
- docs - Main documentation site (Nuxt + Nuxt UI Pro)
- Vue playground - Development testing sandbox for Vue
- Nuxt playground - Development testing sandbox for Nuxt
- lab - Experimental features and testing environment
- Node.js v24 (or what is written in .nmvrc)
- pnpm v8 or higher (we use pnpm workspaces)
- NX is included as a dev dependency (no global install needed)
- Git
- Fork and clone the repository:
git clone https://github.com/<your-username>/tres.git
cd tres- Install dependencies:
pnpm install- Build all packages:
pnpm build- Start development mode for a specific package:
# For core package (runs playground)
pnpm --filter playground dev
# For cientos package
pnpm --filter @tresjs/cientos devThis project uses NX for intelligent build caching and affected package detection.
For more advanced NX usage, we recommend exploring:
For repository administrators, we provide the monocubo tool to help manage the monorepo. This tool assists with:
- Package migration
- Dependency management
- Repository maintenance
- Release coordination
See the monocubo package for detailed documentation and usage instructions.
# Build all packages
pnpm build
# Build specific package
pnpm build @tresjs/core
# Build only affected packages
pnpm nx affected --target=build# Run all tests
pnpm test
# Test specific package
pnpm --filter @tresjs/core test
pnpm --filter @tresjs/core test:ui # with UI and coverage
# Test only affected packages
pnpm nx affected --target=test# Lint all files
pnpm lint
# Auto-fix lint issues
pnpm lint:fix
# Format all packages
pnpm format
# Type check all packages
pnpm typecheckWe follow the Conventional Commits specification. This enables automatic version bumping and changelog generation.
<type>(<scope>): <description>
[optional body]
[optional footer]
feat: A new featurefix: A bug fixdocs: Documentation changesstyle: Code style changes (formatting, missing semicolons, etc.)refactor: Code changes that neither fix a bug nor add a featureperf: Performance improvementstest: Adding or updating testschore: Changes to build process, dependencies, or tooling
The scope should be the package or app name:
Packages:
corecientospostprocessinglechesnuxteslint-config
Apps:
docsplaygroundlab
feat(core): add useRaycaster composable
fix(cientos): correct OrbitControls damping behavior
docs(core): update useTresContext documentation
chore(nuxt): upgrade dependenciesFor breaking changes, add ! after the type/scope or add BREAKING CHANGE: in the footer:
feat(core)!: change camera management API
BREAKING CHANGE: useCameraManager now requires sizes parameter- Always use TypeScript for all code
- Avoid using
any- find a good type if possible - Use
typefor unions,interfacefor object shapes - Document public APIs with JSDoc comments
- Use
<script setup lang="ts">syntax - Define props with
defineProps<{ propName: Type }>() - Define emits with
defineEmits<{ eventName: [arg: Type] }>() - Use PascalCase for component names
- Use
defineModel()for v-model bindings
- Write descriptive variable and function names
- Keep functions small and focused
- Add JSDoc comments for public APIs
- Write unit tests for new features
- Ensure type safety throughout
We use Vitest for unit testing:
# Run tests for a package
pnpm --filter @tresjs/core test
# Run tests with UI
pnpm --filter @tresjs/core test:ui
# Run tests in watch mode
pnpm --filter @tresjs/core test:watchPlease include tests for:
- New features
- Bug fixes
- Edge cases
- Breaking changes
When contributing features or fixes:
- Update relevant documentation in the package
- Add JSDoc comments to public APIs
- Include usage examples where appropriate
- Update the docs site if needed (in
apps/docs)
- Create an issue first for major features or changes
- Fork the repository and create your branch from
main - Make your changes following our code style guidelines
- Write or update tests as needed
- Ensure all tests pass:
pnpm test - Ensure linting passes:
pnpm lint - Ensure type checking passes:
pnpm typecheck - Commit using conventional commits
- Push to your fork and submit a pull request
- Keep pull requests scoped and small to avoid overcomplicating the PR and making it harder to review. If you are working on a new feature, please consider splitting it into smaller PRs.
- Reference the issue number in your PR description
- Provide a clear description of the changes
- Include screenshots/videos for visual changes
- Update documentation as needed
Important
At least one core team member must review and approve the PR before merging.
The @tresjs/core package should remain minimal and focused on the core Three.js/Vue integration. Consider adding complex features to:
@tresjs/cientosfor helpers and abstractions@tresjs/post-processingfor effects- A new package if it's a distinct feature set
When reporting bugs, please include:
- A clear description of the issue
- Steps to reproduce
- Expected vs actual behavior
- Minimal reproduction (CodeSandbox, StackBlitz, etc.)
- Environment details (OS, browser, versions)
For new features:
- Open an issue first to discuss the feature
- Explain the use case and benefits
- Consider if it belongs in core or a separate package
- Be open to feedback and alternative approaches
To keep the issue tracker healthy and actionable, items marked with any of these labels — needs reproduction, waiting for author, or needs-translations — may be closed by the Tres team if there’s no activity for more than 30 days. If you later have new information (e.g., a minimal reproduction, updated context, or translations), please comment with the update and we’ll happily reopen.
- Join our Discord server for questions and discussions
- Follow @tresjs_dev on Twitter
- Follow @tresjs on Bluesky
- Check out discussions for RFCs and general discussion
By contributing to TresJS, you agree that your contributions will be licensed under the MIT License.
Thank you for contributing to TresJS! Every contribution, no matter how small, helps us make the project better for everyone.