Skip to content

feat(web): browse git repos in-browser via isomorphic-git#554

Merged
wesbillman merged 4 commits into
mainfrom
web/repo-detail-isogit
May 12, 2026
Merged

feat(web): browse git repos in-browser via isomorphic-git#554
wesbillman merged 4 commits into
mainfrom
web/repo-detail-isogit

Conversation

@wesbillman
Copy link
Copy Markdown
Collaborator

Summary

  • Clones repos into IndexedDB using isomorphic-git + LightningFS, then renders file tree, commit history, and README (as markdown) on the repo detail page
  • Adds NIP-98 HTTP auth for the relay's smart HTTP git transport
  • Patches isomorphic-git's broken exports map (root export missing "import" condition) via pnpm patch so Vite resolves to the browser-safe ESM build
  • Adds Buffer polyfill (feross/buffer) — isomorphic-git needs it for pack-file parsing even in the ESM build

Changes

  • web/src/features/repos/git-client.ts — isomorphic-git wrapper (clone, tree, blob, log, readme)
  • web/src/features/repos/use-git-browse.ts — React Query hooks
  • web/src/features/repos/ui/RepoTreeSection.tsx — file tree component
  • web/src/features/repos/ui/RepoCommitsSection.tsx — commits list
  • web/src/features/repos/ui/RepoReadmeSection.tsx — README markdown renderer
  • web/src/features/repos/ui/RepoDetailPage.tsx — two-column sidebar layout, error banner, git browse integration
  • web/src/shared/lib/nip98.ts — NIP-98 HTTP auth helper
  • web/src/shared/lib/nostr-client.ts — exported getEphemeralKey
  • patches/isomorphic-git.patch — fix missing import condition in exports map
  • .env.example — document SPROUT_GIT_REPO_PATH
  • .gitignore — add sprout.db

Test plan

  • Run just relay and just web, navigate to a repo detail page
  • Verify file tree, commit list, and README render correctly
  • Verify sidebar shows People section and Connect button
  • Check browser console for [git-clone] success log
  • Verify no Node polyfill errors (createHash, Buffer) in console
  • Test with a repo that has no README (should show nothing, no error)

🤖 Generated with Claude Code

wesbillman and others added 4 commits May 12, 2026 13:51
…states

Display branch/tag refs from kind:30618 events, HEAD commit SHA,
channel link from sprout-channel tag, and proper loading/empty states.
No new backend APIs — leverages existing Nostr event types.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Clone repos into IndexedDB using isomorphic-git + LightningFS, then
render file tree, commit history, and README (as markdown) on the repo
detail page. NIP-98 auth headers authenticate the smart HTTP transport.

- Add git-client.ts wrapper (clone, tree, blob, log, readme)
- Add React Query hooks (useGitClone, useGitTree, useGitLog, etc.)
- Add UI sections: RepoTreeSection, RepoCommitsSection, RepoReadmeSection
- Update RepoDetailPage with two-column sidebar layout and error banner
- Export getEphemeralKey from nostr-client for NIP-98 signing
- Add NIP-98 HTTP auth helper (nip98.ts)
- Patch isomorphic-git exports map to resolve ESM build in Vite
- Add Buffer polyfill (feross/buffer) for browser compatibility
- Document SPROUT_GIT_REPO_PATH in .env.example
- Add sprout.db to .gitignore

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Split the repo detail page into two tabs: "Code" (file tree + README)
and "Commits" (commit history), matching the standard GitHub-style
repo page pattern.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Install @tailwindcss/typography so prose classes actually style
  the rendered markdown (headings, lists, code blocks, links)
- Extract triplicated relativeTime() into shared/lib/relative-time.ts
- Remove debug console.log/error statements from git clone hook

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@wesbillman
Copy link
Copy Markdown
Collaborator Author

Screenshot 2026-05-12 at 3 04 59 PM Screenshot 2026-05-12 at 3 05 03 PM Screenshot 2026-05-12 at 3 05 08 PM

@wesbillman wesbillman merged commit 8092757 into main May 12, 2026
15 checks passed
@wesbillman wesbillman deleted the web/repo-detail-isogit branch May 12, 2026 22:06
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.

1 participant