fix!: remove libStorage helper to remove incompatibilities #105
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The
mockLibStorageUpload
was introduced to mock the@aws-sdk/lib-storage
Upload
method. In fact, it just mocks two underlying Commands from@aws-sdk/client-s3
used by theUpload
method.Since it was mocking
@aws-sdk/client-s3
Commands, the library needed a dependency on the@aws-sdk/client-s3
and@aws-sdk/types
. For users that did not use theclient-s3
orlib-storage
at all and did not specify it as a dependency by themselves inpackage.json
, those two packages, specified as peer dependencies, were installed automatically by the NPM v7 and newer.However, automatically installing the
@aws-sdk/types
in the latest available version often lead to it being incompatible with the versions of@aws-sdk/client-*
packages, resulting in type errors and other other issues.To fix this, in v1.0.0 the
@aws-sdk/types
and@aws-sdk/client-s3
were removed from the peer dependencies. The idea was to expose themockLibStorageUpload
from a separate path (aws-sdk-client-mock/libStorage
). Not having themockLibStorageUpload
exposed in the mainindex.ts
made the library work just fine without@aws-sdk/types
and@aws-sdk/client-s3
installed. Users that wanted to usemockLibStorageUpload
had to install those two libraries.mockLibStorageUpload
function was exposed under aaws-sdk-client-mock/libStorage
path with the new package.jsonexports
parameter. However, adding this parameter turned out to cause various effects and incompatibilities depending on the user's project configuration.The
mockLibStorageUpload
helper was mocking just twoclient-s3
Commands. This is trivial and short to implement yourself when needed. Since the helper was constantly causing problems since it was added, I decided it will be better to remove it altogether and replace with a short instruction in the README on how to mock thelibStorage
yourself.