feat(console): bundle Ink frontend in releases; default to it when Node present#192
Merged
Merged
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.yml—npm ci --omit=devper runner (ink+react: portable base64-WASM yoga, no native addons), bundlesignis-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 explicitIGNIS_TUI_ENTRY, then a source-checkoutignis-tui/above the binary, then~/.ignis/ignis-tui. An entry only counts when a siblingnode_modulesexists, so a checkout withoutnpm installstays on ratatui instead of crashing on a missing import.IGNIS_FRONTEND=nativeforces the built-in TUI; any failure (Node missing, deps absent) falls back to it.Tests
locate_ink_entryorder + thenode_modules-required rule;install_frontend_intofull-replace + no-op-without-bundle.IGNIS_FRONTEND=native(a dev with Ink deps installed would otherwise auto-launch Ink and fail them).Verified locally
--lockedrelease build OK.npm ci --omit=devresolves prod deps (ink+react import OK), devDep excluded.~/.ignis/ignis-tui→ launches Ink (screenshot-confirmed).Caveats
release.ymlpackaging only runs on a tag push — verified its commands locally, not the CI job itself.upgrade.rsdoesn't lay JS down, so the firstignis upgradeto this version swaps only the binary → still ratatui. Re-run theinstall.shcurl one-liner to get Ink; from this version's binary onwardignis upgrademaintains it.Checklist
cargo fmt --all -- --checkcargo clippy --workspace --all-targets -- -D warningscargo test --workspacecargo build --release --locked