@octaviaflow/cli-reporter 1.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/index.js +59 -0
- package/package.json +26 -0
package/index.js
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright OctaviaFlow
|
|
3
|
+
* Author: Vishal Kumar
|
|
4
|
+
* Created: 11/November/2025
|
|
5
|
+
*
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
'use strict';
|
|
9
|
+
|
|
10
|
+
const chalk = require('chalk');
|
|
11
|
+
|
|
12
|
+
class ConsoleReporter {
|
|
13
|
+
constructor({
|
|
14
|
+
stderr = process.stderr,
|
|
15
|
+
stdin = process.stdin,
|
|
16
|
+
stdout = process.stdout,
|
|
17
|
+
} = {}) {
|
|
18
|
+
this.format = chalk;
|
|
19
|
+
this.stderr = stderr;
|
|
20
|
+
this.stdin = stdin;
|
|
21
|
+
this.stdout = stdout;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
error(message) {
|
|
25
|
+
this._logCategory('error', 'bgRed', message);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
header(message) {
|
|
29
|
+
this.log(this.format.bold(message));
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
info(message) {
|
|
33
|
+
this._logCategory('info', 'bgBlue', chalk.gray(message));
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
log(message = '') {
|
|
37
|
+
this.stdout.write(`${message}\n`);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
stack(error) {
|
|
41
|
+
this.stdout.write(`\n${error.stack}\n\n`);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
success(message) {
|
|
45
|
+
this._logCategory('success', 'bgGreen', message);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
_logCategory(category, color, message) {
|
|
49
|
+
const block = this.format[color](
|
|
50
|
+
` ${chalk.black(category.toUpperCase())} `
|
|
51
|
+
);
|
|
52
|
+
this.log(`${block} ${message}`);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
module.exports = {
|
|
57
|
+
ConsoleReporter,
|
|
58
|
+
reporter: new ConsoleReporter(),
|
|
59
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@octaviaflow/cli-reporter",
|
|
3
|
+
"description": "Reporter for CLI-based tools in the OctaviaFlow Design System",
|
|
4
|
+
"version": "1.0.0",
|
|
5
|
+
"license": "Apache-2.0",
|
|
6
|
+
"main": "index.js",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/OctaviaFlow/OctaviaFlow-Design-System.git",
|
|
10
|
+
"directory": "packages/cli-reporter"
|
|
11
|
+
},
|
|
12
|
+
"bugs": "https://github.com/OctaviaFlow/OctaviaFlow-Design-System/issues",
|
|
13
|
+
"keywords": [
|
|
14
|
+
"octaviaflow",
|
|
15
|
+
"octaviaflow-design-system",
|
|
16
|
+
"cli",
|
|
17
|
+
"reporter",
|
|
18
|
+
"logging"
|
|
19
|
+
],
|
|
20
|
+
"publishConfig": {
|
|
21
|
+
"access": "public"
|
|
22
|
+
},
|
|
23
|
+
"dependencies": {
|
|
24
|
+
"chalk": "^4.1.1"
|
|
25
|
+
}
|
|
26
|
+
}
|