oxc-project / oxc

⚓ A collection of JavaScript tools written in Rust.
https://oxc.rs
MIT License
9.7k stars 360 forks source link

proposal: `@oxc/jest` package #3886

Open DonIsaac opened 1 week ago

DonIsaac commented 1 week ago

The Jest testing framework supports transforming code via transform plugins, such as babel-jest, ts-jest, and @swc/jest. It would be a large quality-of-life improvement to use oxc to transform files instead of any of the above packages. The transformer is progressing quite well, and making it usable in Jest could help with the adoption of oxc in general.

Unfortunately, Jest only ships with experimental support for ESM, so transpilation to CJS is a must-have for this to work properly. I took a crack at this about two weeks ago. Within about 2 hours I got about 80% of the way there, with this missing plugin being the only remaining major blocker.

Goals

Tasks

Considerations

Boshen commented 1 week ago

My only concern is the maintenance cost, the core team will not have the time to maintain this :-(

I'm fine with shipping all the puzzles pieces have a separate repo that glues things together with its own release pipeline.

DonIsaac commented 1 week ago

My only concern is the maintenance cost, the core team will not have the time to maintain this :-(

I'm fine with shipping all the puzzles pieces have a separate repo that glues things together with its own release pipeline.

Once transformation is exposed as an npm package, creating a jest plugin package is relatively trivial. @swc/jest is one file and about 200 lines of code. I'd be happy to maintain it myself. Would you be willing to create a git repo for it within oxc-project and give me the permissions needed to maintain it, or should I create it myself?

Boshen commented 1 week ago

should I create it myself

Yes please, ping me if you don't have all the permissions.

DonIsaac commented 1 week ago

https://github.com/oxc-project/oxc-jest