-
Notifications
You must be signed in to change notification settings - Fork 88
Feature/jss 133 naga feature request #969
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
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.
Pull Request Overview
This PR introduces a tree-shakeable IPFS utility subpath export for the @lit-protocol/lit-client package, providing a getIpfsId function that generates CIDv0 IPFS identifiers without bloating the main client bundle.
Key Changes:
- Added a new
getIpfsIdfunction that generates CIDv0 IPFS hashes from strings, Uint8Arrays, ArrayBuffers, or ArrayBufferViews - Exposed the utility via a subpath export
@lit-protocol/lit-client/ipfsto enable tree-shaking - Included comprehensive test coverage for various input types and error cases
Reviewed Changes
Copilot reviewed 9 out of 10 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/lit-client/src/ipfs/getIpfsId.ts | Implements core CIDv0 generation logic with cross-platform input normalization |
| packages/lit-client/src/ipfs/index.ts | Re-exports getIpfsId function and IpfsCidV0 type |
| packages/lit-client/ipfs/index.ts | Public subpath entry point that forwards exports from src/ipfs |
| packages/lit-client/package.json | Configures subpath exports, type mappings, and adds typestub-ipfs-only-hash dependency |
| packages/lit-client/src/ipfs/getIpfsId.spec.ts | Tests string/byte input handling and error conditions |
| packages/lit-client/jest.config.ts | Sets test environment to node for IPFS utility tests |
| docs/sdk/sdk-reference/lit-client/functions/getIpfsId.mdx | Documents API usage and parameters |
| docs/docs.json | Adds getIpfsId documentation to Utilities navigation group |
| .changeset/solid-heads-repeat.md | Changelog entry describing the new feature |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Anson <ansonox@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Anson <ansonox@gmail.com>
WHAT
ipfssubpath on@lit-protocol/lit-clientthat wraps the existingCIDv0routineUSAGE
TEST
./packages/lit-client/src/ipfs/getIpfsId.spec.ts
https://discord.com/channels/896185694857343026/1430161313430241461/1430479660516507729
REF
SNAPSHOTS