NERDDISCO commited on
Commit
443cc20
Β·
1 Parent(s): bdc1ac8

chore: release

Browse files
.changeset/seven-windows-play.md ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ "lerobot": minor
3
+ "@lerobot/node": minor
4
+ "@lerobot/web": minor
5
+ ---
6
+
7
+ \# Changes Summary
8
+
9
+ \## Features
10
+
11
+ \- feat(node): add `connectPort()` function for direct port connections
12
+
13
+ \- feat(node): implement proper `findPort()` / `connectPort()` API separation
14
+
15
+ \- feat(node): add comprehensive Node.js README with API documentation
16
+
17
+ \- feat(lint): add ESLint configuration for both Node.js and Web packages
18
+
19
+ \## Fixes
20
+
21
+ \- fix(node): resolve motor position reading to return instant real values
22
+
23
+ \- fix(node): implement proper calibration flow matching Python lerobot
24
+
25
+ \- fix(node): resolve EventEmitter memory leaks in motor communication
26
+
27
+ \- fix(examples): update all Node.js examples to use correct API pattern
28
+
29
+ \## Documentation
30
+
31
+ \- docs(web): clarify `findPort()` vs `connectPort()` API differences
32
+
33
+ \- docs: add Python compatibility notes for calibration files
34
+
35
+ \## Refactor
36
+
37
+ \- refactor: unify `CalibrationResults` type across Node.js and Web packages
38
+
39
+ \- refactor: remove legacy type aliases and old `src` folder structure
docs/conventions.md CHANGED
@@ -246,6 +246,15 @@ packages/
246
  - Shared constants and protocols via dedicated utils
247
  - Cross-platform compatibility for data formats (calibration files, etc.)
248
 
 
 
 
 
 
 
 
 
 
249
  **CLI Architecture & Separation of Concerns:**
250
 
251
  - **Library (`@lerobot/node`)**: Pure programmatic API for Node.js applications
@@ -512,9 +521,24 @@ const response = await new Promise((resolve, reject) => {
512
 
513
  ### Development Process Requirements
514
 
515
- #### CLI Build Process
 
 
 
 
 
 
 
 
 
516
 
517
- - **Critical**: After TypeScript changes, MUST run `pnpm run build` to update CLI
 
 
 
 
 
 
518
  - **Global CLI**: `lerobot` command uses compiled `dist/` files, not source
519
  - **Testing Flow**: Edit source β†’ Build β†’ Test CLI β†’ Repeat
520
  - **Common Mistake**: Testing source changes without rebuilding CLI
@@ -746,18 +770,11 @@ private handleKeyboardInput(key: string): void {
746
 
747
  **Package Development Without Constant Rebuilding:**
748
 
749
- **βœ… PERFECT Development Setup:**
750
 
751
- 1. **Terminal 1**: `cd packages/node && pnpm dev` (watch mode)
752
- 2. **Terminal 2**: `cd packages/cli && pnpm dev teleoperate ...` (direct TypeScript execution)
753
-
754
- **❌ WRONG**: Constantly running `pnpm build` and clearing `node_modules`
755
-
756
- **Why This Works:**
757
-
758
- - Node package rebuilds automatically on changes
759
- - CLI dev mode uses `vite-node` to run TypeScript directly
760
- - No package caching issues, immediate feedback
761
 
762
  ##### πŸ”§ CLI Architecture Lessons
763
 
 
246
  - Shared constants and protocols via dedicated utils
247
  - Cross-platform compatibility for data formats (calibration files, etc.)
248
 
249
+ **Critical API Design: Node.js `findPort()` vs `connectPort()` Separation**
250
+
251
+ - **`findPort()`**: Discovery only - returns `DiscoveredPort[]` with `path` and `robotType`
252
+ - **`connectPort(portPath, robotType, robotId)`**: Connection only - returns `RobotConnection`
253
+ - **Beginner Flow**: `findPort()` β†’ pick from results β†’ `connectPort()` β†’ use robot
254
+ - **Advanced Flow**: Direct `connectPort()` when port is known
255
+ - **Why Separated**: Node.js can programmatically list ports (unlike browser security model)
256
+ - **Python Compatibility**: Matches Python lerobot's separation of discovery vs connection
257
+
258
  **CLI Architecture & Separation of Concerns:**
259
 
260
  - **Library (`@lerobot/node`)**: Pure programmatic API for Node.js applications
 
521
 
522
  ### Development Process Requirements
523
 
524
+ #### Optimized Development Workflow (No Constant Rebuilding)
525
+
526
+ **βœ… PERFECT Development Setup:**
527
+
528
+ 1. **Terminal 1**: `cd packages/node && pnpm dev` (watch mode)
529
+ 2. **Terminal 2**: `cd packages/cli && pnpm dev teleoperate ...` (direct TypeScript execution)
530
+
531
+ **❌ WRONG**: Constantly running `pnpm build` and clearing `node_modules`
532
+
533
+ **Why This Works:**
534
 
535
+ - Node package rebuilds automatically on changes
536
+ - CLI dev mode uses `vite-node` to run TypeScript directly
537
+ - No package caching issues, immediate feedback
538
+
539
+ #### CLI Build Process (Production Only)
540
+
541
+ - **Critical**: After TypeScript changes, MUST run `pnpm run build` to update CLI for production
542
  - **Global CLI**: `lerobot` command uses compiled `dist/` files, not source
543
  - **Testing Flow**: Edit source β†’ Build β†’ Test CLI β†’ Repeat
544
  - **Common Mistake**: Testing source changes without rebuilding CLI
 
770
 
771
  **Package Development Without Constant Rebuilding:**
772
 
773
+ **βœ… PERFECT Development Setup (documented above in Development Process Requirements):**
774
 
775
+ - Use `pnpm dev` for watch mode development
776
+ - Use `vite-node` for direct TypeScript execution
777
+ - Avoid constant rebuilding and `node_modules` clearing
 
 
 
 
 
 
 
778
 
779
  ##### πŸ”§ CLI Architecture Lessons
780