github-search-cli 9.4.0 → 9.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,192 +1,238 @@
1
- # Changelog
2
-
3
- All notable changes to `github-search-cli` (published as the `ghfind` binary).
4
-
5
- Format follows [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). Published versions and dates mirror [npm](https://www.npmjs.com/package/github-search-cli?activeTab=versions).
6
-
7
- ---
8
-
9
- ## [Unreleased] — 9.4.0
10
-
11
- Release tracking for bookmarked repos, plus a bookmarks page and toast notifications in the TUI.
12
-
13
- ### Added
14
-
15
- **Release tracker** — follow releases of repos you've bookmarked
16
- - `src/releases.ts` — checks each bookmarked repo against `GET /repos/{owner}/{repo}/releases?per_page=5`
17
- - Seen state is `lastSeenAt` per bookmark; "new" means published after that timestamp
18
- - ETag conditional requests + `GITHUB_TOKEN` when available to conserve rate budget
19
- - Prereleases shown and tagged `[pre]`; drafts never shown
20
- - `ghfind --releases` prints the new-release feed, then marks everything seen; `--releases --json` for machine output
21
- - Opening the Notifications panel (Space → System → Notifications) now runs a check in the background and files each new release as a `🚀` notification
22
-
23
- **Bookmarks page** — bookmarks are now a first-class mode, not an overlay
24
- - Reachable from the landing screen (`b`, or `Enter` on the new button) and from Space → Navigate → Bookmarks
25
- - `Enter` opens the repo in a browser, `d` removes, `Esc` / `←` returns to landing
26
- - `SessionState.mode` accepts `"bookmarks"`, so a restart restores you onto the page
27
-
28
- **Landing bookmarks button** — fourth selectable row below the three mode cards, with a live count (`4 saved` / `none yet`) refreshed on every visit
29
-
30
- **Toast popup** — top-right rounded card confirming bookmark changes; green border for bookmarked, yellow for unbookmarked, auto-hides after 2s
31
-
32
- **`b` keybinding** — toggles bookmark on the selected repo from the main view (previously only reachable via Space → Repo → Bookmark)
33
-
34
- **Diagnostics: `ghfind --doctor`** — environment troubleshooting command for the interactive TUI
35
- - 10 checks: runtime, bundled Bun, system Bun, Node version, build output, source, TTY, config validity, GitHub token, state/cache dirs
36
- - Per-check status: green `PASS`, yellow `WARN`, red `FAIL`; non-zero exit on any FAIL so scripts can detect broken installs
37
- - `src/doctor.ts` is purely diagnostic (no TUI, no network) and exits with code 1 if any check fails
38
- - `bin/ghfind.js` Strategy 1 now prefers the bundled `vendor/bun` (downloaded by `postinstall.js`) and falls back to a system-installed `bun` on PATH; doctor confirms which one wins
39
-
40
- **Error report on uncaught exceptions** — never auto-posts
41
- - When `ghfind` hits an unexpected error, builds a pre-filled `https://github.com/codersdfs/search-cli/issues/new?title=...&body=...&labels=bug` URL with the error class, message, stack, command line, and environment (ghfind version, runtime, platform)
42
- - Tries to open the URL in the user's default browser (Bun.spawn when available, child_process.spawn detached fallback for Node); prints the URL when no browser can be launched
43
- - Known user-facing errors (`SearchCliError` subclasses) keep their existing friendly message and skip the report flow
44
- - `src/error-report.ts` is the new module; `tests/error-report.test.ts` covers URL format, ANSI stripping, long-message truncation, non-Error throwables, env + command in body
45
-
46
- ### Fixed
47
- - Landing screen vanished after the bookmarks page landed — `showLanding()` revealed `landingBox` before `hideMainContent()` hid it again; ordering corrected
48
- - Arrow keys moved the landing selection *and* the bookmarks list at the same time — the landing handler only checked `currentMode`, which opening bookmarks doesn't change. Now gated on `landingKeysActive(mode, overlay)`
49
- - `Enter` on the landing bookmarks button immediately opened the first bookmark in a browser — the same key event reached the global handler after the page opened. Consumed keys now call `key.stopPropagation()`
50
- - `q` inside the bookmarks overlay quit the app instead of closing it — same double-handling root cause
51
- - `tests/tips.test.ts` imported a `TipRotator` class that `src/tips.ts` never exported, so its module-load error was misattributed to whichever test file ran next. Added the class and `defaultRotator`; behavior unchanged
52
-
53
- ### Changed
54
- - Help screen: new "Bookmarks Page" section; `b` / `c` / `t` documented under Main View; Landing section documents the button; "Overlay Keys" no longer lists bookmarks
55
- - Leader menu "Notifications" now reads "View alerts — checks bookmarks for new releases"
56
- - Landing hint line includes `[b]ookmarks`
57
- - `Bookmark` type gains `lastSeenAt`; `src/bookmarks.ts` exports `getLastSeen()` / `markSeen()`
58
-
59
- ### Internal
60
- - Extracted `src/toast.ts` and `src/landing.ts` so the toast, button, and key-routing predicates are testable without booting the TUI
61
- - Tests: 187 passing — `tests/landing.test.ts` (30), `tests/toast.test.ts` (6), `tests/releases.test.ts`, `tests/tips.test.ts`, `tests/doctor.test.ts` (2), `tests/error-report.test.ts` (6)
62
-
63
- ---
64
-
65
- ## [9.3.0] — 2026-08-24
66
-
67
- ### Fixed
68
- - `c` keybinding in the TUI not adding repos to comparison — a missing closing brace in the space-key handler broke every later key handler (`c`, `t`, `?`)
69
- - README viewer now renders full markdown (headings, code blocks, lists, tables, blockquotes, rules) instead of stripping formatting
70
-
71
- ### Changed
72
- - Widened compare table columns (min 35 chars) and added Description + URL rows
73
- - Compare table shows up to 5 topics per repo (was 3)
74
-
75
- ---
76
-
77
- ## [9.2.1] — 2026-08-23
78
-
79
- ### Added
80
- - npm package search (beta)
81
- - New landing screen with selectable mode cards
82
-
83
- ### Fixed
84
- - TUI layout issues on small terminals
85
- - Trending not visible when launched from the landing screen — `loadTrending()` was the only mode switch that didn't set `body.visible`
86
- - Trending tabs now fetch independently, with an active-tab underline
87
-
88
- ### Changed
89
- - Removed the bundled Bun binary from the npm package; it is downloaded at install time on all platforms
90
- - Package size reduced from 39.5 MB to 100 KB
91
- - Postinstall no longer fails `npm install` when the Bun download fails (graceful fallback)
92
- - Removed `bun` from the engines field — Bun need not be pre-installed
93
- - Non-interactive modes (`--json`, `--csv`, …) run on Node.js 20+ alone
94
-
95
- ---
96
-
97
- ## [9.1.1] — 2026-08-11
98
-
99
- ### Fixed
100
- - Postinstall now exits with code 1 on Bun download failure
101
- - Removed dead Strategy 3 fallback in `bin/ghfind.js` (Node cannot import `.ts`)
102
-
103
- ### Changed
104
- - Bundle `vendor/` and `dist/` in the npm package for offline install
105
- - Bundled Bun updated from 1.3.12 to 1.3.14
106
-
107
- ---
108
-
109
- ## [9.1.0] — 2026-08-07
110
-
111
- ### Added
112
- - Automatic update checking against the npm registry, with a Y/N/L modal (install now / skip / dismiss)
113
- - Leader menu (Space) consolidating all contextual actions
114
- - Topic explorer, notifications panel, and saved searches overlay
115
- - Activity graph toggle (commit chart fullscreen)
116
- - README viewer
117
- - Tab auto-complete for search qualifiers
118
- - PageUp / PageDown navigation
119
- - `Ctrl+X` clears history, `Ctrl+C` clears all notifications
120
-
121
- ### Fixed
122
- - Postinstall downloads the Bun binary correctly on all platforms
123
- - Zip asset names match Bun's current release naming
124
- - Zip parsing uses the central directory instead of local file headers
125
- - `postinstall` uses `node` instead of `bun run`, so Bun need not be pre-installed
126
- - TUI works on Node.js 20+ via the downloaded Bun binary
127
-
128
- ### Changed
129
- - Removed `vendor/` from the npm package (Bun downloaded at install time)
130
- - Improved export error handling and format selection
131
-
132
- ---
133
-
134
- ## [0.9.0] — 2026-07-31
135
-
136
- ### Added
137
- - Watch mode (`--watch`) for polling a query
138
- - Notifications panel and UI refinements
139
-
140
- ### Fixed
141
- - Trending browser fixes
142
-
143
- ---
144
-
145
- ## [0.8.2] — 2026-07-31
146
-
147
- ### Fixed
148
- - TUI stability fixes; rewritten keybindings reference
149
-
150
- ---
151
-
152
- ## [0.8.1] — 2026-07-27
153
-
154
- ### Fixed
155
- - Follow-up fixes to the 0.8.0 breaking change
156
-
157
- ---
158
-
159
- ## [0.8.0] — 2026-07-26
160
-
161
- ### Added
162
- - Trending browser, deep-dive, compare, export, share, topics, saved searches
163
- - Activity graph, README viewer, notifications panel
164
-
165
- **Breaking:** entry point and command surface changed; 0.8.1 shipped the same day as an emergency follow-up
166
-
167
- ---
168
-
169
- ## [0.7.0] — 2026-07-25
170
-
171
- ### Added
172
- - Bookmarks and search history
173
-
174
- ---
175
-
176
- ## [0.6.1] — 2026-07-24
177
-
178
- ### Fixed
179
- - Fixes for the initial release
180
-
181
- ---
182
-
183
- ## [0.6.0] — 2026-07-23
184
-
185
- ### Added
186
- - First public release: repo search with qualifiers, sorting, and JSON output
187
-
188
- ---
189
-
190
- ## A note on version numbers
191
-
192
- The jump from `0.9.0` to `9.1.0` was a one-time renumbering, not 9 major releases. The `9.x` line begins with the update checker and leader menu. There is no `9.0.0`, and `9.2.0` was never published — `9.2.1` superseded it before release.
1
+ # Changelog
2
+
3
+ All notable changes to `github-search-cli` (published as the `ghfind` binary).
4
+
5
+ Format follows [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). Published versions and dates mirror [npm](https://www.npmjs.com/package/github-search-cli?activeTab=versions).
6
+
7
+ ---
8
+
9
+ ## [Unreleased] — 9.4.1
10
+
11
+ ### Changed
12
+
13
+ - **TUI overlay registry seam** — `src/tui.ts` is 2,867 lines and was the
14
+ most-changed file in the repo (28 of the last 200 commits). A new
15
+ `src/tui/overlays/registry.ts` introduces the seam that future
16
+ migrations will consume: `Overlay` interface plus `OVERLAYS` array and
17
+ `getOverlay()` lookup. The first overlay (`help`) is extracted behind
18
+ it. Behaviour is unchanged. Migration is gradual; subsequent commits
19
+ move one overlay at a time and rewire `showOverlay()` to query the
20
+ registry.
21
+
22
+ ### Added
23
+
24
+ - 6 guard tests in `tests/overlay-registry.test.ts` pin the registry
25
+ contract and source-grep `src/tui.ts` to fail on drift between the
26
+ registered ids and the dispatcher's union type.
27
+
28
+ ---
29
+
30
+ ## [9.4.0] — 2026-08-28
31
+
32
+ Release tracking for bookmarked repos, plus a bookmarks page and toast notifications in the TUI.
33
+
34
+ ### Added
35
+
36
+ **Release tracker** — follow releases of repos you've bookmarked
37
+
38
+ - `src/releases.ts` — checks each bookmarked repo against `GET /repos/{owner}/{repo}/releases?per_page=5`
39
+ - Seen state is `lastSeenAt` per bookmark; "new" means published after that timestamp
40
+ - ETag conditional requests + `GITHUB_TOKEN` when available to conserve rate budget
41
+ - Prereleases shown and tagged `[pre]`; drafts never shown
42
+ - `ghfind --releases` prints the new-release feed, then marks everything seen; `--releases --json` for machine output
43
+ - Opening the Notifications panel (Space → System → Notifications) now runs a check in the background and files each new release as a `🚀` notification
44
+
45
+ **Bookmarks page** — bookmarks are now a first-class mode, not an overlay
46
+
47
+ - Reachable from the landing screen (`b`, or `Enter` on the new button) and from Space → Navigate → Bookmarks
48
+ - `Enter` opens the repo in a browser, `d` removes, `Esc` / `←` returns to landing
49
+ - `SessionState.mode` accepts `"bookmarks"`, so a restart restores you onto the page
50
+
51
+ **Landing bookmarks button** — fourth selectable row below the three mode cards, with a live count (`4 saved` / `none yet`) refreshed on every visit
52
+
53
+ **Toast popup** — top-right rounded card confirming bookmark changes; green border for bookmarked, yellow for unbookmarked, auto-hides after 2s
54
+
55
+ **`b` keybinding** — toggles bookmark on the selected repo from the main view (previously only reachable via Space → Repo → Bookmark)
56
+
57
+ **Diagnostics: `ghfind --doctor`** — environment troubleshooting command for the interactive TUI
58
+
59
+ - 10 checks: runtime, bundled Bun, system Bun, Node version, build output, source, TTY, config validity, GitHub token, state/cache dirs
60
+ - Per-check status: green `PASS`, yellow `WARN`, red `FAIL`; non-zero exit on any FAIL so scripts can detect broken installs
61
+ - `src/doctor.ts` is purely diagnostic (no TUI, no network) and exits with code 1 if any check fails
62
+ - `bin/ghfind.js` Strategy 1 now prefers the bundled `vendor/bun` (downloaded by `postinstall.js`) and falls back to a system-installed `bun` on PATH; doctor confirms which one wins
63
+
64
+ **Error report on uncaught exceptions** — never auto-posts
65
+
66
+ - When `ghfind` hits an unexpected error, builds a pre-filled `https://github.com/codersdfs/search-cli/issues/new?title=...&body=...&labels=bug` URL with the error class, message, stack, command line, and environment (ghfind version, runtime, platform)
67
+ - Tries to open the URL in the user's default browser (Bun.spawn when available, child_process.spawn detached fallback for Node); prints the URL when no browser can be launched
68
+ - Known user-facing errors (`SearchCliError` subclasses) keep their existing friendly message and skip the report flow
69
+ - `src/error-report.ts` is the new module; `tests/error-report.test.ts` covers URL format, ANSI stripping, long-message truncation, non-Error throwables, env + command in body
70
+
71
+ ### Fixed
72
+
73
+ - Landing screen vanished after the bookmarks page landed — `showLanding()` revealed `landingBox` before `hideMainContent()` hid it again; ordering corrected
74
+ - Arrow keys moved the landing selection _and_ the bookmarks list at the same time — the landing handler only checked `currentMode`, which opening bookmarks doesn't change. Now gated on `landingKeysActive(mode, overlay)`
75
+ - `Enter` on the landing bookmarks button immediately opened the first bookmark in a browser — the same key event reached the global handler after the page opened. Consumed keys now call `key.stopPropagation()`
76
+ - `q` inside the bookmarks overlay quit the app instead of closing it — same double-handling root cause
77
+ - `tests/tips.test.ts` imported a `TipRotator` class that `src/tips.ts` never exported, so its module-load error was misattributed to whichever test file ran next. Added the class and `defaultRotator`; behavior unchanged
78
+
79
+ ### Changed
80
+
81
+ - Help screen: new "Bookmarks Page" section; `b` / `c` / `t` documented under Main View; Landing section documents the button; "Overlay Keys" no longer lists bookmarks
82
+ - Leader menu "Notifications" now reads "View alerts — checks bookmarks for new releases"
83
+ - Landing hint line includes `[b]ookmarks`
84
+ - `Bookmark` type gains `lastSeenAt`; `src/bookmarks.ts` exports `getLastSeen()` / `markSeen()`
85
+
86
+ ### Internal
87
+
88
+ - Extracted `src/toast.ts` and `src/landing.ts` so the toast, button, and key-routing predicates are testable without booting the TUI
89
+ - Tests: 187 passing — `tests/landing.test.ts` (30), `tests/toast.test.ts` (6), `tests/releases.test.ts`, `tests/tips.test.ts`, `tests/doctor.test.ts` (2), `tests/error-report.test.ts` (6)
90
+
91
+ ---
92
+
93
+ ## [9.3.0] — 2026-08-24
94
+
95
+ ### Fixed
96
+
97
+ - `c` keybinding in the TUI not adding repos to comparison — a missing closing brace in the space-key handler broke every later key handler (`c`, `t`, `?`)
98
+ - README viewer now renders full markdown (headings, code blocks, lists, tables, blockquotes, rules) instead of stripping formatting
99
+
100
+ ### Changed
101
+
102
+ - Widened compare table columns (min 35 chars) and added Description + URL rows
103
+ - Compare table shows up to 5 topics per repo (was 3)
104
+
105
+ ---
106
+
107
+ ## [9.2.1] — 2026-08-23
108
+
109
+ ### Added
110
+
111
+ - npm package search (beta)
112
+ - New landing screen with selectable mode cards
113
+
114
+ ### Fixed
115
+
116
+ - TUI layout issues on small terminals
117
+ - Trending not visible when launched from the landing screen — `loadTrending()` was the only mode switch that didn't set `body.visible`
118
+ - Trending tabs now fetch independently, with an active-tab underline
119
+
120
+ ### Changed
121
+
122
+ - Removed the bundled Bun binary from the npm package; it is downloaded at install time on all platforms
123
+ - Package size reduced from 39.5 MB to 100 KB
124
+ - Postinstall no longer fails `npm install` when the Bun download fails (graceful fallback)
125
+ - Removed `bun` from the engines field — Bun need not be pre-installed
126
+ - Non-interactive modes (`--json`, `--csv`, …) run on Node.js 20+ alone
127
+
128
+ ---
129
+
130
+ ## [9.1.1] — 2026-08-11
131
+
132
+ ### Fixed
133
+
134
+ - Postinstall now exits with code 1 on Bun download failure
135
+ - Removed dead Strategy 3 fallback in `bin/ghfind.js` (Node cannot import `.ts`)
136
+
137
+ ### Changed
138
+
139
+ - Bundle `vendor/` and `dist/` in the npm package for offline install
140
+ - Bundled Bun updated from 1.3.12 to 1.3.14
141
+
142
+ ---
143
+
144
+ ## [9.1.0] — 2026-08-07
145
+
146
+ ### Added
147
+
148
+ - Automatic update checking against the npm registry, with a Y/N/L modal (install now / skip / dismiss)
149
+ - Leader menu (Space) consolidating all contextual actions
150
+ - Topic explorer, notifications panel, and saved searches overlay
151
+ - Activity graph toggle (commit chart fullscreen)
152
+ - README viewer
153
+ - Tab auto-complete for search qualifiers
154
+ - PageUp / PageDown navigation
155
+ - `Ctrl+X` clears history, `Ctrl+C` clears all notifications
156
+
157
+ ### Fixed
158
+
159
+ - Postinstall downloads the Bun binary correctly on all platforms
160
+ - Zip asset names match Bun's current release naming
161
+ - Zip parsing uses the central directory instead of local file headers
162
+ - `postinstall` uses `node` instead of `bun run`, so Bun need not be pre-installed
163
+ - TUI works on Node.js 20+ via the downloaded Bun binary
164
+
165
+ ### Changed
166
+
167
+ - Removed `vendor/` from the npm package (Bun downloaded at install time)
168
+ - Improved export error handling and format selection
169
+
170
+ ---
171
+
172
+ ## [0.9.0] — 2026-07-31
173
+
174
+ ### Added
175
+
176
+ - Watch mode (`--watch`) for polling a query
177
+ - Notifications panel and UI refinements
178
+
179
+ ### Fixed
180
+
181
+ - Trending browser fixes
182
+
183
+ ---
184
+
185
+ ## [0.8.2] — 2026-07-31
186
+
187
+ ### Fixed
188
+
189
+ - TUI stability fixes; rewritten keybindings reference
190
+
191
+ ---
192
+
193
+ ## [0.8.1] — 2026-07-27
194
+
195
+ ### Fixed
196
+
197
+ - Follow-up fixes to the 0.8.0 breaking change
198
+
199
+ ---
200
+
201
+ ## [0.8.0] — 2026-07-26
202
+
203
+ ### Added
204
+
205
+ - Trending browser, deep-dive, compare, export, share, topics, saved searches
206
+ - Activity graph, README viewer, notifications panel
207
+
208
+ **Breaking:** entry point and command surface changed; 0.8.1 shipped the same day as an emergency follow-up
209
+
210
+ ---
211
+
212
+ ## [0.7.0] — 2026-07-25
213
+
214
+ ### Added
215
+
216
+ - Bookmarks and search history
217
+
218
+ ---
219
+
220
+ ## [0.6.1] — 2026-07-24
221
+
222
+ ### Fixed
223
+
224
+ - Fixes for the initial release
225
+
226
+ ---
227
+
228
+ ## [0.6.0] — 2026-07-23
229
+
230
+ ### Added
231
+
232
+ - First public release: repo search with qualifiers, sorting, and JSON output
233
+
234
+ ---
235
+
236
+ ## A note on version numbers
237
+
238
+ The jump from `0.9.0` to `9.1.0` was a one-time renumbering, not 9 major releases. The `9.x` line begins with the update checker and leader menu. There is no `9.0.0`, and `9.2.0` was never published — `9.2.1` superseded it before release.
package/package.json CHANGED
@@ -1,74 +1,76 @@
1
- {
2
- "name": "github-search-cli",
3
- "version": "9.4.0",
4
- "description": "Terminal-native GitHub search — search, trending, bookmarks, history, deep-dive, compare, export, and more. All keyboard-driven, no browser needed.",
5
- "type": "module",
6
- "packageManager": "bun@1",
7
- "volta": {
8
- "extensions": [".ts"]
9
- },
10
- "bin": {
11
- "ghfind": "bin/ghfind.js"
12
- },
13
- "bun": {
14
- "smol": true
15
- },
16
- "files": [
17
- "bin/",
18
- "dist/",
19
- "src/",
20
- "scripts/",
21
- "completions/",
22
- "demo.svg",
23
- "LICENSE",
24
- "CHANGELOG.md",
25
- "release-notes/",
26
- "README.md"
27
- ],
28
- "scripts": {
29
- "start": "bun run src/cli.ts",
30
- "build": "tsup",
31
- "prepublishOnly": "bun run build",
32
- "test": "bun test",
33
- "dev": "bun run --watch src/tui.ts",
34
- "postinstall": "node scripts/postinstall.js",
35
- "format:check": "bunx prettier --check .",
36
- "format": "bunx prettier --write ."
37
- },
38
- "dependencies": {
39
- "@opentui/core": "^0.4.3"
40
- },
41
- "devDependencies": {
42
- "@types/bun": "latest",
43
- "@types/node": "^20.0.0",
44
- "prettier": "^3.2.0",
45
- "tsup": "^8.0.0",
46
- "typescript": "^5.3.0"
47
- },
48
- "engines": {
49
- "node": ">=20.0.0"
50
- },
51
- "repository": {
52
- "type": "git",
53
- "url": "git+https://github.com/codersdfs/search-cli.git"
54
- },
55
- "bugs": {
56
- "url": "https://github.com/codersdfs/search-cli/issues"
57
- },
58
- "homepage": "https://github.com/codersdfs/search-cli#readme",
59
- "keywords": [
60
- "github",
61
- "cli",
62
- "search",
63
- "trending",
64
- "terminal",
65
- "tui",
66
- "browser",
67
- "developer-tools",
68
- "opentui"
69
- ],
70
- "license": "MIT",
71
- "publishConfig": {
72
- "access": "public"
73
- }
74
- }
1
+ {
2
+ "name": "github-search-cli",
3
+ "version": "9.4.1",
4
+ "description": "Terminal-native GitHub search — search, trending, bookmarks, history, deep-dive, compare, export, and more. All keyboard-driven, no browser needed.",
5
+ "type": "module",
6
+ "packageManager": "bun@1",
7
+ "volta": {
8
+ "extensions": [
9
+ ".ts"
10
+ ]
11
+ },
12
+ "bin": {
13
+ "ghfind": "bin/ghfind.js"
14
+ },
15
+ "bun": {
16
+ "smol": true
17
+ },
18
+ "files": [
19
+ "bin/",
20
+ "dist/",
21
+ "src/",
22
+ "scripts/",
23
+ "completions/",
24
+ "demo.svg",
25
+ "LICENSE",
26
+ "CHANGELOG.md",
27
+ "release-notes/",
28
+ "README.md"
29
+ ],
30
+ "scripts": {
31
+ "start": "bun run src/cli.ts",
32
+ "build": "tsup",
33
+ "prepublishOnly": "bun run build",
34
+ "test": "bun test",
35
+ "dev": "bun run --watch src/tui.ts",
36
+ "postinstall": "node scripts/postinstall.js",
37
+ "format:check": "bunx prettier --check .",
38
+ "format": "bunx prettier --write ."
39
+ },
40
+ "dependencies": {
41
+ "@opentui/core": "^0.4.3"
42
+ },
43
+ "devDependencies": {
44
+ "@types/bun": "latest",
45
+ "@types/node": "^20.0.0",
46
+ "prettier": "^3.2.0",
47
+ "tsup": "^8.0.0",
48
+ "typescript": "^5.3.0"
49
+ },
50
+ "engines": {
51
+ "node": ">=20.0.0"
52
+ },
53
+ "repository": {
54
+ "type": "git",
55
+ "url": "git+https://github.com/codersdfs/search-cli.git"
56
+ },
57
+ "bugs": {
58
+ "url": "https://github.com/codersdfs/search-cli/issues"
59
+ },
60
+ "homepage": "https://github.com/codersdfs/search-cli#readme",
61
+ "keywords": [
62
+ "github",
63
+ "cli",
64
+ "search",
65
+ "trending",
66
+ "terminal",
67
+ "tui",
68
+ "browser",
69
+ "developer-tools",
70
+ "opentui"
71
+ ],
72
+ "license": "MIT",
73
+ "publishConfig": {
74
+ "access": "public"
75
+ }
76
+ }
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Help overlay — smallest of the 12, uses only pure data from src/help.ts.
3
+ * First overlay migrated out of tui.ts to prove the registry seam works.
4
+ */
5
+ import { buildHelpSections, HELP_KEYS_COLUMN } from "../../help";
6
+ import type { Overlay } from "./registry";
7
+
8
+ export const helpOverlay: Overlay = {
9
+ id: "help",
10
+ build() {
11
+ // Defer to the existing data builder; rendering stays in tui.ts until
12
+ // the next migration step (this is a structural refactor, not a
13
+ // visual rewrite).
14
+ return {
15
+ sections: buildHelpSections(),
16
+ keysColumn: HELP_KEYS_COLUMN,
17
+ };
18
+ },
19
+ };
@@ -0,0 +1,52 @@
1
+ /**
2
+ * Overlay registry seam.
3
+ *
4
+ * Each overlay owns its own renderable subtree, its own keybinds, and its
5
+ * own refresh logic. The TUI shell no longer hard-codes if/else-if chains
6
+ * over id strings; it queries this registry.
7
+ *
8
+ * When migrating an overlay out of src/tui.ts, add its module here and
9
+ * register it in OVERLAYS. The test suite in tests/overlay-registry.test.ts
10
+ * fails if the registry is out of sync with the dispatcher's id set.
11
+ */
12
+
13
+ export interface Overlay {
14
+ /** Stable id matched by the dispatcher's setOverlay(id) calls. */
15
+ id: string;
16
+ /**
17
+ * Build the root renderable for this overlay. Called once during shell
18
+ * construction; the caller adds the result to the modal layer.
19
+ */
20
+ build(): unknown;
21
+ /**
22
+ * Optional refresh hook fired every time the overlay becomes visible.
23
+ * Use this to re-read history, re-list bookmarks, etc.
24
+ */
25
+ onShow?(): void;
26
+ /**
27
+ * Optional teardown fired when the overlay is hidden. Cancel pending
28
+ * fetches, drop focus, etc.
29
+ */
30
+ onHide?(): void;
31
+ /**
32
+ * Optional key handler. Return true if the overlay consumed the key
33
+ * (caller should not propagate to the main view).
34
+ */
35
+ handleKey?(key: string): boolean;
36
+ }
37
+
38
+ // ponytail: registry is an array (not a Map) to keep import order trivial
39
+ // and to let tests inspect id order. Add when we exceed ~20 overlays.
40
+ export const OVERLAYS: Overlay[] = [];
41
+ // helpOverlay intentionally not auto-registered: the migration is gradual.
42
+ // Uncomment when src/tui.ts is ready to consume the registry instead of
43
+ // building helpBox inline.
44
+ // import { helpOverlay } from "./help";
45
+ // OVERLAYS.push(helpOverlay);
46
+
47
+ const byId = new Map<string, Overlay>();
48
+ for (const o of OVERLAYS) byId.set(o.id, o);
49
+
50
+ export function getOverlay(id: string): Overlay | undefined {
51
+ return byId.get(id);
52
+ }