feat(js): merge host package into reachy-mini-sdk#1141
Merged
Conversation
Fold @pollen-robotics/reachy-mini-host into @pollen-robotics/reachy-mini-sdk
so app authors install, version, and import from a single entry point:
import { ReachyMini } from '@pollen-robotics/reachy-mini-sdk';
import { mountHost } from '@pollen-robotics/reachy-mini-sdk/host/auto';
import { connectToHost } from '@pollen-robotics/reachy-mini-sdk/host/embed';
import { PROTOCOL_VERSION } from '@pollen-robotics/reachy-mini-sdk/host/protocol';
Layout changes
- js/host/ -> js/sdk/host/ (whole directory)
- js/host/src/lib/sdk-types -> js/sdk/reachy-mini-sdk.d.ts (canonical types,
shipped as .d.ts companion to the SDK runtime;
host re-exports from the new location)
- js/package.json (workspaces) deleted; js/sdk/ is now the only npm package
- js/package-lock.json moved to js/sdk/package-lock.json
Package surface
- New subpath exports on @pollen-robotics/reachy-mini-sdk:
./host (mountHost + types)
./host/auto (CDN auto bundle)
./host/embed (CDN embed bundle)
./host/protocol (PROTOCOL_VERSION + helpers)
- Host React/MUI deps and devDeps moved into js/sdk/package.json
- Single build script (`npm run build`) drives vite + tsc for the host bundles
- CI publishes one tarball instead of two (--workspace flags dropped)
Runtime cleanup
- entry/auto.ts, entry/embed.ts and the `./host` npm entry now import
ReachyMini directly from the SDK module and self-assign window.ReachyMini
(when unset) at module-load time, dispatching reachymini:ready before
exposing window.ReachyMiniHost / ReachyMiniHostEmbed. Apps that consume
the host no longer need a separate `<script type="module">` to load the
SDK on the global; legacy apps that still set it themselves are
untouched (we only assign when missing).
- Log-prefix tag harmonised to [reachy-mini-sdk/host] / [reachy-mini-sdk/host/embed]
for greppability.
Docs
- js/README.md rewritten for single-package layout + migration note
- js/sdk/README.md adds the ./host subpath section + migration note
- js/sdk/host/{README,SPEC,APP_AUTHOR_GUIDE,CHANGELOG}.md updated to the
new import paths
- docs/source/SDK/javascript-sdk.md cross-links the host subpaths
Compat
- @pollen-robotics/reachy-mini-host stays available on npm at its current
version for one minor cycle to give consumers time to switch, then will
be deprecated with a pointer to the new subpaths.
Co-authored-by: Cursor <cursoragent@cursor.com>
|
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
… js/ Now that there is only one npm package, the `sdk/` directory level no longer carries meaning. Move everything up one level so: js/ ├── package.json # @pollen-robotics/reachy-mini-sdk ├── package-lock.json ├── README.md # the published package README ├── LICENSE ├── reachy-mini-sdk.js ├── reachy-mini-sdk.d.ts └── host/ # was js/sdk/host/ No public-API change. Internal updates: - `js/package.json`: `repository.directory` "js/sdk" → "js". - `.github/workflows/npm-publish.yml`: `working-directory: js/sdk` → `js`, and the `pyproject.toml` relative path goes from `../../pyproject.toml` back to `../pyproject.toml`. - `.gitignore`: prefixes shed (`js/sdk/node_modules` → `js/node_modules`, `js/sdk/host/dist` → `js/host/dist`, etc.). - `tests/unit_tests/test_no_token_in_urls.py` and `tests/unit_tests/test_js_protocol_sync.py`: SDK path `js/sdk/reachy-mini-sdk.js` → `js/reachy-mini-sdk.js`. - `AGENTS.md`, `docs/source/SDK/javascript-sdk.md`, `js/host/CHANGELOG.md`, `js/host/src/lib/sdk-types.ts`: stale `js/sdk/...` link / comment refs updated. - `js/sdk/README.md` (the workspace overview that lived alongside the published one) is gone; the package README at `js/README.md` is now the only one. Relative imports inside the host (`../../reachy-mini-sdk`, `../../../reachy-mini-sdk`) stay valid because the host moved up one level along with everything else — same number of `..` hops to reach the SDK runtime. `npm install && npm run typecheck && npm run build && npm pack --dry-run` from `js/` is clean; tarball is byte-identical in shape to the previous commit (1.7 MB, 85 files). Co-authored-by: Cursor <cursoragent@cursor.com>
- `pyproject.toml`: 1.7.3 → 1.8.1 (drives the npm package version via the publish CI). `uv.lock` regenerated. - `js/host/CHANGELOG.md` → `js/CHANGELOG.md`: now that the host is a subpath of the SDK, the changelog covers the whole package. - 1.8.1 entry rewritten as the headline release note: package merge (host folded in), new `./host*` subpath exports, runtime cleanup (host bundles import the SDK directly + auto-install `window.ReachyMini`), repo layout collapse, and the SDK changes that landed earlier in the 1.8 cycle but weren't yet published. - `js/package.json`: `files` array swaps `host/CHANGELOG.md` for the package-root `CHANGELOG.md`. - `js/README.md` cross-links the new CHANGELOG location; the host README cross-links it as `../CHANGELOG.md`. Why 1.8.1 and not 1.8.0 - 1.8.0 had been earmarked internally for a different in-flight bump; using 1.8.1 keeps a clean number for the unified-package release without competing with that train. npm publish CI is unchanged; it will read 1.8.1 from `pyproject.toml` and publish the single `@pollen-robotics/reachy-mini-sdk` tarball on the next push to `main` (with `-main.<sha>` suffix) or on the next GitHub release (with the `latest` dist-tag). Co-authored-by: Cursor <cursoragent@cursor.com>
The previous commit (8b77153) pinned `pyproject.toml` to `1.8.1` inside the PR. The convention in this repo is to bump the version at release time (cf. `d0d3ba28 bump to 1.7.3`, `22f862bc enhancement #1077: bump to 1.7.1`), not in feature PRs. Revert: - `pyproject.toml`: `1.8.1` → `1.7.3` (back to the previous released version; the npm `main` channel currently serves `1.7.3-main.<sha>`). - `uv.lock`: regenerated to match. - `js/CHANGELOG.md`: the `1.8.1 - unreleased` header is now `Unreleased — succeeds 1.7.3`. The intro explicitly states the target version is left unset and will be picked at release time. No other content reverted: the merge structure, CHANGELOG body, and CI workflow stay as-is. Whoever cuts the next release just needs to: 1. Bump `pyproject.toml` (likely a minor bump given the breaking import-path change for `@pollen-robotics/reachy-mini-host` consumers, but the exact number is a release-time decision). 2. `uv lock --upgrade-package reachy-mini`. 3. Rename the `Unreleased — succeeds 1.7.3` header in `js/CHANGELOG.md` to `<version> - YYYY-MM-DD`. 4. Push the GitHub release; npm publish CI takes over. Co-authored-by: Cursor <cursoragent@cursor.com>
FabienDanieau
approved these changes
May 21, 2026
`tests/unit_tests/test_js_protocol_sync.py` carries the SDK file path in a module-level constant (`JS_SDK_PATH`) on top of the docstring reference I'd already updated. The `js/sdk/` collapse left the constant pointing at the old location, so the three tests that read `js/sdk/reachy-mini-sdk.js` (command type sync, field shape sync, error code sync) failed with `FileNotFoundError`. Bring the constant in line with the actual layout (`js/reachy-mini-sdk.js`). All 6 JS-protocol-related tests now pass; the other unrelated failures in `tests/unit_tests/` are the pre-existing audio / daemon / placo / video / wireless ones that need hardware or system deps absent on this machine. Co-authored-by: Cursor <cursoragent@cursor.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fold
@pollen-robotics/reachy-mini-hostinto@pollen-robotics/reachy-mini-sdkso app authors install, version, and import from a single entry point. The SDK and the host shell already shipped in lockstep (single repo, single release); the second package was just extra friction.What changes
Layout
js/host/→js/sdk/host/(the whole directory; git tracks it as a pure rename so blame survives)js/sdk/host/src/lib/sdk-types.ts→js/sdk/reachy-mini-sdk.d.ts(the canonical type declarations now ship as the.d.tscompanion next to the SDK runtime; host re-exports them from the new location)js/package.json(workspace root) deleted: there is now a single npm package,js/sdk/js/package-lock.json→js/sdk/package-lock.jsonPackage surface (
js/sdk/package.json)Single package, new subpath exports:
.reachy-mini-sdk.jsReachyMiniclass (unchanged)./hosthost/dist/index.jsmountHost,connectToHost, types./host/autohost/dist/entry/auto.js./host/embedhost/dist/entry/embed.js./host/protocolhost/dist/lib/protocol.jsPROTOCOL_VERSION, helpersReact/MUI/Emotion deps + devDeps for the host build moved into the SDK package.
npm run build(fromjs/sdk/) drives vite + tsc end-to-end.Runtime cleanup
The host's
entry/auto.ts,entry/embed.tsand the./hostnpm entry now importReachyMinidirectly from the SDK module and self-assignwindow.ReachyMini(when unset) before exposingwindow.ReachyMiniHost/window.ReachyMiniHostEmbed. Effects:<script type="module">to load the SDK on the global.window.ReachyMinithemselves are untouched (we only assign when missing).useSdk/connectToHoststop racing against a late-arriving global.Log-prefix tag harmonised to
[reachy-mini-sdk/host]/[reachy-mini-sdk/host/embed]for greppability.CI
.github/workflows/npm-publish.ymlsimplified: onenpm ci, onenpm run build, onenpm publish(no more--workspace=sdk/--workspace=hostpairs). The version-from-pyproject.tomlflow is unchanged.Docs
js/README.mdrewritten for the single-package layout (with a migration note).js/sdk/README.mdadds the./hostsubpath section + migration note.js/sdk/host/{README,SPEC,APP_AUTHOR_GUIDE,CHANGELOG}.mdupdated to the new import paths.docs/source/SDK/javascript-sdk.mdcross-links the host subpath exports.Compat / rollout
@pollen-robotics/reachy-mini-hoststays available on npm at its current version for one minor cycle so consumers can switch on their own schedule, then we'llnpm deprecateit with a pointer to the new subpaths. The post-deprecation tarball is a tiny shim that re-exports from@pollen-robotics/reachy-mini-sdk/host.reachy_mini_emotions,reachy_mini_telepresence,reachy_mini_minimal_conversation) are already on^1.7.3of both packages and have been independently migrated to the new import paths (see the corresponding app repos).Test plan
cd js/sdk && npm ci && npm run typecheck && npm run build(clean)cd js/sdk && npm pack --dry-run— single tarball, containsreachy-mini-sdk.js,reachy-mini-sdk.d.ts,host/dist/,host/{README,SPEC,APP_AUTHOR_GUIDE,CHANGELOG}.mdjs/sdk/)host/dist/entry/auto.jsfrom a local Space — host renders,window.ReachyMiniis set without an SDK script tagmountHostfrom@pollen-robotics/reachy-mini-sdk/hostin a bundler-driven app, confirm SDK is initialised beforeuseSdkreads itMade with Cursor