@mintlify/previewing 4.0.970 → 4.0.972

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 { optionallyAddLeadingSlash, replaceVariables, isSnippetExtension, isImportedAsSnippet, } from '@mintlify/common';
1
+ import { optionallyAddLeadingSlash, replaceVariables, isSnippetExtension, isImportedAsSnippet, isJsxOrTsx, } from '@mintlify/common';
2
2
  import { getFileListSync, preparseMdxTree, getFileExtension } from '@mintlify/prebuild';
3
3
  import { promises as _promises } from 'fs';
4
4
  import { join } from 'path';
@@ -16,7 +16,7 @@ const getSnippetBase = async (baseDir) => {
16
16
  if (file.startsWith('snippets/') || file.startsWith('_snippets/')) {
17
17
  return true;
18
18
  }
19
- if (getFileExtension(file) === 'jsx') {
19
+ if (isJsxOrTsx(file)) {
20
20
  return true;
21
21
  }
22
22
  return isImportedAsSnippet(file, importedFiles);
@@ -1,4 +1,4 @@
1
- import { findAndRemoveImports, replaceVariables, stringifyTree, topologicalSort, hasImports, optionallyAddLeadingSlash, optionallyRemoveLeadingSlash, resolveImportPath, resolveAllImports as baseResolveAllImports, isSnippetExtension, isImportedAsSnippet, } from '@mintlify/common';
1
+ import { findAndRemoveImports, replaceVariables, stringifyTree, topologicalSort, hasImports, optionallyAddLeadingSlash, optionallyRemoveLeadingSlash, resolveImportPath, resolveAllImports as baseResolveAllImports, isSnippetExtension, isImportedAsSnippet, isJsxOrTsx, } from '@mintlify/common';
2
2
  import { preparseMdxTree, getFileListSync, getFileExtension } from '@mintlify/prebuild';
3
3
  import { outputFile } from 'fs-extra';
4
4
  import { readFile } from 'fs/promises';
@@ -13,7 +13,7 @@ const getV2SnippetFilenames = () => {
13
13
  return false;
14
14
  if (file.startsWith('snippets/'))
15
15
  return true;
16
- if (getFileExtension(file) === 'jsx')
16
+ if (isJsxOrTsx(file))
17
17
  return true;
18
18
  return isImportedAsSnippet(file, importedFiles);
19
19
  });