Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.
Mirrored from https://github.com/Camo67/composio.git
Synced Nov 22, 08:15 UTC
fix: link checker was silently broken due to missing route group prefix
The populate keys in validate-links.ts were missing the (home) route group prefix, so next-validate-link could never match them against the actual file paths from app/(home)/. This meant zero URLs were registered and all internal links passed validation silently. Also adds toolkit FAQ markdown files to the link checker scope since they are loaded outside of Fumadocs sources. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sushmithamallesh committed
Feb 17, 2026 at 19:32 UTC
e9ac4a5ea9c6b84c8c45ac78123b0d9da53663da
1 file changed
+26
-5
docs/scripts/validate-links.ts
+26
-5
@@ -1,3 +1,5 @@
1
+import { readdir, readFile } from 'node:fs/promises';
2
+import { join } from 'node:path';
3
import {
4
type FileObject,
5
printErrors,
@@ -22,20 +24,20 @@ async function checkLinks() {
24
const scanned = await scanURLs({
25
preset: 'next',
26
populate: {
25
- // Dynamic routes
26
- 'docs/[[...slug]]': source.getPages().map((page) => ({
27
+ // Dynamic routes (keys must include (home) route group to match app directory structure)
28
+ '(home)/docs/[[...slug]]': source.getPages().map((page) => ({
29
value: { slug: page.slugs },
30
hashes: getHeadings(page),
31
})),
30
- 'reference/[[...slug]]': referenceSource.getPages().map((page) => ({
32
+ '(home)/reference/[[...slug]]': referenceSource.getPages().map((page) => ({
33
value: { slug: page.slugs },
34
hashes: getHeadings(page),
35
})),
34
- 'cookbooks/[[...slug]]': cookbooksSource.getPages().map((page) => ({
36
+ '(home)/cookbooks/[[...slug]]': cookbooksSource.getPages().map((page) => ({
37
value: { slug: page.slugs },
38
hashes: getHeadings(page),
39
})),
38
- 'toolkits/[[...slug]]': toolkitsSource.getPages().map((page) => ({
40
+ '(home)/toolkits/[[...slug]]': toolkitsSource.getPages().map((page) => ({
41
value: { slug: page.slugs },
42
hashes: getHeadings(page),
43
})),
@@ -94,6 +96,25 @@ async function getFiles(): Promise<FileObject[]> {
96
}
97
}
98
99
+ // Toolkit FAQ files (embedded snippets not in any Fumadocs source)
100
+ const faqDir = join(process.cwd(), 'content/toolkit-faq');
101
+ try {
102
+ const faqFiles = await readdir(faqDir);
103
+ for (const file of faqFiles) {
104
+ if (!file.endsWith('.md')) continue;
105
+ const filePath = join(faqDir, file);
106
+ const content = await readFile(filePath, 'utf-8');
107
+ const slug = file.replace(/\.md$/, '');
108
+ allFiles.push({
109
+ path: filePath,
110
+ content,
111
+ url: `/toolkits/${slug}`,
112
+ });
113
+ }
114
+ } catch {
115
+ // toolkit-faq directory doesn't exist, skip
116
+ }
117
+
118
return allFiles;
119
}
120