Change type import rule (#13751)
Forcing "type" to be explicit, works best will rollup on the frontend to exclude depdendencies
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
import { faker } from '@faker-js/faker';
|
||||
import { FieldMetadataType } from 'twenty-shared/types';
|
||||
import { type FieldMetadataType } from 'twenty-shared/types';
|
||||
|
||||
import { FieldMetadataEntity } from 'src/engine/metadata-modules/field-metadata/field-metadata.entity';
|
||||
import { IndexFieldMetadataEntity } from 'src/engine/metadata-modules/index-metadata/index-field-metadata.entity';
|
||||
import { ObjectMetadataEntity } from 'src/engine/metadata-modules/object-metadata/object-metadata.entity';
|
||||
import { type FieldMetadataEntity } from 'src/engine/metadata-modules/field-metadata/field-metadata.entity';
|
||||
import { type IndexFieldMetadataEntity } from 'src/engine/metadata-modules/index-metadata/index-field-metadata.entity';
|
||||
import { type ObjectMetadataEntity } from 'src/engine/metadata-modules/object-metadata/object-metadata.entity';
|
||||
|
||||
type GetMockFieldMetadataEntityOverride<
|
||||
T extends FieldMetadataType = FieldMetadataType,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { faker } from '@faker-js/faker';
|
||||
|
||||
import { DataSourceEntity } from 'src/engine/metadata-modules/data-source/data-source.entity';
|
||||
import { ObjectMetadataEntity } from 'src/engine/metadata-modules/object-metadata/object-metadata.entity';
|
||||
import { type DataSourceEntity } from 'src/engine/metadata-modules/data-source/data-source.entity';
|
||||
import { type ObjectMetadataEntity } from 'src/engine/metadata-modules/object-metadata/object-metadata.entity';
|
||||
|
||||
export type GetMockObjectMetadataEntityOverride =
|
||||
Partial<ObjectMetadataEntity> &
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
import { ObjectMetadataItemWithFieldMaps } from 'src/engine/metadata-modules/types/object-metadata-item-with-field-maps';
|
||||
import { type ObjectMetadataItemWithFieldMaps } from 'src/engine/metadata-modules/types/object-metadata-item-with-field-maps';
|
||||
import {
|
||||
GetMockObjectMetadataEntityOverride,
|
||||
type GetMockObjectMetadataEntityOverride,
|
||||
getMockObjectMetadataEntity,
|
||||
} from 'src/utils/__test__/get-object-metadata-entity.mock';
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { EachTestingContext } from 'twenty-shared/testing';
|
||||
import { type EachTestingContext } from 'twenty-shared/testing';
|
||||
|
||||
import { isSnakeCaseString } from 'src/utils/is-snake-case-string';
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { HttpException } from '@nestjs/common';
|
||||
import { type HttpException } from '@nestjs/common';
|
||||
|
||||
type Assert = (
|
||||
condition: unknown,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import isObject from 'lodash.isobject';
|
||||
import lodashCamelCase from 'lodash.camelcase';
|
||||
import { CamelCase, CamelCasedPropertiesDeep } from 'type-fest';
|
||||
import { type CamelCase, type CamelCasedPropertiesDeep } from 'type-fest';
|
||||
|
||||
export const camelCase = <T>(text: T) =>
|
||||
lodashCamelCase(text as unknown as string) as CamelCase<T>;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { isDefined } from 'twenty-shared/utils';
|
||||
|
||||
import { FullNameMetadata } from 'src/engine/metadata-modules/field-metadata/composite-types/full-name.composite-type';
|
||||
import { type FullNameMetadata } from 'src/engine/metadata-modules/field-metadata/composite-types/full-name.composite-type';
|
||||
|
||||
export const computeDisplayName = (
|
||||
name: FullNameMetadata | null | undefined,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { ExecutionContext } from '@nestjs/common';
|
||||
import { GqlContextType, GqlExecutionContext } from '@nestjs/graphql';
|
||||
import { type ExecutionContext } from '@nestjs/common';
|
||||
import { type GqlContextType, GqlExecutionContext } from '@nestjs/graphql';
|
||||
|
||||
// extract request from the execution context
|
||||
export const getRequest = (context: ExecutionContext) => {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Axios } from 'axios';
|
||||
import { type Axios } from 'axios';
|
||||
|
||||
const cropRegex = /([w|h])([0-9]+)/;
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import isObject from 'lodash.isobject';
|
||||
import lodashKebabCase from 'lodash.kebabcase';
|
||||
import { KebabCase, KebabCasedPropertiesDeep } from 'type-fest';
|
||||
import { type KebabCase, type KebabCasedPropertiesDeep } from 'type-fest';
|
||||
|
||||
export const kebabCase = <T>(text: T) =>
|
||||
lodashKebabCase(text as unknown as string) as KebabCase<T>;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import isObject from 'lodash.isobject';
|
||||
import lodashCamelCase from 'lodash.camelcase';
|
||||
import upperFirst from 'lodash.upperfirst';
|
||||
import { PascalCase, PascalCasedPropertiesDeep } from 'type-fest';
|
||||
import { type PascalCase, type PascalCasedPropertiesDeep } from 'type-fest';
|
||||
|
||||
export const pascalCase = <T>(text: T) =>
|
||||
upperFirst(lodashCamelCase(text as unknown as string)) as PascalCase<T>;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import isObject from 'lodash.isobject';
|
||||
import lodashSnakeCase from 'lodash.snakecase';
|
||||
import { SnakeCase, SnakeCasedPropertiesDeep } from 'type-fest';
|
||||
import { type SnakeCase, type SnakeCasedPropertiesDeep } from 'type-fest';
|
||||
|
||||
export const snakeCase = <T>(text: T) =>
|
||||
lodashSnakeCase(text as unknown as string) as SnakeCase<T>;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Readable } from 'stream';
|
||||
import { type Readable } from 'stream';
|
||||
|
||||
export const streamToBuffer = async (stream: Readable): Promise<Buffer> => {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import 'reflect-metadata';
|
||||
|
||||
import { Gate } from 'src/engine/twenty-orm/interfaces/gate.interface';
|
||||
import { type Gate } from 'src/engine/twenty-orm/interfaces/gate.interface';
|
||||
|
||||
import { WorkspaceEntityDuplicateCriteria } from 'src/engine/api/graphql/workspace-query-builder/types/workspace-entity-duplicate-criteria.type';
|
||||
import { FeatureFlagKey } from 'src/engine/core-modules/feature-flag/enums/feature-flag-key.enum';
|
||||
import { ConfigVariablesMetadataMap } from 'src/engine/core-modules/twenty-config/decorators/config-variables-metadata.decorator';
|
||||
import { type WorkspaceEntityDuplicateCriteria } from 'src/engine/api/graphql/workspace-query-builder/types/workspace-entity-duplicate-criteria.type';
|
||||
import { type FeatureFlagKey } from 'src/engine/core-modules/feature-flag/enums/feature-flag-key.enum';
|
||||
import { type ConfigVariablesMetadataMap } from 'src/engine/core-modules/twenty-config/decorators/config-variables-metadata.decorator';
|
||||
|
||||
export interface ReflectMetadataTypeMap {
|
||||
['workspace:is-nullable-metadata-args']: true;
|
||||
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
import { EachTestingContext } from 'twenty-shared/testing';
|
||||
import { type EachTestingContext } from 'twenty-shared/testing';
|
||||
|
||||
import {
|
||||
CompareVersionMajorAndMinorReturnType,
|
||||
type CompareVersionMajorAndMinorReturnType,
|
||||
compareVersionMajorAndMinor,
|
||||
} from 'src/utils/version/compare-version-minor-and-major';
|
||||
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
import { EachTestingContext } from 'twenty-shared/testing';
|
||||
import { type EachTestingContext } from 'twenty-shared/testing';
|
||||
|
||||
import { extractVersionMajorMinorPatch } from 'src/utils/version/extract-version-major-minor-patch';
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { EachTestingContext } from 'twenty-shared/testing';
|
||||
import { type EachTestingContext } from 'twenty-shared/testing';
|
||||
|
||||
import { getPreviousVersion } from 'src/utils/version/get-previous-version';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user