@alterior/terminal 3.1.11 → 3.6.7

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/dist/index.d.ts CHANGED
@@ -1,2 +1,3 @@
1
1
  export * from './style';
2
2
  export * from './read';
3
+ export * from './terminal-ui';
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,eAAe,CAAC"}
package/dist/index.js CHANGED
@@ -16,4 +16,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./style"), exports);
18
18
  __exportStar(require("./read"), exports);
19
+ __exportStar(require("./terminal-ui"), exports);
19
20
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0CAAwB;AACxB,yCAAuB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0CAAwB;AACxB,yCAAuB;AACvB,gDAA8B"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"basic.test.d.ts","sourceRoot":"","sources":["../../src/read/basic.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fixtures.d.ts","sourceRoot":"","sources":["../../src/read/fixtures.ts"],"names":[],"mappings":"AAKA,wBAAsB,SAAS,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;YAGjD,MAAM;YAAU,MAAM;GAuBpD"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/read/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"many.test.d.ts","sourceRoot":"","sources":["../../src/read/many.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"read.d.ts","sourceRoot":"","sources":["../../src/read/read.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,KAAK,CAAC;AAE9C,MAAM,WAAW,WAAW;IAC1B;;OAEG;IACH,OAAO,CAAC,EAAE,GAAG,CAAC;IAEd;;OAEG;IACH,KAAK,CAAC,EAAE,UAAU,CAAC;IAEnB;;OAEG;IACH,MAAM,CAAC,EAAE,WAAW,CAAC;IAErB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IAEjB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IAEf;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,wBAAsB,IAAI,CAAE,OAAO,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,MAAM,CAAC,CAwElE"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"style.d.ts","sourceRoot":"","sources":["../src/style.ts"],"names":[],"mappings":"AAKA,QAAA,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8BhB,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG,CAAC,GAAG,QAAQ,EAAE,CAAC,YAAY,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC,EAAE,KAAK,YAAY,CAAC;AACxG,MAAM,MAAM,cAAc,GAAG;KACxB,CAAC,IAAI,MAAM,OAAO,WAAW,IAAI,IAAI,CAAC,EAAE,GAAG,CAAC,GAAG,QAAQ,EAAE,CAAC,YAAY,GAAG,MAAM,GAAG,MAAM,CAAC,EAAE,KAAK,YAAY;CAChH,CAAA;AAED,MAAM,MAAM,MAAM,GAAG,WAAW,GAAG,cAAc,CAAC;AAElD,MAAM,MAAM,KAAK,GAAG,MAAM,OAAO,WAAW,CAAC;AAC7C,eAAO,MAAM,UAAU,QAAS,MAAM,kBAAkB,GAAG,SAAS,WAA2B,CAAC;AAChG,eAAO,MAAM,QAAQ,QAAS,MAAM,kBAAkB,GAAG,SAAS,WAA2B,CAAC;AAE9F,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,OAAO,WAAW,GAAG,SAAS,EAAE,KAAK,EAAE,MAAM,UAMtF;AAED,qBAAa,YAAY;IAEjB,QAAQ,CAAC,KAAK,CAAC;IACf,QAAQ,CAAC,KAAK,EAAE,CAAC,YAAY,GAAG,MAAM,GAAG,MAAM,CAAC,EAAE;gBADzC,KAAK,CAAC,wSAA0B,EAChC,KAAK,GAAE,CAAC,YAAY,GAAG,MAAM,GAAG,MAAM,CAAC,EAAO;IAI3D,KAAK;IAIL,GAAG;IAIH,QAAQ;CAGX;AASD,eAAO,MAAM,KAAK,QAAiB,CAAC;AAEpC,wBAAgB,MAAM,CAAC,GAAG,QAAQ,EAAE,CAAC,MAAM,GAAG,MAAM,GAAG,YAAY,CAAC,EAAE,GAAG,MAAM,CAE9E"}
@@ -0,0 +1,26 @@
1
+ /// <reference types="node" />
2
+ /// <reference types="node" />
3
+ import { ReadStream, WriteStream } from 'tty';
4
+ import { StyledString } from './style';
5
+ export declare class TerminalUI {
6
+ constructor(input?: NodeJS.ReadStream & {
7
+ fd: 0;
8
+ }, output?: NodeJS.WriteStream & {
9
+ fd: 1;
10
+ });
11
+ input: ReadStream;
12
+ output: WriteStream;
13
+ private rl;
14
+ private _prompt;
15
+ get prompt(): string;
16
+ set prompt(value: string);
17
+ runCommand: (line: string) => Promise<void>;
18
+ beforeShowingPrompt: () => Promise<void>;
19
+ runningCommand: boolean;
20
+ start(): Promise<void>;
21
+ history: string[];
22
+ private startPrompt;
23
+ private allocatePromptSpace;
24
+ private deletePrompt;
25
+ log(...contents: (string | number | StyledString)[]): Promise<void>;
26
+ }
@@ -0,0 +1 @@
1
+ {"version":3,"file":"terminal-ui.d.ts","sourceRoot":"","sources":["../src/terminal-ui.ts"],"names":[],"mappings":";;AAAA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,KAAK,CAAC;AAE9C,OAAO,EAAU,YAAY,EAAE,MAAM,SAAS,CAAC;AAE/C,qBAAa,UAAU;gBACP,KAAK;;KAAgB,EAAE,MAAM;;KAAiB;IAK1D,KAAK,EAAE,UAAU,CAAC;IAClB,MAAM,EAAE,WAAW,CAAC;IAEpB,OAAO,CAAC,EAAE,CAAmC;IAC7C,OAAO,CAAC,OAAO,CAAc;IAC7B,IAAI,MAAM,WAET;IAED,IAAI,MAAM,CAAC,KAAK,QAAA,EAMf;IAED,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC7C,mBAAmB,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1C,cAAc,UAAS;IAEjB,KAAK;IAKX,OAAO,EAAE,MAAM,EAAE,CAAM;YAET,WAAW;IAqCzB,OAAO,CAAC,mBAAmB;IAM3B,OAAO,CAAC,YAAY;IASd,GAAG,CAAC,GAAG,QAAQ,EAAE,CAAC,MAAM,GAAG,MAAM,GAAG,YAAY,CAAC,EAAE;CAe5D"}
@@ -0,0 +1,95 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.TerminalUI = void 0;
7
+ const readline_1 = __importDefault(require("readline"));
8
+ const style_1 = require("./style");
9
+ class TerminalUI {
10
+ constructor(input = process.stdin, output = process.stdout) {
11
+ this.runningCommand = false;
12
+ this.history = [];
13
+ this.input = input;
14
+ this.output = output;
15
+ }
16
+ get prompt() {
17
+ return this._prompt;
18
+ }
19
+ set prompt(value) {
20
+ this._prompt = value;
21
+ if (this.rl) {
22
+ this.rl.setPrompt(value);
23
+ this.rl._refreshLine();
24
+ }
25
+ }
26
+ async start() {
27
+ //await this.runCommand('sleep');
28
+ this.startPrompt();
29
+ }
30
+ async startPrompt() {
31
+ var _a;
32
+ readline_1.default.emitKeypressEvents(this.input);
33
+ this.rl = readline_1.default.createInterface({
34
+ input: this.input,
35
+ output: this.output,
36
+ history: this.history
37
+ });
38
+ this.rl.addListener('SIGINT', () => {
39
+ this.log();
40
+ });
41
+ this.rl.setPrompt(this._prompt);
42
+ this.rl.addListener('history', async (lines) => this.history = lines);
43
+ this.rl.addListener('line', async (line) => {
44
+ this.rl.close();
45
+ this.rl = null;
46
+ this.runningCommand = true;
47
+ this.output.cork();
48
+ this.output.moveCursor(0, -1);
49
+ this.deletePrompt();
50
+ this.output.uncork();
51
+ try {
52
+ await this.runCommand(line);
53
+ }
54
+ finally {
55
+ this.runningCommand = false;
56
+ this.output.cork();
57
+ this.startPrompt();
58
+ this.output.uncork();
59
+ }
60
+ });
61
+ await ((_a = this.beforeShowingPrompt) === null || _a === void 0 ? void 0 : _a.call(this));
62
+ this.allocatePromptSpace();
63
+ this.rl.prompt();
64
+ }
65
+ allocatePromptSpace() {
66
+ let lines = this._prompt.split("\n").length + 1;
67
+ this.output.write(Array(lines + 1).join("\n"));
68
+ this.output.moveCursor(0, -lines);
69
+ }
70
+ deletePrompt() {
71
+ for (let i = 0, max = this.prompt.split("\n").length; i < max; ++i) {
72
+ this.output.clearLine(0);
73
+ this.output.cursorTo(0);
74
+ if (i + 1 < max)
75
+ this.output.moveCursor(0, -1);
76
+ }
77
+ }
78
+ async log(...contents) {
79
+ var _a, _b;
80
+ let message = (0, style_1.styled)(...contents);
81
+ let actualCursorPos = (_b = (_a = this.rl) === null || _a === void 0 ? void 0 : _a.getCursorPos()) !== null && _b !== void 0 ? _b : { rows: 0, cols: 0 };
82
+ this.output.cork();
83
+ if (this.rl)
84
+ this.deletePrompt();
85
+ this.output.write(message + `\n`);
86
+ if (this.rl) {
87
+ this.allocatePromptSpace();
88
+ this.output.write(this.prompt + this.rl.line);
89
+ this.output.cursorTo(actualCursorPos.cols);
90
+ }
91
+ this.output.uncork();
92
+ }
93
+ }
94
+ exports.TerminalUI = TerminalUI;
95
+ //# sourceMappingURL=terminal-ui.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"terminal-ui.js","sourceRoot":"","sources":["../src/terminal-ui.ts"],"names":[],"mappings":";;;;;;AACA,wDAAgC;AAChC,mCAA+C;AAE/C,MAAa,UAAU;IACnB,YAAY,KAAK,GAAG,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM;QAwB1D,mBAAc,GAAG,KAAK,CAAC;QAOvB,YAAO,GAAa,EAAE,CAAC;QA9BnB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACzB,CAAC;IAOD,IAAI,MAAM;QACN,OAAO,IAAI,CAAC,OAAO,CAAC;IACxB,CAAC;IAED,IAAI,MAAM,CAAC,KAAK;QACZ,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC;QACrB,IAAI,IAAI,CAAC,EAAE,EAAE;YACT,IAAI,CAAC,EAAE,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;YACxB,IAAI,CAAC,EAAU,CAAC,YAAY,EAAE,CAAC;SACnC;IACL,CAAC;IAMD,KAAK,CAAC,KAAK;QACP,iCAAiC;QACjC,IAAI,CAAC,WAAW,EAAE,CAAC;IACvB,CAAC;IAIO,KAAK,CAAC,WAAW;;QACrB,kBAAQ,CAAC,kBAAkB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACxC,IAAI,CAAC,EAAE,GAAG,kBAAQ,CAAC,eAAe,CAAC;YAC/B,KA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AI,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,GAAG,IAAI,CAAC,CAAC;QAClC,IAAI,IAAI,CAAC,EAAE,EAAE;YACT,IAAI,CAAC,mBAAmB,EAAE,CAAC;YAC3B,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC;YAC9C,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;SAC9C;QAED,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC;IACzB,CAAC;CACJ;AArGD,gCAqGC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"test.d.ts","sourceRoot":"","sources":["../src/test.ts"],"names":[],"mappings":""}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alterior/terminal",
3
- "version": "3.1.11",
3
+ "version": "3.6.7",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "publishConfig": {
@@ -27,5 +27,5 @@
27
27
  "test": "npm run build && node dist/test",
28
28
  "prepublishOnly": "npm test"
29
29
  },
30
- "gitHead": "541793b14f2b48a840c27243f2b71aa4f4f148dd"
30
+ "gitHead": "5a2dddeed850b8e59217dbbe0614f641206c9072"
31
31
  }
package/src/index.ts CHANGED
@@ -1,2 +1,3 @@
1
1
  export * from './style';
2
- export * from './read';
2
+ export * from './read';
3
+ export * from './terminal-ui';
@@ -0,0 +1,106 @@
1
+ import { ReadStream, WriteStream } from 'tty';
2
+ import readline from 'readline';
3
+ import { styled, StyledString } from './style';
4
+
5
+ export class TerminalUI {
6
+ constructor(input = process.stdin, output = process.stdout) {
7
+ this.input = input;
8
+ this.output = output;
9
+ }
10
+
11
+ input: ReadStream;
12
+ output: WriteStream;
13
+
14
+ private rl: readline.Interface;
15
+ private _prompt: string;
16
+ get prompt() {
17
+ return this._prompt;
18
+ }
19
+
20
+ set prompt(value) {
21
+ this._prompt = value;
22
+ if (this.rl) {
23
+ this.rl.setPrompt(value);
24
+ (this.rl as any)._refreshLine();
25
+ }
26
+ }
27
+
28
+ runCommand: (line: string) => Promise<void>;
29
+ beforeShowingPrompt: () => Promise<void>;
30
+ runningCommand = false;
31
+
32
+ async start() {
33
+ //await this.runCommand('sleep');
34
+ this.startPrompt();
35
+ }
36
+
37
+ history: string[] = [];
38
+
39
+ private async startPrompt() {
40
+ readline.emitKeypressEvents(this.input);
41
+ this.rl = readline.createInterface({
42
+ input: this.input,
43
+ output: this.output,
44
+ history: this.history
45
+ });
46
+ this.rl.addListener('SIGINT', () => {
47
+ this.log();
48
+ });
49
+ this.rl.setPrompt(this._prompt);
50
+ this.rl.addListener('history', async lines => this.history = lines);
51
+ this.rl.addListener('line', async line => {
52
+ this.rl.close();
53
+ this.rl = null;
54
+ this.runningCommand = true;
55
+
56
+ this.output.cork();
57
+ this.output.moveCursor(0, -1);
58
+ this.deletePrompt();
59
+ this.output.uncork();
60
+ try {
61
+ await this.runCommand(line);
62
+ } finally {
63
+ this.runningCommand = false;
64
+ this.output.cork();
65
+ this.startPrompt();
66
+ this.output.uncork();
67
+ }
68
+ });
69
+
70
+ await this.beforeShowingPrompt?.();
71
+
72
+ this.allocatePromptSpace();
73
+ this.rl.prompt();
74
+ }
75
+
76
+ private allocatePromptSpace() {
77
+ let lines = this._prompt.split("\n").length + 1;
78
+ this.output.write(Array(lines + 1).join("\n"));
79
+ this.output.moveCursor(0, -lines);
80
+ }
81
+
82
+ private deletePrompt() {
83
+ for (let i = 0, max = this.prompt.split("\n").length; i < max; ++i) {
84
+ this.output.clearLine(0);
85
+ this.output.cursorTo(0);
86
+ if (i + 1 < max)
87
+ this.output.moveCursor(0, -1);
88
+ }
89
+ }
90
+
91
+ async log(...contents: (string | number | StyledString)[]) {
92
+ let message = styled(...<any[]>contents);
93
+ let actualCursorPos = this.rl?.getCursorPos() ?? { rows: 0, cols: 0 };
94
+ this.output.cork();
95
+ if (this.rl)
96
+ this.deletePrompt();
97
+ this.output.write(message + `\n`);
98
+ if (this.rl) {
99
+ this.allocatePromptSpace();
100
+ this.output.write(this.prompt + this.rl.line);
101
+ this.output.cursorTo(actualCursorPos.cols);
102
+ }
103
+
104
+ this.output.uncork();
105
+ }
106
+ }