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
+3 -16
View File
@@ -1,21 +1,10 @@
'use client';
/**
* Widget core — Composant client : nombre d'utilisateurs
*
* Auto-enregistré via admin/dashboard/widgets/index.client.js.
* Pas besoin de modifier features/dashboard.client.js pour ce widget.
*
* Props du composant :
* data — { totalUsers: number, newThisMonth: number } retourné par getUsersDashboardData(), ou null
* loading — true tant que les données serveur ne sont pas disponibles
*/
import { registerClientWidget } from '../clientRegistry.js';
import { registerWidget } from '../registry.js';
import { StatCard } from '@zen/core/shared/components';
import { UserMultiple02Icon } from '@zen/core/shared/icons';
function UsersDashboardWidget({ data, loading }) {
function UsersWidget({ data, loading }) {
const newThisMonth = data?.newThisMonth ?? 0;
return (
<StatCard
@@ -31,6 +20,4 @@ function UsersDashboardWidget({ data, loading }) {
);
}
registerClientWidget('users', UsersDashboardWidget, 10);
export default UsersDashboardWidget;
registerWidget({ id: 'users', Component: UsersWidget, order: 10 });