Fix import twenty-shared (#9754)

In this PR:
- removing rootDir / baseUrl from any tsconfig.json
- we need to keep it in tsconfig.spec.json and also specify rootDir in
jest.config.ts moduleMapper because of the way nx jest executor works
(automatically moving back to root)
- we need to explictly specify the depencies to twenty-shared /
twenty-emails (built packages) in packages package.json to help nx
understand dependencies
This commit is contained in:
Charles Bochet
2025-01-20 23:10:39 +01:00
committed by GitHub
parent 3838fef812
commit e3f7cec82f
16 changed files with 43 additions and 30 deletions

View File

@ -27,7 +27,9 @@ const jestConfig: JestConfigWithTsJest = {
'\\.(jpg|jpeg|png|gif|webp|svg|svg\\?react)$':
'<rootDir>/__mocks__/imageMock.js',
'\\.css$': '<rootDir>/__mocks__/styleMock.js',
...pathsToModuleNameMapper(tsConfig.compilerOptions.paths),
...pathsToModuleNameMapper(tsConfig.compilerOptions.paths, {
prefix: '<rootDir>/../../',
}),
},
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'],
extensionsToTreatAsEsm: ['.ts', '.tsx'],

View File

@ -49,7 +49,8 @@
"docx": "^9.1.0",
"file-saver": "^2.0.5",
"recoil-sync": "^0.2.0",
"transliteration": "^2.3.5"
"transliteration": "^2.3.5",
"twenty-shared": "workspace:*"
},
"devDependencies": {
"@types/file-saver": "^2"

View File

@ -13,7 +13,6 @@ import { useRunWorkflowVersion } from '@/workflow/hooks/useRunWorkflowVersion';
import { useRecoilValue } from 'recoil';
import { capitalize } from 'twenty-shared';
import { IconSettingsAutomation, isDefined } from 'twenty-ui';
export const useWorkflowRunRecordActions = ({
objectMetadataItem,
}: {

View File

@ -1,8 +1,8 @@
import { TextInput } from '@/ui/field/input/components/TextInput';
import { useTheme } from '@emotion/react';
import styled from '@emotion/styled';
import { IconComponent } from 'packages/twenty-ui';
import { useState } from 'react';
import { IconComponent } from 'twenty-ui';
import { useDebouncedCallback } from 'use-debounce';
const StyledHeader = styled.div`

View File

@ -21,10 +21,10 @@
"forceConsistentCasingInFileNames": true,
"outDir": "../../.cache/tsc",
"paths": {
"@/*": ["packages/twenty-front/src/modules/*"],
"~/*": ["packages/twenty-front/src/*"],
"twenty-ui": ["packages/twenty-ui/src/index.ts"],
"@ui/*": ["packages/twenty-ui/src/*"]
"@/*": ["./src/modules/*"],
"~/*": ["./src/*"],
"twenty-ui": ["../twenty-ui/src/index.ts"],
"@ui/*": ["../twenty-ui/src/*"]
}
},
"files": [],

View File

@ -2,11 +2,12 @@
"extends": "./tsconfig.json",
"compilerOptions": {
"types": ["jest", "node"],
"baseUrl": "../..",
"paths": {
"@/*": ["packages/twenty-front/src/modules/*"],
"~/*": ["packages/twenty-front/src/*"],
"twenty-ui": ["packages/twenty-ui/src/index.ts"],
"@ui/*": ["packages/twenty-ui/src/*"]
"@/*": ["./packages/twenty-front/src/modules/*"],
"~/*": ["./packages/twenty-front/src/*"],
"twenty-ui": ["./packages/twenty-ui/src/index.ts"],
"@ui/*": ["./packages/twenty-ui/src/*"]
}
},
"include": [