Something went wrong

Thank you for being patient! We're working hard on resolving the issue

Package Architecture - Lona Docs Log in

Package Architecture

The Lona SDK is split across four published packages with explicit audiences. Picking the right entry point makes the rest of your code read predictably.

Packages and audiences

PackageAudienceWhen you import it
@tento-lonaEveryday SDK consumers — app code, integration testsYou're building on top of Lona: open sheets, list rows, subscribe to changes, fetch events / tasks / preferences.
@tento-lona/sheetsData-model consumers — row-shape readers, encoders, fixture writersYou need wire-format types (Dtype, CellEntry, RowKey), built-in encodings, alias templates, system rows, or a backend implementation.
@tento-lona/platformPlatform implementors — CLI, TUI, native renderers, future canvas back-endsYou're writing a new front-end that consumes the per-type plugin contract, scene + diff pipeline, tree pipeline, layout math, plugin data providers, or the TUI reference impl.
@tento-lona/sheets-uiDOM hosts — browsers, Electron, web-viewsYou're rendering sheets in a DOM. Provides Sheet, DOM_PLATFORM, the per-type DOM plugins, and the gesture system.

Every package has its own lib.ts barrel. Reach for the barrel that matches your audience — deep imports past it (e.g. @tento-lona/clients/<name>) signal that the wrong barrel was picked, and a CI guard test (tento/tento-lona-js/sheets/tests/platform-barrel-stability.deno.test.ts) fails if a known-bad deep import re-appears.

Common picks

  • App codeimport { LonaSdk, SheetHandle, RowClient, CalendarClient, EventsClient, TasksClient, PreferencesClient, Network } from "@tento-lona";
  • Reactive subscribersimport { Actor, InvalidationSink, RowDataChanged } from "@tento-lona"; (re-exported from rows for convenience)
  • Wire-format readersimport { Sheet, SheetRow, RowKey, Dtype, CellEntry, EVENT_V1 } from "@tento-lona/sheets";
  • CLI / TUI implementorsimport { PER_TYPE_SPECS, RenderScene, buildScene, diffScene, TreeWatcher, calendarListDataProvider, TuiReconciler, resolveAliasActiveLayout } from "@tento-lona/platform";
  • DOM hostsimport { Sheet, DOM_PLATFORM, RenderPluginManager, SheetDelegate, GestureCoordinator } from "@tento-lona/sheets-ui";

Internals are intentionally hidden

The following are SDK-internal and not exported from any public barrel:

  • Formula solver plumbing — SheetLispLibrary, extractFormulaDependencies, makeComputeRange. App-facing formula entry-points live under SheetLispEnvironment, evaluateFormula, and makeSheetView on @tento-lona.
  • Sync runtime internals — RowHandle, ClientContext, IndexFactory, SubscribeHandle, SubscribeOptions. App code never instantiates these directly; the indices (EventsIndex, TasksIndex, DataIndex, RegressionIndex) are the public surface.
  • Chart canvas math — ChartViewModel. Pure data-side primitives (LinearYScaler, castData, formatValue, GraphData, ChartPointerStore, DiscreteConvolution) live on @tento-lona/sheets and are the supported scaler API.

If a missing name blocks you, file an issue. Re-introducing the internal export should be a deliberate decision, not a workaround.

See also

  • @tento-lona/sheets library — row-shape readers, encoders, fixture writers
  • @tento-lona/cli/rows-fixtures — rows fixture CLI tooling
  • @tento-lona/cli — SDK command-line tooling
  • tento/tento-lona-js/sheets/tests/platform-barrel-stability.deno.test.ts — the CI guard that locks in the audience separation.