Add Launcher application template and icon system
This commit is contained in:
@@ -9,6 +9,7 @@ const registry = await parse("registry/registry.json");
|
||||
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 failures = [];
|
||||
const requireValue = (condition, message) => {
|
||||
@@ -21,12 +22,16 @@ requireValue(Array.isArray(registry.packages) && registry.packages.length >= 4,
|
||||
requireValue(Array.isArray(sources.sources) && sources.sources.length >= 6, "source audit is incomplete");
|
||||
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");
|
||||
|
||||
const ids = components.components.map((component) => component.id);
|
||||
requireValue(new Set(ids).size === ids.length, "component ids must be unique");
|
||||
const candidateIds = candidates.candidates.map((component) => component.id);
|
||||
requireValue(new Set(candidateIds).size === candidateIds.length, "candidate ids must be unique");
|
||||
requireValue(candidateIds.every((id) => !ids.includes(id)), "a component cannot be both baseline and candidate");
|
||||
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");
|
||||
|
||||
for (const component of components.components) {
|
||||
requireValue(component.id && component.status && component.summary, `component entry is incomplete: ${component.id ?? "unknown"}`);
|
||||
@@ -53,4 +58,4 @@ if (failures.length > 0) {
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
console.log(`Registry valid: ${components.components.length} components, ${candidates.candidates.length} candidates, ${sources.sources.length} audited sources.`);
|
||||
console.log(`Registry valid: ${components.components.length} components, ${iconNames.length} icons, ${candidates.candidates.length} candidates, ${sources.sources.length} audited sources.`);
|
||||
|
||||
Reference in New Issue
Block a user