Skip to content

Commit f5116f4

Browse files
authored
fix(emcn): resolve Calendar icon/component barrel collision and preserve prism side effects (#5261)
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.
1 parent 6dea1dc commit f5116f4

3 files changed

Lines changed: 4 additions & 3 deletions

File tree

apps/sim/app/workspace/[workspaceId]/scheduled-tasks/loading.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use client'
22

3-
import { Calendar, Plus } from '@sim/emcn'
3+
import { Calendar, Plus } from '@sim/emcn/icons'
44
import {
55
type ChromeActionSpec,
66
ResourceChromeFallback,

apps/sim/app/workspace/[workspaceId]/scheduled-tasks/scheduled-tasks.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
'use client'
22

33
import { useCallback, useMemo, useState } from 'react'
4-
import { Calendar, Plus } from '@sim/emcn'
4+
import { Calendar, Plus } from '@sim/emcn/icons'
55
import { useParams } from 'next/navigation'
66
import type { ResourceAction } from '@/app/workspace/[workspaceId]/components'
77
import { Resource } from '@/app/workspace/[workspaceId]/components'

packages/emcn/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
"version": "0.1.0",
44
"private": true,
55
"sideEffects": [
6-
"**/*.css"
6+
"**/*.css",
7+
"**/components/code/prism.ts"
78
],
89
"type": "module",
910
"license": "Apache-2.0",

0 commit comments

Comments
 (0)