Repository navigation
feat!: switch the CJS entry to the generic shim - #121
Merged
Merged
Conversation
src/index.cjs is now the generic CLDMV shim: after the Node version guard it returns the single exported value, or the module object when the ESM entry exports more than one distinct value. Here that is the module object. The CJS tests and the README CommonJS usage match the new shape.
Migration:
- require("@cldmv/node-android-tv-remote") now returns the module object, not the createRemote function.
- require(x)(…) becomes require(x).createRemote(…).
- require(x).create(…) becomes require(x).createRemote(…) (the CJS-only create alias is gone).
- .createRemote, .createAndroidTVRemote, .default and destructuring of them keep working.
BREAKING CHANGE: require("@cldmv/node-android-tv-remote") returns the module object instead of the createRemote function, and the CJS-only create alias is removed.
Resolves #120
Shinrai
approved these changes
Nov 28, 2026
This was referenced Nov 28, 2026
cldmv-bot Bot
added a commit
that referenced
this pull request
Nov 29, 2026
# `@cldmv/node-android-tv-remote` v3.0.0 Changelog
**Release Date**: November 2026
**Release Type**: Major
**Branch**: `release/3.0.0`
---
## Overview
v3.0.0 switches the CommonJS entry to the generic `index.cjs` shim used across the CLDMV libraries. `require("@cldmv/node-android-tv-remote")` now returns the module object, the same exports `import` gives, instead of the `createRemote` function with properties attached.
This is the only breaking change, and it only affects code that uses `require()` and calls the result directly. ESM `import` is unchanged, and so is every remote method. The release also moves the build from a single tsup bundle to one minified file per module in `dist/`, and bumps the CLDMV dev tools; neither changes what `import` or `require()` return.
---
## 💥 Breaking Changes
### `require("@cldmv/node-android-tv-remote")` returns the module object ([#121](#121), fixes [#120](#120))
The ESM entry exports two distinct values, `createRemote` (also exported as `default`) and `createAndroidTVRemote`, so the shim hands back the module object:
```javascript
const remote = require("@cldmv/node-android-tv-remote");
// => { __esModule, default: createRemote, createRemote, createAndroidTVRemote }
const { createRemote } = require("@cldmv/node-android-tv-remote");
const device = await createRemote({ ip: "192.168.1.100" });
```
- `require(x)({ ip })` becomes `require(x).createRemote({ ip })`, or `const { createRemote } = require(x)`.
- `require(x).createRemote`, `require(x).createAndroidTVRemote`, `require(x).default` and destructuring keep working.
- `__esModule` is newly present on the result, and the result is no longer callable.
`src/index.cjs` is now the same small file as in other CLDMV libraries (Node version guard, then `require("./index.mjs")`), and the build still copies it unchanged to `dist/index.cjs`. The CJS test expects the module object and checks its keys. The README CommonJS example uses the destructured form.
---
## 🔧 CI & tooling
- `dist/` now mirrors `src/`, one minified file per module with `keepNames` and source maps, built with esbuild (`bundle: false`) instead of a single tsup bundle ([#124](#124), fixes [#118](#118)). The `import` and `require()` shapes and the exported subpaths are unchanged, and `src/index.cjs` is still copied verbatim to `dist/index.cjs`. The published tarball now holds several files under `dist/` instead of one, source maps are still left out, and `tsup` is replaced by `esbuild` in the dev dependencies.
- `ci.yml` is synced with the CLDMV/.github v4.43.0 template ([#112](#112)).
- `ci.yml` adopts the v4.46.0 concurrency block, so superseded runs on `next`, `hotfixes` and feature branches are cancelled and only pushes to the release branch keep a unique group per run ([#122](#122), fixes [#119](#119)).
## 📚 Documentation
- **NEW:** [docs/changelog/v3/v3.0.0.md](https://github.com/CLDMV/node-android-tv-remote/blob/v3.0.0/docs/changelog/v3/v3.0.0.md): this changelog.
- README: the CommonJS example uses `const { createRemote } = require(...)`.
- README: the build note describes the per-module esbuild output.
- README What's New promoted to v3.0.0.
## 🔧 Dependencies
- `vitest` 5.1.0 → 5.1.1 ([#114](#114))
- `@vitest/coverage-v8` 5.1.0 → 5.1.1 ([#115](#115))
- `@cldmv/vitest-runner` 1.6.1 → 1.8.0 ([#116](#116))
- The CLDMV dev tools: `@cldmv/vitest-runner` 1.8.0 → 1.11.4, `@cldmv/configs` 1.4.0 → 1.5.0 and `@cldmv/fix-headers` 2.2.7 → 2.6.1, plus `npm update` for the rest, with file headers restamped and `.github/dependabot.yml` synced to the CLDMV/.github v4.47.0 groups ([#123](#123))
- `tsup` removed and `esbuild` added for the per-module build ([#124](#124))
All of these are dev dependencies; no runtime dependencies changed.
---
## Upgrade notes
- `require("@cldmv/node-android-tv-remote")` is no longer callable. Use `const { createRemote } = require("@cldmv/node-android-tv-remote")`.
- `.createRemote`, `.createAndroidTVRemote`, `.default` and destructuring work as before.
- ESM `import` is unchanged.
<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%** · `55cffdd` · 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.
src/index.cjsis now the generic CLDMV shim. The ESM entry exports two distinct values, sorequire("@cldmv/node-android-tv-remote")returns the module object instead of thecreateRemotefunction, and the CommonJS-onlycreatealias is gone. That's a breaking change for CommonJS callers.Migration:
require(x)(…)becomesrequire(x).createRemote(…)require(x).create(…)becomesrequire(x).createRemote(…).createRemote,.createAndroidTVRemote,.defaultand destructuring of them keep workingResolves #120