Skip to content

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

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 esm.default and attaches default, wisp and wispSync to it. The ESM entry exports more than one value, so with the shim require("@cldmv/wisp") returns the module object: .default, .wisp and .wispSync keep working, but require(x)(…) breaks. Ships as a major, with the upgrade note const { wisp } = require("@cldmv/wisp") (or .default).

Change: replace src/index.cjs with the shim, 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 #86, merged into next. This issue closes automatically when that work ships to the default branch.

  4. added a commit that references this issue on Nov 28, 2026
    70e8470
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