[CHORE] Avoid isDefined duplicated reference, move it to twenty-shared (#9967)

# Introduction
Avoid having multiple `isDefined` definition across our pacakges
Also avoid importing `isDefined` from `twenty-ui` which exposes a huge
barrel for a such little util function

## In a nutshell
Removed own `isDefined.ts` definition from `twenty-ui` `twenty-front`
and `twenty-server` to move it to `twenty-shared`.
Updated imports for each packages, and added explicit dependencies to
`twenty-shared` if not already in place

Related PR https://github.com/twentyhq/twenty/pull/9941
This commit is contained in:
Paul Rastoin
2025-02-01 12:10:10 +01:00
committed by GitHub
parent d9b86475d3
commit 7fd89678b7
559 changed files with 731 additions and 770 deletions

View File

@ -11,7 +11,8 @@ import { StepOutputSchema } from '@/workflow/workflow-variables/types/StepOutput
import { useTheme } from '@emotion/react';
import styled from '@emotion/styled';
import { useState } from 'react';
import { IconVariablePlus, isDefined } from 'twenty-ui';
import { isDefined } from 'twenty-shared';
import { IconVariablePlus } from 'twenty-ui';
const StyledDropdownVariableButtonContainer = styled(
StyledDropdownButtonContainer,

View File

@ -19,9 +19,9 @@ import { getStepHeaderLabel } from '@/workflow/workflow-variables/utils/getStepH
import { isLinkOutputSchema } from '@/workflow/workflow-variables/utils/isLinkOutputSchema';
import { useState } from 'react';
import { useSetRecoilState } from 'recoil';
import { isDefined } from 'twenty-shared';
import {
IconChevronLeft,
isDefined,
MenuItemSelect,
OverflowingTextWithTooltip,
useIcons,

View File

@ -13,7 +13,7 @@ import { filterOutputSchema } from '@/workflow/workflow-variables/utils/filterOu
import { getTriggerStepName } from '@/workflow/workflow-variables/utils/getTriggerStepName';
import isEmpty from 'lodash.isempty';
import { useRecoilValue } from 'recoil';
import { isDefined } from 'twenty-ui';
import { isDefined } from 'twenty-shared';
import { isEmptyObject } from '~/utils/isEmptyObject';
export const useAvailableVariablesInWorkflowStep = ({

View File

@ -1,4 +1,4 @@
import { isDefined } from 'twenty-ui';
import { isDefined } from 'twenty-shared';
const CAPTURE_ALL_VARIABLE_TAG_INNER_REGEX = /{{([^{}]+)}}/g;

View File

@ -6,7 +6,7 @@ import {
import { isBaseOutputSchema } from '@/workflow/workflow-variables/utils/isBaseOutputSchema';
import { isLinkOutputSchema } from '@/workflow/workflow-variables/utils/isLinkOutputSchema';
import { isRecordOutputSchema } from '@/workflow/workflow-variables/utils/isRecordOutputSchema';
import { isDefined } from 'twenty-ui';
import { isDefined } from 'twenty-shared';
const isValidRecordOutputSchema = (
outputSchema: RecordOutputSchema,

View File

@ -2,7 +2,7 @@ import { StepOutputSchema } from '@/workflow/workflow-variables/types/StepOutput
import { getCurrentSubStepFromPath } from '@/workflow/workflow-variables/utils/getCurrentSubStepFromPath';
import { isBaseOutputSchema } from '@/workflow/workflow-variables/utils/isBaseOutputSchema';
import { isRecordOutputSchema } from '@/workflow/workflow-variables/utils/isRecordOutputSchema';
import { isDefined } from '~/utils/isDefined';
import { isDefined } from 'twenty-shared';
export const getStepHeaderLabel = (
step: StepOutputSchema,

View File

@ -4,8 +4,7 @@ import {
} from '@/workflow/types/Workflow';
import { assertUnreachable } from '@/workflow/utils/assertUnreachable';
import { getTriggerDefaultLabel } from '@/workflow/workflow-trigger/utils/getTriggerLabel';
import { capitalize } from 'twenty-shared';
import { isDefined } from 'twenty-ui';
import { capitalize, isDefined } from 'twenty-shared';
export const getTriggerStepName = (trigger: WorkflowTrigger): string => {
switch (trigger.type) {

View File

@ -1,5 +1,5 @@
import { JSONContent } from '@tiptap/react';
import { isDefined } from 'twenty-ui';
import { isDefined } from 'twenty-shared';
export const parseEditorContent = (json: JSONContent): string => {
const parseNode = (node: JSONContent): string => {