wasmerio / winterjs

Winter is coming... ❄️
https://winterjs.org/
MIT License
3.04k stars 53 forks source link

Generate `setup.js` from a TypeScript project #13

Closed Michael-F-Bryan closed 8 months ago

Michael-F-Bryan commented 1 year ago

I've taken our hand-written setup.js file and converted it into a TypeScript project.

This should make things easier going forward because we'll be able to precisely define the native functions exposed by WinterJS and write abstractions on top of them.

It also gives us nice things like bundling (our setup code can now use dependencies!) and *.d.ts files that we can upload to the DefinitelyTyped repo and have published as @types/winterjs.

To make sure our setup.js file doesn't go out of sync with the TypeScript code, I've added a self-updating integration test.

The main concern I have is that my translation won't be a 1:1 identical copy of setup.js and I might have missed something. I copied as much as possible from the original setup.js and winter.d.ts files but wasn't able to test the new code because mozjs doesn't build on my machine.

Arshia001 commented 8 months ago

Closing as stale.