Thanks for your interest in diffy!
When contributing:
- Use Conventional Commits for commit messages (e.g.
feat: add refresh button,fix: expand file when unmarking as viewed). - Keep PR descriptions clear and concise.
git clone git@github.com:suveshmoza/diffy.git
cd diffy
pnpm install
pnpm devpnpm dev watches for changes and rebuilds the extension. Reload the unpacked extension in your browser after each rebuild.
When developing with pnpm dev, load the extension from dist/chrome-mv3-dev. Production builds output to dist/chrome-mv3.
pnpm build # Chrome
pnpm build:firefox # Firefox
pnpm build:edge # Edge
pnpm build:safari # Safari
pnpm zip # Packaged Chrome zip
pnpm zip:firefox # Packaged Firefox zip
pnpm zip:edge # Packaged Edge zip-
Build the extension (or keep
pnpm devrunning):pnpm build # or: pnpm dev -
Open
chrome://extensions. -
Enable Developer mode.
-
Click Load unpacked.
-
Select the build output folder:
pnpm dev→dist/chrome-mv3-devpnpm build→dist/chrome-mv3
-
Build for Firefox:
pnpm build:firefox
-
Open
about:debugging#/runtime/this-firefox. -
Click Load Temporary Add-on….
-
Select any file inside
dist/firefox-mv3(for examplemanifest.json).
To remove the extension, use Remove on the extension card (Chrome) or reload the temporary add-on page (Firefox).
diffy/
├── src/
│ ├── app/ # Overlay React composition root
│ ├── domains/ # Feature slices (code-view, diff, github, review, theming, …)
│ ├── entrypoints/ # background, github-pr.content, overlay, popup
│ ├── modules/ # WXT modules (shiki-pruner)
│ ├── shared/ # Shared UI and utilities
│ └── types/
├── patches/ # pnpm patchedDependencies (@pierre/trees)
└── wxt.config.ts
Syntax highlighting is powered by Pierre Diffs, which selects one highlighter backend at runtime:
- Highlights when WebAssembly SIMD is available (the usual case)
- Shiki JS (
shiki-js) as a fallback when WASM is unavailable or blocked
Only one backend is active per page. To keep the extension size small, we do not ship every Shiki grammar or theme. Languages and themes are controlled by hand-maintained allowlists (preload + pruning unused chunks from production builds).
| File | Editable? | Role |
|---|---|---|
src/domains/diff/highlighting/lang-ids.json |
Yes | Allowlist of canonical language ids to load and keep in the zip |
src/domains/diff/highlighting/lang-ids.ts |
No | Typed re-export of lang-ids.json for app / worker preload code |
src/domains/theming/model/theme-ids.json |
Yes | Allowlist of theme names offered in the UI and kept in the zip |
src/domains/theming/model/theme-ids.ts |
No | Typed re-export of theme-ids.json for catalog / preload code |
src/modules/shiki-pruner.ts |
No | On pnpm build, deletes Shiki lang/theme chunks not in the allowlists |
Use Shiki canonical language ids (the ID column, not Alias) — e.g. python, typescript, shellscript, docker. Aliases like ts / py / sh still work at highlight time; do not list them in lang-ids.json.
Add / remove: edit src/domains/diff/highlighting/lang-ids.json, then pnpm build and reload the extension.
Theme names match Pierre / Shiki theme ids (e.g. pierre-dark, pierre-light). The default allowlist is the Pierre family only; adding a Shiki theme name (e.g. catppuccin-mocha) keeps its grammar chunk and makes it selectable in the UI.
Add / remove: edit src/domains/theming/model/theme-ids.json, then pnpm build and reload the extension. Persisted theme names that are no longer allowlisted fall back to pierre-light / pierre-dark.