@emeryld/ui-config
v0.1.7
Published
Generated preview configuration for `@emeryld/ui`, ready to use with `@emeryld/ui-preview`.
Readme
@emeryld/ui-config
Generated preview configuration for @emeryld/ui, ready to use with @emeryld/ui-preview.
What This Package Exports
@emeryld/ui-config exports a single config object:
emeryldUIConfigfrom@emeryld/ui-config
It is generated from exported components in @emeryld/ui and can be passed directly to UIPreview.
Dependency Contract
@emeryld/uiis a peer dependency and must be installed by consumers.@emeryld/ui-previewis a direct dependency of this package.- In this monorepo, local development uses workspace dev dependencies so generation and typechecking stay aligned with local
@emeryld/ui.
Use In An App
import { UIPreview } from '@emeryld/ui-preview'
import { emeryldUIConfig } from '@emeryld/ui-config'
export function PreviewPage() {
return <UIPreview config={emeryldUIConfig} />
}Build Workflow
pnpm run build does two steps:
build:preview-config: regeneratessrc/components.preview-config.tsxtsc -p tsconfig.json: builds this package intodist
Script:
pnpm run build:preview-configCurrent generator call:
- scans:
../ui/src/components - writes output:
src/components.preview-config.tsx - imports UI from:
@emeryld/ui(--import-path @emeryld/ui)
ui-preview-dev also regenerates this same file during local preview development, so this package remains the single source of truth for preview config.
Manual Edits And Regeneration
src/components.preview-config.tsx is mostly generated, but manual adjustments are expected for edge cases.
When regenerating:
- existing
definePreview(...)entries are read from the same output file - existing values are preserved when possible
- new components are added
- removed components are dropped
This means your manual fixes in src/components.preview-config.tsx should survive future build:preview-config runs.
Source Files
- Entry export:
src/index.ts - Generated config:
src/components.preview-config.tsx - Package build config:
tsconfig.json
