@flyingrobots/bijou-node 4.4.0 → 4.4.1
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 +21 -71
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
Node.js adapters and runtime utilities for Bijou.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
`@flyingrobots/bijou-node` bridges the pure core and the TUI runtime to the Node.js environment. It owns platform detection, terminal I/O, Chalk-backed styling, and worker-thread helpers.
|
|
6
6
|
|
|
7
|
-
##
|
|
7
|
+
## Role
|
|
8
8
|
|
|
9
|
-
- **
|
|
10
|
-
- **
|
|
11
|
-
- **
|
|
9
|
+
- **Port Implementation**: Maps Node.js APIs to the Bijou port interfaces.
|
|
10
|
+
- **Worker Runtime**: Offloads heavy TEA logic to worker threads while maintaining main-thread responsiveness.
|
|
11
|
+
- **Bootstrapping**: One-line context initialization with `initDefaultContext()`.
|
|
12
12
|
|
|
13
13
|
## Install
|
|
14
14
|
|
|
@@ -16,86 +16,36 @@ This package bridges the pure `@flyingrobots/bijou` core and the `@flyingrobots/
|
|
|
16
16
|
npm install @flyingrobots/bijou @flyingrobots/bijou-node
|
|
17
17
|
```
|
|
18
18
|
|
|
19
|
-
##
|
|
19
|
+
## Quick Start
|
|
20
20
|
|
|
21
21
|
```typescript
|
|
22
22
|
import { initDefaultContext } from '@flyingrobots/bijou-node';
|
|
23
|
-
import {
|
|
23
|
+
import { headerBox } from '@flyingrobots/bijou';
|
|
24
24
|
|
|
25
|
-
// Wire up Node.js adapters and set the default context.
|
|
26
|
-
// Auto-detects TTY, CI, NO_COLOR, and TERM=dumb.
|
|
27
25
|
initDefaultContext();
|
|
28
26
|
|
|
29
27
|
console.log(headerBox('My CLI', { detail: 'v1.0.0' }));
|
|
30
28
|
```
|
|
31
29
|
|
|
32
|
-
##
|
|
30
|
+
## Port Mapping
|
|
33
31
|
|
|
34
|
-
|
|
35
|
-
- **Runtime detection**: environment variables, TTY state, and terminal dimensions sourced from `process`.
|
|
36
|
-
- **Interactive terminal I/O**: stdin/stdout integration with readline and resize-event support.
|
|
37
|
-
- **Styling backend**: Chalk-powered color/style methods wired into bijou styling APIs.
|
|
38
|
-
- **One-line bootstrap**: `initDefaultContext()` creates a production-ready context and registers it as default on first call.
|
|
39
|
-
- **Worker helpers**: `runInWorker()` and `startWorkerApp()` for moving app logic into a worker thread.
|
|
40
|
-
- **Native recorder**: `recordDemoGif()` and related helpers for scripted surface capture.
|
|
41
|
-
|
|
42
|
-
## What It Provides
|
|
43
|
-
|
|
44
|
-
`bijou-node` implements the three ports that `@flyingrobots/bijou` requires:
|
|
45
|
-
|
|
46
|
-
| Port | Implementation | What it does |
|
|
32
|
+
| Port | Node.js Implementation | Responsibility |
|
|
47
33
|
| :--- | :--- | :--- |
|
|
48
|
-
|
|
|
49
|
-
|
|
|
50
|
-
|
|
|
51
|
-
|
|
52
|
-
### API
|
|
34
|
+
| **`RuntimePort`** | `nodeRuntime()` | `process.env`, TTY detection, dimensions |
|
|
35
|
+
| **`IOPort`** | `nodeIO()` | `stdout`/`stdin`, readline, resize events |
|
|
36
|
+
| **`StylePort`** | `chalkStyle()` | RGB/hex styling, `NO_COLOR` support |
|
|
53
37
|
|
|
54
|
-
|
|
55
|
-
// Individual port factories
|
|
56
|
-
import { nodeRuntime, nodeIO, chalkStyle } from '@flyingrobots/bijou-node';
|
|
57
|
-
|
|
58
|
-
// All-in-one context (most common)
|
|
59
|
-
import { createNodeContext, initDefaultContext } from '@flyingrobots/bijou-node';
|
|
38
|
+
## API
|
|
60
39
|
|
|
61
|
-
|
|
62
|
-
|
|
40
|
+
- **`createNodeContext()`**: Returns a wired `BijouContext` without setting it as the global default.
|
|
41
|
+
- **`initDefaultContext()`**: Registers the first context as the global default for all Bijou components.
|
|
42
|
+
- **`runInWorker()`**: Starts a TEA app inside a worker thread.
|
|
43
|
+
- **`recordDemoGif()`**: Captures surface frames and rasterizes them to GIF for documentation.
|
|
63
44
|
|
|
64
|
-
|
|
65
|
-
initDefaultContext();
|
|
66
|
-
```
|
|
45
|
+
## Documentation
|
|
67
46
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
See [ARCHITECTURE.md](./ARCHITECTURE.md) for how the adapter maps to Node.js APIs, and [GUIDE.md](./GUIDE.md) for usage patterns.
|
|
71
|
-
For upgrading existing apps, see [`../../docs/MIGRATING_TO_V4.md`](../../docs/MIGRATING_TO_V4.md).
|
|
72
|
-
|
|
73
|
-
## Related Packages
|
|
74
|
-
|
|
75
|
-
- [`@flyingrobots/bijou`](https://www.npmjs.com/package/@flyingrobots/bijou) — Zero-dependency core with all components and theme engine
|
|
76
|
-
- [`@flyingrobots/bijou-tui`](https://www.npmjs.com/package/@flyingrobots/bijou-tui) — TEA runtime for interactive terminal apps
|
|
77
|
-
|
|
78
|
-
## License
|
|
79
|
-
|
|
80
|
-
Apache-2.0
|
|
47
|
+
- **[GUIDE.md](./GUIDE.md)**: Productive-fast path for Node setups.
|
|
48
|
+
- **[ADVANCED_GUIDE.md](./ADVANCED_GUIDE.md)**: Worker thread and recorder internals.
|
|
81
49
|
|
|
82
50
|
---
|
|
83
|
-
|
|
84
|
-
<p align="center">
|
|
85
|
-
Built with 💎 by <a href="https://github.com/flyingrobots">FLYING ROBOTS</a>
|
|
86
|
-
</p>
|
|
87
|
-
|
|
88
|
-
```rust
|
|
89
|
-
.-:::::'::: .-:. ::-.::::::. :::. .,-:::::/
|
|
90
|
-
;;;'''' ;;; ';;. ;;;;';;;`;;;;, `;;;,;;-'````'
|
|
91
|
-
[[[,,== [[[ '[[,[[[' [[[ [[[[[. '[[[[[ [[[[[[/
|
|
92
|
-
`$$$"`` $$' c$$" $$$ $$$ "Y$c$$"$$c. "$$
|
|
93
|
-
888 o88oo,.__ ,8P"` 888 888 Y88 `Y8bo,,,o88o
|
|
94
|
-
"MM, """"YUMMMmM" MMM MMM YM `'YMUP"YMM
|
|
95
|
-
:::::::.. ... :::::::. ... :::::::::::: .::::::.
|
|
96
|
-
;;;;``;;;; .;;;;;;;. ;;;'';;' .;;;;;;;.;;;;;;;;'''';;;` `
|
|
97
|
-
[[[,/[[[' ,[[ \[[, [[[__[[\.,[[ \[[, [[ '[==/[[[[,
|
|
98
|
-
$$$$$$c $$$, $$$ $$""""Y$$$$$, $$$ $$ ''' $
|
|
99
|
-
888b "88bo,"888,_ _,88P_88o,,od8P"888,_ _,88P 88, 88b dP
|
|
100
|
-
MMMM "W" "YMMMMMP" ""YUMMMP" "YMMMMMP" MMM "YMmMY"
|
|
101
|
-
```
|
|
51
|
+
Built with 💎 by [FLYING ROBOTS](https://github.com/flyingrobots)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flyingrobots/bijou-node",
|
|
3
|
-
"version": "4.4.
|
|
3
|
+
"version": "4.4.1",
|
|
4
4
|
"description": "Node.js adapter for bijou — chalk styling, readline I/O, process runtime.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -24,13 +24,13 @@
|
|
|
24
24
|
"lint": "tsc --noEmit"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@flyingrobots/bijou-tui": "4.4.
|
|
27
|
+
"@flyingrobots/bijou-tui": "4.4.1",
|
|
28
28
|
"chalk": "^5.6.2",
|
|
29
29
|
"gifenc": "^1.0.3",
|
|
30
30
|
"oled-font-5x7": "^1.0.3"
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|
|
33
|
-
"@flyingrobots/bijou": "4.4.
|
|
33
|
+
"@flyingrobots/bijou": "4.4.1"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"@types/node": "^22.0.0",
|