@mintlify/previewing 4.0.1622 → 4.0.1624
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 +8 -0
- package/dist/logs.js +13 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +6 -6
package/dist/logs.d.ts
CHANGED
|
@@ -37,6 +37,14 @@ export declare const DeletedLog: ({ filename }: {
|
|
|
37
37
|
export declare const BrokenLinksLog: ({ brokenLinksByFile, }: {
|
|
38
38
|
brokenLinksByFile: Record<string, string[]>;
|
|
39
39
|
}) => import("react/jsx-runtime").JSX.Element | null;
|
|
40
|
+
export declare const LinksToLog: ({ target, links, }: {
|
|
41
|
+
target: string;
|
|
42
|
+
links: {
|
|
43
|
+
file: string;
|
|
44
|
+
line?: number;
|
|
45
|
+
link: string;
|
|
46
|
+
}[];
|
|
47
|
+
}) => import("react/jsx-runtime").JSX.Element | null;
|
|
40
48
|
export declare const RenamedLog: ({ before, after }: {
|
|
41
49
|
before: string;
|
|
42
50
|
after: string;
|
package/dist/logs.js
CHANGED
|
@@ -97,6 +97,19 @@ export const BrokenLinksLog = ({ brokenLinksByFile, }) => {
|
|
|
97
97
|
}
|
|
98
98
|
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)))] }));
|
|
99
99
|
};
|
|
100
|
+
export const LinksToLog = ({ target, links, }) => {
|
|
101
|
+
const totalFiles = new Set(links.map(({ file }) => file)).size;
|
|
102
|
+
const rows = links.map(({ file, line, link }) => ({
|
|
103
|
+
location: line === undefined ? file : `${file}:${line}`,
|
|
104
|
+
link,
|
|
105
|
+
}));
|
|
106
|
+
if (process.env.CLI_TEST_MODE === 'true') {
|
|
107
|
+
console.log(`found ${links.length} links to ${target} in ${totalFiles} files`);
|
|
108
|
+
rows.forEach(({ location, link }) => console.log(`${location} ${link}`));
|
|
109
|
+
return null;
|
|
110
|
+
}
|
|
111
|
+
return (_jsxs(Box, { flexDirection: "column", alignItems: "flex-start", children: [_jsxs(Text, { children: [_jsx(Text, { children: "found" }), _jsxs(Text, { color: "yellow", bold: true, children: [' ', links.length, " links"] }), _jsxs(Text, { children: [' ', "to ", target, " in ", totalFiles, " files"] })] }), _jsx(EmptyLineLog, {}), rows.map(({ location, link }, index) => (_jsxs(Text, { children: [_jsx(Text, { bold: true, children: location }), '\u00A0'.repeat(2), link] }, `${location}-${link}-${index}`))), _jsx(EmptyLineLog, {})] }));
|
|
112
|
+
};
|
|
100
113
|
export const RenamedLog = ({ before, after }) => {
|
|
101
114
|
if (process.env.CLI_TEST_MODE === 'true') {
|
|
102
115
|
console.log(`success renamed ${before} to ${after}`);
|