@mintlify/previewing 4.0.633 → 4.0.634

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/logs.d.ts CHANGED
@@ -2,39 +2,39 @@ export declare const EmptyLineLog: () => import("react/jsx-runtime").JSX.Element
2
2
  export declare const LaunchLog: ({ localUrl, networkUrl }: {
3
3
  localUrl: string;
4
4
  networkUrl?: string;
5
- }) => import("react/jsx-runtime").JSX.Element;
5
+ }) => import("react/jsx-runtime").JSX.Element | null;
6
6
  export declare const InfoLog: ({ message }: {
7
7
  message: string;
8
- }) => import("react/jsx-runtime").JSX.Element;
8
+ }) => import("react/jsx-runtime").JSX.Element | null;
9
9
  export declare const SuccessLog: ({ message }: {
10
10
  message: string;
11
- }) => import("react/jsx-runtime").JSX.Element;
11
+ }) => import("react/jsx-runtime").JSX.Element | null;
12
12
  export declare const SpinnerLog: ({ message }: {
13
13
  message: string;
14
- }) => import("react/jsx-runtime").JSX.Element;
14
+ }) => import("react/jsx-runtime").JSX.Element | null;
15
15
  export declare const WarningLog: ({ message }: {
16
16
  message: string;
17
- }) => import("react/jsx-runtime").JSX.Element;
17
+ }) => import("react/jsx-runtime").JSX.Element | null;
18
18
  export declare const UpdateLog: ({ updateCommand }: {
19
19
  updateCommand: string;
20
- }) => import("react/jsx-runtime").JSX.Element;
20
+ }) => import("react/jsx-runtime").JSX.Element | null;
21
21
  export declare const ErrorLog: ({ message }: {
22
22
  message: string;
23
- }) => import("react/jsx-runtime").JSX.Element;
23
+ }) => import("react/jsx-runtime").JSX.Element | null;
24
24
  export declare const AddedLog: ({ filename }: {
25
25
  filename: string;
26
- }) => import("react/jsx-runtime").JSX.Element;
26
+ }) => import("react/jsx-runtime").JSX.Element | null;
27
27
  export declare const EditedLog: ({ filename }: {
28
28
  filename: string;
29
- }) => import("react/jsx-runtime").JSX.Element;
29
+ }) => import("react/jsx-runtime").JSX.Element | null;
30
30
  export declare const DeletedLog: ({ filename }: {
31
31
  filename: string;
32
- }) => import("react/jsx-runtime").JSX.Element;
32
+ }) => import("react/jsx-runtime").JSX.Element | null;
33
33
  export declare const BrokenLinksLog: ({ brokenLinksByFile, }: {
34
34
  brokenLinksByFile: Record<string, string[]>;
35
- }) => import("react/jsx-runtime").JSX.Element;
35
+ }) => import("react/jsx-runtime").JSX.Element | null;
36
36
  export declare const RenamedLog: ({ before, after }: {
37
37
  before: string;
38
38
  after: string;
39
- }) => import("react/jsx-runtime").JSX.Element;
39
+ }) => import("react/jsx-runtime").JSX.Element | null;
40
40
  export declare const Logs: React.FC;
package/dist/logs.js CHANGED
@@ -5,41 +5,89 @@ import { useState, useEffect } from 'react';
5
5
  import { setLoggingCallbacks } from './logging-state.js';
6
6
  export const EmptyLineLog = () => _jsx(Text, { children: " " });
7
7
  export const LaunchLog = ({ localUrl, networkUrl }) => {
8
+ if (process.env.CLI_TEST_MODE === 'true') {
9
+ console.log(`✓ preview ready, local: ${localUrl}, network: ${networkUrl} press ctrl+c to exit the preview`);
10
+ return null;
11
+ }
8
12
  return (_jsxs(Box, { flexDirection: "column", alignItems: "flex-start", children: [_jsxs(Text, { children: [_jsx(Text, { color: "green", bold: true, children: "\u2713" }), ' ', _jsx(Text, { children: "preview ready" })] }), _jsx(EmptyLineLog, {}), _jsxs(Text, { children: ['\u00A0'.repeat(2), "local", '\u00A0'.repeat(3), "\u2192", '\u00A0'.repeat(1), localUrl] }), networkUrl && (_jsxs(Text, { children: ['\u00A0'.repeat(2), "network", '\u00A0'.repeat(1), "\u2192", '\u00A0'.repeat(1), networkUrl] })), _jsx(EmptyLineLog, {}), _jsxs(Text, { dimColor: true, children: ["press ", _jsx(Text, { bold: true, children: "ctrl+c" }), " to exit the preview"] }), _jsx(EmptyLineLog, {})] }));
9
13
  };
10
14
  export const InfoLog = ({ message }) => {
15
+ if (process.env.CLI_TEST_MODE === 'true') {
16
+ console.log(`info ${message}`);
17
+ return null;
18
+ }
11
19
  return (_jsxs(Box, { children: [_jsx(Text, { color: "blue", bold: true, children: "info" }), _jsxs(Text, { children: [" ", message] })] }));
12
20
  };
13
21
  export const SuccessLog = ({ message }) => {
22
+ if (process.env.CLI_TEST_MODE === 'true') {
23
+ console.log(`success ${message}`);
24
+ return null;
25
+ }
14
26
  return (_jsxs(Box, { children: [_jsx(Text, { color: "green", bold: true, children: "success" }), _jsxs(Text, { children: [" ", message] })] }));
15
27
  };
16
28
  export const SpinnerLog = ({ message }) => {
29
+ if (process.env.CLI_TEST_MODE === 'true') {
30
+ console.log(`${message}`);
31
+ return null;
32
+ }
17
33
  return (_jsxs(Box, { children: [_jsx(Text, { color: "green", bold: true, children: _jsx(Spinner, { type: "dots" }) }), _jsxs(Text, { children: [" ", message] })] }));
18
34
  };
19
35
  export const WarningLog = ({ message }) => {
36
+ if (process.env.CLI_TEST_MODE === 'true') {
37
+ console.log(`warning ${message}`);
38
+ return null;
39
+ }
20
40
  return (_jsxs(Box, { children: [_jsx(Text, { color: "yellow", bold: true, children: "warning" }), _jsxs(Text, { children: [" ", message] })] }));
21
41
  };
22
42
  export const UpdateLog = ({ updateCommand }) => {
43
+ if (process.env.CLI_TEST_MODE === 'true') {
44
+ console.log(`update available - run \`${updateCommand}\` to get the latest version`);
45
+ return null;
46
+ }
23
47
  return (_jsxs(Box, { flexDirection: "column", alignItems: "flex-start", children: [_jsxs(Text, { children: [_jsx(Text, { color: "yellow", bold: true, children: "update available" }), _jsxs(Text, { children: [' ', "- run `", _jsx(Text, { bold: true, children: updateCommand }), "` to get the latest version"] })] }), _jsx(EmptyLineLog, {})] }));
24
48
  };
25
49
  export const ErrorLog = ({ message }) => {
50
+ if (process.env.CLI_TEST_MODE === 'true') {
51
+ console.log(`error ${message}`);
52
+ return null;
53
+ }
26
54
  return (_jsxs(Box, { children: [_jsx(Text, { color: "red", bold: true, children: "error" }), _jsxs(Text, { children: [" ", message] })] }));
27
55
  };
28
56
  export const AddedLog = ({ filename }) => {
57
+ if (process.env.CLI_TEST_MODE === 'true') {
58
+ console.log(`added ${filename}`);
59
+ return null;
60
+ }
29
61
  return (_jsxs(Box, { children: [_jsx(Text, { color: "green", bold: true, children: "added" }), _jsxs(Text, { children: [" ", filename] })] }));
30
62
  };
31
63
  export const EditedLog = ({ filename }) => {
64
+ if (process.env.CLI_TEST_MODE === 'true') {
65
+ console.log(`edited ${filename}`);
66
+ return null;
67
+ }
32
68
  return (_jsxs(Box, { children: [_jsx(Text, { color: "yellow", bold: true, children: "edited" }), _jsxs(Text, { children: [" ", filename] })] }));
33
69
  };
34
70
  export const DeletedLog = ({ filename }) => {
71
+ if (process.env.CLI_TEST_MODE === 'true') {
72
+ console.log(`deleted ${filename}`);
73
+ return null;
74
+ }
35
75
  return (_jsxs(Box, { children: [_jsx(Text, { color: "red", bold: true, children: "deleted" }), _jsxs(Text, { children: [" ", filename] })] }));
36
76
  };
37
77
  export const BrokenLinksLog = ({ brokenLinksByFile, }) => {
38
78
  const totalBrokenLinks = Object.values(brokenLinksByFile).reduce((acc, arr) => acc + arr.length, 0);
39
79
  const totalFiles = Object.keys(brokenLinksByFile).length;
80
+ if (process.env.CLI_TEST_MODE === 'true') {
81
+ console.log(`found ${totalBrokenLinks} broken links in ${totalFiles} files`);
82
+ return null;
83
+ }
40
84
  return (_jsxs(Box, { flexDirection: "column", alignItems: "flex-start", children: [_jsxs(Text, { children: [_jsx(Text, { children: "found" }), _jsxs(Text, { color: "yellow", bold: true, children: [' ', totalBrokenLinks, " broken links"] }), _jsxs(Text, { children: [" in ", totalFiles, " files"] })] }), _jsx(EmptyLineLog, {}), Object.entries(brokenLinksByFile).map(([filename, brokenLinks]) => (_jsxs(Box, { flexDirection: "column", alignItems: "flex-start", children: [_jsx(Box, { children: _jsx(Text, { bold: true, children: filename }) }), brokenLinks.map((link, index) => (_jsxs(Text, { children: ['\u00A0'.repeat(1), "\u23BF", '\u00A0'.repeat(2), link] }, `${link}-${index}`))), _jsx(EmptyLineLog, {})] }, filename)))] }));
41
85
  };
42
86
  export const RenamedLog = ({ before, after }) => {
87
+ if (process.env.CLI_TEST_MODE === 'true') {
88
+ console.log(`success renamed ${before} to ${after}`);
89
+ return null;
90
+ }
43
91
  return (_jsxs(Box, { children: [_jsx(Text, { color: "green", bold: true, children: "success" }), _jsxs(Text, { children: [' ', "renamed ", before, " to ", after] })] }));
44
92
  };
45
93
  export const Logs = () => {