Skip to content

refactor(core): audit @pretable/core public surface; rename GridCore* → Pretable* - #110

Merged
blove merged 11 commits into
mainfrom
api-stabilization-core
May 8, 2026
Merged

blove merged 11 commits into
mainfrom
api-stabilization-core

Conversation

@blove

@blove blove commented May 8, 2026

Copy link
Copy Markdown
Contributor

Summary

PR 2 of 5 for Tier 1 Sub-project A — Public API Stabilization. Audits `@pretable/core` per PR 2's design spec.

  • Engine type rename at source. Every `GridCore*` type renamed to its natural `Pretable*` name in `@pretable-internal/grid-core`. `LayoutSpan` renamed to `PretableRowRange` in `@pretable-internal/layout-core`. `GridCoreStore` becomes `PretableEngine` (kept `@internal`).
  • Explicit `PretableGrid` interface. New `packages/core/src/pretable-grid.ts` lists every method/property pretable promises. Replaces the old `extends Omit<GridCoreStore, "options">` leak.
  • `public_api.ts` convention. `packages/core/src/public_api.ts` is the curated public surface; `index.ts` is one line. `@public` TSDoc on every public symbol. `@internal` on engine-only symbols (`PretableEngine`, `PretableFrame`, `deriveSelectedRows`, `rangeContainsCell`, layout-core's planning types).
  • `bundledPackages` extends to internal packages so `core.api.md` shows inlined types instead of `ae-forgotten-export` warnings. Zero forgotten-exports in the regenerated report.
  • Per-package `README.md` for `@pretable/core` mentioning headless support; full headless docs/examples are deferred per memory.
  • `react.api.md` regenerated — diff is mechanical rename only (no shape changes); react's public surface stays compatible via one alias-rename in its `index.ts`.

Spec corrections discovered during implementation

Two findings landed back into the spec mid-PR:

  1. `ae-missing-release-tag` stays at `none`. The spec assumed api-extractor's non-local mode treated `warning`-level issues as non-fatal. It does not — they fail `api:check`. The flip to `warning` is moved to PR 5 once `@pretable/react`, `/ui`, `/stream-adapter` are also tagged.
  2. `ae-unresolved-link` silenced. Cross-package `{@link createGrid}` references can't resolve when api-extractor processes a different package's bundled report. Silencing avoids false-positive CI failures; the links still work in IDE tooltips.

Test plan

  • `pnpm -w typecheck` clean
  • `pnpm -w test` clean (190 + grid-core's 76 tests)
  • `pnpm -w lint` clean
  • `pnpm format` clean
  • `pnpm api:check` clean (all 4 packages)
  • `core.api.md` has zero `ae-forgotten-export` warnings
  • Every public symbol in `core.api.md` annotated `// @public`
  • `PretableGrid` rendered as flat interface (no `extends Omit<…>`)
  • `react.api.md` diff is rename-only — no added/removed symbols, no signature changes

🤖 Generated with Claude Code

blove and others added 11 commits May 8, 2026 09:34
Renames GridCore* → Pretable* at source in @pretable-internal/grid-core
and layout-core; collapses @pretable/core's types.ts; replaces
PretableGrid's Omit<> leak with an explicit interface; bundledPackages
update so api-extractor inlines the renamed types in core.api.md.
Headless docs/examples are explicitly deferred per memory.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
9 tasks: layout-core rename, grid-core rename (+ renderer-dom), explicit
PretableGrid interface, react import update, public_api.ts with TSDoc +
@public, api-extractor config update, regenerate .api.md files, README,
gates+PR.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Engine-level types now use Pretable* names directly. Internal-only
GridCoreStore renamed to PretableEngine to distinguish from the public
PretableGrid interface (defined separately in @pretable/core).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Replaces extends Omit<GridCoreStore<TRow>, 'options'> with an explicit
interface listing every method/property pretable promises. types.ts
becomes a re-export shell from the renamed engine types. Also re-exports
PretableRowRange via grid-core (which already bridges layout-core), and
updates core/index.ts to export PretableGrid from pretable-grid.ts.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
types.ts imports core's PretableColumn as PretableBaseColumn to
disambiguate from react's own PretableColumn. index.ts re-exports
PretableColumn as PretableCoreColumn so react's public surface is
unchanged — PR 3 will revisit the surface during the react audit.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Adds @public TSDoc tags to every symbol exported through
@pretable/core's public surface, plus @internal tags on engine-only
symbols (PretableEngine, PretableFrame, deriveSelectedRows,
rangeContainsCell, layout-core's planning types). index.ts collapses to
a single re-export from public_api.ts.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…ning

bundledPackages now inlines @pretable-internal/grid-core and
@pretable-internal/layout-core into each report so renamed types appear
self-contained. ae-missing-release-tag was 'none' for the PR 1 baseline;
flips to 'warning' now that core is fully tagged — provides coverage
visibility for PRs 3-5 without failing CI.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…nresolved-link

core.api.md: zero ae-forgotten-export warnings; every public symbol
annotated @public; PretableGrid is a flat interface.
react.api.md: mechanical rename diff (Pretable* names inlined).

api-extractor.base.json: ae-missing-release-tag stays at "none" (the
spec's flip-to-warning broke api:check — non-local mode treats warnings
as fatal, opposite of what the spec assumed). ae-unresolved-link
silenced because cross-package {@link createGrid} can't resolve in
bundled reports. Tag flip will land in PR 5 once react/ui/stream-adapter
are tagged.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…nings

README mentions headless support; full docs/examples deferred per
project_headless_engine_docs_deferred.md memory.

Spec correction: api-extractor's non-local mode treats warnings as
fatal, so ae-missing-release-tag stays at "none" until PR 5. Also
silences ae-unresolved-link for cross-package TSDoc refs.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@vercel

vercel Bot commented May 8, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
pretable Error Error May 8, 2026 6:03pm

@blove
blove enabled auto-merge (squash) May 8, 2026 18:02
@blove
blove merged commit efcab80 into main May 8, 2026
12 of 13 checks passed
@blove
blove deleted the api-stabilization-core branch May 8, 2026 18:04
@github-actions

github-actions Bot commented May 8, 2026

Copy link
Copy Markdown
Contributor

Vercel preview ready

Preview: https://pretable-qt7csecn5-cacheplane.vercel.app
Commit: 0885b7e2e78475a863d3fba5cd77e78f0c1f1b59

Updated automatically by the deploy-preview job.

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.

1 participant