@maz-ui/node 4.2.1-alpha.13 → 4.2.1-beta.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/index.d.mts +11 -2
- package/dist/index.d.ts +11 -2
- package/dist/index.mjs +27 -3
- package/package.json +3 -2
package/dist/index.d.mts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as consola from 'consola';
|
|
2
2
|
import { ConsolaOptions, InputLogObject, ConsolaReporter, ConsolaInstance } from 'consola';
|
|
3
3
|
export { ConsolaOptions } from 'consola';
|
|
4
|
+
import { FigletOptions } from 'figlet/node';
|
|
4
5
|
|
|
5
6
|
declare const LogLevelMap: {
|
|
6
7
|
silent: number;
|
|
@@ -27,7 +28,7 @@ declare function createLogger(options?: LoggerOptions): {
|
|
|
27
28
|
fatal: (message: InputLogObject | any, ...args: any[]) => void;
|
|
28
29
|
ready: (message: InputLogObject | any, ...args: any[]) => void;
|
|
29
30
|
silent: (message: InputLogObject | any, ...args: any[]) => void;
|
|
30
|
-
divider: () => void;
|
|
31
|
+
divider: (character?: string) => void;
|
|
31
32
|
eot: () => void;
|
|
32
33
|
brand: (message: string) => void;
|
|
33
34
|
clear: () => void;
|
|
@@ -61,5 +62,13 @@ declare function execPromise(command: string, { logger, packageName, noSuccess,
|
|
|
61
62
|
stderr: string;
|
|
62
63
|
}>;
|
|
63
64
|
|
|
64
|
-
|
|
65
|
+
declare function printBanner({ name, version, options, }: {
|
|
66
|
+
name: string;
|
|
67
|
+
version?: string;
|
|
68
|
+
options?: FigletOptions & {
|
|
69
|
+
clear?: boolean;
|
|
70
|
+
};
|
|
71
|
+
}): void;
|
|
72
|
+
|
|
73
|
+
export { createLogger, execPromise, logger, printBanner };
|
|
65
74
|
export type { LogLevel, Logger, LoggerOptions };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as consola from 'consola';
|
|
2
2
|
import { ConsolaOptions, InputLogObject, ConsolaReporter, ConsolaInstance } from 'consola';
|
|
3
3
|
export { ConsolaOptions } from 'consola';
|
|
4
|
+
import { FigletOptions } from 'figlet/node';
|
|
4
5
|
|
|
5
6
|
declare const LogLevelMap: {
|
|
6
7
|
silent: number;
|
|
@@ -27,7 +28,7 @@ declare function createLogger(options?: LoggerOptions): {
|
|
|
27
28
|
fatal: (message: InputLogObject | any, ...args: any[]) => void;
|
|
28
29
|
ready: (message: InputLogObject | any, ...args: any[]) => void;
|
|
29
30
|
silent: (message: InputLogObject | any, ...args: any[]) => void;
|
|
30
|
-
divider: () => void;
|
|
31
|
+
divider: (character?: string) => void;
|
|
31
32
|
eot: () => void;
|
|
32
33
|
brand: (message: string) => void;
|
|
33
34
|
clear: () => void;
|
|
@@ -61,5 +62,13 @@ declare function execPromise(command: string, { logger, packageName, noSuccess,
|
|
|
61
62
|
stderr: string;
|
|
62
63
|
}>;
|
|
63
64
|
|
|
64
|
-
|
|
65
|
+
declare function printBanner({ name, version, options, }: {
|
|
66
|
+
name: string;
|
|
67
|
+
version?: string;
|
|
68
|
+
options?: FigletOptions & {
|
|
69
|
+
clear?: boolean;
|
|
70
|
+
};
|
|
71
|
+
}): void;
|
|
72
|
+
|
|
73
|
+
export { createLogger, execPromise, logger, printBanner };
|
|
65
74
|
export type { LogLevel, Logger, LoggerOptions };
|
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { exec } from 'node:child_process';
|
|
2
|
-
import process from 'node:process';
|
|
2
|
+
import process$1 from 'node:process';
|
|
3
3
|
import { blueBright } from 'colorette';
|
|
4
4
|
import { createConsola } from 'consola';
|
|
5
|
+
import figlet from 'figlet';
|
|
5
6
|
|
|
6
7
|
const LogLevelMap = {
|
|
7
8
|
silent: Number.NEGATIVE_INFINITY,
|
|
@@ -33,7 +34,7 @@ function createLogger(options) {
|
|
|
33
34
|
fatal: (message, ...args) => consola.fatal(message, ...args),
|
|
34
35
|
ready: (message, ...args) => consola.ready(message, ...args),
|
|
35
36
|
silent: (message, ...args) => consola.silent(message, ...args),
|
|
36
|
-
divider: () => console.log(
|
|
37
|
+
divider: (character = "=") => console.log(character.repeat(process$1.stdout.columns ?? 20)),
|
|
37
38
|
eot: () => console.log(),
|
|
38
39
|
brand: (message) => console.log(blueBright(message)),
|
|
39
40
|
clear: () => console.clear(),
|
|
@@ -87,4 +88,27 @@ async function execPromise(command, {
|
|
|
87
88
|
});
|
|
88
89
|
}
|
|
89
90
|
|
|
90
|
-
|
|
91
|
+
function printBanner({
|
|
92
|
+
name,
|
|
93
|
+
version,
|
|
94
|
+
options
|
|
95
|
+
}) {
|
|
96
|
+
options = {
|
|
97
|
+
horizontalLayout: "full",
|
|
98
|
+
font: "ANSI Shadow",
|
|
99
|
+
clear: true,
|
|
100
|
+
...options
|
|
101
|
+
};
|
|
102
|
+
if (options.clear)
|
|
103
|
+
process.stdout.write("\x1B[2J");
|
|
104
|
+
const banner = figlet.textSync(name, options);
|
|
105
|
+
logger.brand(banner);
|
|
106
|
+
if (version) {
|
|
107
|
+
logger.brand(version);
|
|
108
|
+
logger.eot();
|
|
109
|
+
}
|
|
110
|
+
logger.divider();
|
|
111
|
+
logger.eot();
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
export { createLogger, execPromise, logger, printBanner };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@maz-ui/node",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "4.2.1-
|
|
4
|
+
"version": "4.2.1-beta.0",
|
|
5
5
|
"description": "Node utilities for Maz-UI library",
|
|
6
6
|
"author": "Louis Mazel <me@loicmazuel.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -40,7 +40,8 @@
|
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
42
|
"colorette": "^2.0.20",
|
|
43
|
-
"consola": "^3.4.2"
|
|
43
|
+
"consola": "^3.4.2",
|
|
44
|
+
"figlet": "^1.9.3"
|
|
44
45
|
},
|
|
45
46
|
"devDependencies": {
|
|
46
47
|
"unbuild": "^3.6.1"
|