@abapify/adt-tui
v0.3.6
Published
Terminal UI components for ADT - page-based navigation with Ink
Readme
@abapify/adt-tui
Terminal UI primitives for ADT, built on Ink
and React. Provides a small page-based navigation framework — a Navigator,
a PageRenderer, a hypermedia link parser, and a generic page — that other
packages and CLI commands use to build interactive ADT explorers in the
terminal.
Install
npm i @abapify/adt-tui
# or
bun add @abapify/adt-tui@abapify/adt-client is a peer dependency and must be installed by the host.
Usage
Boot the TUI from a CLI command, passing in an initial fetch function (typically backed by the ADT client) and a start URI:
import { run } from '@abapify/adt-tui';
await run({
fetch: (uri) => client.request(uri),
startUrl: '/sap/bc/adt/repository/nodestructure',
});Or compose the primitives directly inside your own Ink app:
import { App, Navigator, NavigationProvider } from '@abapify/adt-tui';
import { render } from 'ink';
render(
<NavigationProvider>
<App fetch={fetchFn} startUrl="/sap/bc/adt/discovery" />
</NavigationProvider>,
);Custom pages implement the PageComponent contract and return a
PageResult describing which link to follow next; the framework takes
care of history, rendering, and back-navigation.
Role in the monorepo
- Ink-based TUI primitives layer: it owns
Navigator,PageRenderer, the navigation context, the hypermedia response parser, and the shared page/route types. - Consumed by interactive
adt-clicommands and experiments; it deliberately contains no ADT-specific business logic beyond link parsing, so commands bring their own pages. - Depends on
@abapify/adt-contractsfor response typing and keeps@abapify/adt-clientas a peer dependency to avoid duplicating the client in host applications.
Related
License
MIT
