@docusaurus/logger 3.10.1-canary-6655 → 3.10.1-canary-6803
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/lib/logger.d.ts.map +1 -1
- package/lib/logger.js +27 -18
- package/lib/logger.js.map +1 -1
- package/package.json +3 -3
- package/src/logger.ts +38 -19
package/lib/logger.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../src/logger.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,mBAAmB,CAAC;AAEzD,KAAK,mBAAmB,GAAG,MAAM,GAAG,MAAM,GAAG,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../src/logger.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,mBAAmB,CAAC;AAEzD,KAAK,mBAAmB,GAAG,MAAM,GAAG,MAAM,GAAG,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,CAAC;AA0BjE,iBAAS,WAAW,CAClB,IAAI,EAAE,oBAAoB,EAC1B,GAAG,MAAM,EAAE,mBAAmB,EAAE,GAC/B,MAAM,CAkCR;AAYD,iBAAS,IAAI,CAAC,GAAG,EAAE,OAAO,GAAG,IAAI,CAAC;AAClC,iBAAS,IAAI,CACX,GAAG,EAAE,oBAAoB,EACzB,GAAG,MAAM,EAAE,CAAC,mBAAmB,EAAE,GAAG,mBAAmB,EAAE,CAAC,GACzD,IAAI,CAAC;AAUR,iBAAS,IAAI,CAAC,GAAG,EAAE,OAAO,GAAG,IAAI,CAAC;AAClC,iBAAS,IAAI,CACX,GAAG,EAAE,oBAAoB,EACzB,GAAG,MAAM,EAAE,CAAC,mBAAmB,EAAE,GAAG,mBAAmB,EAAE,CAAC,GACzD,IAAI,CAAC;AAaR,iBAAS,KAAK,CAAC,GAAG,EAAE,OAAO,GAAG,IAAI,CAAC;AACnC,iBAAS,KAAK,CACZ,GAAG,EAAE,oBAAoB,EACzB,GAAG,MAAM,EAAE,CAAC,mBAAmB,EAAE,GAAG,mBAAmB,EAAE,CAAC,GACzD,IAAI,CAAC;AAaR,iBAAS,OAAO,CAAC,GAAG,EAAE,OAAO,GAAG,IAAI,CAAC;AACrC,iBAAS,OAAO,CACd,GAAG,EAAE,oBAAoB,EACzB,GAAG,MAAM,EAAE,CAAC,mBAAmB,EAAE,GAAG,mBAAmB,EAAE,CAAC,GACzD,IAAI,CAAC;AAuBR,iBAAS,OAAO,IAAI,IAAI,CAEvB;AAED;;;;;;;;;;;;;GAaG;AACH,iBAAS,MAAM,CAAC,iBAAiB,EAAE,iBAAiB,GAAG,OAAO,OAAO,CAepE;AAED,QAAA,MAAM,MAAM;eACC,MAAM,GAAG,MAAM,KAAG,MAAM;kBACrB,MAAM,GAAG,MAAM,KAAG,MAAM;iBACzB,MAAM,GAAG,MAAM,KAAG,MAAM;gBACzB,MAAM,GAAG,MAAM,KAAG,MAAM;gBACxB,MAAM,GAAG,MAAM,KAAG,MAAM;eACzB,MAAM,GAAG,MAAM,KAAG,MAAM;gBA/KlB,OAAO,KAAG,MAAM;eAEjB,OAAO,KAAG,MAAM;gBAEf,OAAO,KAAG,MAAM;gBAEhB,OAAO,KAAG,MAAM;kBACd,OAAO,KAAG,MAAM;eACnB,OAAO,KAAG,MAAM;;;;;;;;CAqLjC,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
package/lib/logger.js
CHANGED
|
@@ -6,14 +6,23 @@
|
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*/
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
|
|
9
|
+
const node_util_1 = require("node:util");
|
|
10
|
+
const CommonStyles = {
|
|
11
|
+
blueBold: ['blue', 'bold'],
|
|
12
|
+
cyanUnderline: ['cyan', 'underline'],
|
|
13
|
+
};
|
|
14
|
+
const Prefixes = {
|
|
15
|
+
success: (0, node_util_1.styleText)(['green', 'bold'], '[SUCCESS]'),
|
|
16
|
+
info: (0, node_util_1.styleText)(['cyan', 'bold'], '[INFO]'),
|
|
17
|
+
warning: (0, node_util_1.styleText)(['yellow', 'bold'], '[WARNING]'),
|
|
18
|
+
error: (0, node_util_1.styleText)(['red', 'bold'], '[ERROR]'),
|
|
19
|
+
};
|
|
20
|
+
const path = (msg) => (0, node_util_1.styleText)(CommonStyles.cyanUnderline, `"${String(msg)}"`);
|
|
21
|
+
const url = (msg) => (0, node_util_1.styleText)(CommonStyles.cyanUnderline, String(msg));
|
|
22
|
+
const name = (msg) => (0, node_util_1.styleText)(CommonStyles.blueBold, String(msg));
|
|
23
|
+
const code = (msg) => (0, node_util_1.styleText)('cyan', `\`${String(msg)}\``);
|
|
24
|
+
const subdue = (msg) => (0, node_util_1.styleText)('gray', String(msg));
|
|
25
|
+
const num = (msg) => (0, node_util_1.styleText)('yellow', String(msg));
|
|
17
26
|
function interpolate(msgs, ...values) {
|
|
18
27
|
let res = '';
|
|
19
28
|
values.forEach((value, idx) => {
|
|
@@ -57,22 +66,22 @@ function stringify(msg) {
|
|
|
57
66
|
return String(msg);
|
|
58
67
|
}
|
|
59
68
|
function info(msg, ...values) {
|
|
60
|
-
console.info(`${
|
|
69
|
+
console.info(`${Prefixes.info} ${values.length === 0
|
|
61
70
|
? stringify(msg)
|
|
62
71
|
: interpolate(msg, ...values)}`);
|
|
63
72
|
}
|
|
64
73
|
function warn(msg, ...values) {
|
|
65
|
-
console.warn(
|
|
74
|
+
console.warn((0, node_util_1.styleText)('yellow', `${Prefixes.warning} ${values.length === 0
|
|
66
75
|
? stringify(msg)
|
|
67
76
|
: interpolate(msg, ...values)}`));
|
|
68
77
|
}
|
|
69
78
|
function error(msg, ...values) {
|
|
70
|
-
console.error(
|
|
79
|
+
console.error((0, node_util_1.styleText)('red', `${Prefixes.error} ${values.length === 0
|
|
71
80
|
? stringify(msg)
|
|
72
81
|
: interpolate(msg, ...values)}`));
|
|
73
82
|
}
|
|
74
83
|
function success(msg, ...values) {
|
|
75
|
-
console.log(`${
|
|
84
|
+
console.log(`${Prefixes.success} ${values.length === 0
|
|
76
85
|
? stringify(msg)
|
|
77
86
|
: interpolate(msg, ...values)}`);
|
|
78
87
|
}
|
|
@@ -111,12 +120,12 @@ function report(reportingSeverity) {
|
|
|
111
120
|
return reportingMethods[reportingSeverity];
|
|
112
121
|
}
|
|
113
122
|
const logger = {
|
|
114
|
-
red: (msg) =>
|
|
115
|
-
yellow: (msg) =>
|
|
116
|
-
green: (msg) =>
|
|
117
|
-
cyan: (msg) =>
|
|
118
|
-
bold: (msg) =>
|
|
119
|
-
dim: (msg) =>
|
|
123
|
+
red: (msg) => (0, node_util_1.styleText)('red', String(msg)),
|
|
124
|
+
yellow: (msg) => (0, node_util_1.styleText)('yellow', String(msg)),
|
|
125
|
+
green: (msg) => (0, node_util_1.styleText)('green', String(msg)),
|
|
126
|
+
cyan: (msg) => (0, node_util_1.styleText)('cyan', String(msg)),
|
|
127
|
+
bold: (msg) => (0, node_util_1.styleText)('bold', String(msg)),
|
|
128
|
+
dim: (msg) => (0, node_util_1.styleText)('dim', String(msg)),
|
|
120
129
|
path,
|
|
121
130
|
url,
|
|
122
131
|
name,
|
package/lib/logger.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../src/logger.ts"],"names":[],"mappings":";AAAA;;;;;GAKG
|
|
1
|
+
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../src/logger.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;AAEH,yCAAoC;AAOpC,MAAM,YAAY,GAAG;IACnB,QAAQ,EAAE,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BAAS,EAAC,QAAQ,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC;IAC1E,KAAK,EAAE,CAAC,GAAoB,EAAU,EAAE,CAAC,IAAA,qBAAS,EAAC,OAAO,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC;IACxE,IAAI,EAAE,CAAC,GAAoB,EAAU,EAAE,CAAC,IAAA,qBAAS,EAAC,MAAM,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC;IACtE,IAAI,EAAE,CAAC,GAAoB,EAAU,EAAE,CAAC,IAAA,qBAAS,EAAC,MAAM,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC;IACtE,GAAG,EAAE,CAAC,GAAoB,EAAU,EAAE,CAAC,IAAA,qBAAS,EAAC,KAAK,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC;IACpE,IAAI;IACJ,GAAG;IACH,IAAI;IACJ,IAAI;IACJ,MAAM;IACN,GAAG;IACH,WAAW;IACX,IAAI;IACJ,IAAI;IACJ,KAAK;IACL,OAAO;IACP,MAAM;IACN,OAAO;CACR,CAAC;AAEF,kBAAe,MAAM,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@docusaurus/logger",
|
|
3
|
-
"version": "3.10.1-canary-
|
|
3
|
+
"version": "3.10.1-canary-6803",
|
|
4
4
|
"description": "An encapsulated logger for semantically formatting console messages.",
|
|
5
5
|
"main": "./lib/index.js",
|
|
6
6
|
"repository": {
|
|
@@ -20,11 +20,11 @@
|
|
|
20
20
|
},
|
|
21
21
|
"license": "MIT",
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"
|
|
23
|
+
"@docusaurus/types": "3.10.1-canary-6803",
|
|
24
24
|
"tslib": "^2.6.0"
|
|
25
25
|
},
|
|
26
26
|
"engines": {
|
|
27
27
|
"node": ">=24.14"
|
|
28
28
|
},
|
|
29
|
-
"gitHead": "
|
|
29
|
+
"gitHead": "d2c7b381512bd4e7e90e33f56649e68d618eaa92"
|
|
30
30
|
}
|
package/src/logger.ts
CHANGED
|
@@ -5,17 +5,34 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import
|
|
8
|
+
import {styleText} from 'node:util';
|
|
9
9
|
import type {ReportingSeverity} from '@docusaurus/types';
|
|
10
10
|
|
|
11
11
|
type InterpolatableValue = string | number | (string | number)[];
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
13
|
+
type StyleTextFormat = Parameters<typeof styleText>[0];
|
|
14
|
+
|
|
15
|
+
const CommonStyles = {
|
|
16
|
+
blueBold: ['blue', 'bold'],
|
|
17
|
+
cyanUnderline: ['cyan', 'underline'],
|
|
18
|
+
} satisfies Record<string, StyleTextFormat>;
|
|
19
|
+
|
|
20
|
+
const Prefixes = {
|
|
21
|
+
success: styleText(['green', 'bold'], '[SUCCESS]'),
|
|
22
|
+
info: styleText(['cyan', 'bold'], '[INFO]'),
|
|
23
|
+
warning: styleText(['yellow', 'bold'], '[WARNING]'),
|
|
24
|
+
error: styleText(['red', 'bold'], '[ERROR]'),
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
const path = (msg: unknown): string =>
|
|
28
|
+
styleText(CommonStyles.cyanUnderline, `"${String(msg)}"`);
|
|
29
|
+
const url = (msg: unknown): string =>
|
|
30
|
+
styleText(CommonStyles.cyanUnderline, String(msg));
|
|
31
|
+
const name = (msg: unknown): string =>
|
|
32
|
+
styleText(CommonStyles.blueBold, String(msg));
|
|
33
|
+
const code = (msg: unknown): string => styleText('cyan', `\`${String(msg)}\``);
|
|
34
|
+
const subdue = (msg: unknown): string => styleText('gray', String(msg));
|
|
35
|
+
const num = (msg: unknown): string => styleText('yellow', String(msg));
|
|
19
36
|
|
|
20
37
|
function interpolate(
|
|
21
38
|
msgs: TemplateStringsArray,
|
|
@@ -73,7 +90,7 @@ function info(
|
|
|
73
90
|
): void;
|
|
74
91
|
function info(msg: unknown, ...values: InterpolatableValue[]): void {
|
|
75
92
|
console.info(
|
|
76
|
-
`${
|
|
93
|
+
`${Prefixes.info} ${
|
|
77
94
|
values.length === 0
|
|
78
95
|
? stringify(msg)
|
|
79
96
|
: interpolate(msg as TemplateStringsArray, ...values)
|
|
@@ -87,8 +104,9 @@ function warn(
|
|
|
87
104
|
): void;
|
|
88
105
|
function warn(msg: unknown, ...values: InterpolatableValue[]): void {
|
|
89
106
|
console.warn(
|
|
90
|
-
|
|
91
|
-
|
|
107
|
+
styleText(
|
|
108
|
+
'yellow',
|
|
109
|
+
`${Prefixes.warning} ${
|
|
92
110
|
values.length === 0
|
|
93
111
|
? stringify(msg)
|
|
94
112
|
: interpolate(msg as TemplateStringsArray, ...values)
|
|
@@ -103,8 +121,9 @@ function error(
|
|
|
103
121
|
): void;
|
|
104
122
|
function error(msg: unknown, ...values: InterpolatableValue[]): void {
|
|
105
123
|
console.error(
|
|
106
|
-
|
|
107
|
-
|
|
124
|
+
styleText(
|
|
125
|
+
'red',
|
|
126
|
+
`${Prefixes.error} ${
|
|
108
127
|
values.length === 0
|
|
109
128
|
? stringify(msg)
|
|
110
129
|
: interpolate(msg as TemplateStringsArray, ...values)
|
|
@@ -119,7 +138,7 @@ function success(
|
|
|
119
138
|
): void;
|
|
120
139
|
function success(msg: unknown, ...values: InterpolatableValue[]): void {
|
|
121
140
|
console.log(
|
|
122
|
-
`${
|
|
141
|
+
`${Prefixes.success} ${
|
|
123
142
|
values.length === 0
|
|
124
143
|
? stringify(msg)
|
|
125
144
|
: interpolate(msg as TemplateStringsArray, ...values)
|
|
@@ -175,12 +194,12 @@ function report(reportingSeverity: ReportingSeverity): typeof success {
|
|
|
175
194
|
}
|
|
176
195
|
|
|
177
196
|
const logger = {
|
|
178
|
-
red: (msg: string | number): string =>
|
|
179
|
-
yellow: (msg: string | number): string =>
|
|
180
|
-
green: (msg: string | number): string =>
|
|
181
|
-
cyan: (msg: string | number): string =>
|
|
182
|
-
bold: (msg: string | number): string =>
|
|
183
|
-
dim: (msg: string | number): string =>
|
|
197
|
+
red: (msg: string | number): string => styleText('red', String(msg)),
|
|
198
|
+
yellow: (msg: string | number): string => styleText('yellow', String(msg)),
|
|
199
|
+
green: (msg: string | number): string => styleText('green', String(msg)),
|
|
200
|
+
cyan: (msg: string | number): string => styleText('cyan', String(msg)),
|
|
201
|
+
bold: (msg: string | number): string => styleText('bold', String(msg)),
|
|
202
|
+
dim: (msg: string | number): string => styleText('dim', String(msg)),
|
|
184
203
|
path,
|
|
185
204
|
url,
|
|
186
205
|
name,
|