Shared diff-viewer package consumed as workspace TypeScript source (no build step). See the root AGENTS.md for repo-wide commands and gotchas.
Run from the monorepo root, or cd packages/diff-core first:
pnpm --filter @diffhub/diff-core run lint # oxlint .
pnpm --filter @diffhub/diff-core run check-types # tsc --noEmit
pnpm --filter @diffhub/diff-core run format:check # oxfmt --check . (read-only, verified)
pnpm --filter @diffhub/diff-core run format # oxfmt --write .All three read-only commands above were run against this checkout and passed.
- Two entry points:
.(src/index.ts, framework-agnostic stream/theme/display utilities and types) and./react(src/react.ts, the worker-pool provider, streaming hook,ReadOnlyDiffView, and the shared chrome:FileList,StatusBar,FileDiffHeader,Sidebar). - Both
apps/cliandapps/webdepend on it ("@diffhub/diff-core": "*") and import from both entry points;apps/cli/next.config.tsadds it totranspilePackagessince it ships untranspiled.tsx/.ts. - It is not framework-agnostic:
./reacthas"use client"components, a Next.js peer dependency, and React 19 peer deps (@base-ui/react,@pierre/diffs,@pierre/trees,blode-icons-react). Treat it as a shared UI/diff-rendering layer, not a pure utility library. - Never import from
apps/cliorapps/webhere. This package is consumed by both apps; a reverse dependency on either app would create a cycle. - No Node-only APIs (
fs,child_process) appear insrc/today; keep it that way so./reactstays safe to bundle for the browser. Server-only git/filesystem logic belongs in the consuming app (e.g.apps/cli/lib/git.ts), not here. - Diff syntax themes (
src/themes/diff-themes.ts) and worker-pool registration (src/worker/) are shared verbatim betweenapps/cliandapps/web; changes here affect both apps' viewers.