Skip to content

feat(console): bundle Ink frontend in releases; default to it when Node present#192

Merged
Fullstop000 merged 3 commits into
masterfrom
feat/ink-default-when-available
Jun 17, 2026
Merged

feat(console): bundle Ink frontend in releases; default to it when Node present#192
Fullstop000 merged 3 commits into
masterfrom
feat/ink-default-when-available

Conversation

@Fullstop000

Copy link
Copy Markdown
Owner

What

Make the Ink frontend the default UI for installed/upgraded ignis (when Node ≥18 is present), by bundling it into releases. Follow-up to #174, which left Ink opt-in and the JS packaging deferred.

How

  • release.ymlnpm ci --omit=dev per runner (ink+react: portable base64-WASM yoga, no native addons), bundles ignis-tui/{src,package.json,package-lock.json,node_modules} into every platform archive.
  • install.sh / ignis upgrade — lay the bundle down at ~/.ignis/ignis-tui. Upgrade does it before swapping the binary (failure ⇒ old install intact) and fully replaces the tree, keeping JS + binary in lockstep.
  • locate_ink_entry — resolves an explicit IGNIS_TUI_ENTRY, then a source-checkout ignis-tui/ above the binary, then ~/.ignis/ignis-tui. An entry only counts when a sibling node_modules exists, so a checkout without npm install stays on ratatui instead of crashing on a missing import.
  • IGNIS_FRONTEND=native forces the built-in TUI; any failure (Node missing, deps absent) falls back to it.

Tests

  • New unit coverage: locate_ink_entry order + the node_modules-required rule; install_frontend_into full-replace + no-op-without-bundle.
  • The two native-TUI e2e suites pin IGNIS_FRONTEND=native (a dev with Ink deps installed would otherwise auto-launch Ink and fail them).

Verified locally

  • Full workspace test green; clippy + fmt clean; --locked release build OK.
  • npm ci --omit=dev resolves prod deps (ink+react import OK), devDep excluded.
  • End-to-end: binary in an isolated dir + bundle at a fake ~/.ignis/ignis-tui → launches Ink (screenshot-confirmed).

Caveats

  • The actual cross-platform release.yml packaging only runs on a tag push — verified its commands locally, not the CI job itself.
  • First upgrade is chicken-and-egg: v0.39.0 ships no JS bundle and its upgrade.rs doesn't lay JS down, so the first ignis upgrade to this version swaps only the binary → still ratatui. Re-run the install.sh curl one-liner to get Ink; from this version's binary onward ignis upgrade maintains it.

Checklist

  • cargo fmt --all -- --check
  • cargo clippy --workspace --all-targets -- -D warnings
  • cargo test --workspace
  • cargo build --release --locked
  • secret scan clean

…de present

Releases now ship the Ink frontend (ink + react via `npm ci --omit=dev` —
portable base64-WASM yoga, no native addons) bundled into each platform
archive. install.sh and `ignis upgrade` lay it down at ~/.ignis/ignis-tui, and
the installed `ignis` auto-locates it: Ink is the default UI when Node >=18 is
present, falling back to the built-in ratatui TUI otherwise
(IGNIS_FRONTEND=native forces the built-in).

locate_ink_entry resolves, in order: an explicit IGNIS_TUI_ENTRY, a
source-checkout ignis-tui/ above the binary, then ~/.ignis/ignis-tui. An entry
only counts when a sibling node_modules exists, so a checkout without
`npm install` stays on ratatui rather than crashing on a missing import.

`ignis upgrade` lays the JS down before swapping the binary (a copy failure
leaves the old install intact) and fully replaces the tree, keeping the JS and
binary in lockstep across upgrades.

The native-TUI e2e suites pin IGNIS_FRONTEND=native so a developer with the Ink
deps installed still exercises the built-in TUI.
Addresses two review findings on the Ink-bundling PR:

- HIGH: `ignis-tui/package-lock.json` was gitignored and untracked, so
  `actions/checkout` never restored it and the release `npm ci --omit=dev` step
  would abort (EUSAGE), making every release archive fail to build. Un-ignore
  and commit the lockfile so `npm ci` is reproducible.

- HIGH: now that Ink is the default UI, an old/missing Node must not crash the
  user — ink 5 / react 18 throw at module load on Node <18. `launch_ink_frontend`
  now probes `node --version` and bubbles an error (→ falls back to the built-in
  TUI) when Node is missing or <18; install.sh advertises Ink only when Node >=18
  is present.

Also refresh the now-stale "packaging deferred" comment in main.rs.
@Fullstop000 Fullstop000 merged commit 9fc4019 into master Jun 17, 2026
5 checks passed
@Fullstop000 Fullstop000 deleted the feat/ink-default-when-available branch June 17, 2026 12:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant