Skip to content

Conversation

@seefeldb
Copy link
Contributor

@seefeldb seefeldb commented Oct 17, 2025

Adds a new resolveAsCell() method that resolves a cell reference to the actual cell it points to. This is useful when accessing data via .key() and wanting a direct reference to the final underlying document, e.g. to create an id for it.

The method is equivalent to wrapping the current schema in Cell<> and calling .get(), providing a more convenient API for this common pattern.

Includes test coverage for resolving nested cell references.


Summary by cubic

Added resolveAsCell() to the Cell API to resolve a linked cell to the actual target cell. Helpful after .key() to get a direct cell for the final document.

  • New Features
    • Added Cell.resolveAsCell(): resolves the link and returns the underlying Cell.
    • Updated API typings and runner implementation; added tests for nested references.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Adds a new Cell API method resolveAsCell() to resolve a cell reference to the actual underlying cell, along with tests demonstrating its use.

  • Introduces resolveAsCell() on Cell and RegularCell implementations.
  • Updates public API typings to include resolveAsCell().
  • Adds a unit test validating resolution of a nested cell reference.

Reviewed Changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 3 comments.

File Description
packages/runner/src/cell.ts Implements resolveAsCell() and updates JSDoc.
packages/api/index.ts Exposes resolveAsCell() on the public Cell interface.
packages/runner/test/cell.test.ts Adds test for resolving a nested cell reference.

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 4 files

seefeldb and others added 2 commits October 17, 2025 11:44
Adds a new `resolveAsCell()` method that resolves a cell reference to the
actual cell it points to. This is useful when accessing data via .key() and wanting a direct reference to the final underlying document, e.g. to create an id for it.

The method is equivalent to wrapping the current schema in `Cell<>` and
calling `.get()`, providing a more convenient API for this common pattern.

Includes test coverage for resolving nested cell references.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@seefeldb seefeldb merged commit 70a7227 into main Oct 17, 2025
8 checks passed
@seefeldb seefeldb deleted the feat/add-resolve-to-cell branch October 17, 2025 21:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants