@mintlify/prebuild 1.0.891 → 1.0.893

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.
@@ -33,7 +33,7 @@ export const update = async ({ contentDirectoryPath, staticFilenames, openApiFil
33
33
  contentFilenames,
34
34
  pagesAcc,
35
35
  });
36
- const snippetV2Promises = readSnippetsV2Contents(contentDirectoryPath, snippetV2Filenames);
36
+ const snippetV2Promises = readSnippetsV2Contents(contentDirectoryPath, snippetV2Filenames, newDocsConfig.variables ?? undefined);
37
37
  const [snippetV2Contents, { mdxFilesWithNoImports, filesWithImports }] = await Promise.all([
38
38
  snippetV2Promises,
39
39
  pagePromises,
@@ -23,7 +23,7 @@ export declare const readPageContents: ({ contentDirectoryPath, openApiFiles, as
23
23
  pagesAcc: Record<string, DecoratedNavigationPage>;
24
24
  filesWithImports: FileWithImportsAndMetadata[];
25
25
  }>;
26
- export declare const readSnippetsV2Contents: (contentDirectoryPath: string, snippetV2Filenames: string[]) => Promise<{
26
+ export declare const readSnippetsV2Contents: (contentDirectoryPath: string, snippetV2Filenames: string[], variables?: Record<string, string>) => Promise<{
27
27
  filename: string;
28
28
  tree: Root;
29
29
  }[]>;
@@ -1,4 +1,4 @@
1
- import { hasImports, findAndRemoveImports, getDecoratedNavPageAndSlug, parseFrontmatter, } from '@mintlify/common';
1
+ import { hasImports, findAndRemoveImports, getDecoratedNavPageAndSlug, parseFrontmatter, replaceVariables, } from '@mintlify/common';
2
2
  import { promises as _promises } from 'fs';
3
3
  import { join } from 'path';
4
4
  import { preparseMdxTree } from '../../../createPage/preparseMdx/index.js';
@@ -39,10 +39,10 @@ export const readPageContents = async ({ contentDirectoryPath, openApiFiles, asy
39
39
  const mdxFilesWithNoImports = (await Promise.all(pagePromises)).filter((item) => item !== undefined);
40
40
  return { mdxFilesWithNoImports, pagesAcc, filesWithImports };
41
41
  };
42
- export const readSnippetsV2Contents = (contentDirectoryPath, snippetV2Filenames) => {
42
+ export const readSnippetsV2Contents = (contentDirectoryPath, snippetV2Filenames, variables) => {
43
43
  const snippetV2Promises = snippetV2Filenames.map(async (filename) => {
44
44
  const sourcePath = join(contentDirectoryPath, filename);
45
- const contentStr = await readFile(sourcePath, 'utf8');
45
+ const contentStr = replaceVariables(await readFile(sourcePath, 'utf8'), variables);
46
46
  const tree = await preparseMdxTree(contentStr, contentDirectoryPath, sourcePath);
47
47
  return { filename, tree };
48
48
  });