Skip to content

feat: color engine and core style system refactor#147

Merged
mehdibha merged 48 commits intomainfrom
color-engine
Dec 21, 2025
Merged

feat: color engine and core style system refactor#147
mehdibha merged 48 commits intomainfrom
color-engine

Conversation

@mehdibha
Copy link
Owner

@mehdibha mehdibha commented Dec 19, 2025

Summary

  • New @dotui/colors package (color engine)
  • Core package reorganization (merged style/ + components/ into react/)
  • Style system refactor (StyleConfig, StyleProvider, createDynamicComponent)
  • Registry refactor with component groups + consolidated build scripts
  • Database schema migration (single config column)
  • Various dependency updates and fixes

mehdibha and others added 16 commits December 14, 2025 17:35
Phase 1 of the refactor plan:

- Add `ComponentGroup` type to registry types (buttons, inputs, selections,
  overlays, feedback, navigation, data-display, date-time, color, forms, layout)
- Add `group` field to all 60 component meta.ts files
- Create `scripts/build-registry.ts` to generate variants.ts from meta files
- Generate `packages/core/src/__registry__/variants.ts` with VARIANTS and
  VARIANT_GROUPS constants (only components with 2+ variants)
- Add `build:registry` and `dev:registry` scripts to root package.json
- Add CI check to ensure generated files stay in sync

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@changeset-bot
Copy link

changeset-bot bot commented Dec 19, 2025

⚠️ No Changeset found

Latest commit: 0cbed58

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

💥 An error occurred when fetching the changed packages and changesets in this PR
Some errors occurred when validating the changesets config:
The package or glob expression "@dotui/style-system" is specified in the `ignore` option but it is not found in the project. You may have misspelled the package name or provided an invalid glob expression. Note that glob expressions must be defined according to https://www.npmjs.com/package/micromatch.
The package "@dotui/core" depends on the ignored package "@dotui/ts-config", but "@dotui/core" is not being ignored. Please add "@dotui/core" to the `ignore` option.
The package "@dotui/core" depends on the ignored package "@dotui/colors", but "@dotui/core" is not being ignored. Please add "@dotui/core" to the `ignore` option.
The package "@dotui/core" depends on the ignored package "@dotui/types", but "@dotui/core" is not being ignored. Please add "@dotui/core" to the `ignore` option.

@vercel
Copy link

vercel bot commented Dec 19, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
dotui Ready Ready Preview, Comment Dec 21, 2025 2:25am

@github-actions github-actions bot added documentation Improvements or additions to documentation area: www area: ci labels Dec 19, 2025
- Update tsx to ^4.21.0 in all packages (was ^4.19.2)
- Update zod to ^4.1.13 in all packages (was ^4.0.5)
- Resolves workspace dependency version conflicts
Phase 2 of the refactor plan:

- Add Zod schemas for style configuration:
  - colorsConfigSchema (re-export from @dotui/colors)
  - typographyConfigSchema, effectsConfigSchema
  - iconsConfigSchema (uses __registry__/icons.ts as source of truth)
  - variantsConfigSchema (generated from __registry__/variants.ts)
  - themeConfigSchema, styleConfigSchema

- Add style providers:
  - StyleProvider - main provider wrapping theme + variants
  - ThemeProvider - provides theme config and generated theme
  - VariantsProvider - provides variant selection with useVariant() hook

- Add createDynamicComponent factory:
  - Suspense support with DisableSuspense context for React Aria
  - ErrorBoundary for graceful error handling
  - Skeleton fallback during lazy loading

- Update package.json exports for new structure

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
mehdibha and others added 5 commits December 19, 2025 03:02
Phase 3 of the refactor plan:

- Update createDynamicComponent signature to accept `Props extends object`
  and optional variant type parameter `V extends string`
- Update import paths in all 57 components from
  `@dotui/core/utils/...` to `@dotui/core/components/...`
- Update build-registry.ts to include all components (not just 2+ variants)
- Regenerate variants.ts with all 59 components

Type safety maintained: variant components must match DefaultComponent props.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Phase 4 of the refactor plan:

- Update style table: theme/icons/variants columns → single `config` column
- Add `isPreset` column for admin-managed presets
- Simplify typography: heading/body/mono → single `font` field
- Update db package to use @dotui/core for schemas
- Update tRPC router to use new updateStyleConfigSchema
- Update seed files with new StyleConfig structure
- Add CI check for database migrations sync
- Add db-migrate workflow for production deployments

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Port @dotui/transformers to core/shadcn/transforms/
  - types.ts, pipeline.ts, icons.ts, imports.ts
- Port @dotui/shadcn-adapter to core/shadcn/
  - generators: base.ts, all.ts, item.ts, registry.ts, theme.ts
  - transform.ts with transformItemJson, updateFiles, etc.
- Import from internal __registry__ instead of @dotui/registry
  - Eliminates cyclic dependency between core and registry
- Create __registry__/index.ts with combined registry export
- Create registry/src/index.ts for backwards compatibility
- Add shadcn export to core package.json

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Delete packages/shadcn-adapter (now in @dotui/core/shadcn)
- Delete packages/transformers (now in @dotui/core/shadcn/transforms)
- Add core/src/types.ts with runtime types (Style, Variants, etc.)
- Update www to import from @dotui/core/shadcn
- Remove tsconfig path alias for style-system in core
- Update changeset config to remove deleted packages

Note: www typecheck failing - needs updates for new DB schema
(style.config.* instead of style.theme/icons/variants)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add registry/src/providers.tsx (re-exports from style-system)
- Add registry/src/constants.ts (DEFAULT_STYLE, DEFAULT_THEME)
- Update use-update-style-mutation.ts to use config wrapper
- Update use-create-style.ts to use config wrapper

Note: www still has type errors - style-editor needs full refactor
for new StyleConfig schema (colors algorithm change)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
mehdibha and others added 3 commits December 20, 2025 22:29
- Rename _style-editor to style-editor (remove underscore prefix)
- Fix HSL color format for @react-stately/color (requires commas)
- Remove typescript.ignoreBuildErrors from next.config.mjs

Build and typecheck now pass with style-editor included.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Use @dotui/core/__registry__/variants instead of relative import
to fix module resolution on Vercel.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add build script to core package
- Extend internal-package.json for declaration output
- Revert to relative imports in schemas/variants.ts

This ensures core builds before db in turbo, fixing Vercel builds.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
mehdibha and others added 7 commits December 21, 2025 02:31
- Add @dotui/core/* path to core, registry, db, api, and www tsconfigs
- Enable absolute imports across packages following cal.com/midday pattern
- Each package can now import from @dotui/core/* with proper resolution

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…ports

- Update all relative parent imports (../) to use @dotui/core/* absolute paths
- Improves code clarity and enables proper cross-package resolution
- Follows monorepo best practices from cal.com/midday

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Remove build: "tsc" from core, db, and api packages
- These packages don't need to emit declarations
- Fixes cross-package resolution issues during build

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Merge 3 separate scripts into packages/registry/scripts/build.ts
- Generates all registry data in one pass:
  - registry/__generated__/ (blocks, demos, icons)
  - core/__registry__/ (base, hooks, lib, ui, icons, blocks, variants, index)
- Delete old scripts:
  - packages/registry/scripts/build-internal-registry.ts
  - packages/registry/scripts/build-registry.ts
  - scripts/build-registry.ts
- Update package.json build commands
- Fixes issue where rimraf deleted variants.ts

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Regenerate all core/__registry__/ files
- Regenerate registry/__generated__/icons.tsx
- Comment updated to reference new build.ts location

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Fixes CI typecheck failure - auth needs to resolve core's internal imports

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
mehdibha and others added 2 commits December 21, 2025 02:55
- zod 4.1.13 → 4.2.1
- react-hook-form 7.68.0 → 7.69.0
- Fixes Turbopack build error: Can't resolve 'zod/v4/core'

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…react

- Update package from hugeicons-react@0.3.0 to @hugeicons/react@0.4.1
- Fix renamed icons in the new package:
  - TextCheckIcon → ClosedCaptionIcon
  - Shield01Icon → SecurityIcon
  - Activity01Icon → Cardiogram01Icon
  - TableIcon → Table01Icon
- Regenerate registry files with updated imports
- Also includes react-hook-form update to 7.69.0 from previous fix

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@mehdibha mehdibha changed the title refactor(colors): add @dotui/colors to handle theme generation feat: color engine and core style system refactor Dec 21, 2025
@mehdibha mehdibha merged commit 4063dff into main Dec 21, 2025
15 checks passed
@mehdibha mehdibha deleted the color-engine branch December 21, 2025 02:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: ci area: www documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant