Skip to content

[P2] Migrate packages from CommonJS to ESM #29

Description

@dalberola

Priority 2. Both packages are CommonJS ("type" defaults to commonjs; dredd builds CJS via tsc, dredd-transactions is module.exports). This blocks upgrading ESM-only deps (chai >=5, inquirer >=9, @cucumber/cucumber newer, @apidevtools/swagger-parser).

Scope

  • Convert source + build output to ESM ("type": "module", module/moduleResolution settings, import/export, __dirname/require shims, dynamic require sites).
  • Update the ts-node test setup and .mocharc (dredd uses ts-node CJS today; dredd-transactions is already .mjs).
  • Verify the bin/dredd entrypoint, hook loading (proxyquire), and the Docker build still work.

Large and cross-cutting — do after P1 (typing first makes the conversion safer). Likely several PRs (per package / per concern). Each gated on CI.

Done when

Both packages publish as ESM, the CLI + hooks + Docker image work, and at least one previously-blocked ESM-only dep (e.g. chai 5) is upgraded as proof.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions