@mintlify/scraping 4.0.149 → 4.0.151
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/bin/index.d.ts +1 -0
- package/bin/index.js +1 -0
- package/bin/index.js.map +1 -1
- package/bin/tsconfig.build.tsbuildinfo +1 -1
- package/bin/utils/log.d.ts +9 -1
- package/bin/utils/log.js +19 -4
- package/bin/utils/log.js.map +1 -1
- package/package.json +2 -2
- package/src/index.ts +1 -0
- package/src/utils/log.ts +28 -5
package/bin/utils/log.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ export declare const colors: {
|
|
|
5
5
|
readonly blue: "\u001B[34m";
|
|
6
6
|
readonly magenta: "\u001B[35m";
|
|
7
7
|
readonly cyan: "\u001B[36m";
|
|
8
|
+
readonly grey: "\u001B[90m";
|
|
8
9
|
readonly default: "\u001B[0m";
|
|
9
10
|
};
|
|
10
11
|
declare const statuses: readonly ["success", "failure", "error", "warn", "warning", "info"];
|
|
@@ -15,6 +16,7 @@ export declare const activeColors: {
|
|
|
15
16
|
readonly blue: "\u001B[34m";
|
|
16
17
|
readonly magenta: "\u001B[35m";
|
|
17
18
|
readonly cyan: "\u001B[36m";
|
|
19
|
+
readonly grey: "\u001B[90m";
|
|
18
20
|
readonly default: "\u001B[0m";
|
|
19
21
|
} | {
|
|
20
22
|
readonly red: "";
|
|
@@ -23,6 +25,7 @@ export declare const activeColors: {
|
|
|
23
25
|
readonly blue: "";
|
|
24
26
|
readonly magenta: "";
|
|
25
27
|
readonly cyan: "";
|
|
28
|
+
readonly grey: "";
|
|
26
29
|
readonly default: "";
|
|
27
30
|
};
|
|
28
31
|
export type Status = (typeof statuses)[number];
|
|
@@ -31,5 +34,10 @@ export declare const checkIcon: "✔ ";
|
|
|
31
34
|
export declare const xIcon: "✘ ";
|
|
32
35
|
export declare const infoIcon: "ⓘ ";
|
|
33
36
|
export declare const warningIcon: "⚠ ";
|
|
34
|
-
export declare function log(message: string | unknown, statusOrColor?: Status
|
|
37
|
+
export declare function log(message: string | unknown, statusOrColor?: Status | undefined, opts?: {
|
|
38
|
+
trailingNewLine?: boolean;
|
|
39
|
+
leadingNewLine?: boolean;
|
|
40
|
+
omitStatusMessage?: boolean;
|
|
41
|
+
omitIcon?: boolean;
|
|
42
|
+
}): void;
|
|
35
43
|
export {};
|
package/bin/utils/log.js
CHANGED
|
@@ -5,6 +5,7 @@ export const colors = {
|
|
|
5
5
|
blue: '\x1b[34m',
|
|
6
6
|
magenta: '\x1b[35m',
|
|
7
7
|
cyan: '\x1b[36m',
|
|
8
|
+
grey: '\x1b[90m',
|
|
8
9
|
default: '\x1b[0m',
|
|
9
10
|
};
|
|
10
11
|
const noColors = {
|
|
@@ -14,6 +15,7 @@ const noColors = {
|
|
|
14
15
|
blue: '',
|
|
15
16
|
magenta: '',
|
|
16
17
|
cyan: '',
|
|
18
|
+
grey: '',
|
|
17
19
|
default: '',
|
|
18
20
|
};
|
|
19
21
|
const statuses = ['success', 'failure', 'error', 'warn', 'warning', 'info'];
|
|
@@ -22,9 +24,9 @@ export const checkIcon = '✔ ';
|
|
|
22
24
|
export const xIcon = '✘ ';
|
|
23
25
|
export const infoIcon = 'ⓘ ';
|
|
24
26
|
export const warningIcon = '⚠ ';
|
|
25
|
-
export function log(message, statusOrColor) {
|
|
27
|
+
export function log(message, statusOrColor = undefined, opts = {}) {
|
|
26
28
|
let color = activeColors.blue;
|
|
27
|
-
let statusMsg = 'INFO
|
|
29
|
+
let statusMsg = 'INFO';
|
|
28
30
|
let icon = infoIcon;
|
|
29
31
|
const msg = typeof message === 'string' ? message.toLowerCase() : '';
|
|
30
32
|
if (!statusOrColor) {
|
|
@@ -64,15 +66,28 @@ export function log(message, statusOrColor) {
|
|
|
64
66
|
case 'failure':
|
|
65
67
|
case 'error':
|
|
66
68
|
color = activeColors.red;
|
|
67
|
-
statusMsg = 'ERROR
|
|
69
|
+
statusMsg = 'ERROR';
|
|
68
70
|
icon = xIcon;
|
|
69
71
|
break;
|
|
70
72
|
}
|
|
71
|
-
|
|
73
|
+
if (opts.omitIcon)
|
|
74
|
+
icon = '';
|
|
75
|
+
if (opts.omitStatusMessage)
|
|
76
|
+
statusMsg = '';
|
|
77
|
+
const separator = !opts.omitIcon || !opts.omitStatusMessage ? ' - ' : '';
|
|
78
|
+
if (opts.leadingNewLine)
|
|
79
|
+
console.log();
|
|
80
|
+
console[statusOrColor === 'error' || statusOrColor === 'failure'
|
|
81
|
+
? 'error'
|
|
82
|
+
: statusOrColor === 'warn' || statusOrColor === 'warning'
|
|
83
|
+
? 'warn'
|
|
84
|
+
: 'log'](`${color}${icon} ${statusMsg}${activeColors.default}${separator}${typeof message === 'string' ||
|
|
72
85
|
typeof message === 'bigint' ||
|
|
73
86
|
typeof message === 'number' ||
|
|
74
87
|
typeof message === 'boolean'
|
|
75
88
|
? message
|
|
76
89
|
: JSON.stringify(message, undefined, 2)}`);
|
|
90
|
+
if (opts.trailingNewLine)
|
|
91
|
+
console.log();
|
|
77
92
|
}
|
|
78
93
|
//# sourceMappingURL=log.js.map
|
package/bin/utils/log.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"log.js","sourceRoot":"","sources":["../../src/utils/log.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,MAAM,GAAG;IACpB,GAAG,EAAE,UAAU;IACf,KAAK,EAAE,UAAU;IACjB,MAAM,EAAE,UAAU;IAClB,IAAI,EAAE,UAAU;IAChB,OAAO,EAAE,UAAU;IACnB,IAAI,EAAE,UAAU;IAChB,OAAO,EAAE,SAAS;CACV,CAAC;AAEX,MAAM,QAAQ,GAAG;IACf,GAAG,EAAE,EAAE;IACP,KAAK,EAAE,EAAE;IACT,MAAM,EAAE,EAAE;IACV,IAAI,EAAE,EAAE;IACR,OAAO,EAAE,EAAE;IACX,IAAI,EAAE,EAAE;IACR,OAAO,EAAE,EAAE;CACH,CAAC;AAEX,MAAM,QAAQ,GAAG,CAAC,SAAS,EA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C,OAAO;QACT,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,SAAS,EAAE,CAAC,CAC1C,EAAE,CACH,CAAC;IACF,IAAI,IAAI,CAAC,eAAe;QAAE,OAAO,CAAC,GAAG,EAAE,CAAC;AAC1C,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mintlify/scraping",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.151",
|
|
4
4
|
"description": "Scrape documentation frameworks to Mintlify docs",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=18.0.0"
|
|
@@ -78,5 +78,5 @@
|
|
|
78
78
|
"typescript": "^5.5.3",
|
|
79
79
|
"vitest": "^2.0.4"
|
|
80
80
|
},
|
|
81
|
-
"gitHead": "
|
|
81
|
+
"gitHead": "7f9b39e00387d0bf2ad026f96254f905195a8dfb"
|
|
82
82
|
}
|
package/src/index.ts
CHANGED
package/src/utils/log.ts
CHANGED
|
@@ -5,6 +5,7 @@ export const colors = {
|
|
|
5
5
|
blue: '\x1b[34m',
|
|
6
6
|
magenta: '\x1b[35m',
|
|
7
7
|
cyan: '\x1b[36m',
|
|
8
|
+
grey: '\x1b[90m',
|
|
8
9
|
default: '\x1b[0m',
|
|
9
10
|
} as const;
|
|
10
11
|
|
|
@@ -15,6 +16,7 @@ const noColors = {
|
|
|
15
16
|
blue: '',
|
|
16
17
|
magenta: '',
|
|
17
18
|
cyan: '',
|
|
19
|
+
grey: '',
|
|
18
20
|
default: '',
|
|
19
21
|
} as const;
|
|
20
22
|
|
|
@@ -30,9 +32,18 @@ export const xIcon = '✘ ' as const;
|
|
|
30
32
|
export const infoIcon = 'ⓘ ' as const;
|
|
31
33
|
export const warningIcon = '⚠ ' as const;
|
|
32
34
|
|
|
33
|
-
export function log(
|
|
35
|
+
export function log(
|
|
36
|
+
message: string | unknown,
|
|
37
|
+
statusOrColor: Status | undefined = undefined,
|
|
38
|
+
opts: {
|
|
39
|
+
trailingNewLine?: boolean;
|
|
40
|
+
leadingNewLine?: boolean;
|
|
41
|
+
omitStatusMessage?: boolean;
|
|
42
|
+
omitIcon?: boolean;
|
|
43
|
+
} = {}
|
|
44
|
+
): void {
|
|
34
45
|
let color: (typeof activeColors)[Color] = activeColors.blue;
|
|
35
|
-
let statusMsg: string = 'INFO
|
|
46
|
+
let statusMsg: string = 'INFO';
|
|
36
47
|
let icon: string = infoIcon;
|
|
37
48
|
|
|
38
49
|
const msg = typeof message === 'string' ? message.toLowerCase() : '';
|
|
@@ -77,13 +88,24 @@ export function log(message: string | unknown, statusOrColor?: Status): void {
|
|
|
77
88
|
case 'failure':
|
|
78
89
|
case 'error':
|
|
79
90
|
color = activeColors.red;
|
|
80
|
-
statusMsg = 'ERROR
|
|
91
|
+
statusMsg = 'ERROR';
|
|
81
92
|
icon = xIcon;
|
|
82
93
|
break;
|
|
83
94
|
}
|
|
84
95
|
|
|
85
|
-
|
|
86
|
-
|
|
96
|
+
if (opts.omitIcon) icon = '';
|
|
97
|
+
if (opts.omitStatusMessage) statusMsg = '';
|
|
98
|
+
const separator = !opts.omitIcon || !opts.omitStatusMessage ? ' - ' : '';
|
|
99
|
+
|
|
100
|
+
if (opts.leadingNewLine) console.log();
|
|
101
|
+
console[
|
|
102
|
+
statusOrColor === 'error' || statusOrColor === 'failure'
|
|
103
|
+
? 'error'
|
|
104
|
+
: statusOrColor === 'warn' || statusOrColor === 'warning'
|
|
105
|
+
? 'warn'
|
|
106
|
+
: 'log'
|
|
107
|
+
](
|
|
108
|
+
`${color}${icon} ${statusMsg}${activeColors.default}${separator}${
|
|
87
109
|
typeof message === 'string' ||
|
|
88
110
|
typeof message === 'bigint' ||
|
|
89
111
|
typeof message === 'number' ||
|
|
@@ -92,4 +114,5 @@ export function log(message: string | unknown, statusOrColor?: Status): void {
|
|
|
92
114
|
: JSON.stringify(message, undefined, 2)
|
|
93
115
|
}`
|
|
94
116
|
);
|
|
117
|
+
if (opts.trailingNewLine) console.log();
|
|
95
118
|
}
|