@mintlify/prebuild 1.0.1197 → 1.0.1198
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/index.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
export interface PrebuildResult {
|
|
2
2
|
fileImportsMap: Map<string, Set<string>>;
|
|
3
3
|
}
|
|
4
|
-
export declare const prebuild: (contentDirectoryPath: string, { localSchema, groups, disableOpenApi, strict, allowSourceRefs, lazyPages, }?: {
|
|
4
|
+
export declare const prebuild: (contentDirectoryPath: string, { localSchema, groups, disableOpenApi, disablePrefetch, strict, allowSourceRefs, lazyPages, }?: {
|
|
5
5
|
localSchema?: boolean;
|
|
6
6
|
groups?: string[];
|
|
7
7
|
disableOpenApi?: boolean;
|
|
8
|
+
disablePrefetch?: boolean;
|
|
8
9
|
strict?: boolean;
|
|
9
10
|
allowSourceRefs?: boolean;
|
|
10
11
|
lazyPages?: boolean;
|
package/dist/prebuild/index.js
CHANGED
|
@@ -3,7 +3,7 @@ import { categorizeFilePaths } from './categorizeFilePaths.js';
|
|
|
3
3
|
import { warnInvalidSpecFiles } from './invalidSpecFiles.js';
|
|
4
4
|
import { update } from './update/index.js';
|
|
5
5
|
import { clearWarnings, checkStrictMode } from './warnings.js';
|
|
6
|
-
export const prebuild = async (contentDirectoryPath, { localSchema, groups, disableOpenApi, strict, allowSourceRefs, lazyPages, } = {}) => {
|
|
6
|
+
export const prebuild = async (contentDirectoryPath, { localSchema, groups, disableOpenApi, disablePrefetch, strict, allowSourceRefs, lazyPages, } = {}) => {
|
|
7
7
|
if (process.env.IS_MULTI_TENANT === 'true') {
|
|
8
8
|
console.log('Skipping prebuild in multi-tenant mode.');
|
|
9
9
|
return;
|
|
@@ -30,6 +30,7 @@ export const prebuild = async (contentDirectoryPath, { localSchema, groups, disa
|
|
|
30
30
|
groups,
|
|
31
31
|
mintIgnore,
|
|
32
32
|
disableOpenApi,
|
|
33
|
+
disablePrefetch,
|
|
33
34
|
strict,
|
|
34
35
|
invalidSpecFiles,
|
|
35
36
|
allowSourceRefs,
|
|
@@ -16,6 +16,7 @@ type UpdateArgs = {
|
|
|
16
16
|
groups?: string[];
|
|
17
17
|
mintIgnore?: string[];
|
|
18
18
|
disableOpenApi?: boolean;
|
|
19
|
+
disablePrefetch?: boolean;
|
|
19
20
|
strict?: boolean;
|
|
20
21
|
invalidSpecFiles?: InvalidSpecFile[];
|
|
21
22
|
allowSourceRefs?: boolean;
|
|
@@ -23,7 +24,7 @@ type UpdateArgs = {
|
|
|
23
24
|
pageScans?: Map<string, PageScan>;
|
|
24
25
|
fileImportsMap?: Map<string, Set<string>>;
|
|
25
26
|
};
|
|
26
|
-
export declare const update: ({ contentDirectoryPath, staticFilenames, openApiFiles, asyncApiFiles, contentFilenames, snippets, snippetV2Filenames, docsConfigPath, localSchema, groups, mintIgnore, disableOpenApi, strict, invalidSpecFiles, allowSourceRefs, lazyPages, pageScans, fileImportsMap, }: UpdateArgs) => Promise<{
|
|
27
|
+
export declare const update: ({ contentDirectoryPath, staticFilenames, openApiFiles, asyncApiFiles, contentFilenames, snippets, snippetV2Filenames, docsConfigPath, localSchema, groups, mintIgnore, disableOpenApi, disablePrefetch, strict, invalidSpecFiles, allowSourceRefs, lazyPages, pageScans, fileImportsMap, }: UpdateArgs) => Promise<{
|
|
27
28
|
name: string;
|
|
28
29
|
$schema: string;
|
|
29
30
|
theme: "mint";
|
|
@@ -58,7 +58,7 @@ const filterToImportClosure = (snippetV2Filenames, rootFilenames, fileImportsMap
|
|
|
58
58
|
}
|
|
59
59
|
return snippetV2Filenames.filter((filename) => needed.has(filename.toLowerCase()));
|
|
60
60
|
};
|
|
61
|
-
export const update = async ({ contentDirectoryPath, staticFilenames, openApiFiles, asyncApiFiles, contentFilenames, snippets, snippetV2Filenames, docsConfigPath, localSchema, groups, mintIgnore, disableOpenApi, strict, invalidSpecFiles, allowSourceRefs, lazyPages, pageScans, fileImportsMap, }) => {
|
|
61
|
+
export const update = async ({ contentDirectoryPath, staticFilenames, openApiFiles, asyncApiFiles, contentFilenames, snippets, snippetV2Filenames, docsConfigPath, localSchema, groups, mintIgnore, disableOpenApi, disablePrefetch, strict, invalidSpecFiles, allowSourceRefs, lazyPages, pageScans, fileImportsMap, }) => {
|
|
62
62
|
const mintConfigResult = await updateMintConfigFile(contentDirectoryPath, openApiFiles, localSchema, strict, invalidSpecFiles);
|
|
63
63
|
// we used the original mint config without openapi pages injected
|
|
64
64
|
// because we will do it in `updateDocsConfigFile`, this will avoid duplicated openapi pages
|
|
@@ -150,6 +150,11 @@ export const update = async ({ contentDirectoryPath, staticFilenames, openApiFil
|
|
|
150
150
|
const writeDevGroupsPromise = groups && groups.length > 0
|
|
151
151
|
? outputFile('src/_props/dev-groups.json', JSON.stringify({ groups }, null, 2), { flag: 'w' })
|
|
152
152
|
: Promise.resolve();
|
|
153
|
+
const writeDevFlagsPromise = disablePrefetch
|
|
154
|
+
? outputFile('src/_props/dev-flags.json', JSON.stringify({ disablePrefetch }, null, 2), {
|
|
155
|
+
flag: 'w',
|
|
156
|
+
})
|
|
157
|
+
: Promise.resolve();
|
|
153
158
|
const writeMintIgnorePromise = mintIgnore && mintIgnore.length > 0
|
|
154
159
|
? outputFile('src/_props/mint-ignore.json', JSON.stringify(mintIgnore, null, 2), {
|
|
155
160
|
flag: 'w',
|
|
@@ -157,6 +162,7 @@ export const update = async ({ contentDirectoryPath, staticFilenames, openApiFil
|
|
|
157
162
|
: Promise.resolve();
|
|
158
163
|
await Promise.all([
|
|
159
164
|
writeDevGroupsPromise,
|
|
165
|
+
writeDevFlagsPromise,
|
|
160
166
|
writeMintIgnorePromise,
|
|
161
167
|
resolveImportsAndWriteFiles({
|
|
162
168
|
openApiFiles: newOpenApiFiles,
|