Build Module Studio application composition

This commit is contained in:
DCCONSTRUCTIONS
2026-07-11 21:37:20 +03:00
parent d3e2859ca1
commit 50718a33a1
22 changed files with 2243 additions and 35 deletions
+14 -1
View File
@@ -10,6 +10,7 @@ const sources = await parse("registry/sources.json");
const components = await parse("registry/components.json");
const candidates = await parse("registry/candidates.json");
const icons = await parse("registry/icons.json");
const pages = await parse("registry/pages.json");
const failures = [];
const requireValue = (condition, message) => {
@@ -23,6 +24,8 @@ requireValue(Array.isArray(sources.sources) && sources.sources.length >= 6, "sou
requireValue(Array.isArray(components.components) && components.components.length >= 10, "component registry is incomplete");
requireValue(Array.isArray(candidates.candidates) && candidates.candidates.length >= 10, "candidate registry is incomplete");
requireValue(Array.isArray(icons.groups) && icons.groups.length >= 5, "icon registry is incomplete");
requireValue(pages.schemaVersion === "0.1.0", "page registry schemaVersion must be 0.1.0");
requireValue(Array.isArray(pages.templates) && pages.templates.length >= 1, "page registry must contain at least one template");
const ids = components.components.map((component) => component.id);
requireValue(new Set(ids).size === ids.length, "component ids must be unique");
@@ -32,6 +35,16 @@ requireValue(candidateIds.every((id) => !ids.includes(id)), "a component cannot
const iconNames = icons.groups.flatMap((group) => group.names ?? []);
requireValue(iconNames.length >= 35, "icon registry must contain the audited baseline set");
requireValue(new Set(iconNames).size === iconNames.length, "icon names must be unique across groups");
const pageTemplateKeys = pages.templates.map((template) => `${template.id}@${template.version}`);
requireValue(new Set(pageTemplateKeys).size === pageTemplateKeys.length, "page template id/version pairs must be unique");
for (const template of pages.templates) {
requireValue(template.schemaVersion === "0.1.0", `unsupported page template schema: ${template.id ?? "unknown"}`);
requireValue(template.id && template.version && template.title && template.page, `page template entry is incomplete: ${template.id ?? "unknown"}`);
requireValue(Array.isArray(template.features), `page template features are missing: ${template.id ?? "unknown"}`);
requireValue(Array.isArray(template.slots), `page template slots are missing: ${template.id ?? "unknown"}`);
requireValue(Array.isArray(template.actions), `page template actions are missing: ${template.id ?? "unknown"}`);
}
for (const component of components.components) {
requireValue(component.id && component.status && component.summary, `component entry is incomplete: ${component.id ?? "unknown"}`);
@@ -58,4 +71,4 @@ if (failures.length > 0) {
process.exit(1);
}
console.log(`Registry valid: ${components.components.length} components, ${iconNames.length} icons, ${candidates.candidates.length} candidates, ${sources.sources.length} audited sources.`);
console.log(`Registry valid: ${components.components.length} components, ${iconNames.length} icons, ${pages.templates.length} page templates, ${candidates.candidates.length} candidates, ${sources.sources.length} audited sources.`);