Skip to content

v3.0.0

Latest

Choose a tag to compare

@bennycode bennycode released this 01 Oct 14:31
· 1 commit to main since this release
afaed0e

Breaking change

ts2esm now requires Node.js 20.17, 22.13, or 23.5 and later, because @inquirer/prompts 8 needs it.

Fixes

  • module.exports = { ... } and other assignments that aren't a plain identifier or function are converted instead of deleted. module.exports.foo = bar now exports foo instead of bar, and values like module.exports.answer = 42 produce valid code. Fixes #125 in #210.
  • Imports from packages that define exports in their package.json stay untouched, so pkg/sub no longer becomes pkg/sub.js and fails with ERR_PACKAGE_PATH_NOT_EXPORTED. Legacy packages like lodash/omit still get .js. Fixes #128 in #212.
  • Path aliases declared in a root tsconfig.json that an app's tsconfig extends are resolved from the right directory, so monorepo imports like @mylib/utils/helper get their extension. Aliases with several targets try each one in order. Fixes #127 in #213.
  • Importing ts2esm as a library works again. main in package.json pointed to a file that was never built. #215

Dependencies

Upgraded to ts-morph 28 and TypeScript 6.0, along with the rest of the dependencies. #214