Open 72636c opened 3 years ago
Just dropping this issue here in case someone asks about this. We are still waiting on Jest to fully support ESM https://github.com/facebook/jest/issues/9430
Last time I tried switching Jest -> Vitest it did not properly support CJS. So it seemed like I would have to both switch to ESM and Vitest at the same time which gives me lower confidence that the move worked.
https://github.com/seek-oss/skuba/blob/48c4208616e4dcd349670131fcad1fc9827e3ce7/src/skuba.ts#L38-L40
This bit of code would need to be re-written as ESM doesn't support importing from directories/magic index.js files.
ESM requires file extensions within the imports.
Or
Some packages in the Node.js ecosystem are starting to go ESM-only, e.g. https://github.com/seek-oss/skuba/pull/397.
We can probably move most internal CLI code over to ESM without a breaking change; we already require Node.js 12+ and therefore ESM support via
"type": "module"
inpackage.json
. The tricky part will be maintaining CommonJS compatibility in src/api and src/wrapper as consumers call this code from their own module context and we don't want to force a switch at this time.