From 00415bb3590a94bc7658691f9f9a4d02dfcadec5 Mon Sep 17 00:00:00 2001 From: Jarvis Jr Hermes Date: Mon, 24 Aug 2026 11:34:18 +0000 Subject: [PATCH] fix: reject alternate sidebar entries --- scripts/verify-portal.mjs | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/scripts/verify-portal.mjs b/scripts/verify-portal.mjs index 9ec5db0..1ca59d2 100644 --- a/scripts/verify-portal.mjs +++ b/scripts/verify-portal.mjs @@ -67,14 +67,23 @@ for (const route of ['/', 'architecture-high-level', 'projects', 'teams', 'membe } const architectureSidebar = read('sidebars/architecture-high-level.ts'); -const architectureEntries = [...architectureSidebar.matchAll(/\{type:\s*'doc',\s*id:\s*'([^']+)',\s*label:\s*'([^']+)'\}/g)] - .map((match) => ({id: match[1], label: match[2]})); -assert.deepEqual(architectureEntries, [ - {id: 'context', label: 'Context'}, - {id: 'overview', label: 'Overview'}, - {id: 'overview-channels', label: 'Overview Channels'}, - {id: 'overview-repositories', label: 'Overview Repositories'}, -], 'Architecture High Level sidebar must contain exactly the four requested documents in order'); +const expectedArchitectureSidebar = `import type {SidebarsConfig} from '@docusaurus/plugin-content-docs'; + +const sidebars: SidebarsConfig = { + architectureHighLevelSidebar: [ + {type: 'doc', id: 'context', label: 'Context'}, + {type: 'doc', id: 'overview', label: 'Overview'}, + {type: 'doc', id: 'overview-channels', label: 'Overview Channels'}, + {type: 'doc', id: 'overview-repositories', label: 'Overview Repositories'}, + ], +}; + +export default sidebars;`; +assert.equal( + architectureSidebar.trim(), + expectedArchitectureSidebar, + 'Architecture High Level sidebar must contain exactly the four requested documents in order', +); const architecturePages = { context: read('docs/architecture-high-level/context.mdx'), overview: read('docs/architecture-high-level/overview.mdx'),