@rushstack/terminal 0.8.0 → 0.9.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/dist/terminal.d.ts
CHANGED
|
@@ -108,11 +108,12 @@ export declare class Colorize {
|
|
|
108
108
|
|
|
109
109
|
/**
|
|
110
110
|
* Terminal provider that prints to STDOUT (for log- and verbose-level messages) and
|
|
111
|
-
* STDERR (for warning- and error-level
|
|
111
|
+
* STDERR (for warning- and error-level messages).
|
|
112
112
|
*
|
|
113
113
|
* @beta
|
|
114
114
|
*/
|
|
115
115
|
export declare class ConsoleTerminalProvider implements ITerminalProvider {
|
|
116
|
+
static readonly supportsColor: boolean;
|
|
116
117
|
/**
|
|
117
118
|
* If true, verbose-level messages should be written to the console.
|
|
118
119
|
*/
|
|
@@ -18,11 +18,12 @@ export interface IConsoleTerminalProviderOptions {
|
|
|
18
18
|
}
|
|
19
19
|
/**
|
|
20
20
|
* Terminal provider that prints to STDOUT (for log- and verbose-level messages) and
|
|
21
|
-
* STDERR (for warning- and error-level
|
|
21
|
+
* STDERR (for warning- and error-level messages).
|
|
22
22
|
*
|
|
23
23
|
* @beta
|
|
24
24
|
*/
|
|
25
25
|
export declare class ConsoleTerminalProvider implements ITerminalProvider {
|
|
26
|
+
static readonly supportsColor: boolean;
|
|
26
27
|
/**
|
|
27
28
|
* If true, verbose-level messages should be written to the console.
|
|
28
29
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConsoleTerminalProvider.d.ts","sourceRoot":"","sources":["../src/ConsoleTerminalProvider.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,iBAAiB,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AAEvF;;;;GAIG;AACH,MAAM,WAAW,+BAA+B;IAC9C;;OAEG;IACH,cAAc,EAAE,OAAO,CAAC;IAExB;;;;OAIG;IACH,YAAY,EAAE,OAAO,CAAC;CACvB;AAED;;;;;GAKG;AACH,qBAAa,uBAAwB,YAAW,iBAAiB;IAC/D;;OAEG;IACI,cAAc,EAAE,OAAO,CAAS;IAEvC;;OAEG;IACI,YAAY,EAAE,OAAO,CAAS;gBAElB,OAAO,GAAE,OAAO,CAAC,+BAA+B,CAAM;IAKzE;;OAEG;IACI,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,wBAAwB,GAAG,IAAI;IA8BpE;;OAEG;IACH,IAAW,YAAY,IAAI,MAAM,CAEhC;IAED;;OAEG;IACH,IAAW,aAAa,IAAI,OAAO,CAElC;CACF"}
|
|
1
|
+
{"version":3,"file":"ConsoleTerminalProvider.d.ts","sourceRoot":"","sources":["../src/ConsoleTerminalProvider.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,iBAAiB,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AAEvF;;;;GAIG;AACH,MAAM,WAAW,+BAA+B;IAC9C;;OAEG;IACH,cAAc,EAAE,OAAO,CAAC;IAExB;;;;OAIG;IACH,YAAY,EAAE,OAAO,CAAC;CACvB;AAED;;;;;GAKG;AACH,qBAAa,uBAAwB,YAAW,iBAAiB;IAC/D,gBAAuB,aAAa,EAAE,OAAO,CAAiB;IAE9D;;OAEG;IACI,cAAc,EAAE,OAAO,CAAS;IAEvC;;OAEG;IACI,YAAY,EAAE,OAAO,CAAS;gBAElB,OAAO,GAAE,OAAO,CAAC,+BAA+B,CAAM;IAKzE;;OAEG;IACI,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,wBAAwB,GAAG,IAAI;IA8BpE;;OAEG;IACH,IAAW,YAAY,IAAI,MAAM,CAEhC;IAED;;OAEG;IACH,IAAW,aAAa,IAAI,OAAO,CAElC;CACF"}
|
|
@@ -8,7 +8,7 @@ const safe_1 = require("colors/safe");
|
|
|
8
8
|
const ITerminalProvider_1 = require("./ITerminalProvider");
|
|
9
9
|
/**
|
|
10
10
|
* Terminal provider that prints to STDOUT (for log- and verbose-level messages) and
|
|
11
|
-
* STDERR (for warning- and error-level
|
|
11
|
+
* STDERR (for warning- and error-level messages).
|
|
12
12
|
*
|
|
13
13
|
* @beta
|
|
14
14
|
*/
|
|
@@ -68,4 +68,5 @@ class ConsoleTerminalProvider {
|
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
70
|
exports.ConsoleTerminalProvider = ConsoleTerminalProvider;
|
|
71
|
+
ConsoleTerminalProvider.supportsColor = safe_1.enabled;
|
|
71
72
|
//# sourceMappingURL=ConsoleTerminalProvider.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConsoleTerminalProvider.js","sourceRoot":"","sources":["../src/ConsoleTerminalProvider.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;AAE3D,2BAAyB;AACzB,sCAAuD;AAEvD,2DAAuF;AAqBvF;;;;;GAKG;AACH,MAAa,uBAAuB;
|
|
1
|
+
{"version":3,"file":"ConsoleTerminalProvider.js","sourceRoot":"","sources":["../src/ConsoleTerminalProvider.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;AAE3D,2BAAyB;AACzB,sCAAuD;AAEvD,2DAAuF;AAqBvF;;;;;GAKG;AACH,MAAa,uBAAuB;IAalC,YAAmB,UAAoD,EAAE;QAVzE;;WAEG;QACI,mBAAc,GAAY,KAAK,CAAC;QAEvC;;WAEG;QACI,iBAAY,GAAY,KAAK,CAAC;QAGnC,IAAI,CAAC,cAAc,GAAG,CAAC,CAAC,OAAO,CAAC,cAAc,CAAC;QAC/C,IAAI,CAAC,YAAY,GAAG,CAAC,CAAC,OAAO,CAAC,YAAY,CAAC;IAC7C,CAAC;IAED;;OAEG;IACI,KAAK,CAAC,IAAY,EAAE,QAAkC;QAC3D,QAAQ,QAAQ,EAAE,CAAC;YACjB,KAAK,4CAAwB,CAAC,OAAO,CAAC;YACtC,KAAK,4CAAwB,CAAC,KAAK,CAAC,CAAC,CAAC;gBACpC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;gBAC3B,MAAM;YACR,CAAC;YAED,KAAK,4CAAwB,CAAC,OAAO,CAAC,CAAC,CAAC;gBACtC,IAAI,IAAI,CAAC,cAAc,EAAE,CAAC;oBACxB,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;gBAC7B,CAAC;gBACD,MAAM;YACR,CAAC;YAED,KAAK,4CAAwB,CAAC,KAAK,CAAC,CAAC,CAAC;gBACpC,IAAI,IAAI,CAAC,YAAY,EAAE,CAAC;oBACtB,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;gBAC7B,CAAC;gBACD,MAAM;YACR,CAAC;YAED,KAAK,4CAAwB,CAAC,GAAG,CAAC;YAClC,OAAO,CAAC,CAAC,CAAC;gBACR,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;gBAC3B,MAAM;YACR,CAAC;QACH,CAAC;IACH,CAAC;IAED;;OAEG;IACH,IAAW,YAAY;QACrB,OAAO,QAAG,CAAC;IACb,CAAC;IAED;;OAEG;IACH,IAAW,aAAa;QACtB,OAAO,cAAa,CAAC;IACvB,CAAC;;AA/DH,0DAgEC;AA/DwB,qCAAa,GAAY,cAAa,AAAzB,CAA0B","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.\n\nimport { EOL } from 'os';\nimport { enabled as supportsColor } from 'colors/safe';\n\nimport { type ITerminalProvider, TerminalProviderSeverity } from './ITerminalProvider';\n\n/**\n * Options to be provided to a {@link ConsoleTerminalProvider}\n *\n * @beta\n */\nexport interface IConsoleTerminalProviderOptions {\n /**\n * If true, print verbose logging messages.\n */\n verboseEnabled: boolean;\n\n /**\n * If true, print debug logging messages. Note that \"verbose\" and \"debug\" are considered\n * separate message filters; if you want debug to imply verbose, it is up to your\n * application code to enforce that.\n */\n debugEnabled: boolean;\n}\n\n/**\n * Terminal provider that prints to STDOUT (for log- and verbose-level messages) and\n * STDERR (for warning- and error-level messages).\n *\n * @beta\n */\nexport class ConsoleTerminalProvider implements ITerminalProvider {\n public static readonly supportsColor: boolean = supportsColor;\n\n /**\n * If true, verbose-level messages should be written to the console.\n */\n public verboseEnabled: boolean = false;\n\n /**\n * If true, debug-level messages should be written to the console.\n */\n public debugEnabled: boolean = false;\n\n public constructor(options: Partial<IConsoleTerminalProviderOptions> = {}) {\n this.verboseEnabled = !!options.verboseEnabled;\n this.debugEnabled = !!options.debugEnabled;\n }\n\n /**\n * {@inheritDoc ITerminalProvider.write}\n */\n public write(data: string, severity: TerminalProviderSeverity): void {\n switch (severity) {\n case TerminalProviderSeverity.warning:\n case TerminalProviderSeverity.error: {\n process.stderr.write(data);\n break;\n }\n\n case TerminalProviderSeverity.verbose: {\n if (this.verboseEnabled) {\n process.stdout.write(data);\n }\n break;\n }\n\n case TerminalProviderSeverity.debug: {\n if (this.debugEnabled) {\n process.stdout.write(data);\n }\n break;\n }\n\n case TerminalProviderSeverity.log:\n default: {\n process.stdout.write(data);\n break;\n }\n }\n }\n\n /**\n * {@inheritDoc ITerminalProvider.eolCharacter}\n */\n public get eolCharacter(): string {\n return EOL;\n }\n\n /**\n * {@inheritDoc ITerminalProvider.supportsColor}\n */\n public get supportsColor(): boolean {\n return supportsColor;\n }\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rushstack/terminal",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"description": "User interface primitives for console applications",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"typings": "dist/terminal.d.ts",
|
|
@@ -11,14 +11,14 @@
|
|
|
11
11
|
"directory": "libraries/terminal"
|
|
12
12
|
},
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"
|
|
14
|
+
"colors": "~1.2.1",
|
|
15
|
+
"@rushstack/node-core-library": "4.0.2"
|
|
15
16
|
},
|
|
16
17
|
"devDependencies": {
|
|
17
18
|
"@rushstack/heft": "0.64.0",
|
|
18
19
|
"@rushstack/heft-node-rig": "2.4.0",
|
|
19
20
|
"@types/heft-jest": "1.0.1",
|
|
20
21
|
"@types/node": "18.17.15",
|
|
21
|
-
"colors": "~1.2.1",
|
|
22
22
|
"local-eslint-config": "1.0.0"
|
|
23
23
|
},
|
|
24
24
|
"peerDependencies": {
|