renovatebot / renovate

Home of the Renovate CLI: Cross-platform Dependency Automation by Mend.io
https://mend.io/renovate
GNU Affero General Public License v3.0
17.16k stars 2.23k forks source link

Publish CJS + ESM #13181

Open rarkins opened 2 years ago

rarkins commented 2 years ago

What would you like Renovate to be able to do?

Publish both CJS + ESM so that downstream tools can migrate gradually to ESM, prior to us supporting ESM only once #9890 is done

If you have any ideas on how this should be implemented, please tell us here.

@viceice :)

Is this a feature you are interested in implementing yourself?

No

viceice commented 2 years ago

Looks like i need to forward this as more and more deps become ESM only 😞

JamieMagee commented 1 year ago

What work is required or blocking here?

Jest has experimental support for mocking ESM, but I don't see it becoming stable any time soon as jest is blocked by work required upstream in Node and v8.

viceice commented 1 year ago

we can continue to test as commonjs, but the hard part is to properly compile to esm. the typescript compiler still can't do this on our codebase without changes.

we would need to change all local imports to full files with extension and add /index.ts for barrel imports.

or we use some kind of bundler to bundle only our code. but we should still provide some API to be used by ourselves other tools. so we can't simply build a single js binary.

viceice commented 11 months ago