Repository navigation
Closed
Labels
area: coreTouches core library / runtime source codepriority: lowMinor issue or improvement that can be deferred without impactstatus: implementedBuilt and deployed, but not yet fully tested/verifiedtype: enhancementAn improvement to existing functionality without adding a new feature
Description
Problem
There is no build. build and build:ci are echo '✓ no build step', and the package ships src/ and scripts/ directly, with hand-written root index.mjs / index.cjs entries (index.mjs re-exports ./src/lib/android-tv-remote.mjs). There is no -dev condition, so a checkout can't tell source from a build.
Target layout
CLDMV/llm-translator (PR #1) is the reference implementation for the layout.
package.json "." → { "node-android-tv-remote-dev": { import: ./src/index.mjs, require: ./src/index.cjs },
import: ./dist/index.mjs, require: ./dist/index.cjs }
src/
index.mjs the real exports
index.cjs require_module guard + require("./index.mjs"), mapped to the CJS export shape
lib/ …
dist/ tsup output (gitignored, rebuilt by prepack)
index.mjs bundle
index.cjs verbatim copy of src/index.cjs (tsup onSuccess copyFileSync)
Tasks
git mv index.mjs src/index.mjsandgit mv index.cjs src/index.cjs, and change the re-export to./lib/android-tv-remote.mjs.- Pass
--conditions=node-android-tv-remote-devto the vitest config andtest:cjs(as in llm-translator). - Add tsup, modeled on llm-translator's
tsup.config.mjs: anindexentry,onSuccesscopyingsrc/index.cjstodist/index.cjs,keepNames: true,removeNodeProtocol: false. Runtime deps (@devicefarmer/adbkit,sharp) stay external. package.json:- put the
-devcondition on"." main/module→dist/files:dist/,types/; notsrc/build= tsup,prepack:npm run build,build:ci: lint + format:check + buildengines.node:^20.19.0 || >=22.13.0, because the CJS entry needsrequire(esm)and Node 22.12.x warns whenrequire()loads ESM (today>=20.9.0, whichindex.cjsalready rejects at runtime)
- put the
- Decide whether
scripts/still needs to ship, and move the rooteslint.config.mjsinto.configs/like the other CLDMV repos. tests/cjs/entry.test.cjs: point atdist/.ci.yml:coverage_build_command: "npm run build:ci".bundle-size.yml:dist_paths= the realdist/output.
Compatibility
The public entry (".") and its exports don't change. The one consumer-visible change is the engines floor, which matches what index.cjs already enforces at runtime.
Metadata
Metadata
Assignees
Labels
area: coreTouches core library / runtime source codepriority: lowMinor issue or improvement that can be deferred without impactstatus: implementedBuilt and deployed, but not yet fully tested/verifiedtype: enhancementAn improvement to existing functionality without adding a new feature
Activity
[-]Adopt the CLDMV library layout: tsup build, src/index.mjs + src/index.cjs entries, devcheck[/-][+]Adopt the CLDMV library layout: tsup build, src/index.mjs + src/index.cjs entries[/+]Shinrai commentedon Nov 1, 2026
Dropped the devcheck part, it's being removed from all the packages instead.
cldmv-bot commentedon Nov 1, 2026
Marked
status: implemented— resolved by #81, merged intonext. This issue closes automatically when that work ships to the default branch.release: v2.2.0 - adopt the CLDMV library layout with a tsup build
release: v2.2.0 - adopt the CLDMV library layout with a tsup build