@mintlify/previewing 4.0.449 → 4.0.450
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.
|
@@ -13,13 +13,13 @@ import { promises as _promises } from 'fs';
|
|
|
13
13
|
import { join } from 'path';
|
|
14
14
|
import { CMD_EXEC_PATH, NEXT_PROPS_PATH } from '../../constants.js';
|
|
15
15
|
const { readFile } = _promises;
|
|
16
|
-
const createFilenamePageMetadataMap = (
|
|
16
|
+
const createFilenamePageMetadataMap = (_a) => __awaiter(void 0, [_a], void 0, function* ({ contentDirectoryPath, contentFilenames, openApiFiles, asyncApiFiles, pagesAcc = {}, }) {
|
|
17
17
|
const contentPromises = [];
|
|
18
18
|
contentFilenames.forEach((filename) => {
|
|
19
19
|
contentPromises.push((() => __awaiter(void 0, void 0, void 0, function* () {
|
|
20
20
|
const sourcePath = join(contentDirectoryPath, filename);
|
|
21
21
|
const contentStr = (yield readFile(sourcePath)).toString();
|
|
22
|
-
const { slug, pageMetadata } = yield createPage(filename, contentStr, contentDirectoryPath, openApiFiles, true);
|
|
22
|
+
const { slug, pageMetadata } = yield createPage(filename, contentStr, contentDirectoryPath, openApiFiles, asyncApiFiles, true);
|
|
23
23
|
pagesAcc = Object.assign(Object.assign({}, pagesAcc), { [slug]: pageMetadata });
|
|
24
24
|
}))());
|
|
25
25
|
});
|
|
@@ -28,9 +28,15 @@ const createFilenamePageMetadataMap = (contentDirectoryPath_1, contentFilenames_
|
|
|
28
28
|
});
|
|
29
29
|
export const generateNav = (pagesAcc) => __awaiter(void 0, void 0, void 0, function* () {
|
|
30
30
|
var _a;
|
|
31
|
-
const { contentFilenames, openApiFiles } = yield categorizeFilePaths(CMD_EXEC_PATH);
|
|
31
|
+
const { contentFilenames, openApiFiles, asyncApiFiles } = yield categorizeFilePaths(CMD_EXEC_PATH);
|
|
32
32
|
const [filenamePageMetadataMap, configObj, docsConfigObj] = yield Promise.all([
|
|
33
|
-
createFilenamePageMetadataMap(
|
|
33
|
+
createFilenamePageMetadataMap({
|
|
34
|
+
contentDirectoryPath: CMD_EXEC_PATH,
|
|
35
|
+
contentFilenames,
|
|
36
|
+
openApiFiles,
|
|
37
|
+
asyncApiFiles,
|
|
38
|
+
pagesAcc,
|
|
39
|
+
}),
|
|
34
40
|
getConfigObj(NEXT_PROPS_PATH, 'mint'),
|
|
35
41
|
getConfigObj(NEXT_PROPS_PATH, 'docs'),
|
|
36
42
|
]);
|
|
@@ -208,7 +208,7 @@ const onUpdateEvent = (filename, callback) => __awaiter(void 0, void 0, void 0,
|
|
|
208
208
|
if (hasImports(importsResponse)) {
|
|
209
209
|
contentStr = yield resolveAllImports(Object.assign(Object.assign({}, importsResponse), { filename }));
|
|
210
210
|
}
|
|
211
|
-
const { pageContent } = yield createPage(filename, contentStr, CMD_EXEC_PATH, []);
|
|
211
|
+
const { pageContent } = yield createPage(filename, contentStr, CMD_EXEC_PATH, [], []);
|
|
212
212
|
yield fse.outputFile(targetPath, pageContent, {
|
|
213
213
|
flag: 'w',
|
|
214
214
|
});
|