@abapify/adt-tui 0.0.0 → 0.3.6
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.
- package/README.md +69 -1
- package/package.json +41 -3
package/README.md
CHANGED
|
@@ -1,3 +1,71 @@
|
|
|
1
1
|
# @abapify/adt-tui
|
|
2
2
|
|
|
3
|
-
|
|
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
|
+
[](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,5 +1,43 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abapify/adt-tui",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "
|
|
5
|
-
|
|
3
|
+
"version": "0.3.6",
|
|
4
|
+
"description": "Terminal UI components for ADT - page-based navigation with Ink",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"publishConfig": {
|
|
7
|
+
"access": "public"
|
|
8
|
+
},
|
|
9
|
+
"type": "module",
|
|
10
|
+
"types": "./dist/index.d.mts",
|
|
11
|
+
"exports": {
|
|
12
|
+
".": "./dist/index.mjs",
|
|
13
|
+
"./package.json": "./package.json"
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"dist",
|
|
17
|
+
"README.md"
|
|
18
|
+
],
|
|
19
|
+
"dependencies": {
|
|
20
|
+
"@abapify/adt-contracts": "0.3.6",
|
|
21
|
+
"fast-xml-parser": "^5.3.1",
|
|
22
|
+
"ink": "5.1.0",
|
|
23
|
+
"ink-select-input": "^6.0.0",
|
|
24
|
+
"ink-spinner": "^5.0.0",
|
|
25
|
+
"ink-text-input": "^6.0.0",
|
|
26
|
+
"react": "18.3.1"
|
|
27
|
+
},
|
|
28
|
+
"devDependencies": {
|
|
29
|
+
"@types/react": "18.3.0"
|
|
30
|
+
},
|
|
31
|
+
"peerDependencies": {
|
|
32
|
+
"@abapify/adt-client": "0.3.6"
|
|
33
|
+
},
|
|
34
|
+
"repository": {
|
|
35
|
+
"type": "git",
|
|
36
|
+
"url": "git+https://github.com/abapify/adt-cli.git",
|
|
37
|
+
"directory": "packages/adt-tui"
|
|
38
|
+
},
|
|
39
|
+
"homepage": "https://github.com/abapify/adt-cli/tree/main/packages/adt-tui#readme",
|
|
40
|
+
"bugs": {
|
|
41
|
+
"url": "https://github.com/abapify/adt-cli/issues"
|
|
42
|
+
}
|
|
43
|
+
}
|