- Plugins nach WordPress-Prinzip: plugin.json-Manifest mit Versions- und Abhängigkeitsprüfung, eigenes PSR-4-Autoloading, register()/boot(), activate()/deactivate()/uninstall(), Migrationen, Routen und Views je Plugin - plugins-core/ (mitgeliefert, aktiv bis zur Deaktivierung) und plugins/ (Kunden-Plugins, geschützt vor Updates, inaktiv bis zur Aktivierung) - Zustand in storage/app/plugins.json – Laden ohne Datenbankabfrage - Wiederherstellungsmodus: Ausnahmen und Fatal Errors beim Laden deaktivieren das Plugin, das Portal bleibt erreichbar - Hooks (Actions/Filter mit Prioritäten) und Registries für Navigation, Startseiten-Kacheln, Rechte und Admin-Seiten (Filament-Discovery) - Admin-Seite „Plugins“: aktivieren, deaktivieren, per ZIP installieren (ZIP-Slip-Schutz), löschen mit oder ohne Daten; abschaltbar per INHAUS_DISALLOW_FILE_MODS - Startseite komplett aus Kacheln; Plugin-Seiten als „slug::Seite“ - Version 0.3.0 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
23 lines
827 B
JavaScript
23 lines
827 B
JavaScript
import { defineAsyncComponent } from 'vue';
|
|
|
|
/**
|
|
* Vue-Komponenten der Startseiten-Kacheln: „core::Name“ aus resources/js/widgets,
|
|
* „<plugin>::Name“ aus plugins-core/<plugin>/resources/js/widgets.
|
|
*/
|
|
const core = import.meta.glob('../widgets/*.vue');
|
|
const plugins = import.meta.glob('../../../plugins-core/*/resources/js/widgets/*.vue');
|
|
|
|
const registry = {};
|
|
|
|
for (const [path, loader] of Object.entries(core)) {
|
|
registry[`core::${path.split('/').pop().replace('.vue', '')}`] = defineAsyncComponent(loader);
|
|
}
|
|
|
|
for (const [path, loader] of Object.entries(plugins)) {
|
|
const [, slug] = path.match(/plugins-core\/([^/]+)\//);
|
|
registry[`${slug}::${path.split('/').pop().replace('.vue', '')}`] = defineAsyncComponent(loader);
|
|
}
|
|
|
|
export function widgetComponent(name) {
|
|
return registry[name] ?? null;
|
|
}
|