MCPcopy Index your code
hub / github.com/simstudioai/sim / generateAllBlockDocs

Function generateAllBlockDocs

scripts/generate-docs.ts:3830–3866  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

3828}
3829
3830async function generateAllBlockDocs() {
3831 try {
3832 // Copy icons from sim app to docs app
3833 copyIconsFile()
3834
3835 // Generate icon mappings from block definitions
3836 const docsIconMapping = await generateIconMapping({ includeHidden: true })
3837 const visibleIconMapping = await generateIconMapping({ includeHidden: false })
3838 writeIconMapping(docsIconMapping)
3839
3840 // Generate landing integrations page data (JSON + icon mapping)
3841 await writeIntegrationsJson(visibleIconMapping)
3842 writeIntegrationsIconMapping(visibleIconMapping)
3843
3844 // Compute the canonical set of tool docs and clean up anything stale —
3845 // covers hidden blocks AND blocks re-categorized away from `'tools'`.
3846 const validToolDocs = await getCanonicalToolDocNames()
3847 cleanupStaleToolDocs(validToolDocs)
3848
3849 const blockFiles = (await glob(`${BLOCKS_PATH}/*.ts`)).sort()
3850
3851 for (const blockFile of blockFiles) {
3852 await generateBlockDoc(blockFile)
3853 }
3854
3855 // Merge trigger sections into the per-service pages (and write trigger-only pages)
3856 await generateAllTriggerDocs()
3857
3858 // Write the integrations meta after both passes so trigger-only pages are included
3859 updateMetaJson()
3860
3861 return true
3862 } catch (error) {
3863 console.error('Error generating documentation:', error)
3864 return false
3865 }
3866}
3867
3868function updateMetaJson() {
3869 const metaJsonPath = path.join(DOCS_OUTPUT_PATH, 'meta.json')

Callers 1

generate-docs.tsFile · 0.85

Calls 12

copyIconsFileFunction · 0.85
generateIconMappingFunction · 0.85
writeIconMappingFunction · 0.85
writeIntegrationsJsonFunction · 0.85
getCanonicalToolDocNamesFunction · 0.85
cleanupStaleToolDocsFunction · 0.85
globFunction · 0.85
generateBlockDocFunction · 0.85
generateAllTriggerDocsFunction · 0.85
updateMetaJsonFunction · 0.85
errorMethod · 0.80

Tested by

no test coverage detected