Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from
Jun 6, 2024

Conversation

LuchoTurtle
Copy link
Member

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
Copy link
Member Author

@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.

nelsonic
nelsonic previously approved these changes Jun 6, 2024
Copy link
Member

@nelsonic nelsonic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@LuchoTurtle code/updates look good. :shipit:

@nelsonic nelsonic removed their assignment Jun 6, 2024
@LuchoTurtle LuchoTurtle merged commit 2b1adfb into main Jun 6, 2024
10 checks passed
@LuchoTurtle LuchoTurtle deleted the not-defined-fix#411-2 branch June 6, 2024 23:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

v6.0.1 broken with TypeError: AWS.mock is not a function
2 participants