Skip to content

Bug: Idempotency Package has No Exports #1479

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

Closed
brianhyder opened this issue Jun 1, 2023 · 7 comments · Fixed by #1483
Closed

Bug: Idempotency Package has No Exports #1479

brianhyder opened this issue Jun 1, 2023 · 7 comments · Fixed by #1483
Assignees
Labels
bug Something isn't working completed This item is complete and has been merged/shipped idempotency This item relates to the Idempotency Utility

Comments

@brianhyder
Copy link

Expected Behaviour

The Idempotency package exports the functions and classes necessary to utilize the idempotency package.

Current Behaviour

The idempotency package does not seem to export any of the functions/classes as the other packages do.

If you look at the package.json for the idempotency implementation, it specifies that lib/index.js is the main entry point. However, that file does not exist. When you look at the other packges (logging, metrics, etc) it has the same package.json configuration but the index file exists.

Code snippet

See the links above.

Steps to Reproduce

See the links above.

Possible Solution

Add the index.ts file to the idempotency package and export the necessary types and functions.

Powertools for AWS Lambda (TypeScript) version

main

AWS Lambda function runtime

18.x

Packaging format used

npm

Execution logs

No response

@brianhyder brianhyder added triage This item has not been triaged by a maintainer, please wait bug Something isn't working labels Jun 1, 2023
@boring-cyborg
Copy link

boring-cyborg bot commented Jun 1, 2023

Thanks for opening your first issue here! We'll come back to you as soon as we can.
In the meantime, check out the #typescript channel on our Powertools for AWS Lambda Discord: Invite link

@dreamorosi
Copy link
Contributor

Hi @brianhyder thanks for opening the issue.

At the moment this is intentional as we hadn't gotten yet to the point of building the utility for npm.

We will prioritize this item as soon as #1474 is merged, which should happen sometime tomorrow or Monday at the latest.

@dreamorosi dreamorosi added confirmed The scope is clear, ready for implementation idempotency This item relates to the Idempotency Utility and removed triage This item has not been triaged by a maintainer, please wait labels Jun 1, 2023
@dreamorosi dreamorosi self-assigned this Jun 1, 2023
@dreamorosi
Copy link
Contributor

Hi @brianhyder, I've started working on this but I will need a bit more time as I want to make sure the exports are as isolated as possible and avoid running into future issues. For context: customers should be able to import & build the project regardless of whether they use Middy or DynamoDB as persistence layer, and so we need to build the exports accordingly.

In the meantime, after running npm pack and installing the tarball into your project, you can import any of the files by referencing it directly, i.e.

import { makeFunctionIdempotent } from '@aws-lambda-powertools/idempotency/lib/makeFunctionIdempotent';
import { DynamoDBPersistenceLayer } from '@aws-lambda-powertools/idempotency/lib/persistence/DynamoDBPersistenceLayer';
import { IdempotencyConfig } from '@aws-lambda-powertools/idempotency/lib/IdempotencyConfig';

The solution is not optimal and will change in the coming days, however it'll allow you to start playing with the module.

@brianhyder
Copy link
Author

Excellent. I really appreciate the reply and workaround.

@dreamorosi dreamorosi linked a pull request Jun 2, 2023 that will close this issue
9 tasks
@github-project-automation github-project-automation bot moved this from Backlog to Coming soon in AWS Lambda Powertools for TypeScript Jun 2, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Jun 2, 2023

⚠️ COMMENT VISIBILITY WARNING ⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

@github-actions github-actions bot added pending-release This item has been merged and will be released soon and removed confirmed The scope is clear, ready for implementation labels Jun 2, 2023
@dreamorosi
Copy link
Contributor

Hi Brian, I have merged some changes that include a new structure for exports. The PR description has some examples.

You should be able to access all the modules and types. This is a new structure that we haven't used in other utilities, so if there's any issue module/type that you need to access and it's not exposed, please don't hesitate to let me know and I'll fix it.

Thank you again for opening the issue and for the patience!

@github-actions
Copy link
Contributor

github-actions bot commented Jun 9, 2023

This is now released under version!

@dreamorosi dreamorosi moved this from Coming soon to Shipped in AWS Lambda Powertools for TypeScript Jun 9, 2023
@dreamorosi dreamorosi added completed This item is complete and has been merged/shipped and removed pending-release This item has been merged and will be released soon labels Jun 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working completed This item is complete and has been merged/shipped idempotency This item relates to the Idempotency Utility
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants