React code diff viewer with virtual scroll, split/unified/preview modes, syntax highlighting, inline diff, search.
npm run dev— start demo app (App.tsx)npm run build:lib— build library distnpm test— run vitestnpx tsc --noEmit— typecheck
Before publishing, you MUST update CHANGELOG.md:
- Run tests:
npx vitest run - Run typecheck:
npx tsc --noEmit - Build:
npm run build:lib - Bump version in
package.json - Add a new entry to the top of
CHANGELOG.mdwith the version number and all changes - Publish:
npm publish --registry https://registry.npmjs.org --access public - Sync to consumer (
E:\binn\ftre-desktop): updatepnpm-lock.yaml(3 spots: resolution, specifier+version, package entry) +pnpm install --frozen-lockfile
src/code-diff/CodeDiff.tsx— main component, virtual scroll, toolbar, split/unified/preview renderingsrc/code-diff/diff-engine.ts— computeDiff, buildVisibleRows, findChangeBlocks, searchsrc/code-diff/CodeDiff.css— all stylingsrc/code-diff/types.ts— TypeScript interfaces (CodeDiffProps, ToolbarRenderProps, etc.)src/code-diff/default-config.tsx— theme colors, token colors, default configvite.lib.config.ts— library build config (external: react, react-dom, react/jsx-runtime)CHANGELOG.md— version history (MUST update on every publish)