@mintlify/prebuild 1.0.333 → 1.0.335
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/prebuild/generateFavicons.d.ts +3 -4
- package/dist/prebuild/generateFavicons.js +33 -9
- package/dist/prebuild/update/ConfigUpdater.d.ts +150 -90
- package/dist/prebuild/update/index.d.ts +1726 -1
- package/dist/prebuild/update/index.js +2 -2
- package/dist/prebuild/update/updateFavicons.d.ts +3 -4
- package/dist/prebuild/update/updateFavicons.js +18 -14
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +6 -6
|
@@ -21,13 +21,13 @@ export const update = async (contentDirectoryPath, staticFilenames, openApiFiles
|
|
|
21
21
|
await Promise.all([
|
|
22
22
|
resolveImportsAndWriteFiles(openApiFiles, pagesAcc, snippetV2Contents, filesWithImports),
|
|
23
23
|
writeOpenApiFiles(newOpenApiFiles),
|
|
24
|
-
updateFavicons(
|
|
24
|
+
updateFavicons(docsConfig, contentDirectoryPath),
|
|
25
25
|
...writeMdxFilesWithNoImports(mdxFilesWithNoImports),
|
|
26
26
|
...writeFiles(contentDirectoryPath, 'public', [...staticFilenames, ...snippets]),
|
|
27
27
|
]);
|
|
28
28
|
await updateGeneratedDocsNav(pagesAcc, newDocsConfig.navigation);
|
|
29
29
|
await updateGeneratedNav(pagesAcc, mintConfig.navigation);
|
|
30
|
-
return
|
|
30
|
+
return docsConfig;
|
|
31
31
|
};
|
|
32
32
|
export const writeMdxFilesWithNoImports = (mdxFilesWithNoImports) => {
|
|
33
33
|
return mdxFilesWithNoImports.map(async (response) => {
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
}, contentDirectoryPath: string) => Promise<void>;
|
|
1
|
+
import type { MintConfig } from '@mintlify/models';
|
|
2
|
+
import { DocsConfig } from '@mintlify/validation';
|
|
3
|
+
export declare const updateFavicons: (config: MintConfig | DocsConfig, contentDirectoryPath: string) => Promise<void>;
|
|
@@ -1,24 +1,28 @@
|
|
|
1
1
|
import { outputFile } from 'fs-extra';
|
|
2
2
|
import path from 'path';
|
|
3
3
|
import { generateFavicons } from '../generateFavicons.js';
|
|
4
|
-
export const updateFavicons = async (
|
|
5
|
-
const generatedFavicons = await generateFavicons(
|
|
4
|
+
export const updateFavicons = async (config, contentDirectoryPath) => {
|
|
5
|
+
const generatedFavicons = await generateFavicons(config, contentDirectoryPath);
|
|
6
6
|
if (!generatedFavicons)
|
|
7
7
|
return;
|
|
8
8
|
const promises = [];
|
|
9
|
-
generatedFavicons.
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
9
|
+
generatedFavicons.forEach((icons) => {
|
|
10
|
+
icons.images.forEach((img) => {
|
|
11
|
+
promises.push((async () => {
|
|
12
|
+
const targetPath = path.join('public', 'favicons', img.name);
|
|
13
|
+
await outputFile(targetPath, Buffer.from(img.contents), {
|
|
14
|
+
flag: 'w',
|
|
15
|
+
});
|
|
16
|
+
})());
|
|
17
|
+
});
|
|
16
18
|
});
|
|
17
|
-
generatedFavicons.
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
generatedFavicons.forEach((icon) => {
|
|
20
|
+
icon.files.forEach((file) => {
|
|
21
|
+
promises.push((async () => {
|
|
22
|
+
const targetPath = path.join('public', 'favicons', file.name);
|
|
23
|
+
await outputFile(targetPath, file.contents, { flag: 'w' });
|
|
24
|
+
})());
|
|
25
|
+
});
|
|
22
26
|
});
|
|
23
27
|
await Promise.all(promises);
|
|
24
28
|
};
|