Skip to content

fix: add exports to core#6

Merged
smmoosavi merged 1 commit intomainfrom
fix-exports
Dec 6, 2025
Merged

fix: add exports to core#6
smmoosavi merged 1 commit intomainfrom
fix-exports

Conversation

@smmoosavi
Copy link
Copy Markdown
Contributor

@smmoosavi smmoosavi commented Dec 6, 2025

Summary by CodeRabbit

  • New Features

    • Added useKey hook for accessing key values
    • Exposed KeyContext as a public API
  • Changes

    • Updated accessByFn export behavior

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Dec 6, 2025

Walkthrough

New exports have been added to the ctablex-core package's public API: KeyContext (a React Context for managing keys) and useKey() (a custom hook). Additionally, accessByFn has been changed from a type-only export to a standard export.

Changes

Cohort / File(s) Summary
Public API Exports
packages/ctablex-core/index.d.ts, packages/ctablex-core/src/index.ts
Added KeyContext and useKey exports from ./contexts/key-context. Changed accessByFn from type export to value export.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

  • Verify that KeyContext and useKey are correctly implemented in ./contexts/key-context and match the exported type signatures
  • Confirm that changing accessByFn from type-only export to standard export does not impact downstream type-only imports

Poem

🐰 New contexts hop into the light,
useKey() and KeyContext take flight!
The APIs grow, symbols unfold,
A simpler path for tales untold.
Exports dance in harmony true!

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix: add exports to core' directly relates to the changeset, which adds public exports (KeyContext, useKey) and changes an export type to value export in the core package.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix-exports

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b4376b5 and 09f516d.

📒 Files selected for processing (2)
  • packages/ctablex-core/index.d.ts (2 hunks)
  • packages/ctablex-core/src/index.ts (2 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
packages/ctablex-core/index.d.ts (2)
packages/ctablex-core/src/index.ts (2)
  • KeyContext (8-8)
  • useKey (8-8)
packages/ctablex-core/src/contexts/key-context.tsx (2)
  • KeyContext (3-5)
  • useKey (7-13)
🔇 Additional comments (3)
packages/ctablex-core/src/index.ts (2)

8-8: LGTM! New exports for key management.

The new exports for useKey and KeyContext appropriately expand the public API. The implementation correctly validates context usage (throws when used outside provider), following standard React patterns.


39-39: Good fix! Changed from type-only to value export.

This correctly changes accessByFn from a type-only export to a value export, which is appropriate since it's a function. The previous type-only export would have prevented consumers from using the actual function implementation.

packages/ctablex-core/index.d.ts (1)

188-188: LGTM! Type declarations align with implementation.

The type declarations correctly reflect the implementation:

  • KeyContext includes undefined as the default context value
  • useKey() return type correctly excludes undefined since the implementation throws when used outside the context provider

Also applies to: 263-263


Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov
Copy link
Copy Markdown

codecov bot commented Dec 6, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (b4376b5) to head (09f516d).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main        #6   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           35        35           
  Lines          213       213           
  Branches        45        45           
=========================================
  Hits           213       213           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@smmoosavi smmoosavi merged commit c03c449 into main Dec 6, 2025
4 checks passed
@smmoosavi smmoosavi deleted the fix-exports branch December 6, 2025 09:03
smmoosavi added a commit that referenced this pull request Dec 6, 2025
@coderabbitai coderabbitai bot mentioned this pull request Dec 11, 2025
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