Spaces:
Running
Running
docs: simplified contribution guide
Browse files- .github/CONTRIBUTING.md +27 -198
.github/CONTRIBUTING.md
CHANGED
@@ -1,243 +1,72 @@
|
|
1 |
# Contributing to lerobot.js
|
2 |
|
3 |
-
|
4 |
-
|
5 |
-
## π Quick Start
|
6 |
|
7 |
```bash
|
8 |
-
# Clone and setup
|
9 |
git clone https://github.com/timpietrusky/lerobot.js.git
|
10 |
cd lerobot.js
|
11 |
pnpm install
|
12 |
-
|
13 |
-
# Run cyberpunk demo (recommended)
|
14 |
-
pnpm example:cyberpunk
|
15 |
-
|
16 |
-
# Build packages
|
17 |
-
pnpm --filter "@lerobot/web" run build
|
18 |
```
|
19 |
|
20 |
-
##
|
21 |
-
|
22 |
-
- **`packages/web/`** - Browser package (`@lerobot/web` on npm)
|
23 |
-
- **`examples/cyberpunk-standalone/`** - Main demo application (standalone)
|
24 |
-
- **`examples/iframe-dialog-test/`** - Test application for iframe integration
|
25 |
-
- **`examples/test-sequential-operations/`** - Sequential operations test
|
26 |
-
- **`src/cli/`** - Node.js CLI tool
|
27 |
-
- **`src/lerobot/node/`** - Node.js library implementation
|
28 |
|
29 |
-
|
30 |
|
31 |
-
|
32 |
-
|
33 |
-
**For Web Library Changes:**
|
34 |
|
35 |
```bash
|
36 |
cd packages/web
|
37 |
-
pnpm
|
38 |
-
pnpm build # Build the library
|
39 |
```
|
40 |
|
41 |
-
**
|
42 |
|
43 |
```bash
|
44 |
-
|
45 |
-
|
46 |
-
pnpm example:sequential-test
|
47 |
```
|
48 |
|
49 |
-
|
50 |
|
51 |
-
|
52 |
-
pnpm cli:find-port # Test CLI commands
|
53 |
-
pnpm cli:calibrate
|
54 |
-
pnpm cli:teleoperate
|
55 |
-
pnpm build # Build CLI for distribution
|
56 |
-
```
|
57 |
-
|
58 |
-
### 2. Creating a Changeset
|
59 |
-
|
60 |
-
**For any changes to `packages/web/`:**
|
61 |
|
62 |
```bash
|
63 |
-
|
64 |
-
pnpm
|
|
|
65 |
```
|
66 |
|
67 |
-
|
68 |
-
- **Version type**:
|
69 |
-
- `patch` (0.1.1 β 0.1.2) - Bug fixes
|
70 |
-
- `minor` (0.1.1 β 0.2.0) - New features
|
71 |
-
- `major` (0.1.1 β 1.0.0) - Breaking changes
|
72 |
-
- **Summary**: Clear description for changelog
|
73 |
-
|
74 |
-
### 3. Submit Pull Request
|
75 |
|
76 |
```bash
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
```
|
81 |
|
82 |
-
|
83 |
-
|
84 |
-
- Clear description of changes
|
85 |
-
- Reference any related issues
|
86 |
-
- Include changeset if modifying `@lerobot/web`
|
87 |
|
88 |
-
|
89 |
-
|
90 |
-
### Automated Releases (Recommended)
|
91 |
-
|
92 |
-
1. **Changeset added** β PR merged to `main`
|
93 |
-
2. **GitHub Actions** creates Release PR automatically
|
94 |
-
3. **Maintainer merges** Release PR
|
95 |
-
4. **Package published** to npm with GitHub release
|
96 |
-
|
97 |
-
### Manual Testing
|
98 |
|
99 |
```bash
|
100 |
-
|
101 |
-
pnpm changeset:version
|
102 |
-
|
103 |
-
# Publish manually (only for emergencies)
|
104 |
-
pnpm changeset:publish
|
105 |
```
|
106 |
|
107 |
-
|
108 |
-
|
109 |
-
### TypeScript
|
110 |
|
111 |
-
|
112 |
-
- Export types explicitly
|
113 |
-
- Document public APIs with JSDoc
|
114 |
-
|
115 |
-
### Code Style
|
116 |
|
117 |
- Follow existing patterns
|
118 |
-
- Use
|
119 |
-
-
|
120 |
-
- **NO explanation comments** in code (see `docs/conventions.md`)
|
121 |
|
122 |
-
|
123 |
|
124 |
- `feat:` - New features
|
125 |
- `fix:` - Bug fixes
|
126 |
- `docs:` - Documentation
|
127 |
- `chore:` - Maintenance
|
128 |
-
- `refactor:` - Code restructuring
|
129 |
-
|
130 |
-
## π§ͺ Testing
|
131 |
-
|
132 |
-
### Manual Testing
|
133 |
-
|
134 |
-
```bash
|
135 |
-
# Test demo locally
|
136 |
-
pnpm dev
|
137 |
-
|
138 |
-
# Test CLI
|
139 |
-
pnpm cli:find-port
|
140 |
-
pnpm cli:calibrate
|
141 |
-
|
142 |
-
# Test package build
|
143 |
-
pnpm --filter "@lerobot/web" run build
|
144 |
-
```
|
145 |
-
|
146 |
-
### Hardware Testing
|
147 |
-
|
148 |
-
- Use SO-100 leader/follower arms when available
|
149 |
-
- Test calibration, teleoperation, port discovery
|
150 |
-
- Verify WebSerial API compatibility
|
151 |
-
|
152 |
-
## π Documentation
|
153 |
-
|
154 |
-
### Update Documentation For:
|
155 |
-
|
156 |
-
- New functions in `@lerobot/web`
|
157 |
-
- CLI command changes
|
158 |
-
- Hardware support additions
|
159 |
-
- Breaking changes
|
160 |
-
|
161 |
-
### Files to Update:
|
162 |
-
|
163 |
-
- `packages/web/README.md` - Package documentation
|
164 |
-
- `README.md` - Main project overview
|
165 |
-
- JSDoc comments for new APIs
|
166 |
-
|
167 |
-
## π Bug Reports
|
168 |
-
|
169 |
-
Include:
|
170 |
-
|
171 |
-
- Steps to reproduce
|
172 |
-
- Expected vs actual behavior
|
173 |
-
- Browser/Node.js version
|
174 |
-
- Hardware setup (if relevant)
|
175 |
-
- Error messages/console output
|
176 |
-
|
177 |
-
## π‘ Feature Requests
|
178 |
-
|
179 |
-
- Explain the use case
|
180 |
-
- Provide examples if possible
|
181 |
-
- Consider backward compatibility
|
182 |
-
- Discuss implementation approach
|
183 |
-
|
184 |
-
## π― Areas for Contribution
|
185 |
-
|
186 |
-
### High Priority
|
187 |
-
|
188 |
-
- New robot hardware support
|
189 |
-
- Browser compatibility improvements
|
190 |
-
- Performance optimizations
|
191 |
-
- Documentation improvements
|
192 |
-
|
193 |
-
### Medium Priority
|
194 |
-
|
195 |
-
- Additional calibration methods
|
196 |
-
- UI/UX enhancements
|
197 |
-
- CLI tool features
|
198 |
-
- Testing infrastructure
|
199 |
-
|
200 |
-
### Advanced
|
201 |
-
|
202 |
-
- WebRTC integration
|
203 |
-
- Computer vision features
|
204 |
-
- Machine learning integration
|
205 |
-
- Protocol implementations
|
206 |
-
|
207 |
-
## π§ Development Tips
|
208 |
-
|
209 |
-
### Common Commands
|
210 |
-
|
211 |
-
```bash
|
212 |
-
# Install dependencies
|
213 |
-
pnpm install
|
214 |
-
|
215 |
-
# Start demo development
|
216 |
-
pnpm dev
|
217 |
-
|
218 |
-
# Build everything
|
219 |
-
pnpm build
|
220 |
-
|
221 |
-
# Create changeset
|
222 |
-
pnpm changeset
|
223 |
-
|
224 |
-
# Work with specific package
|
225 |
-
pnpm --filter "@lerobot/web" run build
|
226 |
-
```
|
227 |
-
|
228 |
-
### Debugging
|
229 |
-
|
230 |
-
- Use browser DevTools for WebSerial issues
|
231 |
-
- Check console for hardware communication errors
|
232 |
-
- Use `console.log` for motor position debugging
|
233 |
-
- Test with different hardware configurations
|
234 |
-
|
235 |
-
## π Getting Help
|
236 |
-
|
237 |
-
- **Issues**: Use GitHub issues for bugs/features
|
238 |
-
- **Discussions**: Use GitHub discussions for questions
|
239 |
-
- **Hardware**: Check hardware documentation in `docs/`
|
240 |
|
241 |
-
##
|
242 |
|
243 |
-
|
|
|
1 |
# Contributing to lerobot.js
|
2 |
|
3 |
+
## Quick Start
|
|
|
|
|
4 |
|
5 |
```bash
|
|
|
6 |
git clone https://github.com/timpietrusky/lerobot.js.git
|
7 |
cd lerobot.js
|
8 |
pnpm install
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
```
|
10 |
|
11 |
+
## Development
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
|
13 |
+
### Library + Demo Development (Recommended)
|
14 |
|
15 |
+
**Terminal 1:**
|
|
|
|
|
16 |
|
17 |
```bash
|
18 |
cd packages/web
|
19 |
+
pnpm build:watch
|
|
|
20 |
```
|
21 |
|
22 |
+
**Terminal 2:**
|
23 |
|
24 |
```bash
|
25 |
+
cd examples/cyberpunk-standalone
|
26 |
+
npm run dev
|
|
|
27 |
```
|
28 |
|
29 |
+
Edit `packages/web/src/` β see changes instantly in demo.
|
30 |
|
31 |
+
### Library Only
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
32 |
|
33 |
```bash
|
34 |
+
cd packages/web
|
35 |
+
pnpm build # Build once
|
36 |
+
pnpm dev # Tests in watch mode
|
37 |
```
|
38 |
|
39 |
+
### Examples Only
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
40 |
|
41 |
```bash
|
42 |
+
pnpm example:cyberpunk
|
43 |
+
pnpm example:iframe-test
|
44 |
+
pnpm example:sequential-test
|
45 |
```
|
46 |
|
47 |
+
## Releases
|
|
|
|
|
|
|
|
|
48 |
|
49 |
+
For `@lerobot/web` changes:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
50 |
|
51 |
```bash
|
52 |
+
pnpm changeset
|
|
|
|
|
|
|
|
|
53 |
```
|
54 |
|
55 |
+
Select package, version type (patch/minor/major), add description.
|
|
|
|
|
56 |
|
57 |
+
## Code Standards
|
|
|
|
|
|
|
|
|
58 |
|
59 |
- Follow existing patterns
|
60 |
+
- Use TypeScript strict mode
|
61 |
+
- No explanation comments (see `docs/conventions.md`)
|
|
|
62 |
|
63 |
+
## Commit Format
|
64 |
|
65 |
- `feat:` - New features
|
66 |
- `fix:` - Bug fixes
|
67 |
- `docs:` - Documentation
|
68 |
- `chore:` - Maintenance
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
69 |
|
70 |
+
## Bug Reports
|
71 |
|
72 |
+
Include: steps to reproduce, expected vs actual behavior, browser/Node version, hardware setup, error messages.
|