Spaces:
Running
Running
Contributing to lerobot.js
Thanks for your interest in contributing! This guide will help you get started.
π Quick Start
# Clone and setup
git clone https://github.com/timpietrusky/lerobot.js.git
cd lerobot.js
pnpm install
# Run demo
pnpm dev
# Build packages
pnpm --filter "@lerobot/web" run build
π¦ Package Structure
packages/web/
- Browser package (@lerobot/web
on npm)examples/robot-control-web/
- Demo application (deployed to HF Spaces)src/cli/
- Node.js CLI toolsrc/lerobot/node/
- Node.js library
π Making Changes
1. Development Workflow
# Make your changes to packages/web/ or other code
# Test your changes
pnpm dev # for demo
pnpm --filter "@lerobot/web" run build # for package
# Run any relevant tests
2. Creating a Changeset
For any changes to packages/web/
:
# Describe your changes
pnpm changeset
- Select package:
@lerobot/web
- Version type:
patch
(0.1.1 β 0.1.2) - Bug fixesminor
(0.1.1 β 0.2.0) - New featuresmajor
(0.1.1 β 1.0.0) - Breaking changes
- Summary: Clear description for changelog
3. Submit Pull Request
git add .
git commit -m "feat: your change description"
git push origin your-branch
Create a PR with:
- Clear description of changes
- Reference any related issues
- Include changeset if modifying
@lerobot/web
π Release Process
Automated Releases (Recommended)
- Changeset added β PR merged to
main
- GitHub Actions creates Release PR automatically
- Maintainer merges Release PR
- Package published to npm with GitHub release
Manual Testing
# Preview version changes (safe)
pnpm changeset:version
# Publish manually (only for emergencies)
pnpm changeset:publish
π Code Standards
TypeScript
- Use strict TypeScript settings
- Export types explicitly
- Document public APIs with JSDoc
Code Style
- Follow existing patterns
- Use meaningful variable names
- Add comments for complex logic
- NO explanation comments in code (see
docs/conventions.md
)
Commit Messages
feat:
- New featuresfix:
- Bug fixesdocs:
- Documentationchore:
- Maintenancerefactor:
- Code restructuring
π§ͺ Testing
Manual Testing
# Test demo locally
pnpm dev
# Test CLI
pnpm cli:find-port
pnpm cli:calibrate
# Test package build
pnpm --filter "@lerobot/web" run build
Hardware Testing
- Use SO-100 leader/follower arms when available
- Test calibration, teleoperation, port discovery
- Verify WebSerial API compatibility
π Documentation
Update Documentation For:
- New functions in
@lerobot/web
- CLI command changes
- Hardware support additions
- Breaking changes
Files to Update:
packages/web/README.md
- Package documentationREADME.md
- Main project overview- JSDoc comments for new APIs
π Bug Reports
Include:
- Steps to reproduce
- Expected vs actual behavior
- Browser/Node.js version
- Hardware setup (if relevant)
- Error messages/console output
π‘ Feature Requests
- Explain the use case
- Provide examples if possible
- Consider backward compatibility
- Discuss implementation approach
π― Areas for Contribution
High Priority
- New robot hardware support
- Browser compatibility improvements
- Performance optimizations
- Documentation improvements
Medium Priority
- Additional calibration methods
- UI/UX enhancements
- CLI tool features
- Testing infrastructure
Advanced
- WebRTC integration
- Computer vision features
- Machine learning integration
- Protocol implementations
π§ Development Tips
Common Commands
# Install dependencies
pnpm install
# Start demo development
pnpm dev
# Build everything
pnpm build
# Create changeset
pnpm changeset
# Work with specific package
pnpm --filter "@lerobot/web" run build
Debugging
- Use browser DevTools for WebSerial issues
- Check console for hardware communication errors
- Use
console.log
for motor position debugging - Test with different hardware configurations
π Getting Help
- Issues: Use GitHub issues for bugs/features
- Discussions: Use GitHub discussions for questions
- Hardware: Check hardware documentation in
docs/
π Recognition
All contributors will be recognized in releases and project documentation. Thank you for helping make robotics more accessible! π€β¨