Browse documentation

Eject to source

Transfer a resource, dashboard, or layout from generated behavior to application-owned source.

Eject is an ownership transfer. The CLI writes a starting scaffold into the admin route and disables the matching generated surface. From then on, your application implements, tests, and upgrades that behavior.

Before ejecting, check Choose an extension point. A renderer, custom widget, page, token, or theme slot usually carries less maintenance.

Preview the change

pnpm flowpanel eject resource users --dry-run

The config must exist and the named resource or dashboard must be registered. Dry run prints the filesystem and config plan without writing. Review it before changing a surface that already has custom route files.

Eject a resource

pnpm flowpanel eject resource users

The command writes list, create, detail, edit, and action stubs under app/admin/users or src/app/admin/users. These are starting points, not copies of the fully rendered runtime: you still implement database queries, policies, UI states, and tests.

The matching resource(...) entry is commented in place and an ejection breadcrumb is added. File headers record the installed FlowPanel version so future reviews can identify the scaffold baseline.

Eject a dashboard or layout

pnpm flowpanel eject dashboard /monitoring
pnpm flowpanel eject layout

A dashboard creates one page at its admin path and disables the matching dashboard config. A layout creates an admin layout.tsx; Next.js file routing then wraps the catch-all FlowPanel pages. Layout ejection does not remove resources or dashboards from config.

Handle existing files

The command stops when a target file already exists. --force overwrites it, so use that flag only after reviewing or preserving the existing implementation. Unknown targets, missing names, and config entries that cannot be found exit with an error for CI visibility.

Understand upgrade consequences

Non-ejected surfaces continue receiving FlowPanel behavior and UI updates. Ejected files do not. On upgrades, compare their recorded version with changelog entries and test them against current public component and runtime contracts.

Reverse an eject

There is no merge-back command. To return to generated behavior, restore the config entry and remove or relocate the explicit Next.js route; otherwise file-based routing continues to win over the catch-all page. Any behavior that exists only in the ejected files must be re-expressed or discarded deliberately.

See the generated CLI reference for current arguments and flags.