@bimetal/table-data
v0.17.0
Published
Table-domain event-sourcing prototype: TableRow commands/events, tableAggregate, tableProjection, createTableStore. Architecture test for @bimetal/event-sourcing — proves the generic schicht carries non-calendar domains without leakage.
Maintainers
Readme
@bimetal/table-data
Table-domain event sourcing — a deliberately minimal second domain built on @bimetal/event-sourcing, no UI.
This package was introduced as the architecture test for the generic event-sourcing schicht (Phase 10e). It mirrors what @bimetal/calendar-data does for the calendar domain, in a completely different shape (rows + cells instead of events + recurrence). If @bimetal/table-data composes cleanly without forcing changes back into @bimetal/event-sourcing, the generic schicht is genuinely domain-agnostic.
Installation
npm install @bimetal/table-dataWhat's Inside
Domain
TableRow—{ readonly id: string; readonly cells: Readonly<Record<string, CellValue>> }CellValue—string | number | boolean | nullTableReadModel—{ rows: readonly TableRow[]; version: number }
Domain Events
TableRowCreated/Updated/Deleted/Reverted- Union:
TableDomainEvent
Commands
CreateTableRow,UpdateTableRow,DeleteTableRow,UndoLastChange- Union:
TableCommand
Command Factories
createRow,updateRow,deleteRow,undoLastChange
Facade
TableStore— extendsDomainStore<AggregateState, TableCommand, TableDomainEvent, TableReadModel>withgetRows()createTableStore(config?)— main entry pointHydratableTableStore— addshydrate()andrebuild()
Table-flavored generics (with T = TableRow defaults)
AggregateState,AggregateSnapshot,TableSnapshotStore
Example
import { createTableStore, createRow, updateRow } from '@bimetal/table-data';
const store = createTableStore();
await store.dispatch(createRow({ id: 'r1', cells: { name: 'Alice', age: 30 } }));
await store.dispatch(updateRow('r1', { cells: { name: 'Bob', age: 30 } }));
await store.undo('r1'); // name reverts to 'Alice'Status
Prototype. Intended as an architecture validation, not a feature-complete table component. A future @bimetal/table component package (with UI: virtual scrolling, sorting, filtering, column resize, etc.) will be built on top once Phase 10 closes.
License
PolyForm Noncommercial License 1.0.0
