@travetto/terminal 6.0.0-rc.1 → 6.0.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.
- package/README.md +2 -0
- package/__index__.ts +5 -5
- package/package.json +2 -2
- package/src/terminal.ts +1 -1
- package/src/trv.d.ts +1 -1
- package/src/util.ts +2 -2
package/README.md
CHANGED
|
@@ -23,6 +23,7 @@ Oddly enough, colorizing output in a terminal is a fairly complex process. The
|
|
|
23
23
|
* 1 - Basic color support, 16 colors
|
|
24
24
|
* 2 - Enhanced color support, 225 colors, providing a fair representation of most colors
|
|
25
25
|
* 3 - True color, 24bit color with R, G, B each getting 8-bits. Can represent any color needed
|
|
26
|
+
|
|
26
27
|
This module provides the ability to define color palettes using RGB colors, and additionally provides support for palettes based on a dark or light background for a given terminal. Support for this is widespread, but when it fails, it will gracefully assume a dark background.
|
|
27
28
|
|
|
28
29
|
These palettes then are usable at runtime, with the module determining light or dark palettes, as well as falling back to the closest color value based on what the existing terminal supports. This means a color like 'olivegreen', will get the proper output in 24bit color support, a close approximation in enhanced color support, fall back to green in basic color support, and will be color less at level 0.
|
|
@@ -74,6 +75,7 @@ Within the [Travetto](https://travetto.dev) framework, there are plenty of comma
|
|
|
74
75
|
* Progress Bars
|
|
75
76
|
* Waiting Indicators
|
|
76
77
|
* Streaming Content
|
|
78
|
+
|
|
77
79
|
This is generally meant for use within the framework, and so is highly tailored to the specific needs and scenarios. You can see this pattern play out in the [Compiler](https://github.com/travetto/travetto/tree/main/module/compiler#readme "The compiler infrastructure for the Travetto framework") progress output, or in [Pack](https://github.com/travetto/travetto/tree/main/module/pack#readme "Code packing utilities")'s output.
|
|
78
80
|
|
|
79
81
|
In these scenarios, the dynamic behaviors are dependent on having an interactive TTY. When running without access to a proper stdin, the output will default to basic line printing. This dynamic behavior can also be disabled using the environment variable `TRV_QUIET`. When set to `1` will provide a minimal text-based experience.
|
package/__index__.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { } from './src/trv';
|
|
2
|
-
export * from './src/style';
|
|
3
|
-
export * from './src/terminal';
|
|
4
|
-
export * from './src/writer';
|
|
5
|
-
export * from './src/util';
|
|
1
|
+
import type { } from './src/trv.d.ts';
|
|
2
|
+
export * from './src/style.ts';
|
|
3
|
+
export * from './src/terminal.ts';
|
|
4
|
+
export * from './src/writer.ts';
|
|
5
|
+
export * from './src/util.ts';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@travetto/terminal",
|
|
3
|
-
"version": "6.0.0
|
|
3
|
+
"version": "6.0.0",
|
|
4
4
|
"description": "General terminal support",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"terminal",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"directory": "module/terminal"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@travetto/runtime": "^6.0.0
|
|
27
|
+
"@travetto/runtime": "^6.0.0",
|
|
28
28
|
"chalk": "^5.4.1"
|
|
29
29
|
},
|
|
30
30
|
"travetto": {
|
package/src/terminal.ts
CHANGED
|
@@ -2,7 +2,7 @@ import tty from 'node:tty';
|
|
|
2
2
|
|
|
3
3
|
import { Env, Util } from '@travetto/runtime';
|
|
4
4
|
|
|
5
|
-
import { TerminalWriter } from './writer';
|
|
5
|
+
import { TerminalWriter } from './writer.ts';
|
|
6
6
|
|
|
7
7
|
type TerminalStreamingConfig = { minDelay?: number, outputStreamToMain?: boolean };
|
|
8
8
|
type Coord = { x: number, y: number };
|
package/src/trv.d.ts
CHANGED
package/src/util.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { StyleUtil, TermStyleFn, TermStyleInput } from './style';
|
|
2
|
-
import { Terminal, WAIT_TOKEN } from './terminal';
|
|
1
|
+
import { StyleUtil, TermStyleFn, TermStyleInput } from './style.ts';
|
|
2
|
+
import { Terminal, WAIT_TOKEN } from './terminal.ts';
|
|
3
3
|
|
|
4
4
|
type ProgressEvent<T> = { total?: number, idx: number, value: T };
|
|
5
5
|
type ProgressStyle = { complete: TermStyleFn, incomplete?: TermStyleFn };
|