-
Notifications
You must be signed in to change notification settings - Fork 40
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
fix!: remove @aws-sdk types and client-s3 from peer dependencies #57
Conversation
NPM 7 installs peer dependencies automatically. This can cause installing newer version of the @aws-sdk/types than is required by other client libraries, and cause type conflicts. types package is required anyway by the SDK client libs.
This will make the default package import not require @aws-sdk/client-s3 installed.
Codecov Report
@@ Coverage Diff @@
## main #57 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 6 6
Lines 116 115 -1
Branches 12 12
=========================================
- Hits 116 115 -1
Continue to review full report at Codecov.
|
Looking forward to seeing this go in 👍 We were trying to upgrade all our runtimes to Node v16 given the recent AWS announcement and started to encounter these issues |
@sekhavati thanks for the ping 🙂 It's definitely a time to merge it. I will merge it now and release a new version later today. |
@sekhavati check out the freshly released v1.0.0 🙂 |
@m-radzikowski I've given this a fresh run today and unfortunately I'm still encountering similar issues regarding type conflicts as mentioned here. To give you some background:
I'll have to come back and revisit this again antoher time now, but rather short on ideas at the moment, other than perhaps try upgrading all the If you have any other suggestions please let me know! Thanks again for the effort that's gone into this library, it's awesome 👍 |
@m-radzikowski on a whim I thought I'd try regenerating all the ps. above was without installing |
@sekhavati great, I'm glad you solved it! Seems like npm did not clear no longer needed peer dependencies upon library version bump? Weird. |
NPM 7 installs peer dependencies automatically. This can cause installing newer version of the @aws-sdk/types than is required by other client libraries, and cause type conflicts.
We remove
@aws-sdk/types
and@aws-sdk/client-s3
from peer dependencies.@aws-sdk/types
package is required anyway by the SDK client libs.The
client-s3
lib is needed forlibStorage
mock functionality. Now, thelibStorage
is not imported in the main packageindex.ts
, so lack ofclient-s3
will not cause errors for users not needing it. ThemockLibStorageUpload
must be now imported as:TODO:
jest-resolve
jestjs/jest#9771 solved - until then, jest does not support package exports, andimport ... from 'aws-sdk-client-mock/libStorage'
failslibStorage
mocking, including required jest version >= 28Solves #56