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

Function updateMetaJson

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

Source from the content-addressed store, hash-verified

3866}
3867
3868function updateMetaJson() {
3869 const metaJsonPath = path.join(DOCS_OUTPUT_PATH, 'meta.json')
3870
3871 const blockFiles = fs
3872 .readdirSync(DOCS_OUTPUT_PATH)
3873 .filter((file: string) => file.endsWith('.mdx'))
3874 .map((file: string) => path.basename(file, '.mdx'))
3875
3876 const items = [
3877 ...(blockFiles.includes('index') ? ['index'] : []),
3878 ...blockFiles.filter((file: string) => file !== 'index').sort(),
3879 ]
3880
3881 const metaJson = {
3882 pages: items,
3883 }
3884
3885 fs.writeFileSync(metaJsonPath, `${JSON.stringify(metaJson, null, 2)}\n`)
3886 console.log(`Updated meta.json with ${items.length} entries`)
3887}
3888
3889generateAllBlockDocs()
3890 .then((success) => {

Callers 1

generateAllBlockDocsFunction · 0.85

Calls 2

joinMethod · 0.80
logMethod · 0.80

Tested by

no test coverage detected