[REFACTOR] Twenty UI multi barrel (#11301)

# Introduction
closes https://github.com/twentyhq/core-team-issues/issues/591
Same than for `twenty-shared` made in
https://github.com/twentyhq/twenty/pull/11083.

## TODO
- [x] Manual migrate twenty-website twenty-ui imports

## What's next:
- Generate barrel and migration script factorization within own package
+ tests
- Refactoring using preconstruct ? TimeBox
- Lint circular dependencies
- Lint import from barrel and forbid them

### Preconstruct
We need custom rollup plugins addition, but preconstruct does not expose
its rollup configuration. It might be possible to handle this using the
babel overrides. But was a big tunnel.
We could give it a try afterwards ! ( allowing cjs interop and stuff
like that )
Stuck to vite lib app

Closed related PRs:
- https://github.com/twentyhq/twenty/pull/11294
- https://github.com/twentyhq/twenty/pull/11203
This commit is contained in:
Paul Rastoin
2025-04-03 11:47:55 +02:00
committed by GitHub
parent 8c9fcfe5a4
commit 4a4e65fe4a
1009 changed files with 5757 additions and 2828 deletions
@@ -1,6 +1,5 @@
import IconAddressBookRaw from '@assets/icons/address-book.svg?react';
import { useTheme } from '@emotion/react';
import IconAddressBookRaw from '@ui/display/icon/assets/address-book.svg?react';
import { IconComponentProps } from '@ui/display/icon/types/IconComponent';
type IconAddressBookProps = Pick<
@@ -1,6 +1,6 @@
import { useTheme } from '@emotion/react';
import IconGmailRaw from '@ui/display/icon/assets/gmail.svg?react';
import IconGmailRaw from '@assets/icons/gmail.svg?react';
import { IconComponentProps } from '@ui/display/icon/types/IconComponent';
type IconGmailProps = Pick<IconComponentProps, 'size'>;
@@ -1,6 +1,6 @@
import { useTheme } from '@emotion/react';
import IconGoogleRaw from '@ui/display/icon/assets/google.svg?react';
import IconGoogleRaw from '@assets/icons/google-calendar.svg?react';
import { IconComponentProps } from '@ui/display/icon/types/IconComponent';
type IconGoogleProps = Pick<IconComponentProps, 'size'>;
@@ -1,6 +1,6 @@
import { useTheme } from '@emotion/react';
import IconGoogleCalendarRaw from '@ui/display/icon/assets/google-calendar.svg?react';
import IconGoogleCalendarRaw from '@assets/icons/google-calendar.svg?react';
import { IconComponentProps } from '@ui/display/icon/types/IconComponent';
type IconGoogleCalendarProps = Pick<IconComponentProps, 'size'>;
@@ -1,6 +1,6 @@
import { useTheme } from '@emotion/react';
import IconLockRaw from '@ui/display/icon/assets/lock.svg?react';
import IconLockRaw from '@assets/icons/lock.svg?react';
import { IconComponentProps } from '@ui/display/icon/types/IconComponent';
type IconLockCustomProps = Pick<IconComponentProps, 'size'>;
@@ -1,6 +1,6 @@
import { useTheme } from '@emotion/react';
import IconMicrosoftRaw from '../assets/microsoft.svg?react';
import IconMicrosoftRaw from '@assets/icons/microsoft.svg?react';
interface IconMicrosoftProps {
size?: number | string;
@@ -1,6 +1,6 @@
import { useTheme } from '@emotion/react';
import IconMicrosoftCalendarRaw from '../assets/microsoft-calendar.svg?react';
import IconMicrosoftCalendarRaw from '@assets/icons/microsoft-calendar.svg?react';
interface IconMicrosoftCalendarProps {
size?: number | string;
@@ -1,6 +1,6 @@
import { useTheme } from '@emotion/react';
import IconMicrosoftOutlookRaw from '../assets/microsoft-outlook.svg?react';
import IconMicrosoftOutlookRaw from '@assets/icons/microsoft-outlook.svg?react';
interface IconMicrosoftOutlookProps {
size?: number | string;
@@ -1,6 +1,6 @@
import { useTheme } from '@emotion/react';
import IconRelationManyToOneRaw from '@ui/display/icon/assets/many-to-one.svg?react';
import IconRelationManyToOneRaw from '@assets/icons/many-to-one.svg?react';
import { IconComponentProps } from '@ui/display/icon/types/IconComponent';
type IconRelationManyToOneProps = Pick<IconComponentProps, 'size' | 'stroke'>;
@@ -1,6 +1,6 @@
import { useTheme } from '@emotion/react';
import IconTwentyStarRaw from '@ui/display/icon/assets/twenty-star.svg?react';
import IconTwentyStarRaw from '@assets/icons/twenty-star.svg?react';
import { IconComponentProps } from '@ui/display/icon/types/IconComponent';
type IconTwentyStarProps = Pick<IconComponentProps, 'size' | 'stroke'>;
@@ -1,4 +1,4 @@
import IconTwentyStarFilledRaw from '@ui/display/icon/assets/twenty-star-filled.svg?react';
import IconTwentyStarFilledRaw from '@assets/icons/twenty-star-filled.svg?react';
import { IconComponentProps } from '@ui/display/icon/types/IconComponent';
import { THEME_COMMON } from '@ui/theme';
@@ -1,5 +1,5 @@
import IllustrationIconArrayRaw from '@assets/icons/illustration-array.svg?react';
import { useTheme } from '@emotion/react';
import IllustrationIconArrayRaw from '@ui/display/icon/assets/illustration-array.svg?react';
import { IllustrationIconWrapper } from '@ui/display/icon/components/IllustrationIconWrapper';
import { IconComponentProps } from '@ui/display/icon/types/IconComponent';
type IllustrationIconArrayProps = Pick<IconComponentProps, 'size'>;
@@ -1,5 +1,5 @@
import IllustrationIconCalendarEventRaw from '@assets/icons/illustration-calendar-event.svg?react';
import { useTheme } from '@emotion/react';
import IllustrationIconCalendarEventRaw from '@ui/display/icon/assets/illustration-calendar-event.svg?react';
import { IllustrationIconWrapper } from '@ui/display/icon/components/IllustrationIconWrapper';
import { IconComponentProps } from '@ui/display/icon/types/IconComponent';
type IllustrationIconCalendarEventProps = Pick<IconComponentProps, 'size'>;
@@ -1,5 +1,5 @@
import IllustrationIconCalendarTimeRaw from '@assets/icons/illustration-calendar-time.svg?react';
import { useTheme } from '@emotion/react';
import IllustrationIconCalendarTimeRaw from '@ui/display/icon/assets/illustration-calendar-time.svg?react';
import { IllustrationIconWrapper } from '@ui/display/icon/components/IllustrationIconWrapper';
import { IconComponentProps } from '@ui/display/icon/types/IconComponent';
@@ -1,7 +1,7 @@
import { useTheme } from '@emotion/react';
import { IllustrationIconWrapper } from '@ui/display/icon/components/IllustrationIconWrapper';
import IllustrationIconCurrencyRaw from '@ui/display/icon/assets/illustration-currency.svg?react';
import IllustrationIconCurrencyRaw from '@assets/icons/illustration-currency.svg?react';
import { IconComponentProps } from '@ui/display/icon/types/IconComponent';
type IllustrationIconCurrencyProps = Pick<IconComponentProps, 'size'>;
@@ -1,7 +1,7 @@
import { useTheme } from '@emotion/react';
import { IllustrationIconWrapper } from '@ui/display/icon/components/IllustrationIconWrapper';
import IllustrationIconJsonRaw from '@ui/display/icon/assets/illustration-json.svg?react';
import IllustrationIconJsonRaw from '@assets/icons/illustration-json.svg?react';
import { IconComponentProps } from '@ui/display/icon/types/IconComponent';
type IllustrationIconJsonProps = Pick<IconComponentProps, 'size'>;
@@ -1,7 +1,7 @@
import { useTheme } from '@emotion/react';
import { IllustrationIconWrapper } from '@ui/display/icon/components/IllustrationIconWrapper';
import IllustrationIconLinkRaw from '@ui/display/icon/assets/illustration-link.svg?react';
import IllustrationIconLinkRaw from '@assets/icons/illustration-link.svg?react';
import { IconComponentProps } from '@ui/display/icon/types/IconComponent';
type IllustrationIconLinkProps = Pick<IconComponentProps, 'size'>;
@@ -1,5 +1,5 @@
import IllustrationIconMailRaw from '@assets/icons/illustration-mail.svg?react';
import { useTheme } from '@emotion/react';
import IllustrationIconMailRaw from '@ui/display/icon/assets/illustration-mail.svg?react';
import { IllustrationIconWrapper } from '@ui/display/icon/components/IllustrationIconWrapper';
import { IconComponentProps } from '@ui/display/icon/types/IconComponent';
@@ -1,5 +1,5 @@
import IllustrationIconManyToManyRaw from '@assets/icons/illustration-many-to-many.svg?react';
import { useTheme } from '@emotion/react';
import IllustrationIconManyToManyRaw from '@ui/display/icon/assets/illustration-many-to-many.svg?react';
import { IllustrationIconWrapper } from '@ui/display/icon/components/IllustrationIconWrapper';
import { IconComponentProps } from '@ui/display/icon/types/IconComponent';
@@ -1,5 +1,5 @@
import IllustrationIconMapRaw from '@assets/icons/illustration-map.svg?react';
import { useTheme } from '@emotion/react';
import IllustrationIconMapRaw from '@ui/display/icon/assets/illustration-map.svg?react';
import { IllustrationIconWrapper } from '@ui/display/icon/components/IllustrationIconWrapper';
import { IconComponentProps } from '@ui/display/icon/types/IconComponent';
@@ -1,5 +1,5 @@
import IllustrationIconNumbersRaw from '@assets/icons/illustration-numbers.svg?react';
import { useTheme } from '@emotion/react';
import IllustrationIconNumbersRaw from '@ui/display/icon/assets/illustration-numbers.svg?react';
import { IllustrationIconWrapper } from '@ui/display/icon/components/IllustrationIconWrapper';
import { IconComponentProps } from '@ui/display/icon/types/IconComponent';
@@ -1,7 +1,7 @@
import { useTheme } from '@emotion/react';
import { IllustrationIconWrapper } from '@ui/display/icon/components/IllustrationIconWrapper';
import IllustrationIconOneToManyRaw from '@ui/display/icon/assets/illustration-one-to-many.svg?react';
import IllustrationIconOneToManyRaw from '@assets/icons/illustration-one-to-many.svg?react';
import { IconComponentProps } from '@ui/display/icon/types/IconComponent';
type IllustrationIconOneToManyProps = Pick<IconComponentProps, 'size'>;
@@ -1,7 +1,7 @@
import { useTheme } from '@emotion/react';
import { IllustrationIconWrapper } from '@ui/display/icon/components/IllustrationIconWrapper';
import IllustrationIconOneToOneRaw from '@ui/display/icon/assets/illustration-one-to-one.svg?react';
import IllustrationIconOneToOneRaw from '@assets/icons/illustration-one-to-one.svg?react';
import { IconComponentProps } from '@ui/display/icon/types/IconComponent';
type IllustrationIconOneToOneProps = Pick<IconComponentProps, 'size'>;
@@ -1,7 +1,7 @@
import { useTheme } from '@emotion/react';
import { IllustrationIconWrapper } from '@ui/display/icon/components/IllustrationIconWrapper';
import IllustrationIconPhoneRaw from '@ui/display/icon/assets/illustration-phone.svg?react';
import IllustrationIconPhoneRaw from '@assets/icons/illustration-phone.svg?react';
import { IconComponentProps } from '@ui/display/icon/types/IconComponent';
type IllustrationIconPhoneProps = Pick<IconComponentProps, 'size'>;
@@ -1,7 +1,7 @@
import { useTheme } from '@emotion/react';
import { IllustrationIconWrapper } from '@ui/display/icon/components/IllustrationIconWrapper';
import IllustrationIconSettingRaw from '@ui/display/icon/assets/illustration-setting.svg?react';
import IllustrationIconSettingRaw from '@assets/icons/illustration-setting.svg?react';
import { IconComponentProps } from '@ui/display/icon/types/IconComponent';
type IllustrationIconSettingProps = Pick<IconComponentProps, 'size'>;
@@ -1,7 +1,7 @@
import { useTheme } from '@emotion/react';
import { IllustrationIconWrapper } from '@ui/display/icon/components/IllustrationIconWrapper';
import IllustrationIconStarRaw from '@ui/display/icon/assets/illustration-star.svg?react';
import IllustrationIconStarRaw from '@assets/icons/illustration-star.svg?react';
import { IconComponentProps } from '@ui/display/icon/types/IconComponent';
type IllustrationIconStarProps = Pick<IconComponentProps, 'size'>;
@@ -1,7 +1,7 @@
import { useTheme } from '@emotion/react';
import { IllustrationIconWrapper } from '@ui/display/icon/components/IllustrationIconWrapper';
import IllustrationIconTagRaw from '@ui/display/icon/assets/illustration-tag.svg?react';
import IllustrationIconTagRaw from '@assets/icons/illustration-tag.svg?react';
import { IconComponentProps } from '@ui/display/icon/types/IconComponent';
type IllustrationIconTagProps = Pick<IconComponentProps, 'size'>;
@@ -1,7 +1,7 @@
import { useTheme } from '@emotion/react';
import { IllustrationIconWrapper } from '@ui/display/icon/components/IllustrationIconWrapper';
import IllustrationIconTagsRaw from '@ui/display/icon/assets/illustration-tags.svg?react';
import IllustrationIconTagsRaw from '@assets/icons/illustration-tags.svg?react';
import { IconComponentProps } from '@ui/display/icon/types/IconComponent';
type IllustrationIconTagsProps = Pick<IconComponentProps, 'size'>;
@@ -1,7 +1,7 @@
import { useTheme } from '@emotion/react';
import { IllustrationIconWrapper } from '@ui/display/icon/components/IllustrationIconWrapper';
import IllustrationIconTextRaw from '@ui/display/icon/assets/illustration-text.svg?react';
import IllustrationIconTextRaw from '@assets/icons/illustration-text.svg?react';
import { IconComponentProps } from '@ui/display/icon/types/IconComponent';
type IllustrationIconTextProps = Pick<IconComponentProps, 'size'>;
@@ -1,7 +1,7 @@
import { useTheme } from '@emotion/react';
import { IllustrationIconWrapper } from '@ui/display/icon/components/IllustrationIconWrapper';
import IllustrationIconToggleRaw from '@ui/display/icon/assets/illustration-toggle.svg?react';
import IllustrationIconToggleRaw from '@assets/icons/illustration-toggle.svg?react';
import { IconComponentProps } from '@ui/display/icon/types/IconComponent';
type IllustrationIconToggleProps = Pick<IconComponentProps, 'size'>;
@@ -1,7 +1,7 @@
import { useTheme } from '@emotion/react';
import { IllustrationIconWrapper } from '@ui/display/icon/components/IllustrationIconWrapper';
import IllustrationIconUidRaw from '@ui/display/icon/assets/illustration-uid.svg?react';
import IllustrationIconUidRaw from '@assets/icons/illustration-uid.svg?react';
import { IconComponentProps } from '@ui/display/icon/types/IconComponent';
type IllustrationIconUidProps = Pick<IconComponentProps, 'size'>;
@@ -1,7 +1,7 @@
import { useTheme } from '@emotion/react';
import { IllustrationIconWrapper } from '@ui/display/icon/components/IllustrationIconWrapper';
import IllustrationIconUserRaw from '@ui/display/icon/assets/illustration-user.svg?react';
import IllustrationIconUserRaw from '@assets/icons/illustration-user.svg?react';
import { IconComponentProps } from '@ui/display/icon/types/IconComponent';
type IllustrationIconUserProps = Pick<IconComponentProps, 'size'>;
@@ -4,18 +4,18 @@ export {
IconAlertCircle,
IconAlertTriangle,
IconApi,
IconApps,
IconAppWindow,
IconApps,
IconArchive,
IconArchiveOff,
IconArrowBackUp,
IconArrowDown,
IconArrowLeft,
IconArrowRight,
IconArrowsDiagonal,
IconArrowsVertical,
IconArrowUp,
IconArrowUpRight,
IconArrowsDiagonal,
IconArrowsVertical,
IconAt,
IconBaselineDensitySmall,
IconBell,
@@ -47,8 +47,8 @@ export {
IconChevronDown,
IconChevronLeft,
IconChevronRight,
IconChevronsRight,
IconChevronUp,
IconChevronsRight,
IconCircleDot,
IconCircleOff,
IconCirclePlus,
@@ -293,6 +293,7 @@ export {
IconVariable,
IconVariablePlus,
IconVersions,
IconVersionsOff,
IconVideo,
IconWand,
IconWebhook,