This repository currently supports being a dual package (CJS and ESM). While we have a simple test using an example TypeScript project, it's not comprehensive enough to cover all use cases.
The primary risk is that in an attempt to fix a CI error, a developer might inadvertently change a critical build option. This could lead to a scenario where our CI pipeline passes, but the change breaks projects for our users. To prevent this, we need to add more robust tests.
I'm aware that the need for dual packages is diminishing with modern Node.js, but since this repository supports a diverse range of environments, these tests serve as a crucial safeguard against regressions. At a minimum, it would be beneficial to add tests that emulate the following common setups:
- JavaScript with CommonJS (
require)
- JavaScript with ESM (
import)
- TypeScript with CommonJS output
- TypeScript with legacy CommonJS resolution settings
- TypeScript with modern ESM output (
"module": "nodenext")
- TypeScript with bundler-specific resolution (
"moduleResolution": "bundler")
This repository currently supports being a dual package (CJS and ESM). While we have a simple test using an example TypeScript project, it's not comprehensive enough to cover all use cases.
The primary risk is that in an attempt to fix a CI error, a developer might inadvertently change a critical build option. This could lead to a scenario where our CI pipeline passes, but the change breaks projects for our users. To prevent this, we need to add more robust tests.
I'm aware that the need for dual packages is diminishing with modern Node.js, but since this repository supports a diverse range of environments, these tests serve as a crucial safeguard against regressions. At a minimum, it would be beneficial to add tests that emulate the following common setups:
require)import)"module": "nodenext")"moduleResolution": "bundler")