import { readFileSync } from 'node:fs'; import { join, dirname } from 'node:path'; import { fileURLToPath } from 'node:url'; const __dirname = dirname(fileURLToPath(import.meta.url)); const submodules = [ { name: 'server-core', path: '../server-core/docs/sidebar.json' }, { name: 'dashboard-ui', path: '../dashboard-ui/docs/sidebar.json' }, { name: 'device-agent', path: '../device-agent/docs/sidebar.json' } ]; const sidebar = []; for (const mod of submodules) { const filePath = join(__dirname, mod.path); try { const content = JSON.parse(readFileSync(filePath, 'utf-8')); sidebar.push(content); console.error(`\u2713 Loaded ${mod.name}`); } catch (e) { console.error(`\u26A0 Skipping ${mod.name}: ${e.message}`); } } console.log(JSON.stringify(sidebar, null, 2));