Skip to content

improvement(emcn): extract design system into shared @sim/emcn package#5257

Merged
waleedlatif1 merged 1 commit into
stagingfrom
feat/extract-emcn-package
Jun 29, 2026
Merged

improvement(emcn): extract design system into shared @sim/emcn package#5257
waleedlatif1 merged 1 commit into
stagingfrom
feat/extract-emcn-package

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

  • Extracted the emcn design system (177 files) into a shared @sim/emcn package, consumed directly by both apps/sim and apps/docs — one source of truth, no duplication.
  • Moved cn, keyboard, and use-copy-to-clipboard into the package. Rewrote all apps/sim imports to direct @sim/emcn (icons via @sim/emcn/icons, CSS modules via file path); removed the @/components/emcn alias and the old re-export shims.
  • apps/docs now consumes @sim/emcn directly — deleted its hand-rolled chip / chip-dropdown / dropdown-menu mirrors and bridged the few missing CSS tokens.
  • Made ChipModal email validation prop-driven: the design system keeps only a generic syntax gate; app-specific disposable-domain policy (quickValidateEmail) stays in apps/sim and is injected via the field's validate prop (3 invite call sites), preserving behavior.
  • Barrel resolves the Calendar / Table component-vs-icon name collisions explicitly (the icon stays available from @sim/emcn/icons). Updated the import conventions in CLAUDE.md and the rules.

Type of Change

  • Improvement / refactor

Testing

  • apps/sim typecheck: 0 errors
  • apps/docs typecheck: 0 errors
  • @sim/emcn typecheck: 0 errors, 10 tests pass
  • Monorepo + realtime boundary checks pass
  • check:api-validation passes
  • biome clean

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

Moves apps/sim/components/emcn into a shared @sim/emcn package consumed directly by apps/sim and apps/docs. cn/keyboard/use-copy-to-clipboard move into the package; all imports become direct @sim/emcn (icons via @sim/emcn/icons, CSS via file path). ChipModal email validation is now prop-driven (quickValidateEmail stays in apps/sim, injected via validate). Docs drops its local chip/chip-dropdown/dropdown-menu mirrors and consumes @sim/emcn.
@waleedlatif1 waleedlatif1 requested a review from a team as a code owner June 29, 2026 04:48
@greptile-apps

greptile-apps Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Too many files changed for review. (692 files found, 500 file limit)

@vercel

vercel Bot commented Jun 29, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
docs Ready Ready Preview, Comment Jun 29, 2026 4:52am

Request Review

@cursor

cursor Bot commented Jun 29, 2026

Copy link
Copy Markdown

PR Summary

Medium Risk
Very wide import-path churn across the main app and docs raises regression risk for UI bundling and styling, though behavior is intended to stay the same aside from prop-driven ChipModal email validation.

Overview
Extracts the EMCN design system into a workspace @sim/emcn package and rewires apps/sim and apps/docs to import components, cn, handleKeyboardActivation, and useCopyToClipboard from that barrel (icons from @sim/emcn/icons, CSS from package paths) instead of @/components/emcn or local @/lib helpers.

apps/docs drops its duplicated chip/dropdown implementations, adds the @sim/emcn dependency with transpilePackages, and extends global.css tokens so shared chrome renders correctly.

Contributor rules (CLAUDE.md, .claude/.cursor rules) now document @sim/emcn as the canonical import path. Tests and mocks are updated to target @sim/emcn.

Reviewed by Cursor Bugbot for commit c7d4e7f. Configure here.

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cursor review

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit c7d4e7f. Configure here.

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

1 similar comment
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1 waleedlatif1 merged commit bcf6a80 into staging Jun 29, 2026
16 checks passed
@waleedlatif1 waleedlatif1 deleted the feat/extract-emcn-package branch June 29, 2026 05:50
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.

1 participant