Skip to content

Conversation

@Ansonhkg
Copy link
Collaborator

@Ansonhkg Ansonhkg commented Oct 21, 2025

WHAT

  • expose a tree-shakeable ipfs subpath on @lit-protocol/lit-client that wraps the existing CIDv0 routine

USAGE

import { getIpfsId } from '@lit-protocol/lit-client/ipfs';

const cid = await getIpfsId('hello');
// → Qm...

TEST

./packages/lit-client/src/ipfs/getIpfsId.spec.ts

image

https://discord.com/channels/896185694857343026/1430161313430241461/1430479660516507729

image

REF

SNAPSHOTS

🦋  success packages published successfully:
🦋  @lit-protocol/e2e@0.0.0-20251021155110
🦋  @lit-protocol/lit-client@0.0.0-20251021155110

Copy link
Contributor

Copilot AI left a 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 getIpfsId function that generates CIDv0 IPFS hashes from strings, Uint8Arrays, ArrayBuffers, or ArrayBufferViews
  • Exposed the utility via a subpath export @lit-protocol/lit-client/ipfs to 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.

Ansonhkg and others added 3 commits October 21, 2025 16:44
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>
@Ansonhkg Ansonhkg merged commit fe5d061 into naga Oct 24, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants