muratgozel / MIMEText

RFC-2822, RFC-2045 and RFC-2049 compliant raw email message generator.
https://muratgozel.github.io/MIMEText/
MIT License
82 stars 35 forks source link

Add `types` fields under `exports` in package.json #58

Closed felixfbecker closed 9 months ago

felixfbecker commented 11 months ago

Currently, mimetext cannot be imported in latest TypeScript versions using ESM because TypeScript will expect a types field under exports if exports is used, meaning it cannot find the types for the module.

See https://arethetypeswrong.github.io/?p=mimetext%403.0.16

This PR adds the types fields to each exports field, making the package importable in latest TypeScript and ESM settings. The old types field is preserved for BC.

FabianFrank commented 10 months ago

Can confirm, this is needed for ESM to work and won't break CJS.

florianbepunkt commented 9 months ago

@muratgozel Could you please have a look and merge this? It ensure compatibility with typescript ESM while not affecting other use cases.

muratgozel commented 9 months ago

hi all, there was more to do with type generation, importing and other kind of stuff, i had to handled it by myself. all should be fixed now. closing this pr but please let me know if you have any other problems. sorry for the late action