@abapify/adt-tui 0.3.5 → 0.4.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.
Files changed (2) hide show
  1. package/README.md +71 -0
  2. package/package.json +3 -3
package/README.md ADDED
@@ -0,0 +1,71 @@
1
+ # @abapify/adt-tui
2
+
3
+ Terminal UI primitives for ADT, built on [Ink](https://github.com/vadimdemedes/ink)
4
+ and React. Provides a small page-based navigation framework — a `Navigator`,
5
+ a `PageRenderer`, a hypermedia link parser, and a generic page — that other
6
+ packages and CLI commands use to build interactive ADT explorers in the
7
+ terminal.
8
+
9
+ [![npm](https://img.shields.io/npm/v/%40abapify%2Fadt-tui.svg)](https://www.npmjs.com/package/@abapify/adt-tui)
10
+
11
+ ## Install
12
+
13
+ ```bash
14
+ npm i @abapify/adt-tui
15
+ # or
16
+ bun add @abapify/adt-tui
17
+ ```
18
+
19
+ `@abapify/adt-client` is a peer dependency and must be installed by the host.
20
+
21
+ ## Usage
22
+
23
+ Boot the TUI from a CLI command, passing in an initial fetch function
24
+ (typically backed by the ADT client) and a start URI:
25
+
26
+ ```ts
27
+ import { run } from '@abapify/adt-tui';
28
+
29
+ await run({
30
+ fetch: (uri) => client.request(uri),
31
+ startUrl: '/sap/bc/adt/repository/nodestructure',
32
+ });
33
+ ```
34
+
35
+ Or compose the primitives directly inside your own Ink app:
36
+
37
+ ```tsx
38
+ import { App, Navigator, NavigationProvider } from '@abapify/adt-tui';
39
+ import { render } from 'ink';
40
+
41
+ render(
42
+ <NavigationProvider>
43
+ <App fetch={fetchFn} startUrl="/sap/bc/adt/discovery" />
44
+ </NavigationProvider>,
45
+ );
46
+ ```
47
+
48
+ Custom pages implement the `PageComponent` contract and return a
49
+ `PageResult` describing which link to follow next; the framework takes
50
+ care of history, rendering, and back-navigation.
51
+
52
+ ## Role in the monorepo
53
+
54
+ - Ink-based TUI primitives layer: it owns `Navigator`, `PageRenderer`,
55
+ the navigation context, the hypermedia response parser, and the shared
56
+ page/route types.
57
+ - Consumed by interactive `adt-cli` commands and experiments; it deliberately
58
+ contains no ADT-specific business logic beyond link parsing, so commands
59
+ bring their own pages.
60
+ - Depends on `@abapify/adt-contracts` for response typing and keeps
61
+ `@abapify/adt-client` as a peer dependency to avoid duplicating the
62
+ client in host applications.
63
+
64
+ ## Related
65
+
66
+ - [abapify/adt-cli monorepo](https://github.com/abapify/adt-cli)
67
+ - [Full docs](https://adt-cli.netlify.app)
68
+
69
+ ## License
70
+
71
+ MIT
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abapify/adt-tui",
3
- "version": "0.3.5",
3
+ "version": "0.4.0",
4
4
  "description": "Terminal UI components for ADT - page-based navigation with Ink",
5
5
  "license": "MIT",
6
6
  "publishConfig": {
@@ -17,7 +17,7 @@
17
17
  "README.md"
18
18
  ],
19
19
  "dependencies": {
20
- "@abapify/adt-contracts": "0.3.5",
20
+ "@abapify/adt-contracts": "0.4.0",
21
21
  "fast-xml-parser": "^5.3.1",
22
22
  "ink": "5.1.0",
23
23
  "ink-select-input": "^6.0.0",
@@ -29,7 +29,7 @@
29
29
  "@types/react": "18.3.0"
30
30
  },
31
31
  "peerDependencies": {
32
- "@abapify/adt-client": "0.3.5"
32
+ "@abapify/adt-client": "0.4.0"
33
33
  },
34
34
  "repository": {
35
35
  "type": "git",