Skip to content

Commit 9c5c0d4

Browse files
committed
fix(emcn): repair app-wide crash and unstyled UI after package extraction
Two regressions from moving emcn into @sim/emcn: 1. optimizePackageImports['@sim/emcn'] rewrote barrel imports to direct subpaths, duplicating the toast module so ToastProvider (layout) and useToast (workspace permissions provider) resolved different ToastContext objects — useToast threw 'must be used within <ToastProvider>' on every workspace route. Removed @sim/emcn from optimizePackageImports. 2. emcn's source left apps/sim's Tailwind content globs (and docs' v4 auto-content scope, which excludes node_modules), so utility classes used only inside emcn components stopped generating and components rendered unstyled. Added the package to apps/sim's Tailwind content and a @source to docs.
1 parent bcf6a80 commit 9c5c0d4

3 files changed

Lines changed: 2 additions & 1 deletion

File tree

apps/docs/app/global.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
@import "fumadocs-ui/css/neutral.css";
33
@import "fumadocs-ui/css/preset.css";
44
@import "fumadocs-openapi/css/preset.css";
5+
@source "../../../packages/emcn/src";
56

67
/* Prevent overscroll bounce effect on the page */
78
html,

apps/sim/next.config.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,6 @@ const nextConfig: NextConfig = {
133133
optimizeCss: true,
134134
preloadEntriesOnStart: false,
135135
optimizePackageImports: [
136-
'@sim/emcn',
137136
'lodash',
138137
'framer-motion',
139138
'reactflow',

apps/sim/tailwind.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ export default {
66
'./pages/**/*.{js,ts,jsx,tsx,mdx}',
77
'./components/**/*.{js,ts,jsx,tsx,mdx}',
88
'./app/**/*.{js,ts,jsx,tsx,mdx}',
9+
'../../packages/emcn/src/**/*.{js,ts,jsx,tsx}',
910
'!./app/node_modules/**',
1011
'!**/node_modules/**',
1112
],

0 commit comments

Comments
 (0)