-
Notifications
You must be signed in to change notification settings - Fork 1
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
Creating a singleton instance of Contentful #5
Conversation
New dependencies detected. Learn more about Socket for GitHub ↗︎
|
👍 Dependency issues cleared. Learn more about Socket for GitHub ↗︎ This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored. Ignoring: Next stepsTake a deeper look at the dependencyTake a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support [AT] socket [DOT] dev. Remove the packageIf you happen to install a dependency that Socket reports as Known Malware you should immediately remove it and select a different dependency. For other alert types, you may may wish to investigate alternative packages or consider if there are other ways to mitigate the specific risk posed by the dependency. Mark a package as acceptable riskTo ignore an alert, reply with a comment starting with |
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.
Looks good to me so far! One thing I would add is the type infers from generics instead explicit any
.
I'm thinking of something like:
public async getEntry<T = Record<string, unknown>>(entryId: string) {
return await this.getEntryHarmonized<T>(
() => this.getClientInstance().getEntry<T>(entryId),
// The following might not even needed if we can infer `T` from the return type
({ fields }: { fields: T }) => ({ data: fields }),
);
}
This requires typed client instances. The above example is a high level abstraction of what actually needed here. For now, I'd say we can merge this as is.
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.
I really like your approach, @bounteous17
I've just added a small suggestion about the tests, but we can do it in a future PR if you want.
@UlisesGascon , perhaps your feedback is useful here related to the alerts reported by socket.dev related to some dependencies running post-install scripts. |
I reviewed the comment from the socket.dev bot, and here are my fast conclusions on the topic: Regarding
|
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.
I only reviewed the dependencies and I left a comment with my analysis.
@SocketSecurity ignore npm/[email protected] |
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.
Thank you so much @UlisesGascon ! |
Hi @UlisesGascon, thanks for your time and valuable info! One thing here: |
This is the result of you are running raw |
@matyasjay @inigomarquinez we would implement the abstract type for the different providers instance on another PR. For the moment let's leave it as an |
@UlisesGascon At the beginning |
@all-contributors please add @bounteous17 for code,test,doc |
@all-contributors please add @UlisesGascon for review |
This project's configuration file has malformed JSON: .all-contributorsrc. Error:: Unexpected token ] in JSON at position 940 |
@all-contributors please add @UlisesGascon for review |
I've put up a pull request to add @UlisesGascon! 🎉 |
I've put up a pull request to add @bounteous17! 🎉 I've put up a pull request to add @matyasjay! 🎉 We had trouble processing your request. Please try again later. |
Description
Related Issue
Motivation and Context
How Has This Been Tested?
Screenshots (if appropriate):
Types of changes
Checklist: