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:
@ -23,7 +23,9 @@ const jestConfig: JestConfigWithTsJest = {
|
||||
moduleNameMapper: {
|
||||
'\\.(jpg|jpeg|png|gif|webp|svg|svg\\?react)$':
|
||||
'<rootDir>/__mocks__/imageMock.js',
|
||||
...pathsToModuleNameMapper(tsConfig.compilerOptions.paths),
|
||||
...pathsToModuleNameMapper(tsConfig.compilerOptions.paths, {
|
||||
prefix: '<rootDir>/',
|
||||
}),
|
||||
},
|
||||
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'],
|
||||
extensionsToTreatAsEsm: ['.ts', '.tsx'],
|
||||
|
||||
@ -10,6 +10,9 @@
|
||||
"require": "./dist/index.cjs"
|
||||
}
|
||||
},
|
||||
"dependencies": {
|
||||
"twenty-shared": "workspace:*"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "npx vite build"
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { ReactNode } from 'react';
|
||||
import { ThemeProvider as EmotionThemeProvider } from '@emotion/react';
|
||||
import { ReactNode } from 'react';
|
||||
|
||||
import { ThemeContextProvider } from '@ui/theme/provider/ThemeContextProvider';
|
||||
|
||||
|
||||
@ -10,7 +10,7 @@
|
||||
"types": ["node"],
|
||||
"outDir": "../../.cache/tsc",
|
||||
"paths": {
|
||||
"@ui/*": ["packages/twenty-ui/src/*"]
|
||||
"@ui/*": ["./src/*"]
|
||||
}
|
||||
},
|
||||
"files": [],
|
||||
|
||||
@ -2,7 +2,11 @@
|
||||
"extends": "./tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"types": ["jest", "node"]
|
||||
"types": ["jest", "node"],
|
||||
"baseUrl": "../..",
|
||||
"paths": {
|
||||
"@ui/*": ["./packages/twenty-ui/src/*"]
|
||||
}
|
||||
},
|
||||
"include": [
|
||||
"vite.config.ts",
|
||||
|
||||
Reference in New Issue
Block a user