Skip to content

release: v2.2.0 - adopt the CLDMV library layout with a tsup build - #67

Merged
cldmv-bot[bot] merged 23 commits into
masterfrom
next
Nov 2, 2026
Merged

cldmv-bot[bot] merged 23 commits into
masterfrom
next

Conversation

@cldmv-bot

@cldmv-bot cldmv-bot Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

@cldmv/node-android-tv-remote v2.2.0 Changelog

Release Date: November 2026
Release Type: Minor
Branch: release/2.2.0


Overview

Version 2.2.0 moves the package to the CLDMV library layout with a tsup build, moves the runtime dependency @devicefarmer/adbkit to its new major 4, and fixes two long-standing bugs: waitBootComplete(timeout) now actually stops waiting at its timeout, and screencap() with a filepath no longer reports the file saved before it is written.

The supported Node.js range changes: engines.node goes from >=20.9.0 to >=22.22.0, and @devicefarmer/adbkit 4 itself requires Node.js 22.12 or later. That is a real requirement change even though it ships in a minor release; see Breaking Changes and the upgrade notes. The exported API (createRemote, createAndroidTVRemote and the default export, from both import and require()) is unchanged.


💥 Breaking Changes

Node.js >=22.22.0 is now required (#81)

engines.node was >=20.9.0 in v2.1.9 (set by sharp), with require() documented as needing ^20.19.0 or >=22.12.0. Both are now >=22.22.0. The new build toolchain no longer runs on Node.js 20 (tsup 9 alone declares ^22.18.0 || ^24.11.0 || >=26.0.0), and @devicefarmer/adbkit 4 declares >= 22.12, so Node.js 20 is no longer supported at runtime either. The floor is set to 22.22.0, the oldest version the CI and publish matrices now test. The ERR_REQUIRE_ESM message that require() throws on a Node.js without require(esm) now names >=22.22.0.

npm prints an EBADENGINE warning when installing on an older Node.js, and the install fails when engine-strict is set.

waitBootComplete() now rejects at its timeout (#84, fixes #85)

This is a bug fix, listed here because it changes what a caller sees. waitBootComplete(timeout = 60000) documented a timeout but never passed it on, so the call waited until the device finished booting, however long that took. See Bug Fixes for the details.


🐛 Bug Fixes

waitBootComplete(timeout) honors its timeout (#84, fixes #85)

The remote now hands adbkit 4 an AbortSignal.timeout(timeout). When it fires, adbkit closes the connection and rejects with a TimeoutError; the remote logs the existing "Boot completion timeout after …ms" message, emits the error, and rejects. A call with no argument now gives up after the documented 60 seconds instead of waiting indefinitely.

screencap() finishes writing a resized screenshot before reporting it saved (#84, fixes #86)

With a filepath (and optionally width / height), the background save ended the file stream and emitted screencap-saved and screencap-complete straight away, before the data reached the file, and the file stream had no error listener. The capture, resize and file write now run through stream/promises pipeline(): the two events fire, and lastScreencapData is set, only after the file is fully written. A capture, resize or write failure tears the whole pipeline down and is reported as a screencap error with no completion events.


✨ Features

Library layout: src/ entries and a tsup build (#81, fixes #75)

The hand-written root index.mjs / index.cjs moved to src/index.mjs / src/index.cjs, and build is now tsup (tsup.config.mjs) instead of an echo stub:

  • dist/index.mjs is a minified ESM bundle of src/index.mjs, with names and node: specifiers kept. The keycode, keyboard and remote-key JSON tables are inlined. The runtime dependencies (@devicefarmer/adbkit, sharp) stay external.
  • dist/index.cjs is not a second bundle. It is a verbatim copy of src/index.cjs, the thin wrapper that loads ./index.mjs through Node's synchronous require(esm) and keeps the historical CommonJS shape (module.exports is createRemote, with createRemote, createAndroidTVRemote and default on it).

main / module point at dist/, exports adds ./package.json, and prepack runs the build so dist/ is never committed. The published files are now dist/ (without source maps) and scripts/postinstall.mjs, which still runs on install to check for adb. src/ and the other two helper scripts are no longer published: scripts/setup-device.mjs and scripts/wake-tv.mjs import src/, so they are checkout tools (npm run setup-device in a clone of this repository).

node-android-tv-remote-dev export condition (#81)

The "." export carries a node-android-tv-remote-dev condition that points import and require at src/. In a checkout, node --conditions=node-android-tv-remote-dev runs the unbuilt source; without it the package resolves to dist/, which npm run build produces. Installed copies only ship dist/.


🔧 CI & tooling

  • CI, release and bundle-size workflows run the real build (npm run build:ci: lint, format:check, then tsup), including the coverage legs (coverage_build_command) (#81).
  • The bundle-size check measures dist/**.mjs / dist/**.cjs instead of the root entries, src/ and scripts/ (#81).
  • The CI and publish test matrices start at Node.js 22.22.0, the new package floor (#81).
  • vitest and test:cjs run with the node-android-tv-remote-dev condition, so the suite tests src/; test:cjs builds first and checks dist/. eslint.config.mjs moved into .configs/ (#81).
  • tmp/ is gitignored (#80).

🧪 Tests

  • adb-client.test.vitest.mjs mocks the adbkit client and device and drives every path that calls into adbkit: client creation, connect / disconnect, the heartbeat and connection check, auto-disconnect, key, long-press and text shell commands, setSettings, ensureAwake, reboot, screencap / thumbnail and waitBootComplete, plus a check that the real adbkit package still has every client, device and util method the remote calls. Line coverage of src/lib/android-tv-remote.mjs goes from 24% to 95% (#84).
  • entry.test.vitest.mjs covers src/index.cjs at the source level (#81).

📚 Documentation

  • The README states the >=22.22.0 requirement and documents npm run build and the node-android-tv-remote-dev condition for working from a checkout (#81).
  • NEW: docs/changelog/v2/v2.2.0.md — this changelog.

🔧 Dependencies

Runtime:

  • @devicefarmer/adbkit ^3.3.8 → ^4.0.1 (3.3.9 → 4.0.1 in the lockfile) (#84). adbkit 4 replaces bluebird with native promises, makes cancellation explicit with AbortSignal, adds an exports map that blocks deep imports, requires Node.js 22.12 or later, and moves to adbkit-logcat 3 and adbkit-monkey 2. The remote only imports the package root, only uses .then / .catch / await on adbkit promises, and doesn't use trackers, sync transfers, logcat or monkey, so no source change was needed beyond passing the new signal to waitBootComplete. bluebird is no longer installed.
  • sharp ^0.35.3 → ^0.35.5 (the lockfile was already on 0.35.5) (#82).

Development only:

  • tsup ^9.0.0 and typescript added with the build (#81); typescript is pinned to ^6.0.3, since TypeScript 7's JavaScript declaration emit isn't complete yet (#83).
  • overrides for katex (>=0.19.1 <1.0.0, 0.16.47 → 0.19.1) and minimatch (^11.0.3, 10.2.6 → 11.0.3) clear the dev-only advisories that come in through eslint and @eslint/markdown (#83).
  • Toolchain refresh (#82): @cldmv/configs 1.2.4 → 1.3.0, @cldmv/fix-headers 2.2.0 → 2.2.4, @cldmv/vitest-runner 1.5.3 → 1.5.6, vitest / @vitest/coverage-v8 5.0.3 → 5.0.5, eslint 10.12.0 → 10.14.0, @eslint/css 2.0.0 → 2.0.1, @eslint/json 2.1.0 → 2.1.1, globals 17.13.0 → 17.14.0, plus transitive fixes from npm audit fix (vite 8.3.2 → 8.3.5 among them).
  • prettier 3.9.9 → 3.9.10 (#66).

Upgrade notes

  • Node.js >=22.22.0 is required. Upgrade Node.js before upgrading the package. On Node.js 20, stay on v2.1.9.
  • waitBootComplete() now rejects once its timeout (60 seconds by default) passes. A caller that relied on it waiting indefinitely for a slow boot should pass a larger timeout and handle the rejection.
  • screencap-saved and screencap-complete now fire after the file is on disk, and a write failure arrives as a screencap error. Code that worked around the early events (for example by polling for the file) can drop the workaround.
  • The exported API is unchanged for both import and require(). Code that reached into src/ or scripts/setup-device.mjs / scripts/wake-tv.mjs inside the installed package must stop doing so; those files are no longer published.
👥 Contributors

coverage

Metric Coverage
Statements 94.8%
Branches 86.6%
Functions 97.5%
Lines 95.6%

Avg: 93.6% · b8963e3 · Node lts/*

Co-authored-by: Shinrai [email protected]

dependabot Bot and others added 3 commits October 14, 2026 20:33
Bumps the prettier group with 1 update: [prettier](https://github.com/prettier/prettier).


Updates `prettier` from 3.9.9 to 3.9.10
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](prettier/prettier@3.9.9...3.9.10)

---
updated-dependencies:
- dependency-name: prettier
  dependency-version: 3.9.10
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: prettier
...

Signed-off-by: dependabot[bot] <[email protected]>
Bumps the prettier group with 1 update:
[prettier](https://github.com/prettier/prettier).

Updates `prettier` from 3.9.9 to 3.9.10
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/prettier/prettier/releases">prettier's
releases</a>.</em></p>
<blockquote>
<h2>3.9.10</h2>
<ul>
<li>Markdown: Update <code>micromark-extension-gfm-table</code> to fix
the table parse issue on performance (<a
href="https://redirect.github.com/prettier/prettier/pull/20266">#20266</a>
by <a href="https://github.com/fisker"><code>@​fisker</code></a>)</li>
</ul>
<p>🔗 <a
href="https://github.com/prettier/prettier/blob/3.9.10/CHANGELOG.md#3910">Changelog</a></p>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/prettier/prettier/blob/main/CHANGELOG.md">prettier's
changelog</a>.</em></p>
<blockquote>
<h1>3.9.10</h1>
<p><a
href="https://github.com/prettier/prettier/compare/3.9.9...3.9.10">diff</a></p>
<h4>Markdown: Update <code>micromark-extension-gfm-table</code> to fix
the table parse issue on performance (<a
href="https://redirect.github.com/prettier/prettier/pull/20266">#20266</a>
by <a href="https://github.com/fisker"><code>@​fisker</code></a>)</h4>
<p>See <a
href="https://github.com/micromark/micromark-extension-gfm-table/commit/4f43ead37b786bc531d924530d4ab4c714886267">https://github.com/micromark/micromark-extension-gfm-table/commit/4f43ead37b786bc531d924530d4ab4c714886267</a>
for details.</p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/prettier/prettier/commit/1172b82c295c4f889fd787dc6c78c3e194ebf353"><code>1172b82</code></a>
Release 3.9.10</li>
<li><a
href="https://github.com/prettier/prettier/commit/d0142273aff2c76f8a69785d42ee2cedc4b0aaa3"><code>d014227</code></a>
Update <code>micromark-extension-gfm-table</code> to fix the table parse
issue on perfor...</li>
<li><a
href="https://github.com/prettier/prettier/commit/953b9084329dcd06ed1072a04b333f1e6e9371e8"><code>953b908</code></a>
Bump Prettier dependency to 3.9.9</li>
<li><a
href="https://github.com/prettier/prettier/commit/ad8a6bf4fa23c42fd114683fec43b28a11bd24af"><code>ad8a6bf</code></a>
Clean changelog_unreleased</li>
<li>See full diff in <a
href="https://github.com/prettier/prettier/compare/3.9.9...3.9.10">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=prettier&package-manager=npm_and_yarn&previous-version=3.9.9&new-version=3.9.10)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore <dependency name> major version` will close this
group update PR and stop Dependabot creating any more for the specific
dependency's major version (unless you unignore this specific
dependency's major version or upgrade to it yourself)
- `@dependabot ignore <dependency name> minor version` will close this
group update PR and stop Dependabot creating any more for the specific
dependency's minor version (unless you unignore this specific
dependency's minor version or upgrade to it yourself)
- `@dependabot ignore <dependency name>` will close this group update PR
and stop Dependabot creating any more for the specific dependency
(unless you unignore this specific dependency or upgrade to it yourself)
- `@dependabot unignore <dependency name>` will remove all of the ignore
conditions of the specified dependency
- `@dependabot unignore <dependency name> <ignore condition>` will
remove the ignore condition of the specified dependency and ignore
conditions


</details>
@cldmv-bot cldmv-bot Bot added ! release → master v4 flow: persistent next → master release PR (carries the next feature release) release Marks a pull request as a pending release — merge to publish a new version semver: patch This release contains only backwards-compatible bug fixes release: deps-only Release PR that only touches devDependencies, lockfiles and CI config — held, not released labels Oct 14, 2026
@cldmv-bot

cldmv-bot Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor Author

🔒 Dependency Review

Full job summary

@cldmv-bot cldmv-bot Bot added the type: dependencies Relates to dependency updates, version bumps, or package management label Oct 14, 2026
@cldmv-bot

cldmv-bot Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor Author

⚠️ Bundle size increased

File Raw Δ Raw Gzipped Δ Gzipped
dist/index.cjs 1.7 kB +1.7 kB (+100.0%) ⚠️ 876 B +876 B
dist/index.mjs 26.4 kB +26.4 kB (+100.0%) ⚠️ 9.4 kB +9.4 kB
Total 28.1 kB +28.1 kB 10.2 kB +10.2 kB

📊 Generated by bundle-size. Brotli sizes also measured but omitted from the table for brevity.

Shinrai and others added 5 commits October 31, 2026 12:27
Move the hand-written root entries to src/index.mjs and src/index.cjs and
build with tsup: dist/index.mjs is the bundle, dist/index.cjs a verbatim
copy of src/index.cjs. The "." export gets a node-android-tv-remote-dev
condition pointing at src/, and the package now ships dist/ plus
scripts/postinstall.mjs (the postinstall hook runs on consumer installs)
instead of src/ and scripts/. engines.node becomes ^20.19.0 || >=22.13.0,
matching what the CJS entry already enforces at runtime.

Vitest and test:cjs run with the condition; tests/cjs/entry.test.cjs now
checks the build, and a source-level entry test covers src/index.cjs.
eslint.config.mjs moves to .configs/. CI, release and bundle-size
workflows run the real build.

Closes #75
Node 22.12 warns when require() loads the ESM entry, so the matrix starts where engines.node does.
The dev toolchain (chokidar 6, tsup 9) needs Node 22.22, so nothing older can be tested. engines, the CJS guard message and the CI matrix floor move together.
@cldmv-bot cldmv-bot Bot added type: config Changes to repository or project configuration files and removed release: deps-only Release PR that only touches devDependencies, lockfiles and CI config — held, not released labels Nov 1, 2026
@cldmv-bot cldmv-bot Bot added area: core Touches core library / runtime source code area: tests Touches test files, fixtures, or test infrastructure type: ci Changes to CI workflows, actions, or build pipelines type: documentation Relates to docs, README updates, guides, or inline code comments labels Nov 1, 2026
@cldmv-bot cldmv-bot Bot changed the title release: v2.1.10 - bump prettier from 3.9.9 to 3.9.10 in the prettier… release: v2.2.0 - adopt the CLDMV library layout with a tsup build Nov 1, 2026
@cldmv-bot cldmv-bot Bot added semver: minor This release adds new functionality in a backwards-compatible way type: bug Something is broken or not behaving as expected type: feature Implements new functionality — a PR or issue that adds a feature and removed semver: patch This release contains only backwards-compatible bug fixes labels Nov 1, 2026
sharp 0.35.3 -> 0.35.5
@cldmv/configs 1.2.4 -> 1.3.0
@cldmv/fix-headers 2.2.0 -> 2.2.4
@cldmv/vitest-runner 1.5.3 -> 1.5.6
@eslint/css 2.0.0 -> 2.0.1
@eslint/json 2.1.0 -> 2.1.1
@vitest/coverage-v8, vitest 5.0.3 -> 5.0.5
eslint 10.12.0 -> 10.14.0
globals 17.13.0 -> 17.14.0
prettier -> 3.9.10
Transitive fixes via npm audit fix.

@devicefarmer/adbkit stays on 3.3.9; 4.0.1 is a new major on a runtime dependency.

Supersedes the open Dependabot PR #70 and the hotfix-redirect PRs
#64, #69, #72, #74, #77, #79.
Shinrai and others added 11 commits November 1, 2026 15:04
katex 0.19.1+ and minimatch 11.0.3+ clear the dev-only advisories that come in through eslint and @eslint/markdown; the same overrides fix-headers carries.
Mocks the adbkit client and device and drives client creation,
connect/disconnect, the heartbeat and connection check, auto-disconnect,
key/long-press/text shell commands, setSettings, ensureAwake, reboot,
screencap/thumbnail and waitBootComplete, plus a check that the real
package still has the client, device and util methods the remote calls.
Line coverage of src/lib/android-tv-remote.mjs goes from 24% to 95%.
Breaking changes in 4.0.0 (DeviceFarmer/adbkit#567, #568) and how they
apply here:

- Native promises replace bluebird; bluebird-only methods (.timeout,
  .delay, .return, .cancel, .catch(Class, fn)) are gone. Doesn't apply:
  the remote only uses .then/.catch and await on adbkit promises.
- Cancellation is explicit (AbortSignal on parser reads, tracker.end(),
  transfer.cancel(), a signal option on waitBootComplete/waitForDevice).
  Doesn't apply: we don't use trackers, sync transfers or cancellation;
  waitBootComplete() is still called without options.
- Deep imports outside the new exports map no longer resolve. Doesn't
  apply: only the package root is imported; the default-import shape
  (.Adb) is unchanged.
- Node.js 22.12 or later is required. Already met: engines.node is
  >=22.22.0.
- Unawaited internal promise chains now warn instead of crashing. Doesn't
  apply: no trackers, sync transfers or ProcStat in use.
- adbkit-logcat 3 / adbkit-monkey 2. Doesn't apply: openLogcat() and
  openMonkey() aren't used.

No source changes were needed.
waitBootComplete(timeout) took a timeout but never passed it on, so the
wait ran until the device finished booting however long that took. It
now hands adbkit 4 an AbortSignal.timeout(timeout); adbkit rejects with
a TimeoutError and closes the connection when it fires, which reaches
the existing "Boot completion timeout" hint.

Closes #85
screencap({ width/height, filepath }) ended the file stream and emitted
"screencap-saved"/"screencap-complete" straight away, before the data
had reached the file, and a failing write stream had no error listener.
The background job now runs capture -> resize -> file through
stream/promises pipeline(), so the events fire and the job settles only
after the file is fully written, and a write failure tears the pipeline
down and is emitted as a "screencap" error with no completion events.

Closes #86
@cldmv-bot
cldmv-bot Bot merged commit 6583ff3 into master Nov 2, 2026
43 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: core Touches core library / runtime source code area: tests Touches test files, fixtures, or test infrastructure ! release → master v4 flow: persistent next → master release PR (carries the next feature release) release Marks a pull request as a pending release — merge to publish a new version semver: minor This release adds new functionality in a backwards-compatible way type: bug Something is broken or not behaving as expected type: ci Changes to CI workflows, actions, or build pipelines type: config Changes to repository or project configuration files type: dependencies Relates to dependency updates, version bumps, or package management type: documentation Relates to docs, README updates, guides, or inline code comments type: feature Implements new functionality — a PR or issue that adds a feature

Projects

None yet

1 participant