@mintlify/prebuild 1.0.1155 → 1.0.1157
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.
|
@@ -273,6 +273,7 @@ export declare const DocsConfigUpdater: ConfigUpdater<{
|
|
|
273
273
|
seo?: {
|
|
274
274
|
metatags?: Record<string, string> | undefined;
|
|
275
275
|
indexing?: "all" | "navigable" | undefined;
|
|
276
|
+
trailingSlash?: boolean | undefined;
|
|
276
277
|
} | undefined;
|
|
277
278
|
description?: string | undefined;
|
|
278
279
|
banner?: {
|
|
@@ -656,6 +657,7 @@ export declare const DocsConfigUpdater: ConfigUpdater<{
|
|
|
656
657
|
seo?: {
|
|
657
658
|
metatags?: Record<string, string> | undefined;
|
|
658
659
|
indexing?: "all" | "navigable" | undefined;
|
|
660
|
+
trailingSlash?: boolean | undefined;
|
|
659
661
|
} | undefined;
|
|
660
662
|
description?: string | undefined;
|
|
661
663
|
banner?: {
|
|
@@ -1039,6 +1041,7 @@ export declare const DocsConfigUpdater: ConfigUpdater<{
|
|
|
1039
1041
|
seo?: {
|
|
1040
1042
|
metatags?: Record<string, string> | undefined;
|
|
1041
1043
|
indexing?: "all" | "navigable" | undefined;
|
|
1044
|
+
trailingSlash?: boolean | undefined;
|
|
1042
1045
|
} | undefined;
|
|
1043
1046
|
description?: string | undefined;
|
|
1044
1047
|
banner?: {
|
|
@@ -1422,6 +1425,7 @@ export declare const DocsConfigUpdater: ConfigUpdater<{
|
|
|
1422
1425
|
seo?: {
|
|
1423
1426
|
metatags?: Record<string, string> | undefined;
|
|
1424
1427
|
indexing?: "all" | "navigable" | undefined;
|
|
1428
|
+
trailingSlash?: boolean | undefined;
|
|
1425
1429
|
} | undefined;
|
|
1426
1430
|
description?: string | undefined;
|
|
1427
1431
|
banner?: {
|
|
@@ -1805,6 +1809,7 @@ export declare const DocsConfigUpdater: ConfigUpdater<{
|
|
|
1805
1809
|
seo?: {
|
|
1806
1810
|
metatags?: Record<string, string> | undefined;
|
|
1807
1811
|
indexing?: "all" | "navigable" | undefined;
|
|
1812
|
+
trailingSlash?: boolean | undefined;
|
|
1808
1813
|
} | undefined;
|
|
1809
1814
|
description?: string | undefined;
|
|
1810
1815
|
banner?: {
|
|
@@ -2188,6 +2193,7 @@ export declare const DocsConfigUpdater: ConfigUpdater<{
|
|
|
2188
2193
|
seo?: {
|
|
2189
2194
|
metatags?: Record<string, string> | undefined;
|
|
2190
2195
|
indexing?: "all" | "navigable" | undefined;
|
|
2196
|
+
trailingSlash?: boolean | undefined;
|
|
2191
2197
|
} | undefined;
|
|
2192
2198
|
description?: string | undefined;
|
|
2193
2199
|
banner?: {
|
|
@@ -2571,6 +2577,7 @@ export declare const DocsConfigUpdater: ConfigUpdater<{
|
|
|
2571
2577
|
seo?: {
|
|
2572
2578
|
metatags?: Record<string, string> | undefined;
|
|
2573
2579
|
indexing?: "all" | "navigable" | undefined;
|
|
2580
|
+
trailingSlash?: boolean | undefined;
|
|
2574
2581
|
} | undefined;
|
|
2575
2582
|
description?: string | undefined;
|
|
2576
2583
|
banner?: {
|
|
@@ -2954,6 +2961,7 @@ export declare const DocsConfigUpdater: ConfigUpdater<{
|
|
|
2954
2961
|
seo?: {
|
|
2955
2962
|
metatags?: Record<string, string> | undefined;
|
|
2956
2963
|
indexing?: "all" | "navigable" | undefined;
|
|
2964
|
+
trailingSlash?: boolean | undefined;
|
|
2957
2965
|
} | undefined;
|
|
2958
2966
|
description?: string | undefined;
|
|
2959
2967
|
banner?: {
|
|
@@ -3337,6 +3345,7 @@ export declare const DocsConfigUpdater: ConfigUpdater<{
|
|
|
3337
3345
|
seo?: {
|
|
3338
3346
|
metatags?: Record<string, string> | undefined;
|
|
3339
3347
|
indexing?: "all" | "navigable" | undefined;
|
|
3348
|
+
trailingSlash?: boolean | undefined;
|
|
3340
3349
|
} | undefined;
|
|
3341
3350
|
description?: string | undefined;
|
|
3342
3351
|
banner?: {
|
|
@@ -272,6 +272,7 @@ export declare const update: ({ contentDirectoryPath, staticFilenames, openApiFi
|
|
|
272
272
|
seo?: {
|
|
273
273
|
metatags?: Record<string, string> | undefined;
|
|
274
274
|
indexing?: "all" | "navigable" | undefined;
|
|
275
|
+
trailingSlash?: boolean | undefined;
|
|
275
276
|
} | undefined;
|
|
276
277
|
description?: string | undefined;
|
|
277
278
|
banner?: {
|
|
@@ -655,6 +656,7 @@ export declare const update: ({ contentDirectoryPath, staticFilenames, openApiFi
|
|
|
655
656
|
seo?: {
|
|
656
657
|
metatags?: Record<string, string> | undefined;
|
|
657
658
|
indexing?: "all" | "navigable" | undefined;
|
|
659
|
+
trailingSlash?: boolean | undefined;
|
|
658
660
|
} | undefined;
|
|
659
661
|
description?: string | undefined;
|
|
660
662
|
banner?: {
|
|
@@ -1038,6 +1040,7 @@ export declare const update: ({ contentDirectoryPath, staticFilenames, openApiFi
|
|
|
1038
1040
|
seo?: {
|
|
1039
1041
|
metatags?: Record<string, string> | undefined;
|
|
1040
1042
|
indexing?: "all" | "navigable" | undefined;
|
|
1043
|
+
trailingSlash?: boolean | undefined;
|
|
1041
1044
|
} | undefined;
|
|
1042
1045
|
description?: string | undefined;
|
|
1043
1046
|
banner?: {
|
|
@@ -1421,6 +1424,7 @@ export declare const update: ({ contentDirectoryPath, staticFilenames, openApiFi
|
|
|
1421
1424
|
seo?: {
|
|
1422
1425
|
metatags?: Record<string, string> | undefined;
|
|
1423
1426
|
indexing?: "all" | "navigable" | undefined;
|
|
1427
|
+
trailingSlash?: boolean | undefined;
|
|
1424
1428
|
} | undefined;
|
|
1425
1429
|
description?: string | undefined;
|
|
1426
1430
|
banner?: {
|
|
@@ -1804,6 +1808,7 @@ export declare const update: ({ contentDirectoryPath, staticFilenames, openApiFi
|
|
|
1804
1808
|
seo?: {
|
|
1805
1809
|
metatags?: Record<string, string> | undefined;
|
|
1806
1810
|
indexing?: "all" | "navigable" | undefined;
|
|
1811
|
+
trailingSlash?: boolean | undefined;
|
|
1807
1812
|
} | undefined;
|
|
1808
1813
|
description?: string | undefined;
|
|
1809
1814
|
banner?: {
|
|
@@ -2187,6 +2192,7 @@ export declare const update: ({ contentDirectoryPath, staticFilenames, openApiFi
|
|
|
2187
2192
|
seo?: {
|
|
2188
2193
|
metatags?: Record<string, string> | undefined;
|
|
2189
2194
|
indexing?: "all" | "navigable" | undefined;
|
|
2195
|
+
trailingSlash?: boolean | undefined;
|
|
2190
2196
|
} | undefined;
|
|
2191
2197
|
description?: string | undefined;
|
|
2192
2198
|
banner?: {
|
|
@@ -2570,6 +2576,7 @@ export declare const update: ({ contentDirectoryPath, staticFilenames, openApiFi
|
|
|
2570
2576
|
seo?: {
|
|
2571
2577
|
metatags?: Record<string, string> | undefined;
|
|
2572
2578
|
indexing?: "all" | "navigable" | undefined;
|
|
2579
|
+
trailingSlash?: boolean | undefined;
|
|
2573
2580
|
} | undefined;
|
|
2574
2581
|
description?: string | undefined;
|
|
2575
2582
|
banner?: {
|
|
@@ -2953,6 +2960,7 @@ export declare const update: ({ contentDirectoryPath, staticFilenames, openApiFi
|
|
|
2953
2960
|
seo?: {
|
|
2954
2961
|
metatags?: Record<string, string> | undefined;
|
|
2955
2962
|
indexing?: "all" | "navigable" | undefined;
|
|
2963
|
+
trailingSlash?: boolean | undefined;
|
|
2956
2964
|
} | undefined;
|
|
2957
2965
|
description?: string | undefined;
|
|
2958
2966
|
banner?: {
|
|
@@ -3336,6 +3344,7 @@ export declare const update: ({ contentDirectoryPath, staticFilenames, openApiFi
|
|
|
3336
3344
|
seo?: {
|
|
3337
3345
|
metatags?: Record<string, string> | undefined;
|
|
3338
3346
|
indexing?: "all" | "navigable" | undefined;
|
|
3347
|
+
trailingSlash?: boolean | undefined;
|
|
3339
3348
|
} | undefined;
|
|
3340
3349
|
description?: string | undefined;
|
|
3341
3350
|
banner?: {
|
|
@@ -6,6 +6,12 @@ export type FileWithImportsAndMetadata = FileWithImports & {
|
|
|
6
6
|
metadata?: Record<string, unknown>;
|
|
7
7
|
contentDirectoryPath?: string;
|
|
8
8
|
};
|
|
9
|
+
export type RssCandidatePage = {
|
|
10
|
+
targetPath: string;
|
|
11
|
+
sourcePath: string;
|
|
12
|
+
tree: Root;
|
|
13
|
+
metadata: DecoratedNavigationPage;
|
|
14
|
+
};
|
|
9
15
|
type ReadPageContentsArgs = {
|
|
10
16
|
contentDirectoryPath: string;
|
|
11
17
|
openApiFiles: OpenApiFile[];
|
|
@@ -14,12 +20,7 @@ type ReadPageContentsArgs = {
|
|
|
14
20
|
pagesAcc: Record<string, DecoratedNavigationPage>;
|
|
15
21
|
};
|
|
16
22
|
export declare const readPageContents: ({ contentDirectoryPath, openApiFiles, asyncApiFiles, contentFilenames, pagesAcc, }: ReadPageContentsArgs) => Promise<{
|
|
17
|
-
mdxFilesWithNoImports:
|
|
18
|
-
targetPath: string;
|
|
19
|
-
sourcePath: string;
|
|
20
|
-
tree: Root;
|
|
21
|
-
metadata: DecoratedNavigationPage;
|
|
22
|
-
}[];
|
|
23
|
+
mdxFilesWithNoImports: RssCandidatePage[];
|
|
23
24
|
pagesAcc: Record<string, DecoratedNavigationPage>;
|
|
24
25
|
filesWithImports: FileWithImportsAndMetadata[];
|
|
25
26
|
}>;
|
|
@@ -1,14 +1,19 @@
|
|
|
1
|
-
import { hasImports, findAndRemoveImports, getDecoratedNavPageAndSlug, parseFrontmatter, replaceVariables, } from '@mintlify/common';
|
|
1
|
+
import { containsUpdates, hasImports, findAndRemoveImports, getDecoratedNavPageAndSlug, parseFrontmatter, replaceVariables, stringifyTree, } from '@mintlify/common';
|
|
2
2
|
import { promises as _promises } from 'fs';
|
|
3
|
+
import { outputFile } from 'fs-extra';
|
|
3
4
|
import { join } from 'path';
|
|
4
5
|
import { preparseMdxTree } from '../../../createPage/preparseMdx/index.js';
|
|
5
6
|
import { preserveAutoGeneratedMetadata } from '../preserveAutoGeneratedMetadata.js';
|
|
6
7
|
const { readFile } = _promises;
|
|
8
|
+
const PAGE_PARSE_CONCURRENCY = 8;
|
|
7
9
|
export const readPageContents = async ({ contentDirectoryPath, openApiFiles, asyncApiFiles, contentFilenames, pagesAcc, }) => {
|
|
8
10
|
const filesWithImports = [];
|
|
9
|
-
const
|
|
11
|
+
const mdxFilesWithNoImports = [];
|
|
12
|
+
const remainingFilenames = [...contentFilenames];
|
|
13
|
+
const processFile = async (filename) => {
|
|
10
14
|
const sourcePath = join(contentDirectoryPath, filename);
|
|
11
15
|
const targetPath = join('src', '_props', filename);
|
|
16
|
+
let treeToWrite;
|
|
12
17
|
try {
|
|
13
18
|
const contentStr = (await readFile(sourcePath)).toString();
|
|
14
19
|
const tree = await preparseMdxTree(contentStr, contentDirectoryPath, sourcePath);
|
|
@@ -29,15 +34,33 @@ export const readPageContents = async ({ contentDirectoryPath, openApiFiles, asy
|
|
|
29
34
|
}
|
|
30
35
|
const { slug, pageMetadata } = getDecoratedNavPageAndSlug(filename, contentStr, openApiFiles, asyncApiFiles);
|
|
31
36
|
preserveAutoGeneratedMetadata(contentStr, slug, pageMetadata, pagesAcc);
|
|
32
|
-
|
|
37
|
+
// Only RSS candidates are needed by later phases (writeRssFiles). All
|
|
38
|
+
// other import-free pages are written and dropped immediately so peak
|
|
39
|
+
// memory does not grow with the number of pages.
|
|
40
|
+
if (pageMetadata.rss === true || containsUpdates(tree)) {
|
|
41
|
+
mdxFilesWithNoImports.push({ targetPath, sourcePath, tree, metadata: pageMetadata });
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
treeToWrite = tree;
|
|
33
45
|
}
|
|
34
46
|
catch (error) {
|
|
35
47
|
const errorMessage = error instanceof Error ? error.message : 'Unknown error occurred reading and parsing file.';
|
|
36
48
|
console.error(`${sourcePath}: ${errorMessage}`);
|
|
37
49
|
throw new Error('Failed to parse MDX files, please correct errors before continuing');
|
|
38
50
|
}
|
|
39
|
-
|
|
40
|
-
|
|
51
|
+
await outputFile(targetPath, stringifyTree(treeToWrite), {
|
|
52
|
+
flag: 'w',
|
|
53
|
+
});
|
|
54
|
+
};
|
|
55
|
+
const processFilesUntilDone = async () => {
|
|
56
|
+
let filename = remainingFilenames.shift();
|
|
57
|
+
while (filename !== undefined) {
|
|
58
|
+
await processFile(filename);
|
|
59
|
+
filename = remainingFilenames.shift();
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
const workerCount = Math.min(PAGE_PARSE_CONCURRENCY, remainingFilenames.length);
|
|
63
|
+
await Promise.all(Array.from({ length: workerCount }, processFilesUntilDone));
|
|
41
64
|
return { mdxFilesWithNoImports, pagesAcc, filesWithImports };
|
|
42
65
|
};
|
|
43
66
|
export const readSnippetsV2Contents = (contentDirectoryPath, snippetV2Filenames, variables) => {
|