Skip to content

Commit 7b09e20

Browse files
authored
Merge pull request #1153 from pollen-robotics/origin/1152-port-reachy-mini-sdkjs-to-ts
port reachy-mini-sdk.js to ts
2 parents 8fabda6 + a218db6 commit 7b09e20

63 files changed

Lines changed: 2522 additions & 3065 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/npm-publish.yml

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ on:
88
branches:
99
- main
1010
paths:
11-
- "js/**"
11+
- "ts/**"
1212
- ".github/workflows/npm-publish.yml"
1313
pull_request:
1414
paths:
15-
- "js/**"
15+
- "ts/**"
1616
- ".github/workflows/npm-publish.yml"
1717

1818
jobs:
@@ -23,7 +23,7 @@ jobs:
2323
id-token: write # required for npm trusted publishing (OIDC)
2424
defaults:
2525
run:
26-
working-directory: js
26+
working-directory: ts
2727
steps:
2828
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
2929
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
@@ -32,17 +32,19 @@ jobs:
3232
registry-url: "https://registry.npmjs.org"
3333

3434
# Install deps for the single npm package
35-
# (@pollen-robotics/reachy-mini-sdk). The SDK runtime is plain
36-
# JS at js/reachy-mini-sdk.js; the optional host shell lives
37-
# under js/host/ and is bundled by `npm run build` into
38-
# js/host/dist/, surfaced via the `./host*` subpath exports.
39-
- name: Install JS package dependencies
35+
# (@pollen-robotics/reachy-mini-sdk). The SDK runtime lives at
36+
# ts/reachy-mini-sdk.ts (+ ts/lib/*.ts) and is compiled to
37+
# ts/dist/ by `npm run build:sdk`. The optional host shell lives
38+
# under ts/host/ and is bundled by `npm run build:host` into
39+
# ts/host/dist/, surfaced via the `./host*` subpath exports.
40+
- name: Install package dependencies
4041
run: npm ci
4142

42-
# Build the host bundles into host/dist/. Required for the
43-
# `./host`, `./host/auto`, `./host/embed`, and `./host/protocol`
44-
# subpath exports to resolve in the published tarball.
45-
- name: Build host bundles
43+
# Build the SDK dist/ + host bundles into host/dist/. Required
44+
# for the `.`, `./host`, `./host/auto`, `./host/embed`, and
45+
# `./host/protocol` subpath exports to resolve in the published
46+
# tarball.
47+
- name: Build SDK and host bundles
4648
run: npm run build
4749

4850
# pyproject.toml is the single source of truth for the version.

.gitignore

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -262,12 +262,26 @@ src/reachy_mini/tools/camera_calibration/images_for_crop_analysis/*
262262
src/reachy_mini/tools/camera_calibration/images_for_crop_analysis_lite/*
263263
src/reachy_mini/tools/camera_calibration/*.yaml
264264

265-
# JavaScript (single npm package at js/)
266-
js/node_modules/
267-
js/host/dist/
268-
js/.vite/
265+
# TypeScript (single npm package at ts/)
266+
ts/node_modules/
267+
ts/dist/
268+
ts/host/dist/
269+
ts/.vite/
269270
# The unanchored `lib/` rule above (Python template, intended for
270-
# root-level build artefacts) also matches `js/host/src/lib/`,
271-
# which holds TypeScript source. Re-include it explicitly.
272-
!js/host/src/lib/
273-
!js/host/src/lib/**
271+
# root-level build artefacts) also matches `ts/host/src/lib/` and
272+
# `ts/lib/`, which hold TypeScript source. Re-include them explicitly.
273+
!ts/host/src/lib/
274+
!ts/host/src/lib/**
275+
!ts/lib/
276+
!ts/lib/**
277+
# Belt-and-suspenders: declaration outputs ONLY belong under dist/.
278+
# A stray `tsc` run (or an IDE on-save) can emit `.d.ts(.map)` next to
279+
# the source; never commit those. `ts/host/src/assets/svg.d.ts` is an
280+
# ambient declaration (hand-written, not generated) — kept by the rule
281+
# below.
282+
ts/lib/*.d.ts
283+
ts/lib/*.d.ts.map
284+
ts/*.d.ts
285+
ts/*.d.ts.map
286+
ts/host/src/**/*.d.ts.map
287+
!ts/host/src/assets/svg.d.ts

AGENTS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ Lifecycle (advanced — most consumers should just use `autoConnect()`): `authen
281281

282282
Events: `connected`, `disconnected`, `robotsChanged`, `streaming`, `sessionStopped`, `sessionRejected` (robot busy — inspect `e.detail.activeApp`), `state` (every ~500 ms), `videoTrack`, `micSupported`, `error`.
283283

284-
**Full API:** read the top ~90 lines of [`js/reachy-mini-sdk.js`](js/reachy-mini-sdk.js) — the file header is a complete reference.
284+
**Full API:** read the top ~60 lines of [`ts/reachy-mini-sdk.ts`](ts/reachy-mini-sdk.ts) — the file header is a complete reference.
285285

286286
### Iframe-embedded apps (mobile shell, vibe-coder preview)
287287

docs/source/SDK/javascript-sdk.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ import { ReachyMini } from "https://cdn.jsdelivr.net/npm/@pollen-robotics/reachy
8787
> import { mountHost } from "@pollen-robotics/reachy-mini-sdk/host/auto";
8888
> import { connectToHost } from "@pollen-robotics/reachy-mini-sdk/host/embed";
8989
> ```
90-
> See the [host README](https://github.com/pollen-robotics/reachy_mini/tree/main/js/host) for the full integration recipe.
90+
> See the [host README](https://github.com/pollen-robotics/reachy_mini/tree/main/ts/host) for the full integration recipe.
9191
9292
### 3. Connect to your robot
9393

0 commit comments

Comments
 (0)