dwyl / aws-sdk-mock

:rainbow: AWSomocks for Javascript/Node.js aws-sdk tested, documented & maintained. Contributions welcome!
Apache License 2.0
1.11k stars 110 forks source link

[PR] Exporting default types properly so it matches the javascript file. #418

Closed LuchoTurtle closed 3 months ago

LuchoTurtle commented 3 months ago

fixes #411

The problem was related to how the default export was being treated from Typescript to Javascript. They didn't match, so what happened is that, after transpiling the Typescript to Javascript, the js files would have a different way of exporting the default AWS variable than what was described in the Typescript files. Read https://github.com/arethetypeswrong/arethetypeswrong.github.io/blob/main/docs/problems/FalseExportDefault.md for a comprehensive overview.

This PR fixes this and changes the way AWS is exported to export = AWS (instead of export default AWS).

In addition to this, the bundle configuration from tsup is now explicit.

LuchoTurtle commented 3 months ago

@nelsonic take a look and approve when possible. I've tested the output bundle (the bundled .js files) in the project https://github.com/aannoune/aws-sdk-mock-issue411 and it's working now.

After approval, I'll publish and merge.