@mintlify/prebuild 1.0.359 → 1.0.361
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/update/ConfigUpdater.d.ts +350 -0
- package/dist/prebuild/update/index.d.ts +350 -0
- package/dist/prebuild/update/index.js +3 -1
- package/dist/prebuild/update/mintConfig/index.d.ts +1 -0
- package/dist/prebuild/update/mintConfig/index.js +6 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +5 -5
|
@@ -10,7 +10,9 @@ import { writeFiles } from './write/writeFiles.js';
|
|
|
10
10
|
import { writeOpenApiFiles } from './write/writeOpenApiFiles.js';
|
|
11
11
|
export const update = async (contentDirectoryPath, staticFilenames, openApiFiles, contentFilenames, snippets, snippetV2Filenames, docsConfigPath) => {
|
|
12
12
|
const mintConfigResult = await updateMintConfigFile(contentDirectoryPath, openApiFiles);
|
|
13
|
-
|
|
13
|
+
// we used the original mint config without openapi pages injected
|
|
14
|
+
// because we will do it in `updateDocsConfigFile`, this will avoid duplicated openapi pages
|
|
15
|
+
const docsConfig = mintConfigResult != null ? upgradeToDocsConfig(mintConfigResult.originalMintConfig) : undefined;
|
|
14
16
|
const { docsConfig: newDocsConfig, pagesAcc, newOpenApiFiles, } = await updateDocsConfigFile(contentDirectoryPath, openApiFiles, docsConfigPath ? undefined : docsConfig);
|
|
15
17
|
const pagePromises = readPageContents(contentDirectoryPath, newOpenApiFiles, contentFilenames, pagesAcc);
|
|
16
18
|
const snippetV2Promises = readSnippetsV2Contents(contentDirectoryPath, snippetV2Filenames);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { DecoratedNavigationPage, MintConfig, OpenApiFile } from '@mintlify/models';
|
|
2
2
|
export declare function updateMintConfigFile(contentDirectoryPath: string, openApiFiles: OpenApiFile[]): Promise<{
|
|
3
3
|
mintConfig: MintConfig;
|
|
4
|
+
originalMintConfig: MintConfig;
|
|
4
5
|
pagesAcc: Record<string, DecoratedNavigationPage>;
|
|
5
6
|
openApiFiles: OpenApiFile[];
|
|
6
7
|
} | null>;
|
|
@@ -9,6 +9,11 @@ export async function updateMintConfigFile(contentDirectoryPath, openApiFiles) {
|
|
|
9
9
|
const mintConfig = await MintConfigUpdater.getConfig(configPath);
|
|
10
10
|
const { mintConfig: newMintConfig, pagesAcc, openApiFiles: newOpenApiFiles, } = await generateOpenApiAnchorsOrTabs(mintConfig, openApiFiles);
|
|
11
11
|
await MintConfigUpdater.writeConfigFile(newMintConfig);
|
|
12
|
-
return {
|
|
12
|
+
return {
|
|
13
|
+
mintConfig: newMintConfig,
|
|
14
|
+
pagesAcc,
|
|
15
|
+
openApiFiles: newOpenApiFiles,
|
|
16
|
+
originalMintConfig: mintConfig,
|
|
17
|
+
};
|
|
13
18
|
}
|
|
14
19
|
export { generateOpenApiAnchorsOrTabs, generateOpenApiAnchorOrTab, } from './generateOpenApiAnchorsOrTabs.js';
|