feat(core)!: introduce runtime extension registry and flat module conventions

BREAKING CHANGE: sup config now derives entries from package.json#exports and a server/client glob instead of manual lists; module structure follows flat + barrel convention with .server.js/.client.js runtime suffixes
This commit is contained in:
2026-04-22 14:13:30 -04:00
parent 61388f04a6
commit 0106bc4ea0
35 changed files with 917 additions and 528 deletions
@@ -1,33 +1,20 @@
'use client';
import { getClientWidgets } from '../../dashboard/clientRegistry.js';
import '../../dashboard/widgets/index.client.js';
import '../../../dashboard.client.js';
// Évalué après tous les imports : les auto-registrations sont complètes
const sortedWidgets = getClientWidgets();
import { getWidgets } from '../registry.js';
export default function DashboardPage({ stats }) {
const loading = stats === null || stats === undefined;
const widgets = getWidgets();
return (
<div className="flex flex-col gap-4 sm:gap-6 lg:gap-8">
<div className="flex items-center justify-between">
<div>
<h1 className="text-lg sm:text-xl font-semibold text-neutral-900 dark:text-white">
Tableau de bord
</h1>
<p className="mt-1 text-[13px] text-neutral-500 dark:text-neutral-400">Vue d'ensemble de votre application</p>
</div>
<div>
<h1 className="text-lg sm:text-xl font-semibold text-neutral-900 dark:text-white">Tableau de bord</h1>
<p className="mt-1 text-[13px] text-neutral-500 dark:text-neutral-400">Vue d'ensemble de votre application</p>
</div>
<div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 2xl:grid-cols-4 gap-4 sm:gap-6">
{sortedWidgets.map(({ id, Component }) => (
<Component
key={id}
data={loading ? null : (stats[id] ?? null)}
loading={loading}
/>
{widgets.map(({ id, Component }) => (
<Component key={id} data={loading ? null : (stats[id] ?? null)} loading={loading} />
))}
</div>
</div>