-
Notifications
You must be signed in to change notification settings - Fork 146
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
feat(internal): support Middy.js 5.x #2748
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great addition of middy5! Few questions:
With this, I switched some of the test cases that were already running using ESM output to import v5, and left the others untouched.
Does this imply that not all e2e tests that can run with middy5 are covered and we need to add them overtime? Will this result in duplication?
I just realised that we need to fix our peerDeps for parser as well :| will do in a separate PR.
Currently we have a number of e2e test cases (i.e. 10 <- fictional number for the sake of the argument). Of these 10, today we are running some of them (i.e. 5) using ESM and some other (i.e. the other 5) with CJS. Generally speaking, the distribution between the two has been done in a way that each utility has at least 1 or more tests running in each mode. Because of Middy.js 5.x only supporting ESM, the pool of eligible test cases where to import With all this in mind, the changes in the PR ensure that at least one group of tests for each utility is testing Middy.js 5. I didn't add any new test, and I don't think we should do so, because we are already testing different combinations when looking at the tests all together. |
Added in the last commit - good catch! |
Quality Gate passedIssues Measures |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work as always, I am sure the middy5 support release will be a surprise for many 😎
Summary
Changes
This PR adds support for Middy.js 5.x by including it in some of the integration test cases that are run on the utilities and widening the version range in the peer dependencies from
>= 4.x
to4.x || 5.x
.Because we want to continue supporting both versions, I decided to use an npm feature that allows you to install a package under a custom alias. This mechanism allows multiple versions of the same-name package side-by-side, which is what we need in this case.
To modify the
devDependencies
of the project I run these commands:This created two entries in the main
package.json
file, and allows us to import either of the two versions using the name of the alias like so:With this, I switched some of the test cases that were already running using ESM output to import v5, and left the others untouched.
I also updated the docs to reflect that we support both versions.
Issue number: #2049
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
Disclaimer: We value your time and bandwidth. As such, any pull requests created on non-triaged issues might not be successful.