refactor(docker): drop manual @hermes/ink build, rely on esbuild bundle

the esbuild pipeline (scripts/build.mjs) already bundles ink into a
single self-contained dist/entry.js.

remove the Dockerfile steps that manually copied packages/hermes-ink
into node_modules/@hermes/ink and ran a nested
npm install there.

- Dockerfile: simplify TUI build step to just 'npm run build'
- hermes_cli/main.py: _tui_build_needed now checks dist/entry.js
staleness against source files before falling back to the old
ink-bundle.js logic
- tests: update TUI npm install tests and drop the Dockerfile contract
test for the removed ink materialization step
This commit is contained in:
ethernet 2026-04-30 16:57:02 -04:00
parent 279504d5b8
commit 42e166c7ea
4 changed files with 47 additions and 24 deletions

View file

@ -95,12 +95,25 @@ def test_no_install_prebuilt_bundle_mode(tmp_path: Path, main_mod) -> None:
assert main_mod._tui_need_npm_install(tmp_path) is False
def test_build_needed_when_local_ink_bundle_missing(tmp_path: Path, main_mod) -> None:
def test_build_needed_when_source_newer_than_entry(tmp_path: Path, main_mod) -> None:
_touch_tui_entry(tmp_path)
_touch_ink(tmp_path)
src = tmp_path / "src" / "entry.tsx"
src.parent.mkdir(parents=True, exist_ok=True)
src.write_text("console.log('newer')")
os.utime(src, (200, 200))
os.utime(tmp_path / "dist" / "entry.js", (100, 100))
assert main_mod._tui_need_npm_install(tmp_path) is False
assert main_mod._tui_build_needed(tmp_path) is True
def test_build_not_needed_when_entry_exists_and_sources_unchanged(tmp_path: Path, main_mod) -> None:
_touch_tui_entry(tmp_path)
_touch_ink(tmp_path)
assert main_mod._tui_need_npm_install(tmp_path) is False
assert main_mod._tui_build_needed(tmp_path) is True
assert main_mod._tui_build_needed(tmp_path) is False
def test_build_not_needed_when_entry_and_ink_bundle_present(tmp_path: Path, main_mod) -> None: