Skip to content

Commit bf70483

Browse files
committed
docs: tighten npm-first onboarding
1 parent 9792d4b commit bf70483

5 files changed

Lines changed: 39 additions & 159 deletions

File tree

CONTRIBUTING.md

Lines changed: 0 additions & 68 deletions
This file was deleted.

README.md

Lines changed: 38 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -2,64 +2,19 @@
22

33
Hunk is a terminal diff viewer for reviewing agent-authored changesets with a desktop-style UI.
44

5-
It is built for code review, not patch dumping:
6-
75
- full-screen multi-file review stream
86
- split, stacked, and responsive auto layouts
97
- keyboard and mouse navigation
10-
- optional agent rationale shown next to annotated hunks
8+
- optional agent rationale beside annotated hunks
119
- Git pager and difftool integration
1210

13-
## Requirements
14-
15-
- [Bun](https://bun.sh) 1.3.10+
16-
- Git for `hunk diff`, `hunk show`, `hunk stash show`, and `hunk pager`
17-
18-
> `npm i -g hunkdiff` installs the package, but the `hunk` executable still runs with Bun via its shebang. Install Bun first.
19-
2011
## Install
2112

22-
### Global install from npm
23-
2413
```bash
2514
npm i -g hunkdiff
2615
```
2716

28-
Then run:
29-
30-
```bash
31-
hunk diff
32-
```
33-
34-
### Global install with Bun
35-
36-
```bash
37-
bun install -g hunkdiff
38-
```
39-
40-
### Run from source
41-
42-
```bash
43-
git clone https://github.com/modem-dev/hunk.git
44-
cd hunk
45-
bun install
46-
bun run src/main.tsx -- diff
47-
```
48-
49-
### Build a standalone binary locally
50-
51-
```bash
52-
bun run build:bin
53-
./dist/hunk diff
54-
```
55-
56-
To install that binary into `~/.local/bin`:
57-
58-
```bash
59-
bun run install:bin
60-
```
61-
62-
Set `HUNK_INSTALL_DIR` first if you want a different install location.
17+
For now, the published `hunk` executable still expects [Bun](https://bun.sh) 1.3.10+ to be available on your `PATH` at runtime.
6318

6419
## Quick start
6520

@@ -93,6 +48,40 @@ Open a patch from stdin:
9348
git diff --no-color | hunk patch -
9449
```
9550

51+
## Feature comparison
52+
53+
| Capability | hunk | difftastic | delta | diff |
54+
| --- | --- | --- | --- | --- |
55+
| Dedicated interactive review UI |||||
56+
| Multi-file review stream with navigation sidebar |||||
57+
| Agent / AI rationale sidecar |||||
58+
| Split diffs |||||
59+
| Stacked diffs |||||
60+
| Auto responsive layouts |||||
61+
| Themes |||||
62+
| Syntax highlighting |||||
63+
| Syntax-aware / structural diffing |||||
64+
| Mouse support inside the diff viewer |||||
65+
| Runtime toggles for wrapping / line numbers / hunk metadata |||||
66+
| Pager-compatible mode |||||
67+
68+
## Benchmarks
69+
70+
Quick local timing snapshot from one Linux machine on the same 120-line TypeScript file pair. Metric: time until a changed marker first became visible.
71+
72+
| Tool | Avg first-visible changed output |
73+
| --- | ---: |
74+
| `diff` | ~37 ms |
75+
| `delta --paging=never` | ~35 ms |
76+
| `hunk diff` | ~219 ms |
77+
| `difft --display side-by-side` | ~266 ms |
78+
79+
Takeaway:
80+
81+
- `diff` and `delta` are fastest here because they print plain diff text and exit.
82+
- `hunk` spends more startup time on an interactive UI, syntax highlighting, navigation state, and optional agent context.
83+
- `difftastic` spends more startup time on structural diffing.
84+
9685
## Common workflows
9786

9887
- `hunk` — print CLI help
@@ -235,12 +224,6 @@ Install dependencies:
235224
bun install
236225
```
237226

238-
Run the source entrypoint:
239-
240-
```bash
241-
bun run src/main.tsx -- diff
242-
```
243-
244227
Validate a change:
245228

246229
```bash
@@ -256,8 +239,6 @@ bun run build:npm
256239
bun run check:pack
257240
```
258241

259-
## Open source project docs
242+
## License
260243

261-
- Contributing: [CONTRIBUTING.md](CONTRIBUTING.md)
262-
- Security: [SECURITY.md](SECURITY.md)
263-
- License: [MIT](LICENSE)
244+
[MIT](LICENSE)

SECURITY.md

Lines changed: 0 additions & 22 deletions
This file was deleted.

package.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,7 @@
1010
"files": [
1111
"dist/npm",
1212
"README.md",
13-
"LICENSE",
14-
"CONTRIBUTING.md",
15-
"SECURITY.md"
13+
"LICENSE"
1614
],
1715
"scripts": {
1816
"start": "bun run src/main.tsx",

scripts/check-pack.ts

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
#!/usr/bin/env bun
22

3-
import { existsSync } from "node:fs";
4-
53
interface PackedFile {
64
path: string;
75
size: number;
@@ -46,20 +44,13 @@ if (!pack) {
4644

4745
const publishedPaths = new Set(pack.files.map((file) => file.path));
4846
const requiredPaths = ["dist/npm/main.js", "README.md", "LICENSE", "package.json"];
49-
const optionalPaths = ["CONTRIBUTING.md", "SECURITY.md"];
5047

5148
for (const path of requiredPaths) {
5249
if (!publishedPaths.has(path)) {
5350
throw new Error(`Expected npm package to include ${path}.`);
5451
}
5552
}
5653

57-
for (const path of optionalPaths) {
58-
if (existsSync(path) && !publishedPaths.has(path)) {
59-
throw new Error(`Expected npm package to include ${path} when it exists in the repo.`);
60-
}
61-
}
62-
6354
const forbiddenPrefixes = [".github/", "src/", "test/", "scripts/", "tmp/"];
6455
const forbiddenPaths = ["AGENTS.md", "autoresearch.checks.sh", "autoresearch.sh", "bun.lock"];
6556

0 commit comments

Comments
 (0)