src/admin/<name>/ seam. It is discovered at build time the
same way a custom module is, so nothing in the
framework is edited and the surface survives voyant upgrade.
This is the UI counterpart to
src/modules (API modules) and src/extensions
(API routes on existing modules). Discovery is build-time: Vite compiles
import.meta.glob to static imports.
The src/admin directory is empty until your deployment adds an extension.Add an admin surface
1
Drop a folder into src/admin
Create a directory under A surface can contribute any combination of navigation, widgets, and routes,
so include only the files you need.
src/admin/<name>/ in your deployment (the operator
starter). The directory name is its key in the admin shell.2
Default-export an AdminExtension from index.tsx
index.tsx must default-export an AdminExtension wrapped with
defineAdminExtension from @voyant-travel/admin. It is a bundle of any of
navigation, widgets, and routes:page: () => import("./page.js"))
so each page lands in its own chunk instead of the workspace-chrome bundle.
Widget slot names are the ones the starter exposes (see
src/lib/admin-extensions.tsx); targeting an unknown slot simply renders
nothing.3
How it composes (no manifest to edit)
There is nothing to register. The operator application discovers
src/admin/*/index.tsx and composes each default export into the admin shell:- Nav and widgets merge in
src/lib/admin-extensions.tsx(adminExtensionsFromGlobthencreateOperatorAdminExtensions) and resolve through the sharedresolveAdminNavigationandresolveAdminWidgets. - Page routes are grafted into the route tree at runtime by
src/router.tsx(buildAdminExtensionRoutes). Discovered pages are reachable by string navigation (<Link to="/concierge">); they are not in the generated typed-link map.
4
Regenerate admin artifacts (only for packaged-module surfaces)
The Run any of these after changing the
src/admin seam needs no codegen. The voyant admin generate commands
are for the other admin path: admin surfaces shipped by modules listed in
your voyant.config.* manifest, which are wired into committed, generated
files rather than discovered at build time.modules list in voyant.config.*. Add
--check to verify the generated files are in sync without rewriting them,
which is useful in CI.5
Verify
Check that the admin manifest, extensions, and routes are in parity, then run
the full preflight.
Next steps
Admin
The shared admin runtime, the application-owned shell, and its extension points.
Build an app
Give your admin surface an API and canonical state of its own.
Modules
The concepts behind module isolation, composition, and discovery.
Configuration
The voyant.config manifest that the admin generate commands read.