@mintlify/link-rot 3.0.1341 → 3.0.1343

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/graph.js CHANGED
@@ -311,7 +311,7 @@ export class Graph {
311
311
  addAliasNodes() {
312
312
  // TODO move aliases computation to mint config package, since it'll depend on version
313
313
  // for now this is a hacky implementation
314
- const allAliases = MdxPath.filterMapInternalPaths(getFileListWithDirectories(this.baseDir));
314
+ const allAliases = MdxPath.filterMapInternalPaths(getFileListWithDirectories(this.baseDir, this.baseDir, this.mintIgnoreGlobs));
315
315
  const aliases = allAliases.filter((alias) => !isMintIgnored(alias, this.mintIgnoreGlobs));
316
316
  this.addNodes(aliases);
317
317
  }
@@ -333,7 +333,7 @@ export class Graph {
333
333
  return newEdge;
334
334
  }
335
335
  addEdgesBetweenNodes() {
336
- const allFiles = getLinkPaths(this.baseDir);
336
+ const allFiles = getLinkPaths(this.baseDir, this.mintIgnoreGlobs);
337
337
  for (const node of Object.values(this.nodes)) {
338
338
  for (const path of node.paths) {
339
339
  if (path.pathType === PathType.INTERNAL) {
@@ -347,7 +347,7 @@ export class Graph {
347
347
  }
348
348
  }
349
349
  precomputeFileResolutions() {
350
- const allFiles = getLinkPaths(this.baseDir);
350
+ const allFiles = getLinkPaths(this.baseDir, this.mintIgnoreGlobs);
351
351
  // Build resolution map for all internal paths
352
352
  Object.values(this.nodes).forEach((node) => {
353
353
  node.paths
@@ -11,8 +11,8 @@ export declare const getFullPath: (filePath: ParsedPath) => string;
11
11
  export declare const removeFileExtension: (filePath: ParsedPath) => string;
12
12
  export declare const addLeadingSlash: (filePathString: string) => string;
13
13
  export declare const removeSelectors: (filePathString: string) => string;
14
- export declare const getPagePaths: (dirName: string) => string[];
15
- export declare const getMediaPaths: (dirName: string) => string[];
16
- export declare const getLinkPaths: (dirName: string) => string[];
14
+ export declare const getPagePaths: (dirName: string, mintIgnore?: string[]) => string[];
15
+ export declare const getMediaPaths: (dirName: string, mintIgnore?: string[]) => string[];
16
+ export declare const getLinkPaths: (dirName: string, mintIgnore?: string[]) => string[];
17
17
  export declare const normalizePath: (path: string) => string;
18
18
  export declare const removeLeadingSlash: (filePathString: string) => string;
package/dist/prebuild.js CHANGED
@@ -35,9 +35,9 @@ export const getFullPath = (filePath) => join(filePath.dir, filePath.base);
35
35
  export const removeFileExtension = (filePath) => join(filePath.dir, filePath.name);
36
36
  export const addLeadingSlash = (filePathString) => filePathString.startsWith('/') ? filePathString : '/' + filePathString;
37
37
  export const removeSelectors = (filePathString) => filePathString.split('#')[0].split('?')[0];
38
- export const getPagePaths = (dirName) => filterPages(getFileListSync(dirName)).map(getFullPath);
39
- export const getMediaPaths = (dirName) => filterMedia(getFileListSync(dirName)).map(getFullPath);
40
- export const getLinkPaths = (dirName) => filterLinks(getFileListSync(dirName)).map(getFullPath);
38
+ export const getPagePaths = (dirName, mintIgnore = []) => filterPages(getFileListSync(dirName, dirName, mintIgnore)).map(getFullPath);
39
+ export const getMediaPaths = (dirName, mintIgnore = []) => filterMedia(getFileListSync(dirName, dirName, mintIgnore)).map(getFullPath);
40
+ export const getLinkPaths = (dirName, mintIgnore = []) => filterLinks(getFileListSync(dirName, dirName, mintIgnore)).map(getFullPath);
41
41
  export const normalizePath = (path) => normalize(removeLeadingSlash(path));
42
42
  export const removeLeadingSlash = (filePathString) => {
43
43
  const hasLeadingSlash = filePathString.startsWith('/');
@@ -109,7 +109,7 @@ export const buildGraph = (repoPath, options) => __awaiter(void 0, void 0, void
109
109
  const baseDir = repoPath ? repoPath : process.cwd();
110
110
  const mintIgnoreGlobs = yield getMintIgnore(baseDir);
111
111
  const graph = new Graph(baseDir, mintIgnoreGlobs);
112
- const allFilenames = getLinkPaths(baseDir);
112
+ const allFilenames = getLinkPaths(baseDir, mintIgnoreGlobs);
113
113
  const filenames = allFilenames.filter((file) => !isMintIgnored(file, mintIgnoreGlobs));
114
114
  graph.addNodes(filenames);
115
115
  const redirectMappings = yield getRedirects(baseDir);
@@ -132,7 +132,7 @@ export const buildGraph = (repoPath, options) => __awaiter(void 0, void 0, void
132
132
  configNode.addPath(normalized);
133
133
  }
134
134
  }
135
- const allSitePages = getPagePaths(baseDir);
135
+ const allSitePages = getPagePaths(baseDir, mintIgnoreGlobs);
136
136
  const sitePages = allSitePages.filter((file) => !isMintIgnored(file, mintIgnoreGlobs));
137
137
  const BUILD_GRAPH_CONCURRENCY = 8;
138
138
  let cursor = 0;