domma-cms 0.22.4 → 0.22.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "domma-cms",
3
- "version": "0.22.4",
3
+ "version": "0.22.5",
4
4
  "description": "File-based CMS powered by Domma and Fastify. Run npx domma-cms my-site to create a new project.",
5
5
  "type": "module",
6
6
  "main": "server/server.js",
@@ -217,6 +217,19 @@ export async function registerPlugins(fastify) {
217
217
  });
218
218
  loaded.push(manifest.name);
219
219
 
220
+ // Bridge plugin.json `admin.sidebar` entries into the sidebar
221
+ // registry so they render in the admin sidebar. The admin renderer
222
+ // reads plugin nav from /api/sidebar/registered-items; plugins
223
+ // declare their nav in the manifest rather than calling
224
+ // registerSidebarItem, so register it here on their behalf.
225
+ for (const item of manifest.admin?.sidebar || []) {
226
+ try {
227
+ registerSidebarItem({item});
228
+ } catch (err) {
229
+ fastify.log.warn(`[plugins] sidebar item for "${manifest.name}" skipped: ${err.message}`);
230
+ }
231
+ }
232
+
220
233
  // Ensure plugin collections exist (idempotent — skips if already present)
221
234
  await setupPlugin(manifest.name, {collections: {getCollection, createCollection}})
222
235
  .catch(err => fastify.log.warn(`[plugins] Collection setup for "${manifest.name}" failed: ${err.message}`));