Skip to content

Commit bc44bf7

Browse files
committed
refactor: split extension into focused modules
1 parent 05bfa68 commit bc44bf7

17 files changed

Lines changed: 1389 additions & 1215 deletions

AGENTS.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,19 @@
33
## Purpose
44

55
- Hunk extension that exposes GitHub workflows under `hunk gh`.
6-
- `hunk gh pr` fetches a pull request diff directly from GitHub and delegates to Hunk's built-in `patch` command.
6+
- `hunk gh pr` and `hunk gh commit` fetch diffs directly from GitHub and delegate to Hunk's built-in `patch` command.
77
- The extension ships as TypeScript source with no runtime dependencies.
88

9+
## Architecture
10+
11+
- `index.ts` is the folder-extension entry point and public re-export surface; keep it tiny.
12+
- `src/parsing.ts` validates PR, commit, repository, and delegated patch arguments.
13+
- `src/repository.ts` parses and resolves GitHub origins without invoking a shell.
14+
- `src/github.ts` owns authenticated, bounded, redirect-safe GitHub diff requests.
15+
- `src/temporaryPatch.ts` owns restrictive temporary patch creation and cleanup.
16+
- `src/extension.ts` dispatches commands and delegates fetched diffs to Hunk.
17+
- Tests stay colocated with each module under `src/`.
18+
919
## Working rules
1020

1121
- Preserve the fixed `api.github.com` credential boundary and manual redirect policy.

0 commit comments

Comments
 (0)