* Remove any `docs/tools/*.mdx` that no longer corresponds to a visible * `category: 'tools'` block — covers both hidden blocks and blocks that * have been re-categorized to `'blocks'` / `'triggers'`. Keeps the * tools/ docs directory in lockstep with the canonical block registry.
(validToolDocs: Set<string>)
| 3017 | * tools/ docs directory in lockstep with the canonical block registry. |
| 3018 | */ |
| 3019 | function cleanupStaleToolDocs(validToolDocs: Set<string>): void { |
| 3020 | console.log('Cleaning up stale tool docs...') |
| 3021 | |
| 3022 | const existingDocs = fs |
| 3023 | .readdirSync(DOCS_OUTPUT_PATH) |
| 3024 | .filter((file: string) => file.endsWith('.mdx')) |
| 3025 | |
| 3026 | let removedCount = 0 |
| 3027 | |
| 3028 | for (const docFile of existingDocs) { |
| 3029 | const blockType = path.basename(docFile, '.mdx') |
| 3030 | if (HANDWRITTEN_INTEGRATION_DOCS.has(blockType)) continue |
| 3031 | if (validToolDocs.has(blockType)) continue |
| 3032 | |
| 3033 | const docPath = path.join(DOCS_OUTPUT_PATH, docFile) |
| 3034 | fs.unlinkSync(docPath) |
| 3035 | console.log(`✓ Removed stale tool doc: ${blockType}.mdx`) |
| 3036 | removedCount++ |
| 3037 | } |
| 3038 | |
| 3039 | if (removedCount > 0) { |
| 3040 | console.log(`✓ Cleaned up ${removedCount} stale tool doc files`) |
| 3041 | } else { |
| 3042 | console.log('✓ No stale tool docs to clean up') |
| 3043 | } |
| 3044 | } |
| 3045 | |
| 3046 | // ============================================================================ |
| 3047 | // Trigger Documentation Generation |
no test coverage detected