docs: add high-level Corp v1 architecture
Build and publish Corp v1 Board portal / build (pull_request) Successful in 38s
Build and publish Corp v1 Board portal / build (pull_request) Successful in 38s
This commit is contained in:
@@ -20,10 +20,15 @@ for (const section of ['projects', 'teams', 'members', 'board', 'governance']) {
|
||||
assert.match(config, new RegExp(`sidebarId:\\s*'${section}Sidebar'`), `${section} navbar item does not target its dedicated sidebar`);
|
||||
assert.ok(existsSync(join(root, `sidebars/${section}.ts`)), `${section} sidebar file is missing`);
|
||||
}
|
||||
assert.match(config, /id:\s*'architecture-high-level'/, 'Architecture High Level docs plugin is missing');
|
||||
assert.match(config, /sidebarId:\s*'architectureHighLevelSidebar'/, 'Architecture High Level navbar item does not target its dedicated sidebar');
|
||||
assert.match(config, /label:\s*'Architecture High Level'/, 'Architecture High Level navbar label is missing');
|
||||
assert.ok(existsSync(join(root, 'sidebars/architecture-high-level.ts')), 'Architecture High Level sidebar file is missing');
|
||||
|
||||
assert.match(config, /baseUrl:\s*'\/corp-v1\/portal\/'/, 'Pages base URL must follow the renamed repository');
|
||||
assert.match(config, /projectName:\s*'portal'/, 'Docusaurus project name must be portal');
|
||||
assert.doesNotMatch(config, /sterring-commitee/, 'legacy repository name must not remain in Docusaurus config');
|
||||
assert.doesNotMatch(config, /Pilot Model|docs\/pilot|routeBasePath:\s*'pilot'/, 'legacy Pilot Model navigation must not remain');
|
||||
|
||||
const board = read('docs/board/index.md');
|
||||
for (const memberId of ['1518725627845283888', '476287310627864587', '773109855497093191', '364383883778850827']) {
|
||||
@@ -45,16 +50,57 @@ for (const section of ['projects', 'teams', 'members']) {
|
||||
|
||||
assert.ok(packageJson.dependencies?.['@easyops-cn/docusaurus-search-local'], 'local search dependency is missing');
|
||||
assert.match(config, /@easyops-cn\/docusaurus-search-local/, 'local search theme is not configured');
|
||||
assert.ok(packageJson.dependencies?.['docusaurus-plugin-drawio'], 'Draw.io plugin dependency is missing');
|
||||
assert.ok(packageJson.devDependencies?.['raw-loader'], 'Draw.io raw-loader dependency is missing');
|
||||
assert.match(config, /\['drawio',\s*\{lib:\s*'\/corp-v1\/portal\/drawio\/viewer\.min\.js'\}\]/, 'Draw.io plugin must use the self-hosted viewer');
|
||||
assert.ok(existsSync(join(root, 'static/drawio/viewer.min.js')), 'self-hosted Draw.io viewer is missing');
|
||||
const drawioLicense = read('static/drawio/LICENSE');
|
||||
assert.match(drawioLicense, /MIT License/, 'vendored Draw.io viewer license is missing');
|
||||
assert.match(drawioLicense, /Copyright \(c\) 2022 xiguaxigua/, 'vendored Draw.io viewer copyright notice is missing');
|
||||
assert.match(config, /indexPages:\s*true/, 'custom pages must be indexed');
|
||||
for (const route of ['/', 'projects', 'teams', 'members', 'board', 'governance']) {
|
||||
assert.ok(config.includes(`'${route}'`), `search does not include route base ${route}`);
|
||||
const searchRoutesMatch = config.match(/docsRouteBasePath:\s*\[([^\]]+)\]/);
|
||||
assert.ok(searchRoutesMatch, 'search route configuration is missing');
|
||||
const searchRoutes = searchRoutesMatch[1];
|
||||
for (const route of ['/', 'architecture-high-level', 'projects', 'teams', 'members', 'board', 'governance']) {
|
||||
assert.ok(searchRoutes.includes(`'${route}'`), `search does not include route base ${route}`);
|
||||
}
|
||||
|
||||
const architectureSidebar = read('sidebars/architecture-high-level.ts');
|
||||
const architectureItems = ['Context', 'Overview', 'Overview Channels', 'Overview Repositories'];
|
||||
let architectureCursor = -1;
|
||||
for (const label of architectureItems) {
|
||||
const next = architectureSidebar.indexOf(`label: '${label}'`, architectureCursor + 1);
|
||||
assert.ok(next > architectureCursor, `Architecture High Level sidebar is missing or out of order: ${label}`);
|
||||
architectureCursor = next;
|
||||
}
|
||||
const architecturePages = {
|
||||
context: read('docs/architecture-high-level/context.mdx'),
|
||||
overview: read('docs/architecture-high-level/overview.mdx'),
|
||||
channels: read('docs/architecture-high-level/overview-channels.mdx'),
|
||||
repositories: read('docs/architecture-high-level/overview-repositories.mdx'),
|
||||
};
|
||||
for (const [name, page] of Object.entries(architecturePages)) {
|
||||
assert.match(page, /!!raw-loader!\.\/diagrams\/.+\.drawio/, `${name} page must render an editable Draw.io source`);
|
||||
}
|
||||
for (const term of ['six channel skills', 'seven engineering skills', 'Gitea Actions', 'scheduler jobs']) {
|
||||
assert.ok(Object.values(architecturePages).some((page) => page.includes(term)), `architecture explanation is missing: ${term}`);
|
||||
}
|
||||
for (const [name, markers] of Object.entries({
|
||||
'context.drawio': ['CORP V1 — OPERATING CONTEXT', 'Corp v1 Board', 'Gitea organizations and repositories', 'Delivery platform'],
|
||||
'overview.drawio': ['CORP V1 — PROJECT OPERATING FLOW', 'BOARD APPROVAL', 'KANBAN / FOCUS', 'VERIFY & RECORD'],
|
||||
'channels.drawio': ['CORP V1 — PROJECT CHANNELS', 'GENERAL', 'ARCHITECTURE', 'RELEASES'],
|
||||
'repositories.drawio': ['CORP V1 — ORGANIZATIONS, REPOSITORIES & DELIVERY', 'PROJECT ORGANIZATION', 'SKILLS ORGANIZATION', 'GITEA ACTIONS'],
|
||||
})) {
|
||||
const diagram = read(`docs/architecture-high-level/diagrams/${name}`);
|
||||
assert.match(diagram, /<mxfile[\s>]/, `${name} is not a Draw.io source file`);
|
||||
for (const marker of markers) assert.ok(diagram.includes(marker), `${name} is missing: ${marker}`);
|
||||
}
|
||||
|
||||
if (existsSync(join(root, 'build'))) {
|
||||
const filename = readdirSync(join(root, 'build')).find((name) => /^search-index(?:-[a-f0-9]+)?\.json$/.test(name));
|
||||
assert.ok(filename, 'production search index is missing');
|
||||
const search = readFileSync(join(root, 'build', filename), 'utf8').toLowerCase();
|
||||
for (const term of ['projects registry', 'teams registry', 'members registry', 'board members', 'project lifecycle', 'corp v1 board']) {
|
||||
for (const term of ['projects registry', 'teams registry', 'members registry', 'board members', 'project lifecycle', 'corp v1 board', 'overview channels', 'overview repositories']) {
|
||||
assert.ok(search.includes(term), `search index is missing: ${term}`);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user