@mintlify/prebuild 1.0.1293 → 1.0.1294

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.
Files changed (100) hide show
  1. package/dist/createPage/index.d.ts +0 -0
  2. package/dist/createPage/index.js +0 -0
  3. package/dist/createPage/preparseMdx/index.d.ts +0 -0
  4. package/dist/createPage/preparseMdx/index.js +0 -0
  5. package/dist/errorMessages/formatError.d.ts +0 -0
  6. package/dist/errorMessages/formatError.js +0 -0
  7. package/dist/errorMessages/getLocationErrString.d.ts +0 -0
  8. package/dist/errorMessages/getLocationErrString.js +0 -0
  9. package/dist/fs/index.d.ts +2 -2
  10. package/dist/fs/index.js +30 -12
  11. package/dist/generate.d.ts +0 -0
  12. package/dist/generate.js +0 -0
  13. package/dist/index.d.ts +0 -0
  14. package/dist/index.js +0 -0
  15. package/dist/prebuild/__tests__/resolveRefs.test.d.ts +0 -0
  16. package/dist/prebuild/__tests__/resolveRefs.test.js +0 -0
  17. package/dist/prebuild/categorizeFilePaths.d.ts +0 -0
  18. package/dist/prebuild/categorizeFilePaths.js +0 -0
  19. package/dist/prebuild/discoverOverlayFiles.d.ts +0 -0
  20. package/dist/prebuild/discoverOverlayFiles.js +0 -0
  21. package/dist/prebuild/generateFavicons.d.ts +0 -0
  22. package/dist/prebuild/generateFavicons.js +0 -0
  23. package/dist/prebuild/getOpenApiFiles.d.ts +0 -0
  24. package/dist/prebuild/getOpenApiFiles.js +0 -0
  25. package/dist/prebuild/index.d.ts +0 -0
  26. package/dist/prebuild/index.js +0 -0
  27. package/dist/prebuild/invalidSpecFiles.d.ts +0 -0
  28. package/dist/prebuild/invalidSpecFiles.js +0 -0
  29. package/dist/prebuild/resolveRefs.d.ts +0 -0
  30. package/dist/prebuild/resolveRefs.js +0 -0
  31. package/dist/prebuild/update/ConfigUpdater.d.ts +0 -0
  32. package/dist/prebuild/update/ConfigUpdater.js +0 -0
  33. package/dist/prebuild/update/docsConfig/generateAsyncApiDivisions.d.ts +0 -0
  34. package/dist/prebuild/update/docsConfig/generateAsyncApiDivisions.js +0 -0
  35. package/dist/prebuild/update/docsConfig/generateAsyncApiFromDocsConfig.d.ts +0 -0
  36. package/dist/prebuild/update/docsConfig/generateAsyncApiFromDocsConfig.js +0 -0
  37. package/dist/prebuild/update/docsConfig/generateGraphqlDivisions.d.ts +0 -0
  38. package/dist/prebuild/update/docsConfig/generateGraphqlDivisions.js +0 -0
  39. package/dist/prebuild/update/docsConfig/generateOpenApiDivisions.d.ts +0 -0
  40. package/dist/prebuild/update/docsConfig/generateOpenApiDivisions.js +0 -0
  41. package/dist/prebuild/update/docsConfig/generateOpenApiFromDocsConfig.d.ts +0 -0
  42. package/dist/prebuild/update/docsConfig/generateOpenApiFromDocsConfig.js +0 -0
  43. package/dist/prebuild/update/docsConfig/generateSdkDivisions.d.ts +0 -0
  44. package/dist/prebuild/update/docsConfig/generateSdkDivisions.js +0 -0
  45. package/dist/prebuild/update/docsConfig/generatedRouteCollisions.d.ts +0 -0
  46. package/dist/prebuild/update/docsConfig/generatedRouteCollisions.js +0 -0
  47. package/dist/prebuild/update/docsConfig/getCustomLanguages.d.ts +0 -0
  48. package/dist/prebuild/update/docsConfig/getCustomLanguages.js +0 -0
  49. package/dist/prebuild/update/docsConfig/index.d.ts +0 -0
  50. package/dist/prebuild/update/docsConfig/index.js +0 -0
  51. package/dist/prebuild/update/docsConfig/loadRemoteGraphqlSdl.d.ts +0 -0
  52. package/dist/prebuild/update/docsConfig/loadRemoteGraphqlSdl.js +0 -0
  53. package/dist/prebuild/update/git/getGitBlame.d.ts +0 -0
  54. package/dist/prebuild/update/git/getGitBlame.js +0 -0
  55. package/dist/prebuild/update/index.d.ts +0 -0
  56. package/dist/prebuild/update/index.js +0 -0
  57. package/dist/prebuild/update/mintConfig/generateOpenApiAnchorsOrTabs.d.ts +0 -0
  58. package/dist/prebuild/update/mintConfig/generateOpenApiAnchorsOrTabs.js +0 -0
  59. package/dist/prebuild/update/mintConfig/index.d.ts +0 -0
  60. package/dist/prebuild/update/mintConfig/index.js +0 -0
  61. package/dist/prebuild/update/preserveAutoGeneratedMetadata.d.ts +0 -0
  62. package/dist/prebuild/update/preserveAutoGeneratedMetadata.js +0 -0
  63. package/dist/prebuild/update/read/getAsyncApiFilesFromConfig.d.ts +0 -0
  64. package/dist/prebuild/update/read/getAsyncApiFilesFromConfig.js +0 -0
  65. package/dist/prebuild/update/read/getOpenApiFilesFromConfig.d.ts +0 -0
  66. package/dist/prebuild/update/read/getOpenApiFilesFromConfig.js +0 -0
  67. package/dist/prebuild/update/read/read-page-metadata.d.ts +0 -0
  68. package/dist/prebuild/update/read/read-page-metadata.js +0 -0
  69. package/dist/prebuild/update/read/readContent.d.ts +0 -0
  70. package/dist/prebuild/update/read/readContent.js +0 -0
  71. package/dist/prebuild/update/resolveImportsAndWriteFiles.d.ts +0 -0
  72. package/dist/prebuild/update/resolveImportsAndWriteFiles.js +0 -0
  73. package/dist/prebuild/update/rss/docsConfigToRss.d.ts +0 -0
  74. package/dist/prebuild/update/rss/docsConfigToRss.js +0 -0
  75. package/dist/prebuild/update/rss/index.d.ts +0 -0
  76. package/dist/prebuild/update/rss/index.js +0 -0
  77. package/dist/prebuild/update/rss/mdxToRssUpdates.d.ts +0 -0
  78. package/dist/prebuild/update/rss/mdxToRssUpdates.js +0 -0
  79. package/dist/prebuild/update/rss/pageToRss.d.ts +0 -0
  80. package/dist/prebuild/update/rss/pageToRss.js +0 -0
  81. package/dist/prebuild/update/rss/pathToRss.d.ts +0 -0
  82. package/dist/prebuild/update/rss/pathToRss.js +0 -0
  83. package/dist/prebuild/update/updateFavicons.d.ts +0 -0
  84. package/dist/prebuild/update/updateFavicons.js +0 -0
  85. package/dist/prebuild/update/updateGeneratedNav.d.ts +0 -0
  86. package/dist/prebuild/update/updateGeneratedNav.js +0 -0
  87. package/dist/prebuild/update/write/writeAsyncApiFiles.d.ts +0 -0
  88. package/dist/prebuild/update/write/writeAsyncApiFiles.js +0 -0
  89. package/dist/prebuild/update/write/writeFiles.d.ts +0 -0
  90. package/dist/prebuild/update/write/writeFiles.js +0 -0
  91. package/dist/prebuild/update/write/writeOpenApiData.d.ts +0 -0
  92. package/dist/prebuild/update/write/writeOpenApiData.js +0 -0
  93. package/dist/prebuild/update/write/writeRssFiles.d.ts +0 -0
  94. package/dist/prebuild/update/write/writeRssFiles.js +0 -0
  95. package/dist/prebuild/warnings.d.ts +0 -0
  96. package/dist/prebuild/warnings.js +0 -0
  97. package/dist/tsconfig.build.tsbuildinfo +1 -1
  98. package/dist/utils.d.ts +0 -0
  99. package/dist/utils.js +0 -0
  100. package/package.json +4 -4
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -1,3 +1,3 @@
1
- export declare const getFileListSync: (dirName: string, og?: string, ancestors?: Set<string>, root?: string) => string[];
2
- export declare const getFileListWithDirectories: (dirName: string, og?: string) => string[];
1
+ export declare const getFileListSync: (dirName: string, og?: string, mintIgnore?: string[]) => string[];
2
+ export declare const getFileListWithDirectories: (dirName: string, og?: string, mintIgnore?: string[]) => string[];
3
3
  export declare function getFileList(dirName: string, og?: string, mintIgnore?: string[]): AsyncIterable<string>;
package/dist/fs/index.js CHANGED
@@ -1,8 +1,11 @@
1
- import { isMintIgnored, toPosixPath } from '@mintlify/common';
1
+ import { createMintIgnoreMatcher, isMintIgnoredBy, toPosixPath, } from '@mintlify/common';
2
2
  import { readdirSync, realpathSync, statSync } from 'fs';
3
3
  import { readdir } from 'fs/promises';
4
4
  import path from 'path';
5
- export const getFileListSync = (dirName, og = dirName, ancestors = new Set(), root) => {
5
+ export const getFileListSync = (dirName, og = dirName, mintIgnore = []) => {
6
+ return collectFileListSync(dirName, og, createMintIgnoreMatcher(mintIgnore));
7
+ };
8
+ const collectFileListSync = (dirName, og, matcher, ancestors = new Set(), root) => {
6
9
  const files = [];
7
10
  let realDir;
8
11
  try {
@@ -41,47 +44,62 @@ export const getFileListSync = (dirName, og = dirName, ancestors = new Set(), ro
41
44
  continue;
42
45
  }
43
46
  }
47
+ const relativePath = toPosixPath(path.relative(og, fullPath));
48
+ if (isMintIgnoredBy(relativePath, matcher, isDirectory)) {
49
+ continue;
50
+ }
44
51
  if (isDirectory) {
45
- for (const file of getFileListSync(fullPath, og, ancestors, realRoot)) {
52
+ const nested = collectFileListSync(fullPath, og, matcher, ancestors, realRoot);
53
+ for (const file of nested) {
46
54
  files.push(file);
47
55
  }
48
56
  }
49
57
  else {
50
- files.push(toPosixPath(path.relative(og, fullPath)));
58
+ files.push(relativePath);
51
59
  }
52
60
  }
53
61
  ancestors.delete(realDir);
54
62
  return files;
55
63
  };
56
64
  // TODO consolidate this function
57
- export const getFileListWithDirectories = (dirName, og = dirName) => {
65
+ export const getFileListWithDirectories = (dirName, og = dirName, mintIgnore = []) => {
66
+ return collectFileListWithDirectories(dirName, og, createMintIgnoreMatcher(mintIgnore));
67
+ };
68
+ const collectFileListWithDirectories = (dirName, og, matcher) => {
58
69
  const files = [];
59
70
  const items = readdirSync(dirName, { withFileTypes: true });
60
71
  for (const item of items) {
61
72
  const fullPath = path.join(dirName, item.name);
73
+ const relativePath = toPosixPath(path.relative(og, fullPath));
74
+ if (isMintIgnoredBy(relativePath, matcher, item.isDirectory())) {
75
+ continue;
76
+ }
62
77
  if (item.isDirectory()) {
63
- const relativeDir = toPosixPath(path.relative(og, fullPath));
64
- if (relativeDir !== '.git') {
65
- files.push(relativeDir);
66
- files.push(...getFileListWithDirectories(fullPath, og));
78
+ files.push(relativePath);
79
+ const nested = collectFileListWithDirectories(fullPath, og, matcher);
80
+ for (const file of nested) {
81
+ files.push(file);
67
82
  }
68
83
  }
69
84
  else {
70
- files.push(toPosixPath(path.relative(og, fullPath)));
85
+ files.push(relativePath);
71
86
  }
72
87
  }
73
88
  return files;
74
89
  };
75
90
  export async function* getFileList(dirName, og = dirName, mintIgnore = []) {
91
+ yield* walkFileList(dirName, og, createMintIgnoreMatcher(mintIgnore));
92
+ }
93
+ async function* walkFileList(dirName, og, matcher) {
76
94
  const items = await readdir(dirName, { withFileTypes: true });
77
95
  for (const item of items) {
78
96
  const fullPath = path.join(dirName, item.name);
79
97
  const relativePath = toPosixPath(path.relative(og, fullPath));
80
- if (isMintIgnored(relativePath, mintIgnore)) {
98
+ if (isMintIgnoredBy(relativePath, matcher, item.isDirectory())) {
81
99
  continue;
82
100
  }
83
101
  if (item.isDirectory()) {
84
- yield* getFileList(fullPath, og, mintIgnore);
102
+ yield* walkFileList(fullPath, og, matcher);
85
103
  }
86
104
  else {
87
105
  yield `/${relativePath}`;
File without changes
package/dist/generate.js CHANGED
File without changes
package/dist/index.d.ts CHANGED
File without changes
package/dist/index.js CHANGED
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes