Closed NatoBoram closed 1 month ago
Hey @NatoBoram!
I really appreciate your PR; migrating to ESM is important. I also noticed that you plan to transition from ava to vitest, which is something I also wanted to do but haven't found the time for.
A couple of words about the migration: can we use a bundling tool like Rollup to compile the existing code to ESM while also keeping CommonJS for users who are not using modules?
Thanks! I'm not familiar with Rollup, but I'll see what I can do.
Got approval from my employer, I'm moving this PR to their repos. Sorry for the duplicate.
Motivation
https://www.typescriptlang.org/tsconfig/#verbatimModuleSyntax
When using
verbatimModuleSyntax
in a consuming app, compilation fails because Jira.js is a CommonJS library in TypeScript. This can be fixed withdisableSourceOfProjectReferenceRedirect
, but it's a bit of a shame to lose access to the source code when you have it right there. A better option would be to migrate the library to modern JavaScript standards and improve performance and compatibility along the way.Changes
verbatimModuleSyntax
ava
tovitest