Something went wrong

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

hydrate - Lona Docs Log in

hydrate <fixture-path>

Hydrate a .sheet.json fixture via TestBackend + Sheet.from, then pretty-print the result as a rows × dates grid.

deno run --allow-read --unstable-sloppy-imports \
  tento/tento-lona-js/cli/rows-fixtures/src/lona-rows.deno.ts \
  hydrate tento/tento-lona-js/sheets/tests.shared/sheets/formula-simple-seeded.sheet.json

What it does

  1. Reads the JSON fixture from the given path.
  2. Constructs a TestBackend and seeds it with the fixture.
  3. Calls Sheet.from(rawSheet, { backend }) to build the in-memory model.
  4. Walks sheet.allRows() filtered to SourceRow instances.
  5. For each row, fetches its cells via sheet.stores.sourceCellData.cells(id).
  6. Prints a single grid: bold title, dim row/date count, header row of date keys, separator, then one line per source row.

Output shape

Formula Simple (seeded)
3 rows × 3 dates

                ymd-2026-4-18  ymd-2026-4-19  ymd-2026-4-20
Weight          200.0          —              210.5
Weight Plus 10  210.0          —              220.5  = (+ (rows["Weight"]) 10)
Notes           kept it light  —              —

Conventions:

  • Bold row labels.
  • Dim counts ("3 rows × 3 dates").
  • Cyan = <expression> suffix on FormulaRow rows.
  • for empty cells.
  • Missing rows print nothing (not shown at all).

Date-column dedup

The grid collects every date that appears on any source row; duplicate .toString() outputs collapse to a single column. Two cells with different NaiveDate.Partial types (e.g. day ymd-2026-1-5 + week yw-2026-1) produce distinct columns even if their start DSE overlaps.

Errors

  • Path doesn't exist → exit code 1, error to stderr.
  • File isn't valid JSON → exit code 1, parser error to stderr.
  • File is JSON but not a RawSheet → exit code 1, validation error.
  • Hydration fails (e.g. unknown row type) → exit code 1, full stack trace.

Use cases

  • "What does this fixture render to?" — fastest answer.
  • Diffing two fixture variants side-by-side via diff <(hydrate a) <(hydrate b).
  • Smoke-checking that a fixture is round-trip clean (compare hydrate output against expected snapshot).

See also

  • cells — list every cell on one source row
  • watch — same fixture but REPL over a live Sheet