Skip to content

fix: export missing TimeRange type#2590

Merged
zernonia merged 2 commits intounovue:v2from
Bahtya:fix/export-timerange-type
Apr 10, 2026
Merged

fix: export missing TimeRange type#2590
zernonia merged 2 commits intounovue:v2from
Bahtya:fix/export-timerange-type

Conversation

@Bahtya
Copy link
Copy Markdown
Contributor

@Bahtya Bahtya commented Apr 8, 2026

Problem

Fixes #2589

The TimeRange type is defined in shared/date/types.ts and used internally by TimeRangeField, but it is not re-exported from shared/index.ts. This makes it unavailable to consumers, while the analogous DateRange type is properly exported.

Fix

Add TimeRange to the existing export line in packages/core/src/shared/index.ts:

-export { type DateRange, type DateStep, type DateValue, type SegmentPart, type TimeValue } from './date'
+export { type DateRange, type DateStep, type DateValue, type SegmentPart, type TimeRange, type TimeValue } from './date'

Testing

  • No runtime behavior change — purely a type export addition
  • TimeRange was already defined and used internally; this just makes it available to library consumers

Summary by CodeRabbit

  • Chores
    • Public API exports updated to include a new TimeRange type alongside existing date/time types, making the type available for consumers.

The TimeRange type is defined in shared/date/types.ts but was not
re-exported from shared/index.ts, making it unavailable to consumers
while the similar DateRange type is exported.

Fixes unovue#2589

Signed-off-by: bahtya <bahtyar153@qq.com>
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 8, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: c8650159-58fa-4ebc-ad52-3d945cd8af8b

📥 Commits

Reviewing files that changed from the base of the PR and between 5673bf9 and 14aa820.

📒 Files selected for processing (1)
  • packages/core/src/shared/date/index.ts
✅ Files skipped from review due to trivial changes (1)
  • packages/core/src/shared/date/index.ts

📝 Walkthrough

Walkthrough

Re-exports the TimeRange type from the date module through the shared barrel so TimeRange becomes available from the package's public API alongside other date/time types.

Changes

Cohort / File(s) Summary
Shared barrel export
packages/core/src/shared/index.ts
Added TimeRange to the re-export list from ./date, alongside existing date/time type exports.
Date module exports
packages/core/src/shared/date/index.ts
Re-exported TimeRange (from ./types) as part of the date module's public type surface.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 I hopped through lines both short and fine,
I found a type and made it mine.
TimeRange now springs into the light,
A tiny hop — everything's right! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: adding a missing type export for TimeRange to make it available to consumers.
Linked Issues check ✅ Passed The PR fully addresses issue #2589 by exporting the TimeRange type from the shared barrel export, making it accessible to consumers like DateRange.
Out of Scope Changes check ✅ Passed All changes are directly scoped to the issue: only TimeRange type exports are added to shared index files with no unrelated modifications.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@packages/core/src/shared/index.ts`:
- Line 5: The barrel export in shared/index.ts references TimeRange but the
./date index does not re-export it; open the date module's index (where other
types like DateRange, DateStep, DateValue are exported) and add an export for
TimeRange that forwards it from the underlying types file (e.g., export { type
TimeRange } from './types'), ensuring the symbol TimeRange is exported alongside
the existing DateRange/DateStep/DateValue exports so the shared/index.ts
re-export succeeds.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 5312e04d-8b48-47bf-85dc-f65bc4ddbc26

📥 Commits

Reviewing files that changed from the base of the PR and between e655d29 and 5673bf9.

📒 Files selected for processing (1)
  • packages/core/src/shared/index.ts

The shared/index.ts re-exports TimeRange from ./date, but TimeRange was
missing from the date barrel (shared/date/index.ts). This caused a
resolution failure. TimeRange is defined in shared/date/types.ts
alongside DateRange and other date types, so it belongs in the same
barrel export.

Verified: build passes and TimeRange appears in dist/shared.d.ts.

Bahtya
@Bahtya
Copy link
Copy Markdown
Contributor Author

Bahtya commented Apr 9, 2026

Fixed the CodeRabbit issue: added TimeRange to the export type { ... } block in packages/core/src/shared/date/index.ts alongside the existing DateRange, DateStep, DateValue exports.

Build verified: TimeRange now appears in dist/shared.d.ts.

@Bahtya
Copy link
Copy Markdown
Contributor Author

Bahtya commented Apr 9, 2026

Friendly ping — CodeRabbit review is passing with no actionable comments. This is a small type-export-only change (2 lines) that fixes #2589. Would appreciate a maintainer review when you get a chance. Thanks!

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Apr 10, 2026

Open in StackBlitz

npm i https://pkg.pr.new/reka-ui@2590

commit: 14aa820

@zernonia zernonia merged commit 70e7286 into unovue:v2 Apr 10, 2026
7 checks passed
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.

[Bug]: Missing type "TimeRange"

2 participants