From 9417da241f5143cff7cebe6185bbcab8373796c3 Mon Sep 17 00:00:00 2001 From: waleed Date: Mon, 29 Jun 2026 09:17:51 -0700 Subject: [PATCH] fix(emcn): resolve Calendar icon/component barrel collision and preserve prism side effects Two post-extraction regressions: 1. The barrel resolves the Calendar name-collision to the date-picker COMPONENT (symmetric with Table). Scheduled-tasks imported Calendar from the barrel but used it as an ICON, so its header rendered a date picker. Route the icon consumers (scheduled-tasks + loading) to @sim/emcn/icons, matching the 'icons come from the /icons subpath' convention. 2. The package's new sideEffects: ['**/*.css'] marked code/prism.ts as side-effect-free, but it registers prismjs languages on the global Prism (a real JS side effect). The bundler could drop/reorder its core init, causing 'Prism is not defined'. Add code/prism.ts to sideEffects so the bundler preserves it. --- .../app/workspace/[workspaceId]/scheduled-tasks/loading.tsx | 2 +- .../[workspaceId]/scheduled-tasks/scheduled-tasks.tsx | 2 +- packages/emcn/package.json | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/apps/sim/app/workspace/[workspaceId]/scheduled-tasks/loading.tsx b/apps/sim/app/workspace/[workspaceId]/scheduled-tasks/loading.tsx index cc55388d8a7..6f3c7c88618 100644 --- a/apps/sim/app/workspace/[workspaceId]/scheduled-tasks/loading.tsx +++ b/apps/sim/app/workspace/[workspaceId]/scheduled-tasks/loading.tsx @@ -1,6 +1,6 @@ 'use client' -import { Calendar, Plus } from '@sim/emcn' +import { Calendar, Plus } from '@sim/emcn/icons' import { type ChromeActionSpec, ResourceChromeFallback, diff --git a/apps/sim/app/workspace/[workspaceId]/scheduled-tasks/scheduled-tasks.tsx b/apps/sim/app/workspace/[workspaceId]/scheduled-tasks/scheduled-tasks.tsx index e671c9e4e8f..8f3410fe014 100644 --- a/apps/sim/app/workspace/[workspaceId]/scheduled-tasks/scheduled-tasks.tsx +++ b/apps/sim/app/workspace/[workspaceId]/scheduled-tasks/scheduled-tasks.tsx @@ -1,7 +1,7 @@ 'use client' import { useCallback, useMemo, useState } from 'react' -import { Calendar, Plus } from '@sim/emcn' +import { Calendar, Plus } from '@sim/emcn/icons' import { useParams } from 'next/navigation' import type { ResourceAction } from '@/app/workspace/[workspaceId]/components' import { Resource } from '@/app/workspace/[workspaceId]/components' diff --git a/packages/emcn/package.json b/packages/emcn/package.json index 85d7b1de694..e2e73281ec5 100644 --- a/packages/emcn/package.json +++ b/packages/emcn/package.json @@ -3,7 +3,8 @@ "version": "0.1.0", "private": true, "sideEffects": [ - "**/*.css" + "**/*.css", + "**/components/code/prism.ts" ], "type": "module", "license": "Apache-2.0",