Skip to content

Add IPFS CIDv0 computation and badge - #8

Merged
kirushik merged 2 commits into
mainfrom
kirushik/ipfs
Mar 29, 2026
Merged

kirushik merged 2 commits into
mainfrom
kirushik/ipfs

Conversation

@kirushik

Copy link
Copy Markdown
Owner

Add unit tests for cidv0 and an E2E test for the badge. Update docs/architecture.md to list the new modules and include the CSS and main wiring that render the badge in the UI.

Add unit tests for cidv0 and an E2E test for the badge. Update
docs/architecture.md to list the new modules and include the CSS and
main wiring that render the badge in the UI.
Copilot AI review requested due to automatic review settings March 29, 2026 15:06
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Mar 29, 2026 •

Copy link
Copy Markdown

Deploying paternoster with  Cloudflare Pages  Cloudflare Pages

Latest commit: e3d233b
Status: ✅  Deploy successful!
Preview URL: https://db6fbc03.paternoster.pages.dev
Branch Preview URL: https://kirushik-ipfs.paternoster.pages.dev

View logs

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds IPFS CIDv0 computation to the client and exposes it in the UI as a small “ipfs://…” badge, with accompanying unit + E2E coverage and architecture docs updates.

Changes:

  • Introduces src/ipfs.ts to compute CIDv0 (UnixFS/DAG-PB + multihash + base58btc).
  • Adds src/cid.ts and wires it from src/main.ts to self-fetch and render a CID badge in the UI (with new CSS).
  • Adds unit tests for cidv0 and an E2E assertion that the badge appears and matches CIDv0 format; updates module map docs.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tests/unit/ipfs.test.ts Adds unit coverage for CIDv0 outputs and basic properties.
tests/e2e/basic.spec.ts Adds E2E check that the CID badge renders with a CIDv0-looking value.
src/style.css Styles the new fixed-position CID badge.
src/main.ts Wires CID badge initialization into app startup.
src/ipfs.ts Implements CIDv0 computation (UnixFS/DAG-PB protobuf + SHA-256 + base58btc).
src/cid.ts Fetches the current page, computes CIDv0, and appends the badge element.
docs/architecture.md Documents the new ipfs.ts and cid.ts modules.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/ipfs.ts
Comment thread src/cid.ts
Also fixed a couple of Copilot nits
@kirushik
kirushik merged commit 5fe2cff into main Mar 29, 2026
4 checks passed
@kirushik
kirushik deleted the kirushik/ipfs branch March 29, 2026 15:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants