[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:
@ -9,7 +9,7 @@ import { ComponentInstanceStateContext } from '@/ui/utilities/state/component-st
|
||||
import { globalComponentInstanceContextMap } from '@/ui/utilities/state/component-state/utils/globalComponentInstanceContextMap';
|
||||
import { SelectorGetter } from '@/ui/utilities/state/types/SelectorGetter';
|
||||
import { SelectorSetter } from '@/ui/utilities/state/types/SelectorSetter';
|
||||
import { isDefined } from 'twenty-ui';
|
||||
import { isDefined } from 'twenty-shared';
|
||||
|
||||
export function createComponentFamilySelectorV2<
|
||||
ValueType,
|
||||
|
||||
@ -11,7 +11,7 @@ import {
|
||||
WrappedValue,
|
||||
} from 'recoil';
|
||||
|
||||
import { isDefined } from 'twenty-ui';
|
||||
import { isDefined } from 'twenty-shared';
|
||||
|
||||
type CreateComponentFamilyStateArgs<
|
||||
ValueType,
|
||||
|
||||
@ -9,7 +9,7 @@ import { ComponentStateKeyV2 } from '@/ui/utilities/state/component-state/types/
|
||||
import { globalComponentInstanceContextMap } from '@/ui/utilities/state/component-state/utils/globalComponentInstanceContextMap';
|
||||
import { SelectorGetter } from '@/ui/utilities/state/types/SelectorGetter';
|
||||
import { SelectorSetter } from '@/ui/utilities/state/types/SelectorSetter';
|
||||
import { isDefined } from 'twenty-ui';
|
||||
import { isDefined } from 'twenty-shared';
|
||||
|
||||
export function createComponentSelectorV2<ValueType>(options: {
|
||||
key: string;
|
||||
|
||||
@ -4,7 +4,7 @@ import { ComponentStateV2 } from '@/ui/utilities/state/component-state/types/Com
|
||||
import { globalComponentInstanceContextMap } from '@/ui/utilities/state/component-state/utils/globalComponentInstanceContextMap';
|
||||
import { AtomEffect, atomFamily } from 'recoil';
|
||||
|
||||
import { isDefined } from '~/utils/isDefined';
|
||||
import { isDefined } from 'twenty-shared';
|
||||
|
||||
type CreateComponentInstanceStateArgs<ValueType> = {
|
||||
key: string;
|
||||
|
||||
@ -4,7 +4,7 @@ import { ScopeInternalContext } from '@/ui/utilities/recoil-scope/scopes-interna
|
||||
|
||||
import { RecoilComponentState } from '@/ui/utilities/state/component-state/types/RecoilComponentState';
|
||||
import { RecoilComponentStateKey } from '@/ui/utilities/state/component-state/types/RecoilComponentStateKey';
|
||||
import { isDefined } from '~/utils/isDefined';
|
||||
import { isDefined } from 'twenty-shared';
|
||||
|
||||
type CreateComponentStateV2Type<ValueType> = {
|
||||
key: string;
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { ComponentInstanceStateContext } from '@/ui/utilities/state/component-state/types/ComponentInstanceStateContext';
|
||||
import { isDefined } from 'twenty-ui';
|
||||
import { isDefined } from 'twenty-shared';
|
||||
|
||||
class ComponentInstanceContextMap {
|
||||
constructor() {
|
||||
|
||||
Reference in New Issue
Block a user