Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a pluggable extension system that lets downstream deployments inject pages, navigation items, and sidebar sections into Lagoon UI without modifying core code.
Extensions are defined as directories under
extensions/, each with anextension.jsonmanifest. At build time,build-extensionscopies pages and components into the app and generates a mergedextensions.json. At runtime, theExtensionProviderreads this manifest and makes it available to navigation components.Included change
scripts/build-extensions.ts) discovers extensions, copies pages/components/lib into the app tree, writes merged manifestsrc/lib/extensions/schema.ts) validatesextension.jsonat load timesrc/lib/extensions/loader.ts) readsextensions.jsonand provides it viaExtensionContextuseSidenavItems), project tabs (ProjectNavTabs), environment tabs (EnvironmentNavTabs) all pick up extension nav itemssrc/lib/extensions/rbac.ts,ExtensionRouteGuard) role-based access on nav items and pages viarequiredRoles/excludeRolessrc/lib/extensions/icons.ts) maps Lucide icon names from manifests to componentsExtension structure
Manifest format
{ "meta": { "name": "my-extension", "version": "1.0.0" }, "navigation": { "items": [ { "id": "my-page", "label": "My Page", "href": "/my-page", "icon": "Star", "target": "sidebar-projects" } ], "sections": [ { "section": "My Section", "position": "end", "items": [ { "id": "item1", "label": "Item", "href": "/item", "icon": "Star" } ] } ] }, "pages": [ { "route": "my-page", "requiredRoles": ["admin"] } ] }Navigation targets
sidebar-projectssidebar-deploymentssidebar-organizationssidebar-settingsproject-tabsenvironment-tabsDocker usage
Downstream images will need to optionally inject extensions before build:
Working example
A "functional" analytics dashboard example available here:
feat/extensions-example:extensions/analytics/extension.json- manifest with sidebar section, project tab, RBAC rulesextensions/analytics/pages/analytics/page.tsx- global dashboard with chartsextensions/analytics/pages/projects/[projectSlug]/analytics/page.tsxproject-level analytics pageextensions/analytics/components/StatCard, ChartCard components