@carlesandres/house 0.8.0 → 0.10.0

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,10 +1,60 @@
1
1
  # Changelog
2
2
 
3
- All notable changes to house land here. Format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) and the project follows [Semantic Versioning](https://semver.org/spec/v2.0.0.html) from v0.1.0 onward.
3
+ ## 0.10.0
4
+
5
+ ### Minor Changes
6
+
7
+ - Browser previews now include static syntax highlighting, a native collapsible table of contents,
8
+ and locally bundled Mermaid rendering with readable source fallbacks, so project documentation
9
+ remains useful offline and when browser enhancement fails.
10
+
11
+ ### Patch Changes
12
+
13
+ - Browser previews now sanitize authored HTML and URLs, apply a restrictive local-page policy, and
14
+ serve only immutable built-in assets from loopback-validated requests.
15
+ - Releases now use Changesets: each pull request carries its own release note, and a bot keeps a
16
+ "chore: version packages" pull request current, so publishing a version is a single merge.
17
+ - CI now runs the PTY suite (`bun run test:pty`) after workspace tests, so real-terminal regressions
18
+ for editor, new-file, sidebar selection, status popover, and extension allow-list paths are gated.
19
+ - npm-installed `house` run from a deleted or inaccessible directory now says so and exits,
20
+ instead of failing with an unknown error, so the fix (`cd` elsewhere) is clear.
21
+ - The Browser TUI now exits at startup if the markdown highlighter cannot initialize, instead of
22
+ rendering raw source. CLI and standalone builds fail the same check.
23
+ - `house --root` pointing at a file, missing path or unreadable directory now prints an error before
24
+ the TUI starts, instead of exiting silently, so the bad root is obvious.
25
+ - npm install smoke (and publish verification) now use Node `>=26.4.0`, matching OpenTUI 0.5.11’s
26
+ engine floor so `engine-strict` installs succeed.
27
+ - CI and release workflows now pin every action to a commit SHA, kept current by Dependabot, so a
28
+ moved or compromised tag cannot change what runs.
29
+ - Contributors now install dependencies with pnpm instead of Bun, so Dependabot can raise security
30
+ alerts and open updates that include the lockfile. Bun still builds and runs house.
31
+ - `ROADMAP.md` is removed; planned work is now tracked in Linear (House team), with public items
32
+ mirrored to GitHub issues, so plans no longer drift between a file and the issue tracker.
33
+ - Markdown headings, emphasis, and fenced code now highlight again. `web-tree-sitter` is pinned to
34
+ OpenTUI's `0.25.10` peer so the highlighter can load `tree-sitter.wasm`.
35
+
36
+ ## [0.9.0] — 2026-09-12
4
37
 
5
- The publish workflow (`.github/workflows/publish.yml`) runs on the `release: published` event, builds per-platform binaries, publishes platform packages then the main package via Trusted Publisher, and lets GitHub auto-generate release notes from commit subjects; this file is the curated, narrative version.
38
+ ### Changed
39
+
40
+ - Opening a selected file now hides the Sidebar by default so the Reader gets the full pane; set
41
+ `autoHideSidebar = false` or use `--no-auto-hide-sidebar` to keep the two-pane view.
42
+ - Release preparation now runs from a dispatchable GitHub workflow, and merging its PR creates and verifies the release, so publishing no longer depends on a clean local checkout or a long-running terminal.
43
+ - The publish job no longer waits for a GitHub `npm` environment reviewer, so creating the GitHub Release (or a `main` dispatch) is enough to ship. The environment still allows only `v*` tags and `main`.
44
+ - Empty CLI `--extensions` / `--show` again override file and env lists after the Effect 4.0.0-beta.107 bump, so an explicit empty allow-list still wins.
45
+ - House now runs on OpenTUI 0.5.9, matching `@house/ui` and the current renderer/input stack.
46
+
47
+ ### Fixed
48
+
49
+ - Release preparation now creates GitHub-verified commits, so release pull requests satisfy the
50
+ repository's signed-commit rule and can be merged normally.
51
+ - Release preparation now rejects stale managed branches, requests maintainer review, and reports
52
+ dispatched CI on the pull request, so release approvals remain visible through GitHub and `gh`.
53
+ - Release preparation now passes GitHub authentication and step outputs through Turborepo, so
54
+ dispatches can create release pull requests and start their CI.
55
+ - Shift+A no longer drops a hidden-file selection when toggling hidden files back on, so the original file is reselected after the re-walk.
56
+ - Theme resolution now keeps 8-digit hex alpha from bundled palettes, so muted and border tokens in themes like Cursor stay distinct from opaque text.
6
57
 
7
- ## [Unreleased]
8
58
 
9
59
  ## [0.8.0] — 2026-08-30
10
60
 
@@ -442,7 +492,7 @@ The v1 MVP, published as `@carlesandres/openmdr` on npm.
442
492
 
443
493
  Search, stdin, URL fetching, cross-file link following, `$EDITOR` hand-off, syntax highlighting, persistent config, OS-appearance auto-detect, single-binary distribution (issue [#2](https://github.com/carlesandres/openmdr/issues/2)), Homebrew tap. All tracked.
444
494
 
445
- [Unreleased]: https://github.com/carlesandres/house/compare/v0.8.0...HEAD
495
+ [0.9.0]: https://github.com/carlesandres/house/compare/v0.8.0...v0.9.0
446
496
  [0.8.0]: https://github.com/carlesandres/house/compare/v0.7.0...v0.8.0
447
497
  [0.7.0]: https://github.com/carlesandres/house/compare/v0.6.0...v0.7.0
448
498
  [0.6.0]: https://github.com/carlesandres/house/compare/v0.5.2...v0.6.0
package/README.md CHANGED
@@ -11,7 +11,7 @@ A terminal markdown reader and navigator — themable and configurable, with a k
11
11
  - **Fuzzy search** across nested folders (`.gitignore`-aware)
12
12
  - **Command palette**
13
13
  - **Keyboard-driven**
14
- - **Open in browser**
14
+ - **Open in browser** with syntax highlighting, document contents, and Mermaid diagrams
15
15
  - **Open in `$EDITOR`**
16
16
 
17
17
  Install with npm or Bun. Prebuilt binaries cover macOS and Linux (arm64/x64); no Bun required to *run* on those platforms.
@@ -19,7 +19,7 @@ Install with npm or Bun. Prebuilt binaries cover macOS and Linux (arm64/x64); no
19
19
  ## Runtime requirements
20
20
 
21
21
  - **Run:** a prebuilt binary for your platform (pulled in automatically on install). No Bun needed at runtime on supported platforms.
22
- - **Install:** Node/npm or Bun both work. Prefer `npm install -g` for the normal end-user path.
22
+ - **Install:** Node/npm (`>=26.4.0`) or Bun both work. Prefer `npm install -g` for the normal end-user path.
23
23
 
24
24
  Supported on macOS and Linux (arm64/x64, glibc Linux). Windows is unsupported and unvalidated (see [#129](https://github.com/carlesandres/house/issues/129)).
25
25
 
@@ -59,6 +59,13 @@ house --order tree # files-before-directories instead of recency
59
59
  house --serve README.md
60
60
  ```
61
61
 
62
+ Press `O` in the TUI, choose **Open in browser** from the command palette, or use `--serve` to
63
+ open a live local preview. Code highlighting and a collapsible table of contents are present in
64
+ the HTML itself. Mermaid diagrams enhance in the browser from assets bundled with house; their
65
+ source remains readable if JavaScript is unavailable or a diagram cannot render. Built-in preview
66
+ features work offline while house is running. Relative images and other linked local assets are
67
+ not served yet ([#75](https://github.com/carlesandres/house/issues/75)).
68
+
62
69
  ### Options
63
70
 
64
71
  | Flag | Default | Description |
@@ -68,6 +75,8 @@ house --serve README.md
68
75
  | `--width <N>` | `80` | Reader wrap width used when wrapping is enabled |
69
76
  | `--wrap` | off | Start with reader wrapping enabled |
70
77
  | `--no-wrap` | off | Start with reader wrapping disabled |
78
+ | `--auto-hide-sidebar` | on | Hide the sidebar after explicitly opening a file |
79
+ | `--no-auto-hide-sidebar` | off | Keep the sidebar visible after explicitly opening a file |
71
80
  | `--show <list>` | `""` | Reveal normally-skipped entries; comma-separated subset of `hidden`, `gitignored`. Use `--show ""` to clear. |
72
81
  | `--root <dir>` | current directory | Discovery root to walk; overrides `defaultRoot` config/env |
73
82
  | `--focus <mode>` | `sidebar` | Startup focus: `sidebar`, `reader`, or `filter`. `filter` opens the sidebar filter prompt immediately. |
@@ -97,27 +106,33 @@ tone = "dark"
97
106
  extensions = []
98
107
  width = 80
99
108
  wrap = false
109
+ autoHideSidebar = true
100
110
  show = ["hidden", "gitignored"]
101
111
  focus = "sidebar"
102
112
  defaultRoot = "cwd" # or "git"
103
113
  order = "recently-modified" # or "tree"
104
114
  ```
105
115
 
106
- Supported keys: `theme`, `tone`, `extensions`, `width`, `wrap`, `show`, `focus`, `defaultRoot`, `order`.
116
+ Supported keys: `theme`, `tone`, `extensions`, `width`, `wrap`, `autoHideSidebar`, `show`, `focus`, `defaultRoot`, `order`.
107
117
 
108
118
  `show` is a list of normally-skipped categories to opt into. Known categories: `hidden` (dot-prefixed entries), `gitignored` (entries matched by a `.gitignore`). Default is the empty list. Hard skips (`node_modules`, `.git`, `.venv`) always apply.
109
119
 
110
120
  Precedence, highest to lowest:
111
121
 
112
- 1. CLI flags (`--theme`, `--tone`, `--ext`, `--width`, `--wrap`, `--no-wrap`, `--show`, `--focus`, `--order`, `--root`)
113
- 2. Env vars (`HOUSE_THEME`, `HOUSE_TONE`, `HOUSE_EXTENSIONS`, `HOUSE_WIDTH`, `HOUSE_WRAP`, `HOUSE_SHOW`, `HOUSE_FOCUS`, `HOUSE_DEFAULT_ROOT`, `HOUSE_ORDER`)
122
+ 1. CLI flags (`--theme`, `--tone`, `--ext`, `--width`, `--wrap`, `--no-wrap`, `--auto-hide-sidebar`, `--no-auto-hide-sidebar`, `--show`, `--focus`, `--order`, `--root`)
123
+ 2. Env vars (`HOUSE_THEME`, `HOUSE_TONE`, `HOUSE_EXTENSIONS`, `HOUSE_WIDTH`, `HOUSE_WRAP`, `HOUSE_AUTO_HIDE_SIDEBAR`, `HOUSE_SHOW`, `HOUSE_FOCUS`, `HOUSE_DEFAULT_ROOT`, `HOUSE_ORDER`)
114
124
  3. Config file
115
- 4. Built-in defaults (`opencode` / `dark` / `extensions = []` / `width = 80` / `wrap = false` / `show = []` / `focus = "sidebar"` / `defaultRoot = "cwd"` / `order = "recently-modified"`)
125
+ 4. Built-in defaults (`opencode` / `dark` / `extensions = []` / `width = 80` / `wrap = false` / `autoHideSidebar = true` / `show = []` / `focus = "sidebar"` / `defaultRoot = "cwd"` / `order = "recently-modified"`)
116
126
 
117
127
  `HOUSE_SHOW` takes a comma-separated list (`HOUSE_SHOW=hidden,gitignored`). For `show` specifically, each source completely replaces the next — categories don't merge across layers. Press `shift+a` in the TUI to round-trip between the configured set and the full vocabulary without editing config.
118
128
 
119
129
  `width` is the fixed reader width used when wrapping is enabled. `wrap` controls startup mode; press `w` in the TUI to toggle reader wrapping for the current session without editing config.
120
130
 
131
+ `autoHideSidebar` hides the sidebar when you explicitly open a selected file with `↵`, `→`, `l`,
132
+ the command palette, or a matching filter Return. Selection movement still previews files without
133
+ hiding it. Press `s` or `/` to bring the sidebar back. Set the option to `false` to retain the
134
+ two-pane view after Open file.
135
+
121
136
  `order` is the File Navigator browse order when no filter query is active. `recently-modified` (default) lists the most recently updated files first, using filesystem modification time, then tree order for ties. `tree` lists files before directories, alphabetically within each group, so current-directory files appear before nested subtrees. An active filter still ranks by relevance first.
122
137
 
123
138
  The file is optional — a missing file is fine. Invalid keys, unknown themes, invalid `defaultRoot`, or malformed TOML fail loudly with a one-line error. Per-project config (`.house/config.toml`) and additional keys are deferred.
@@ -157,7 +172,7 @@ The footer only shows essential app controls (`W`, `q`, `tab`, `s`, `ctrl+p`) to
157
172
  | `G` | Last file |
158
173
  | `/` | Filter files (fuzzy match on path) |
159
174
  | `A` | Toggle hidden + gitignored entries (session-only; round-trips with the configured `show`) |
160
- | `↵` / `→` / `l` | Open file (focus reader) |
175
+ | `↵` / `→` / `l` | Open file (focus reader and auto-hide the sidebar when enabled) |
161
176
 
162
177
  ### Reader
163
178
 
package/dist/bin.js CHANGED
@@ -39,6 +39,15 @@ export const resolveBinaryPath = (packageName, resolve = require.resolve) =>
39
39
 
40
40
  export const shouldCaptureOutput = (argv) => argv.some((arg) => fastExitFlags.has(arg))
41
41
 
42
+ export const hasAccessibleCwd = (cwd = process.cwd) => {
43
+ try {
44
+ cwd()
45
+ return true
46
+ } catch {
47
+ return false
48
+ }
49
+ }
50
+
42
51
  export const main = (
43
52
  argv = process.argv.slice(2),
44
53
  platform = process.platform,
@@ -50,6 +59,13 @@ export const main = (
50
59
  process.exit(0)
51
60
  }
52
61
 
62
+ if (!hasAccessibleCwd()) {
63
+ console.error(
64
+ "house: the current directory no longer exists or is not accessible; cd to another directory and retry",
65
+ )
66
+ process.exit(1)
67
+ }
68
+
53
69
  const packageName = binaryPackageNameFor(platform, arch, libc)
54
70
  if (packageName === undefined) {
55
71
  console.error(