()
| 3866 | } |
| 3867 | |
| 3868 | function 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 | |
| 3889 | generateAllBlockDocs() |
| 3890 | .then((success) => { |
no test coverage detected