-
Notifications
You must be signed in to change notification settings - Fork 242
docs(extensions): add example gallery #688
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| --- | ||
| --- |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,25 @@ | ||||||
| # Extension examples | ||||||
|
|
||||||
| Ready-to-run, opt-in examples for Hunk's experimental TypeScript extension API. None of these folders are bundled or loaded automatically. | ||||||
|
|
||||||
| | Example | What it demonstrates | Best starting point for | | ||||||
| | -------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------- | | ||||||
| | [`review-triage/`](review-triage/) | A session-local hunk review board built from a React sidebar, commands, dialogs, navigation, lifecycle events, and the extension event bus | Stateful review workflows and custom sidebars | | ||||||
| | [`rendered-markdown/`](rendered-markdown/) | A parsed Markdown presentation using symbolic rows, exact-source bindings, inline notes, and raw-diff fallback | Host-rendered file previews | | ||||||
| | [`jsx-file-view/`](jsx-file-view/) | The smallest fixed-height React/OpenTUI file-view proof of concept, including hooks, semantic theme props, and row fallback | Custom JSX rows | | ||||||
| | [`jsx-file-view-gallery/`](jsx-file-view-gallery/) | TypeScript change-atlas cards, CSS color swatches, dependency-version deltas, and a mixed raw/custom five-file review | Realistic file-view layouts and fallback behavior | | ||||||
|
|
||||||
| Each folder has its own README with an exact command and notes on the API contract it exercises. Run an example directly from this checkout with `--extension` while developing. To install one, copy its complete folder into `~/.config/hunk/extensions/` and install any dependency its `package.json` declares. | ||||||
|
|
||||||
| ## Reference implementations | ||||||
|
|
||||||
| Hunk also exercises the public API in its bundled extensions: | ||||||
|
|
||||||
| - [`src/extensions/default/ui/sidebar/`](../../src/extensions/default/ui/sidebar/) implements Hunk's built-in file navigation as a registered React sidebar. | ||||||
| - [`src/extensions/default/vcs/`](../../src/extensions/default/vcs/) implements the Git, Jujutsu, and Sapling backends as registered VCS adapters. | ||||||
|
|
||||||
| These are production reference implementations rather than installable examples. They remain loaded when user extensions are disabled. | ||||||
|
|
||||||
| ## Learn the API | ||||||
|
|
||||||
| Start with the [extension authoring guide](../../docs/extensions.md), then use the focused website guides for [custom sidebars](https://hunkdiff.dev/docs/extend/custom-sidebars/), [file previews](https://hunkdiff.dev/docs/extend/file-previews/), and [VCS adapters](https://hunkdiff.dev/docs/extend/vcs-adapters/). | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
These three links use
Suggested change
Prompt To Fix With AIThis is a comment left during a code review.
Path: examples/extensions/README.md
Line: 25
Comment:
**Use the canonical website origin**
These three links use `hunkdiff.dev`, while the website configuration and deployment documentation consistently use `hunk.dev`; readers are therefore sent through an origin that is not maintained as part of the documented website deployment.
```suggestion
Start with the [extension authoring guide](../../docs/extensions.md), then use the focused website guides for [custom sidebars](https://hunk.dev/docs/extend/custom-sidebars/), [file previews](https://hunk.dev/docs/extend/file-previews/), and [VCS adapters](https://hunk.dev/docs/extend/vcs-adapters/).
```
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time! |
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The gallery promises an exact command in every linked README, but the rendered-Markdown command references
before.mdandafter.md, which are absent from the checkout. Following that example therefore does not provide the advertised runnable scenario; point it at included fixtures or identify the arguments as user-supplied files.Knowledge Base Used: Extension System: API, Loading, and Host Integration
Prompt To Fix With AI