Skip to content

feat!: Migrate the package to ESM#31

Merged
mykola-mokhnach merged 1 commit into
mainfrom
esm
Jul 24, 2026
Merged

feat!: Migrate the package to ESM#31
mykola-mokhnach merged 1 commit into
mainfrom
esm

Conversation

@mykola-mokhnach

Copy link
Copy Markdown
Contributor

Summary

  • Add "type": "module" and an exports map to package.json; keep main/types for compatibility.
  • Explicitly set "module": "NodeNext" / "moduleResolution": "NodeNext" in tsconfig.json.
  • Add .js extensions to all relative imports across lib/ and test/ (required by Node ESM resolution).
  • Switch @appium/logger from a default import to the named log import in lib/devicectl.ts — @appium/logger is CJS-only, and under real Node ESM interop a default import binds to the whole module.exports object rather than unwrapping .default (unlike tsc's CJS-output interop shim). The old code would have thrown logger.debug is not a function at runtime; NodeNext module resolution caught this at build time.
  • Add --enable-source-maps to the test/e2e-test scripts.

BREAKING CHANGE: Consumers using require('node-devicectl') muc import() — the package no longer ships a CommonJS entry

@mykola-mokhnach
mykola-mokhnach merged commit f83c598 into main Jul 24, 2026
5 checks passed
@mykola-mokhnach
mykola-mokhnach deleted the esm branch July 24, 2026 18:45
github-actions Bot pushed a commit that referenced this pull request Jul 24, 2026
## [2.0.0](v1.4.3...v2.0.0) (2026-07-24)

### ⚠ BREAKING CHANGES

* Consumers using require('node-devicectl') muc import() — the package no longer ships a CommonJS entry

### Features

* Migrate the package to ESM ([#31](#31)) ([f83c598](f83c598))
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 2.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants