Skip to content

refactor: migrate from docsJson.dataArray to AllComponents and simplify component code#58

Merged
naymurdev merged 9 commits intoui-layouts:mainfrom
Yeom-JinHo:refactor/ssot-ts-2
Sep 20, 2025
Merged

refactor: migrate from docsJson.dataArray to AllComponents and simplify component code#58
naymurdev merged 9 commits intoui-layouts:mainfrom
Yeom-JinHo:refactor/ssot-ts-2

Conversation

@Yeom-JinHo
Copy link
Contributor

#57

Description

This PR migrates the component data source from dataArray to AllComponents to fix consistency issues and centralize configuration.

Changes

  • Config (major): Replace all dataArray imports with AllComponents from the docs config.
  • Preview components: code-preview, drawer-code-preview, and iframe-component-preview now read from a single, unified data source.
  • Cleanup: Remove redundant logic across preview components.
  • Live & build config: Update live-components routing and next.config.ts accordingly.

Motivation

  • Maintainability-first: Centralized config eliminates divergence and ensures consistent behavior across platforms.
  • API simplification: Aligns with common UI-library patterns where data flows from a single config.

@Yeom-JinHo
Copy link
Contributor Author

Yeom-JinHo commented Sep 19, 2025

@naymurdev
I initially planned to normalize and update docsJson, but it turned out that docsJson was not needed at all.
While strengthening typing, I introduced a COMPONENT_KEY constant for componentName. However, due to serialization issues, I had to use JSON.parse(JSON.stringify()) as a workaround. This issue will be addressed in the next PR.

@Yeom-JinHo
Copy link
Contributor Author

Yeom-JinHo commented Sep 19, 2025

Ah, and additionally, I noticed that SpecialComponents and MainComponents are not actually merged into AllComponents.
This is also something I plan to improve. From what I’ve seen so far, aside from the sidebar structure, it should be fine to merge both into AllComponents.

I’d appreciate any feedback on this.

@naymurdev
Copy link
Collaborator

@Yeom-JinHo thanks man, I really want to remove everything and want to have only one component for getting preview, code and also want to use in search, not-found reference
lemme review ur PR

@naymurdev naymurdev merged commit 0d8c88f into ui-layouts:main Sep 20, 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.

2 participants