Skip to content

Conversation

@Brentlok
Copy link
Contributor

@Brentlok Brentlok commented Dec 23, 2025

fixes #245

Summary by CodeRabbit

  • Refactor
    • Reorganized internal type declarations for improved code maintainability. Consolidated type imports across modules without affecting runtime behavior or functionality.

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

@coderabbitai
Copy link

coderabbitai bot commented Dec 23, 2025

Walkthrough

This change consolidates ThemeName type exports by centralizing it in the types module and updating all imports across the codebase to reference this new location, replacing previous imports from config modules.

Changes

Cohort / File(s) Summary
Type Export Centralization
packages/uniwind/src/core/types.ts
Export ThemeName type (previously non-exported). This becomes the single source of truth for the type.
Config Module Imports
packages/uniwind/src/core/config/config.common.ts, packages/uniwind/src/core/config/config.native.ts
Consolidate imports: move ThemeName import source from local declaration/config.common to ../types; align CSSVariables and GenerateStyleSheetsCallback imports to come from ../types.
Config Re-export Removal
packages/uniwind/src/core/config/config.ts
Remove re-export of ThemeName from ./config.common; import directly from ../types instead.
Hook & Store Import Updates
packages/uniwind/src/core/native/store.ts, packages/uniwind/src/hooks/useUniwind.ts
Update ThemeName import source from ../config or ../core to ../core/types.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Pre-merge checks and finishing touches

❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Title check ❓ Inconclusive Title is vague and does not clearly describe the main objective of the changes, which is to export ThemeName from core/types to fix moduleSuffixes resolution issues. Consider a more descriptive title such as 'fix: export ThemeName type from core/types to resolve moduleSuffixes' to clearly convey the primary change.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Linked Issues check ✅ Passed The PR successfully addresses the core issue by exporting ThemeName from core/types and consolidating imports across config and hook modules to ensure ThemeName is accessible regardless of moduleSuffixes configuration.
Out of Scope Changes check ✅ Passed All changes are directly related to fixing the ThemeName export issue; no unrelated modifications to functionality, build configuration, or other systems were introduced.
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/useUniwind-type

📜 Recent review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f0814cd and 6a3984a.

📒 Files selected for processing (6)
  • packages/uniwind/src/core/config/config.common.ts
  • packages/uniwind/src/core/config/config.native.ts
  • packages/uniwind/src/core/config/config.ts
  • packages/uniwind/src/core/native/store.ts
  • packages/uniwind/src/core/types.ts
  • packages/uniwind/src/hooks/useUniwind.ts
🔇 Additional comments (6)
packages/uniwind/src/core/native/store.ts (1)

5-5: LGTM! Import source updated correctly.

The ThemeName import has been correctly updated to source from ../types, aligning with the centralized type export strategy that fixes the moduleSuffixes issue.

packages/uniwind/src/core/config/config.native.ts (1)

7-8: LGTM! Import consolidation looks clean.

The import reorganization correctly consolidates ThemeName, CSSVariables, and GenerateStyleSheetsCallback from the centralized ../types module, while keeping the base class import separate. This aligns with the fix for the moduleSuffixes issue.

packages/uniwind/src/hooks/useUniwind.ts (1)

4-4: LGTM! Import path correctly updated.

The ThemeName import has been properly updated to ../core/types, ensuring the type is available regardless of TypeScript's moduleSuffixes resolution. The hook's functionality remains unchanged.

packages/uniwind/src/core/types.ts (1)

33-33: Excellent! This is the core fix for the moduleSuffixes issue.

Exporting ThemeName from the centralized types module ensures it's available regardless of which config variant (web, native, etc.) TypeScript resolves via moduleSuffixes. This is more robust than the suggested fix in issue #245, which only targeted config.native.d.ts.

packages/uniwind/src/core/config/config.ts (1)

4-5: LGTM! Import reorganization and re-export removal are correct.

The imports have been properly updated to source ThemeName and CSSVariables from the centralized ../types module. Removing the re-export from this file is correct since ThemeName is now directly exported from the types module, preventing the moduleSuffixes resolution issue.

packages/uniwind/src/core/config/config.common.ts (1)

2-4: LGTM! Import consolidation correctly implemented.

The imports have been properly updated to source ThemeName, CSSVariables, and GenerateStyleSheetsCallback from the centralized ../types module. This ensures consistency across all config variants.

Verification confirms:

  • No remaining imports of ThemeName from old config locations
  • All files correctly import from the centralized types module
  • ThemeName is properly exported from packages/uniwind/src/core/types.ts

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

@Brentlok Brentlok merged commit 634fd60 into main Dec 23, 2025
2 checks passed
@Brentlok Brentlok deleted the fix/useUniwind-type branch December 23, 2025 10:37
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.

ThemeName type not exported from uniwind, causing type errors with moduleSuffixes

2 participants