Skip to content

Adopt the generic index.cjs shim (breaking: require() returns the module object) #120

Done

Description

@Shinrai

CLDMV/.github v4.46.0 makes src/index.cjs one generic file for every library (examples/package-layout/src/index.cjs, #589). After the Node version guard it returns the single exported value when the ESM entry has one distinct value, and the module object import gives otherwise.

Today src/index.cjs returns the default createRemote and attaches createRemote, createAndroidTVRemote and default. The ESM entry exports more than one value, so with the shim require() returns the module object. Named properties that index.mjs exports keep working; require(x)(…), and any attached alias that index.mjs doesn't export, break. Ships as a major, with the upgrade note const { default: createRemote } = require(…) or the named export.

Change: replace src/index.cjs with the shim, make sure every name callers need is a real ESM export, keep the build copying it verbatim to dist/index.cjs, and update the CJS test.

Activity

  1. added
    type: enhancement
    priority: low
    status: not started
    on Nov 27, 2026
  2. added
    status: implemented
    and removed
    status: not started
    on Nov 28, 2026
  3. cldmv-bot commented on Nov 28, 2026

    @cldmv-bot
    Contributor

    Marked status: implemented — resolved by #121, merged into next. This issue closes automatically when that work ships to the default branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority: lowstatus: implementedtype: enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions