@mintlify/previewing 4.0.582 → 4.0.584

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.
@@ -1,4 +1,4 @@
1
- import { findAndRemoveImports, optionallyRemoveLeadingSlash, resolveAllImports, stringifyTree, } from '@mintlify/common';
1
+ import { findAndRemoveImports, optionallyRemoveLeadingSlash, resolveAllImports, stringifyTree, SNIPPET_EXTENSIONS, } from '@mintlify/common';
2
2
  import { preparseMdxTree, getFileListSync } from '@mintlify/prebuild';
3
3
  import { promises as _promises } from 'fs';
4
4
  import { outputFile } from 'fs-extra';
@@ -8,7 +8,9 @@ import { getProcessedSnippets } from './getSnippets.js';
8
8
  const { readFile } = _promises;
9
9
  export const generatePagesWithImports = async (updatedSnippets) => {
10
10
  const snippets = await getProcessedSnippets();
11
- const pageFilenames = getFileListSync(CMD_EXEC_PATH).filter((file) => file.endsWith('.mdx') && !file.startsWith('_snippets/') && !file.startsWith('snippets/'));
11
+ const pageFilenames = getFileListSync(CMD_EXEC_PATH).filter((file) => SNIPPET_EXTENSIONS.some((ext) => file.endsWith(ext)) &&
12
+ !file.startsWith('_snippets/') &&
13
+ !file.startsWith('snippets/'));
12
14
  await Promise.all(pageFilenames.map(async (pageFilename) => {
13
15
  const sourcePath = join(CMD_EXEC_PATH, pageFilename);
14
16
  const contentStr = (await readFile(sourcePath)).toString();
@@ -1,11 +1,11 @@
1
- import { optionallyAddLeadingSlash } from '@mintlify/common';
1
+ import { optionallyAddLeadingSlash, SNIPPET_EXTENSIONS } from '@mintlify/common';
2
2
  import { getFileListSync, preparseMdxTree } from '@mintlify/prebuild';
3
3
  import { promises as _promises } from 'fs';
4
4
  import { join } from 'path';
5
5
  import { CMD_EXEC_PATH, NEXT_PUBLIC_PATH } from '../../constants.js';
6
6
  const { readFile } = _promises;
7
7
  const getSnippetBase = async (BASE_DIR) => {
8
- const snippetFilenames = getFileListSync(BASE_DIR).filter((file) => file.endsWith('.mdx') && file.startsWith('snippets/'));
8
+ const snippetFilenames = getFileListSync(BASE_DIR).filter((file) => SNIPPET_EXTENSIONS.some((ext) => file.endsWith(ext)) && file.startsWith('snippets/'));
9
9
  const promises = snippetFilenames.map(async (snippetFilename) => {
10
10
  try {
11
11
  const tree = await preparseMdxTree((await readFile(join(BASE_DIR, snippetFilename))).toString(), BASE_DIR, join(BASE_DIR, snippetFilename));