@savvifi/meridian-aion-projection
v0.3.4
Published
Projects aion graph compositions (@aion/ui-contracts EntityListComposition) into framework-neutral meridian.ui.v1 ViewDescriptor protos. The 'aion emits meridian layouts as protos' half — pure, additive, not wired into any aion runtime.
Readme
@savvifi/meridian-aion-projection
Projects aion graph compositions into framework-neutral meridian ViewDescriptor
protos — the "aion emits its layouts as protos" half of the meridian adoption.
The aion app keeps authoring compositions in the graph (.aion entity-views, compiled
to @aion/ui-contracts EntityListComposition). This package turns one into a
meridian.ui.v1.ViewDescriptor that any meridian renderer paints — the MUI kit
(@savvifi/meridian-mui-kit), the
web-components renderer, or the TUI.
EntityListComposition ──projectEntityView──▶ meridian.ui.v1.ViewDescriptor
(@aion/ui-contracts) (@savvifi/meridian-proto-ts)Pure + additive: it depends only on the published @aion/ui-contracts types and
emits protobuf-es messages. It touches no aion runtime, renders nothing, and is not
wired into any deployment.
Usage
import { projectEntityView } from "@savvifi/meridian-aion-projection";
const view = projectEntityView(composition); // CURSOR pagination (aion default)
const view2 = projectEntityView(composition, { // overrides
kind: "detail",
pagination: "offset",
pageSize: 50,
rowsField: "items",
});Mapping
| aion composition | meridian ViewDescriptor |
| --- | --- |
| viewKey / title / entityType | id / title / subjectKind |
| preset.listRoute / detailRoute | route |
| detailLayoutMode (stacked/tabbed/two-column) | Layout (LIST for a list view) |
| columns[] (key/label/sourcePath) | TablePanel.columns (header / field_path) |
| list queryDescriptors[].operationRef | TablePanel.populate RpcCall |
| — (default) | TablePanel.pagination = CURSOR (cursor / nextCursor, page size 25) |
| detail slots[] (header / section / list) | Slots (AdhocPanel / FormPanel / TablePanel) |
| editFormFields[] (key/label/type/options) | FormPanel (READONLY; select → enumSelection) |
| actionDescriptors[] / pageActions[] | view header Actions (RpcCall + placement) |
Pagination
Defaults to CURSOR — aion's preferred paradigm (its tRPC list procedures use the
infinite-query shape: input { cursor }, output { items, nextCursor }). Override with
{ pagination: "offset" | "client" | "none" }. The projected Pagination is consumed by
the renderer's usePagedRows (see meridian-web-react).
Status
The projection runs standalone against the published @aion/ui-contracts types today.
The end-state is for the aion app to call it (or an equivalent) to serve ViewDescriptors
to a meridian render path — a later, gated step that does not change the current aion/ui
deployments.
Develop
pnpm install # @aion/ui-contracts from the GitLab registry (see .npmrc); meridian from npmjs
pnpm typecheck # type-checks against the REAL @aion/ui-contracts composition types
pnpm test # projects compositions mirroring the real studio product views
pnpm build # dist/ (tsc)