avajs / typescript

Test TypeScript projects using AVA.
MIT License
73 stars 16 forks source link

Add `"types"` entries to the `"exports"` property of package.json, to allow consumption from Typescript with the new `Node16` module resolution strategy #42

Closed Duncan3142 closed 2 years ago

Duncan3142 commented 2 years ago

Is your feature request related to a problem? Please describe.

I'm unable to consume "ava" from Typescript 4.7, when module resolution is set to Node16

Describe the solution you'd like

Add "types" entries to the "exports" property of package.json

Describe alternatives you've considered

None

Additional context

The following should suffice

"exports": {
  ".": {
    "types": "./index.d.ts"
    "import": "./entrypoints/main.mjs",
    "require": "./entrypoints/main.cjs"
  },
  "./eslint-plugin-helper": "./entrypoints/eslint-plugin-helper.cjs",
  "./plugin": {
    "import": "./entrypoints/plugin.mjs",
    "require": "./entrypoints/plugin.cjs"
  }
},
novemberborn commented 2 years ago

This is an issue in AVA itself, keep an eye on https://github.com/avajs/ava/pull/3024.

Will close since the work is tracked in a different repository.