release: v2.1.8 - restore npm run setup-device on the v2 remote API - #47
Merged
Merged
Conversation
Adds a per-version changelog under docs/changelog/v1/ and v2/ for every shipped release, written from the published npm tarballs (1.x-2.1.0) and from each release commit's diff (2.1.1 onward). Breaking changes that shipped in minor or patch releases are called out with upgrade steps. v2.1.1 onward were released on GitHub but have not reached npm.
Adds docs/changelog/v2/v2.1.7.md and reorganizes the README to the CLDMV layout: intro, badges, What's New (v2.1.7 Latest plus four recent releases linking their changelog files), key features, installation with Node.js and ADB requirements, quick start, usage, API, documentation index, contributing, links and license. Install and import examples now use the real package name @cldmv/node-android-tv-remote, the broken promise-chain example is fixed, and createAndroidTVRemote is documented.
Replace the MIT license with the Apache License 2.0 in LICENSE, package.json and the README.
scripts/setup-device.mjs still imported src/lib/adb/setup.mjs, which was removed in v2.1.0, so `npm run setup-device` died with a module-not-found error. The setup steps still exist on the v2 remote (setSettings, ensureAwake, press.home), so the script now drives those through createRemote() instead of the removed AndroidTVSetup helper: connect, apply the keep-awake settings, wake the device, return to the home screen and always disconnect. All scripts now run their CLI only when executed directly and export main(), so tests/scripts.test.vitest.mjs can import every file under scripts/ — a dangling import there now fails CI. The setup flow is covered against a fake remote (no ADB or network). Fixes #42
…nheard error All remotes shared one module-level EventEmitter, so with two TVs each remote's listeners received the other's connect, log and error events, and off() on one affected the other (#43). The emitter and the emitLog / emitError / handleDisconnectError helpers are now created per remote by createEventChannel() inside createRemote(). An `error` event with no listener made EventEmitter throw, crashing the consumer on the first connection or protocol error — including a failed auto-connect inside createRemote(), before a listener could be attached (#44). emitError now emits `error` only when a listener exists; otherwise it emits a `log` event with level "error" (the Error in data.error) and writes to NODE_DEBUG=android-tv-remote. The failing operation still surfaces the error: commands reject, connect()/disconnect() resolve with the Error as before, and initPromise rejects. initPromise also gets a no-op handler so a failed auto-connect isn't an unhandled rejection for callers who never await it. Tests mock @devicefarmer/adbkit (no ADB, device or socket): two remotes are independent for internal events, custom emits and off(); errors with and without a listener for connect, keyboard.key and auto-connect. Fixes #43 Fixes #44
Contributor
Author
🔒 Dependency Review
|
Contributor
Author
|
| File | Raw | Δ Raw | Gzipped | Δ Gzipped |
|---|---|---|---|---|
| index.cjs | 1.5 kB | — | 787 B | — |
| index.mjs | 898 B | — | 477 B | — |
| scripts/postinstall.mjs | 2.8 kB | +410 B (+16.4%) |
1.1 kB | +158 B |
| scripts/setup-device.mjs | 3.4 kB | +1.8 kB (+120.0%) |
1.5 kB | +702 B |
| scripts/wake-tv.mjs | 1.8 kB | +496 B (+37.5%) |
956 B | +226 B |
| src/lib/android-tv-remote.mjs | 67.8 kB | +1.5 kB (+2.3%) |
16.0 kB | +472 B |
| Total | 78.2 kB | +4.2 kB | 20.8 kB | +1.5 kB |
📊 Generated by bundle-size. Brotli sizes also measured but omitted from the table for brevity.
Bumps @cldmv/fix-headers to 2.1.4 and re-runs npm run fix:headers. 0 files' headers were restamped.
Bumps @cldmv/fix-headers from 2.1.4 to 2.2.0. No file headers changed.
Raises the range from ^1.2.0 (locked 1.2.0) to ^1.2.4. Configs 1.2.4 sets forceAuthorUpdate and forceLastModifiedAuthorUpdate to false, so with fix-headers 2.2.0 @author is never rewritten and @last modified by changes only on real content edits. Ran fix:headers under the new config: 0 files restamped.
Shinrai
approved these changes
Oct 5, 2026
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.
@cldmv/node-android-tv-remote v2.1.8 Changelog
Release Date: October 2026
Release Type: Patch
Branch:
release/2.1.8Overview
Version 2.1.8 makes remotes independent of each other and stops an unheard
errorevent from crashing the process. Each remote now has its own event emitter, so two TVs no longer see each other's events. When noerrorlistener is attached, an error is logged instead of thrown, and the failing call still reports it. It also restoresnpm run setup-device, which had been broken since v2.1.0, and relicenses the package under Apache-2.0. The dev tooling for file headers moves to@cldmv/fix-headers2.2.0 and@cldmv/configs1.2.4.🐛 Bug Fixes
Each remote has its own event emitter (#46, fixes #43)
The event emitter and its helper functions were created once at module level and shared by every remote returned by
createRemote(). With two TVs, listeners on one remote received the other remote's connect, disconnect, log and error events, andoff()on one affected the other. Every remote now gets its own emitter.An
errorwith no listener no longer crashes the process (#46, fixes #44)The remote is an event emitter, and Node.js throws when
erroris emitted with no listener. Even a failed auto-connect insidecreateRemote(), before the caller could attach a listener, crashed the process. Nowerroris emitted only when a listener is attached. Otherwise the error goes out as alogevent with level"error"(theErroris indata.error) and toNODE_DEBUG=android-tv-remote. The failing call still reports it: commands reject andinitPromiserejects. A failed auto-connect is no longer an unhandled promise rejection for callers who never awaitinitPromise.connect()anddisconnect()still resolve with theErrorrather than rejecting, as before.npm run setup-deviceworks again (#45, fixes #42)scripts/setup-device.mjsimportedsrc/lib/adb/setup.mjs, which was deleted in v2.1.0, so the script failed with a module-not-found error, and it was still published. It now runs the setup steps through the v2 remote: connect, apply the keep-awake settings withsetSettings, wake the device withensureAwake, go to the home screen, and always disconnect, even when a step fails. All three scripts inscripts/now run their command only when executed directly and exportmain(), so importing them has no side effects.📄 License
The package is relicensed from MIT to Apache-2.0 (#41). The repository now has a
LICENSEfile; before this it had none, althoughpackage.jsondeclared MIT.🧪 Tests
tests/scripts.test.vitest.mjsimports every file underscripts/, so a dangling import fails CI, and tests the setup flow against a fake remote.tests/events.test.vitest.mjsmocks@devicefarmer/adbkit, so no real ADB or network connections are made. It checks that two remotes are independent, and that errors with and without a listener are reported correctly forconnect,keyboard.keyand auto-connect.📚 Documentation
android-tv-remote).errorlistener is optional and describes where unheard errors go (#48).🔧 Dependencies
Both are dev dependencies and affect only the
npm run fix:headersscript, which extends@cldmv/configs/fix-headers.json. Onlypackage.jsonand the lockfile changed; no file headers were restamped and the published package is unaffected.@cldmv/fix-headers^2.1.1→^2.2.0, in two steps. 2.1.4 (#50) no longer writes a JavaScript comment into JSON or Markdown files, processes every repeated--input, and never walks dependency folders such asnode_modules. 2.2.0 (#52) makes@Last modified byfollow edits to a file's content only, so a run that merely rewrites a header keeps the recorded editor.@cldmv/configs^1.2.0→^1.2.4(#52). The shared fix-headers config now setsforceAuthorUpdateandforceLastModifiedAuthorUpdatetofalse, so@Authorkeeps the file's creator and@Last modified bychanges only with real content edits. The 1.2.1 and 1.2.2 releases of that package only changed its own CI.Upgrade notes
errorcrashed it no longer crashes: listen forerror, or forlogevents with level"error", if you want to act on failures without awaiting the call.👥 Contributors
Avg: 26.9% ·
f5dcd8f· Node lts/*Co-authored-by: Shinrai Shinrai@users.noreply.github.com