@level0x40/react-git
v0.0.2
Published
Static Git source artifact viewer powered by @lazarv/react-server. Render any local Git repo as a publishable React UI.
Maintainers
Readme
@level0x40/react-git
Static Git source artifact viewer. Render any local Git repository as a publishable React UI — no server, no database, no runtime access to the original repo.
npx @level0x40/react-git build /path/to/your/repoThe output is plain HTML, JSON, and assets under ./dist. Drop it on Cloudflare Pages, Netlify, GitHub Pages, S3 + CloudFront, or any static host.
What it does
Reads a local Git repository, extracts its source artifacts into a typed manifest, and renders them as a self-contained static site: commits, refs, trees, blobs, diffs, and a contribution heatmap. The build pipeline runs @lazarv/react-server's production server with a streaming export hook driving renders, then writes the result to disk.
Quick start
Run from inside the repo you want to render:
# Build a static site for the current repo.
npx @level0x40/react-git build
# For iterative work, run the dev server with hot reload.
npx @level0x40/react-git devBoth accept an optional repo path if you'd rather run them from elsewhere:
npx @level0x40/react-git build /path/to/your/repoTemplates
Six visual styles ship in the box. Pick one with --template <name>, or stack multiple — file overrides and config merging both honour CLI order, so the last entry wins.
| Name | Style |
| -------------- | ------------------------------------------ |
| default | Editorial monospace, terra-cotta accent. |
| primer | GitHub-faithful Primer aesthetic. |
| w3c | W3C technical-report styling, navy accent. |
| react-server | Companion to react-server.dev, gold ramp. |
| sketchpad | Hand-drawn coral-and-teal panel look. |
| tui | Terminal aesthetic, ANSI palette. |
# Stack two templates: a built-in for the chrome, a local folder for overrides.
react-git build --template primer --template ./my-overlayModes
Two extraction strategies, selected with --live:
- manifest (default) — Pre-extract every commit, ref, tree, and blob into JSON shards. Fastest builds, deterministic, no git access at render time.
- live — Skip extraction; query Git directly for every render. Best for development against a moving repo, or one-off previews.
Data layer
The Git data extraction is a separate concern from rendering. The same code that powers the static site is exposed as a standalone library through three subpath exports — usable from any Node host, with no @lazarv/react-server runtime needed.
| Subpath | Purpose |
| ----------------------------------- | ------------------------------------------------------------------------------ |
| @level0x40/react-git/source | Stable function surface — getProject, listCommits, getDiff, getBlob, … |
| @level0x40/react-git/source/build | Same content under its build-time alias. |
| @level0x40/react-git/source/types | JSDoc typedefs (SourceCommit, SourceTree, SourceDiff, …). |
import { listCommits, getDiff } from "@level0x40/react-git/source";
const commits = await listCommits();
const diff = await getDiff(commits[0].sha);The public functions carry "use cache" directives that the @lazarv/react-server runtime interprets for per-request deduplication. Outside that runtime the directives are inert string statements — calls work in any Node host and just don't dedupe automatically. Wrap with your own cache for hot paths.
Forwarding flags to @lazarv/react-server
Any flag that react-git doesn't own is forwarded verbatim to the underlying runtime, including the optional value forms cac uses:
react-git build --deploy # → react-server build --deploy
react-git build --silent --adapter cloudflare
react-git dev --cors --devtools --inspect--force and --mode collide between react-git and react-server: --force keeps its react-git meaning (cache wipe) and is not forwarded; --mode is forwarded (production/development) — flip to live extraction with --live instead.
Documentation
Full docs: react-git.level0x40.com.
Contributing
Contributions, issues, and feature requests are welcome. See CONTRIBUTING.md and the Code of Conduct. Open an issue at github.com/level0x40/react-git/issues.
License
A Level 0x40 Labs project. For developers, artists and gamers.
