libreria-astro-lefebvre
Version:
Librería de componentes Astro, React y Vue para Lefebvre
15 lines (14 loc) • 559 B
JavaScript
import { components } from '../generated/componentRegistry.ts';
export function listComponents() {
const metadatas = components
.map(c => c.component.metadata)
.sort((a, b) => {
const priorityA = a.priority ?? 0;
const priorityB = b.priority ?? 0;
if (priorityA !== priorityB) {
return priorityB - priorityA; // Higher priority first
}
return (a.name || '').localeCompare(b.name || ''); // Alphabetically by name
});
return metadatas;
}