Repository navigation
feat: use @cldmv/droidsock instead of @devicefarmer/adbkit - #95
Merged
Merged
Conversation
Shinrai
force-pushed
the
feat/droidsock
branch
from
November 8, 2026 08:41
4cdf3c9 to
354a94c
Compare
The remote now talks to the device through droidsock's own ADB client, so the adb command-line tool and its server are no longer needed, and the postinstall check for adb is gone. Connection upkeep moves to droidsock: maintainConnection turns on its heartbeat and automatic reconnect with backoff, replacing the hand-rolled heartbeat and the periodic "adb devices" check (connectionCheckInterval is now ignored). Its lifecycle events keep the connected state and the log channel in step with the socket. Calls droidsock has no equivalent for are built on shell: screencap captures the PNG in memory through a latin1 round trip, and waitBootComplete polls sys.boot_completed, passing the time left to each shell call so a hung device can't outlast the timeout. With autoConnect off, a command on a remote that never connected now rejects with "Device not connected". getConnectionStatus no longer returns "unknown". engines.node moves to >=22.15.0 to match droidsock. The dev-only adb-response tool, which used adbkit, is removed. The adb-client tests are ported to the droidsock mock, and a new test runs the real droidsock against a fake device on a local socket. @cldmv/slothlet is held at 3.22.1 through overrides because 3.24.0 breaks real sockets with "Illegal invocation" (CLDMV/slothlet#708). The override only affects this repo's own install: this must not ship until slothlet 3.24.1 is on npm.
Shinrai
force-pushed
the
feat/droidsock
branch
from
November 8, 2026 21:49
354a94c to
0871711
Compare
cldmv-bot Bot
added a commit
that referenced
this pull request
Nov 22, 2026
# `@cldmv/node-android-tv-remote` v2.3.0 Changelog **Release Date**: November 2026 **Release Type**: Minor **Branch**: `release/2.3.0` --- ## Overview Version 2.3.0 replaces `@devicefarmer/adbkit` with `@cldmv/droidsock`, which speaks the ADB protocol itself. The `adb` command-line tool and its server are no longer needed to drive a device, and the install-time check for `adb` is gone. Keeping the connection alive also moves to droidsock: `maintainConnection` now turns on its heartbeat and its automatic reconnect with backoff, in place of the remote's own heartbeat timer and periodic `adb devices` check. The exported API (`createRemote`, `createAndroidTVRemote` and the default export, from both `import` and `require()`) is unchanged. `engines.node` rises from `>=22.12.0` to `>=22.15.0`, the floor droidsock declares. See [Requirements](#-requirements) and the upgrade notes. --- ## 📦 Requirements ### Node.js `>=22.15.0` is now required ([#95](#95)) `engines.node` goes from `>=22.12.0` to `>=22.15.0`, matching `@cldmv/droidsock` 2. `require()` loads the ESM build through Node's `require(esm)`, which runs without warnings on that floor, so the message `require()` throws on an older Node.js now names `>=22.15.0`. ### The `adb` binary is optional ([#95](#95)) The remote no longer shells out to `adb` or needs its server running. Install `adb` only for your own use, such as the `setup-device` steps in the README. The `postinstall` script that printed install instructions when `adb` was missing has been removed, along with `scripts/postinstall.mjs` in the published package. --- ##⚠️ Behavior changes ### Connection upkeep comes from droidsock ([#95](#95)) With `maintainConnection` on (the default), the remote enables droidsock's heartbeat (every `heartbeatInterval` ms, 20 seconds by default) and its automatic reconnect with backoff. A dropped connection is noticed by the socket and the heartbeat and reconnected without waiting for a polling interval. Reconnect attempts, successful reconnects and giving up are reported through the `log` channel, and the connected state follows the socket. - `connectionCheckInterval` is deprecated and ignored. - `getConnectionStatus()` returns `"connected"` or `"disconnected"`; it no longer returns `"unknown"`. - With `autoConnect` off, a command on a remote that never connected rejects with `Device not connected`. ### Calls without a droidsock equivalent run through `shell` ([#95](#95)) `screencap()` captures the PNG in memory over `shell`, and `waitBootComplete()` polls `sys.boot_completed`. Each poll gets only the time left before the timeout, so a hung device can't keep `waitBootComplete()` waiting past it. --- ## 🧪 Tests - The adb-client and event tests use a droidsock mock, and a new test runs the real droidsock against a fake device on a local socket ([#95](#95)). - `npm run test:dist` builds the package and runs the suite against `dist/`; `npm test` now includes it. The tests import the package by name, and a resolve test checks each run loaded the tree it meant to ([#96](#96)). - The vitest config sets the `node-android-tv-remote-dev` condition with `devCondition()` from `@cldmv/configs`. The `test.nodeOptions` it used before isn't a Vitest option, so the condition never reached the test workers ([#93](#93)). ## 🔧 CI & tooling - The dev-only `dev/tools/adb-response.mjs` tool, which was built on adbkit, has been removed ([#95](#95)). ## 📚 Documentation - The README requirements list Node.js 22.15.0, and the ADB install section is marked optional ([#95](#95)). - The README describes `npm run test:dist` ([#96](#96)). - The `heartbeatInterval` JSDoc gives the real 20-second default ([#95](#95)). - **NEW:** [docs/changelog/v2/v2.3.0.md](https://github.com/CLDMV/node-android-tv-remote/blob/v2.3.0/docs/changelog/v2/v2.3.0.md) — this changelog. ## 🔧 Dependencies Runtime: - `@devicefarmer/adbkit` `^4.0.1` removed, `@cldmv/droidsock` added ([#95](#95)). adbkit's `commander`, `node-forge`, `split`, `adbkit-logcat` and `adbkit-monkey` are no longer installed. - `@cldmv/droidsock` `^2.2.0` → `^2.2.1` ([#111](#111)). droidsock 2.2.1 keeps `@cldmv/slothlet` below 3.24.0, whose stand-ins for sockets made `connect()` throw `Illegal invocation` ([CLDMV/slothlet#708](CLDMV/slothlet#708)). The `@cldmv/slothlet` override this repository carried for its own install is removed. Development only: - `@cldmv/configs` `^1.3.0` → `^1.4.0`, for `devCondition()` ([#93](#93)). --- ## Upgrade notes - **Node.js `>=22.15.0` is required.** On Node.js 22.12 to 22.14, stay on [v2.2.1](https://github.com/CLDMV/node-android-tv-remote/blob/v2.3.0/docs/changelog/v2/v2.2.1.md). - You can uninstall `adb` if nothing else needs it. - Drop `connectionCheckInterval` from your config; it has no effect. Use `heartbeatInterval` to tune how fast a dead connection is noticed. - Code that checked `getConnectionStatus()` for `"unknown"` can drop that branch. <details> <summary>👥 Contributors</summary> - @Shinrai </details> --- <!-- coverage-start -->  | Metric | Coverage | |--------|----------| | Statements | 95.3% | | Branches | 85.3% | | Functions | 97.6% | | Lines | 95.4% | *Avg: **93.4%** · `00d3d51` · Node lts/** <!-- coverage-end --> <!-- co-authors --> Co-authored-by: Shinrai <[email protected]>
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.
Swaps @devicefarmer/adbkit for @cldmv/droidsock, so the adb binary and server are no longer needed and the postinstall adb check is gone. maintainConnection now uses droidsock's heartbeat and auto-reconnect; connectionCheckInterval is ignored. engines.node goes to >=22.15.0 to match droidsock.
Rebased onto next after #96, and the new tests import the package by name so test:dist covers them.
slothlet is pinned to 3.22.1 through overrides because 3.24.0 breaks real sockets (CLDMV/slothlet#708). That only affects this repo's install, but the release has to wait for 3.24.1 and a follow-up PR that drops the override.