Skip to content

feat!: Migrate the package to ESM#1176

Merged
mykola-mokhnach merged 1 commit into
masterfrom
esm
Jul 23, 2026
Merged

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

Conversation

@mykola-mokhnach

Copy link
Copy Markdown

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).
  • Replace the __filename/import.meta.url dual-mode shim in lib/utils/module.ts with a plain fileURLToPath(import.meta.url), now that the package is unambiguously ESM.
  • Add esmock as a dev dependency and rework test/unit/webdriveragent.spec.ts, which stubbed lib/utils's getWDAUpgradeTimestamp via Sinon on a namespace import — real ES module namespaces are non-configurable and can't be mutated directly.
  • Add --enable-source-maps to the test/e2e-test scripts.

BREAKING CHANGE: Consumers using require('appium-webdriveragent') must switch to import/dynamic import() — the package no longer ships a CommonJS entry point.
BREAKING CHANGE: WebDriverAgent#retrieveDerivedDataPath() has been removed; use #retrieveBuildSettings() instead.

@mykola-mokhnach
mykola-mokhnach merged commit fa54e5e into master Jul 23, 2026
45 checks passed
@mykola-mokhnach
mykola-mokhnach deleted the esm branch July 23, 2026 17:20
github-actions Bot pushed a commit that referenced this pull request Jul 23, 2026
## [16.0.0](v15.1.6...v16.0.0) (2026-07-23)

### ⚠ BREAKING CHANGES

* Consumers using require('appium-webdriveragent') must switch to import/dynamic import() — the package no longer ships a CommonJS entry point.
* WebDriverAgent#retrieveDerivedDataPath() has been removed; use #retrieveBuildSettings() instead.

### Features

* Migrate the package to ESM ([#1176](#1176)) ([fa54e5e](fa54e5e))
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 16.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