Run yarn dedupe and upgrade TS (#13853)

Upgrading TS to the latest version, and cleaning up packages with yarn
dedupe
This commit is contained in:
Félix Malfait 2025-08-12 15:18:59 +02:00 committed by GitHub
parent 62352901ba
commit 3c0f3fd2ae
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
17 changed files with 330 additions and 4909 deletions

View file

@ -49,5 +49,6 @@
"files.associations": {
".cursorrules": "markdown"
},
"jestrunner.codeLensSelector": "**/*.{test,spec,integration-spec}.{js,jsx,ts,tsx}"
"jestrunner.codeLensSelector": "**/*.{test,spec,integration-spec}.{js,jsx,ts,tsx}",
"typescript.tsdk": "node_modules/typescript/lib"
}

View file

@ -66,9 +66,9 @@
"slash": "^5.1.0",
"storybook-addon-mock-date": "^0.6.0",
"ts-key-enum": "^2.0.12",
"tslib": "^2.3.0",
"tslib": "^2.8.1",
"type-fest": "4.10.1",
"typescript": "5.3.3",
"typescript": "5.9.2",
"uuid": "^9.0.0",
"vite-tsconfig-paths": "^4.2.1",
"xlsx-ugnis": "^0.19.3",
@ -221,7 +221,7 @@
"resolutions": {
"graphql": "16.8.0",
"type-fest": "4.10.1",
"typescript": "5.3.3",
"typescript": "5.9.2",
"graphql-redis-subscriptions/ioredis": "^5.6.0",
"prosemirror-view": "1.40.0",
"prosemirror-transform": "1.10.4"

View file

@ -1,4 +1,5 @@
import { type ThemeType } from 'twenty-ui/theme';
declare module '@emotion/react' {
export interface Theme extends ThemeType {}
}

View file

@ -4227,7 +4227,7 @@ export type DeleteOneFieldMetadataItemMutation = { __typename?: 'Mutation', dele
export type ObjectMetadataItemsQueryVariables = Exact<{ [key: string]: never; }>;
export type ObjectMetadataItemsQuery = { __typename?: 'Query', objects: { __typename?: 'ObjectConnection', edges: Array<{ __typename?: 'ObjectEdge', node: { __typename?: 'Object', id: string, dataSourceId: string, nameSingular: string, namePlural: string, labelSingular: string, labelPlural: string, description?: string | null, icon?: string | null, isCustom: boolean, isRemote: boolean, isActive: boolean, isSystem: boolean, createdAt: string, updatedAt: string, labelIdentifierFieldMetadataId?: string | null, imageIdentifierFieldMetadataId?: string | null, shortcut?: string | null, isLabelSyncedWithName: boolean, isSearchable: boolean, duplicateCriteria?: Array<Array<string>> | null, indexMetadataList: Array<{ __typename?: 'Index', id: string, createdAt: string, updatedAt: string, name: string, indexWhereClause?: string | null, indexType: IndexType, isUnique: boolean, indexFieldMetadataList: Array<{ __typename?: 'IndexField', id: string, fieldMetadataId: string, createdAt: string, updatedAt: string, order: number }> }>, fieldsList: Array<{ __typename?: 'Field', id: string, type: FieldMetadataType, name: string, label: string, description?: string | null, icon?: string | null, isCustom?: boolean | null, isActive?: boolean | null, isSystem?: boolean | null, isNullable?: boolean | null, isUnique?: boolean | null, createdAt: string, updatedAt: string, defaultValue?: any | null, options?: any | null, settings?: any | null, isLabelSyncedWithName?: boolean | null, relation?: { __typename?: 'Relation', type: RelationType, sourceObjectMetadata: { __typename?: 'Object', id: string, nameSingular: string, namePlural: string }, targetObjectMetadata: { __typename?: 'Object', id: string, nameSingular: string, namePlural: string }, sourceFieldMetadata: { __typename?: 'Field', id: string, name: string }, targetFieldMetadata: { __typename?: 'Field', id: string, name: string } } | null }> } }>, pageInfo: { __typename?: 'PageInfo', hasNextPage?: boolean | null, hasPreviousPage?: boolean | null, startCursor?: any | null, endCursor?: any | null } } };
export type ObjectMetadataItemsQuery = { __typename?: 'Query', objects: { __typename?: 'ObjectConnection', edges: Array<{ __typename?: 'ObjectEdge', node: { __typename?: 'Object', id: string, dataSourceId: string, nameSingular: string, namePlural: string, labelSingular: string, labelPlural: string, description?: string | null, icon?: string | null, isCustom: boolean, isRemote: boolean, isActive: boolean, isSystem: boolean, createdAt: string, updatedAt: string, labelIdentifierFieldMetadataId?: string | null, imageIdentifierFieldMetadataId?: string | null, shortcut?: string | null, isLabelSyncedWithName: boolean, isSearchable: boolean, duplicateCriteria?: Array<Array<string>> | null, indexMetadataList: Array<{ __typename?: 'Index', id: string, createdAt: string, updatedAt: string, name: string, indexWhereClause?: string | null, indexType: IndexType, isUnique: boolean, indexFieldMetadataList: Array<{ __typename?: 'IndexField', id: string, fieldMetadataId: string, createdAt: string, updatedAt: string, order: number }> }>, fieldsList: Array<{ __typename?: 'Field', id: string, type: FieldMetadataType, name: string, label: string, description?: string | null, icon?: string | null, isCustom?: boolean | null, isActive?: boolean | null, isSystem?: boolean | null, isNullable?: boolean | null, isUnique?: boolean | null, createdAt: string, updatedAt: string, defaultValue?: any | null, options?: any | null, settings?: any | null, isLabelSyncedWithName?: boolean | null, relation?: { __typename?: 'Relation', type: RelationType, sourceObjectMetadata: { __typename?: 'Object', id: string, nameSingular: string, namePlural: string }, targetObjectMetadata: { __typename?: 'Object', id: string, nameSingular: string, namePlural: string }, sourceFieldMetadata: { __typename?: 'Field', id: string, name: string }, targetFieldMetadata: { __typename?: 'Field', id: string, name: string } } | null, morphRelations?: Array<{ __typename?: 'Relation', type: RelationType, sourceObjectMetadata: { __typename?: 'Object', id: string, nameSingular: string, namePlural: string }, targetObjectMetadata: { __typename?: 'Object', id: string, nameSingular: string, namePlural: string }, sourceFieldMetadata: { __typename?: 'Field', id: string, name: string }, targetFieldMetadata: { __typename?: 'Field', id: string, name: string } }> | null }> } }>, pageInfo: { __typename?: 'PageInfo', hasNextPage?: boolean | null, hasPreviousPage?: boolean | null, startCursor?: any | null, endCursor?: any | null } } };
export type SkipBookOnboardingStepMutationVariables = Exact<{ [key: string]: never; }>;
@ -7669,6 +7669,27 @@ export const ObjectMetadataItemsDocument = gql`
name
}
}
morphRelations {
type
sourceObjectMetadata {
id
nameSingular
namePlural
}
targetObjectMetadata {
id
nameSingular
namePlural
}
sourceFieldMetadata {
id
name
}
targetFieldMetadata {
id
name
}
}
}
}
}

View file

@ -14,12 +14,13 @@ export type FieldMetadataItemOption = {
export type FieldMetadataItem = Omit<
Field,
'__typename' | 'defaultValue' | 'options' | 'relation'
'__typename' | 'defaultValue' | 'options' | 'relation' | 'morphRelations'
> & {
__typename?: string;
defaultValue?: any;
options?: FieldMetadataItemOption[] | null;
relation?: FieldMetadataItemRelation | null;
morphRelations?: FieldMetadataItemRelation[] | null;
settings?: FieldDateMetadataSettings;
isLabelSyncedWithName?: boolean | null;
};

View file

@ -331,11 +331,10 @@ type DatePickerPropsType = ReactDatePickerLibProps<
boolean | undefined
>;
const ReactDatePicker = lazy(
() =>
import('react-datepicker') as Promise<{
default: ComponentType<DatePickerPropsType>;
}>,
const ReactDatePicker = lazy<ComponentType<DatePickerPropsType>>(() =>
import('react-datepicker').then((mod) => ({
default: mod.default as unknown as ComponentType<DatePickerPropsType>,
})),
);
export const DateTimePicker = ({

View file

@ -96,7 +96,7 @@
"dataloader": "2.2.2",
"date-fns": "2.30.0",
"deep-equal": "2.2.3",
"dompurify": "3.1.6",
"dompurify": "3.2.6",
"dotenv": "16.4.5",
"express": "4.21.2",
"express-session": "^1.18.1",
@ -119,7 +119,7 @@
"handlebars": "^4.7.8",
"imapflow": "1.0.187",
"ioredis": "5.6.0",
"jsdom": "~22.1.0",
"jsdom": "^26.1.0",
"json-schema": "0.4.0",
"jsonc-eslint-parser": "2.4.0",
"jsonwebtoken": "9.0.2",
@ -178,7 +178,7 @@
"tslib": "2.8.1",
"type-fest": "4.10.1",
"typeorm": "patch:typeorm@0.3.20#./patches/typeorm+0.3.20.patch",
"typescript": "5.3.3",
"typescript": "5.9.2",
"unzipper": "^0.12.3",
"uuid": "9.0.1",
"vite-tsconfig-paths": "4.3.2",
@ -228,7 +228,7 @@
"rimraf": "^5.0.5",
"twenty-emails": "workspace:*",
"twenty-shared": "workspace:*",
"typescript": "5.3.3"
"typescript": "5.9.2"
},
"engines": {
"node": "^24.5.0",

View file

@ -1,10 +1,10 @@
import {
type GraphQLResolveInfo,
type SelectionSetNode,
Kind,
type SelectionNode,
type FieldNode,
type GraphQLResolveInfo,
type InlineFragmentNode,
type SelectionNode,
type SelectionSetNode,
type ValueNode,
} from 'graphql';
@ -60,6 +60,7 @@ const parseValueNode = (
case Kind.ENUM:
return valueNode.value;
case Kind.LIST:
// @ts-expect-error legacy noImplicitAny
return valueNode.values.map((value) => parseValueNode(value, variables));
case Kind.OBJECT:
return valueNode.fields.reduce((obj, field) => {

View file

@ -45,6 +45,7 @@ export class InputTypeDefinitionFactory {
const inputType = new GraphQLInputObjectType({
name: `${pascalCase(objectMetadata.nameSingular)}${kind.toString()}Input`,
description: objectMetadata.description,
// @ts-expect-error legacy noImplicitAny
fields: () => {
switch (kind) {
/**

View file

@ -54,9 +54,7 @@ export const cleanGraphQLResponse = (input: any) => {
// @ts-expect-error legacy noImplicitAny
output.data[key] = cleanObject(input[key]);
} else if (Array.isArray(input[key])) {
// @ts-expect-error legacy noImplicitAny
const itemsWithEdges = input[key].filter((item) => item.edges);
// @ts-expect-error legacy noImplicitAny
const cleanedObjArray = itemsWithEdges.map(({ edges, ...item }) => {
return {
...item,

View file

@ -3,7 +3,6 @@ import { Injectable } from '@nestjs/common';
import DOMPurify from 'dompurify';
import FileType from 'file-type';
import { JSDOM } from 'jsdom';
import sharp from 'sharp';
import { v4 } from 'uuid';
@ -12,8 +11,8 @@ import { type FileFolder } from 'src/engine/core-modules/file/interfaces/file-fo
import { settings } from 'src/engine/constants/settings';
import { FileStorageService } from 'src/engine/core-modules/file-storage/file-storage.service';
import { FileService } from 'src/engine/core-modules/file/services/file.service';
import { getCropSize, getImageBufferFromUrl } from 'src/utils/image';
import { buildFileInfo } from 'src/engine/core-modules/file/utils/build-file-info.utils';
import { getCropSize, getImageBufferFromUrl } from 'src/utils/image';
export type SignedFile = { path: string; token: string };
@ -60,6 +59,7 @@ export class FileUploadService {
mimeType: string | undefined;
}): Buffer | Uint8Array | string {
if (ext === 'svg' || mimeType === 'image/svg+xml') {
const { JSDOM } = require('jsdom');
const window = new JSDOM('').window;
const purify = DOMPurify(window);

View file

@ -1,7 +1,6 @@
import { Injectable, Logger } from '@nestjs/common';
import DOMPurify from 'dompurify';
import { JSDOM } from 'jsdom';
import { isDefined, isValidUuid } from 'twenty-shared/utils';
import { z } from 'zod';
@ -116,6 +115,7 @@ export class SendEmailTool implements Tool {
workspaceId,
);
const { JSDOM } = await import('jsdom');
const window = new JSDOM('').window;
const purify = DOMPurify(window);
const safeBody = purify.sanitize(body || '');

View file

@ -10,7 +10,7 @@
"allowSyntheticDefaultImports": true,
"allowUnreachableCode": false,
"esModuleInterop": true,
"target": "es2017",
"target": "es2018",
"sourceMap": true,
"inlineSources": true,
"outDir": "./dist",

View file

@ -7,6 +7,7 @@
"include": [
"jest.config.ts",
"setupTests.ts",
"src/*.d.ts",
"src/**/*.d.ts",
"src/**/*.spec.ts",
"src/**/*.test.ts",

View file

@ -6,6 +6,7 @@
"include": [
".storybook/*.ts",
".storybook/*.tsx",
"src/*.d.ts",
"src/**/*.d.ts",
"src/**/*.stories.mdx",
"src/**/*.stories.ts",

View file

@ -8,7 +8,7 @@
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"importHelpers": true,
"target": "es2015",
"target": "es2018",
"module": "esnext",
"lib": ["es2020", "dom"],
"skipLibCheck": true,

5164
yarn.lock

File diff suppressed because it is too large Load diff