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:
@ -9,8 +9,8 @@
|
|||||||
"skipLibCheck": true,
|
"skipLibCheck": true,
|
||||||
"esModuleInterop": true,
|
"esModuleInterop": true,
|
||||||
"paths": {
|
"paths": {
|
||||||
"@/*": ["packages/twenty-chrome-extension/src/options/modules/*"],
|
"@/*": ["./src/options/modules/*"],
|
||||||
"~/*": ["packages/twenty-chrome-extension/src/*"]
|
"~/*": ["./src/*"]
|
||||||
},
|
},
|
||||||
|
|
||||||
/* Bundler mode */
|
/* Bundler mode */
|
||||||
|
|||||||
@ -27,7 +27,9 @@ const jestConfig: JestConfigWithTsJest = {
|
|||||||
'\\.(jpg|jpeg|png|gif|webp|svg|svg\\?react)$':
|
'\\.(jpg|jpeg|png|gif|webp|svg|svg\\?react)$':
|
||||||
'<rootDir>/__mocks__/imageMock.js',
|
'<rootDir>/__mocks__/imageMock.js',
|
||||||
'\\.css$': '<rootDir>/__mocks__/styleMock.js',
|
'\\.css$': '<rootDir>/__mocks__/styleMock.js',
|
||||||
...pathsToModuleNameMapper(tsConfig.compilerOptions.paths),
|
...pathsToModuleNameMapper(tsConfig.compilerOptions.paths, {
|
||||||
|
prefix: '<rootDir>/../../',
|
||||||
|
}),
|
||||||
},
|
},
|
||||||
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'],
|
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'],
|
||||||
extensionsToTreatAsEsm: ['.ts', '.tsx'],
|
extensionsToTreatAsEsm: ['.ts', '.tsx'],
|
||||||
|
|||||||
@ -49,7 +49,8 @@
|
|||||||
"docx": "^9.1.0",
|
"docx": "^9.1.0",
|
||||||
"file-saver": "^2.0.5",
|
"file-saver": "^2.0.5",
|
||||||
"recoil-sync": "^0.2.0",
|
"recoil-sync": "^0.2.0",
|
||||||
"transliteration": "^2.3.5"
|
"transliteration": "^2.3.5",
|
||||||
|
"twenty-shared": "workspace:*"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/file-saver": "^2"
|
"@types/file-saver": "^2"
|
||||||
|
|||||||
@ -13,7 +13,6 @@ import { useRunWorkflowVersion } from '@/workflow/hooks/useRunWorkflowVersion';
|
|||||||
import { useRecoilValue } from 'recoil';
|
import { useRecoilValue } from 'recoil';
|
||||||
import { capitalize } from 'twenty-shared';
|
import { capitalize } from 'twenty-shared';
|
||||||
import { IconSettingsAutomation, isDefined } from 'twenty-ui';
|
import { IconSettingsAutomation, isDefined } from 'twenty-ui';
|
||||||
|
|
||||||
export const useWorkflowRunRecordActions = ({
|
export const useWorkflowRunRecordActions = ({
|
||||||
objectMetadataItem,
|
objectMetadataItem,
|
||||||
}: {
|
}: {
|
||||||
|
|||||||
@ -1,8 +1,8 @@
|
|||||||
import { TextInput } from '@/ui/field/input/components/TextInput';
|
import { TextInput } from '@/ui/field/input/components/TextInput';
|
||||||
import { useTheme } from '@emotion/react';
|
import { useTheme } from '@emotion/react';
|
||||||
import styled from '@emotion/styled';
|
import styled from '@emotion/styled';
|
||||||
import { IconComponent } from 'packages/twenty-ui';
|
|
||||||
import { useState } from 'react';
|
import { useState } from 'react';
|
||||||
|
import { IconComponent } from 'twenty-ui';
|
||||||
import { useDebouncedCallback } from 'use-debounce';
|
import { useDebouncedCallback } from 'use-debounce';
|
||||||
|
|
||||||
const StyledHeader = styled.div`
|
const StyledHeader = styled.div`
|
||||||
|
|||||||
@ -21,10 +21,10 @@
|
|||||||
"forceConsistentCasingInFileNames": true,
|
"forceConsistentCasingInFileNames": true,
|
||||||
"outDir": "../../.cache/tsc",
|
"outDir": "../../.cache/tsc",
|
||||||
"paths": {
|
"paths": {
|
||||||
"@/*": ["packages/twenty-front/src/modules/*"],
|
"@/*": ["./src/modules/*"],
|
||||||
"~/*": ["packages/twenty-front/src/*"],
|
"~/*": ["./src/*"],
|
||||||
"twenty-ui": ["packages/twenty-ui/src/index.ts"],
|
"twenty-ui": ["../twenty-ui/src/index.ts"],
|
||||||
"@ui/*": ["packages/twenty-ui/src/*"]
|
"@ui/*": ["../twenty-ui/src/*"]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"files": [],
|
"files": [],
|
||||||
|
|||||||
@ -2,11 +2,12 @@
|
|||||||
"extends": "./tsconfig.json",
|
"extends": "./tsconfig.json",
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"types": ["jest", "node"],
|
"types": ["jest", "node"],
|
||||||
|
"baseUrl": "../..",
|
||||||
"paths": {
|
"paths": {
|
||||||
"@/*": ["packages/twenty-front/src/modules/*"],
|
"@/*": ["./packages/twenty-front/src/modules/*"],
|
||||||
"~/*": ["packages/twenty-front/src/*"],
|
"~/*": ["./packages/twenty-front/src/*"],
|
||||||
"twenty-ui": ["packages/twenty-ui/src/index.ts"],
|
"twenty-ui": ["./packages/twenty-ui/src/index.ts"],
|
||||||
"@ui/*": ["packages/twenty-ui/src/*"]
|
"@ui/*": ["./packages/twenty-ui/src/*"]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"include": [
|
"include": [
|
||||||
|
|||||||
@ -74,6 +74,8 @@
|
|||||||
"@types/react": "^18.2.39",
|
"@types/react": "^18.2.39",
|
||||||
"@types/unzipper": "^0",
|
"@types/unzipper": "^0",
|
||||||
"rimraf": "^5.0.5",
|
"rimraf": "^5.0.5",
|
||||||
|
"twenty-emails": "workspace:*",
|
||||||
|
"twenty-shared": "workspace:*",
|
||||||
"typescript": "5.3.3"
|
"typescript": "5.3.3"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
|
|||||||
@ -25,9 +25,9 @@
|
|||||||
"resolveJsonModule": true,
|
"resolveJsonModule": true,
|
||||||
"types": ["jest", "node"],
|
"types": ["jest", "node"],
|
||||||
"paths": {
|
"paths": {
|
||||||
"src/*": ["packages/twenty-server/src/*"],
|
"src/*": ["./src/*"],
|
||||||
"test/*": ["packages/twenty-server/test/*"],
|
"test/*": ["./test/*"],
|
||||||
"twenty-emails": ["packages/twenty-emails/dist"]
|
"twenty-emails": ["../twenty-emails/dist"]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"ts-node": {
|
"ts-node": {
|
||||||
|
|||||||
@ -23,7 +23,9 @@ const jestConfig: JestConfigWithTsJest = {
|
|||||||
moduleNameMapper: {
|
moduleNameMapper: {
|
||||||
'\\.(jpg|jpeg|png|gif|webp|svg|svg\\?react)$':
|
'\\.(jpg|jpeg|png|gif|webp|svg|svg\\?react)$':
|
||||||
'<rootDir>/__mocks__/imageMock.js',
|
'<rootDir>/__mocks__/imageMock.js',
|
||||||
...pathsToModuleNameMapper(tsConfig.compilerOptions.paths),
|
...pathsToModuleNameMapper(tsConfig.compilerOptions.paths, {
|
||||||
|
prefix: '<rootDir>/',
|
||||||
|
}),
|
||||||
},
|
},
|
||||||
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'],
|
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'],
|
||||||
extensionsToTreatAsEsm: ['.ts', '.tsx'],
|
extensionsToTreatAsEsm: ['.ts', '.tsx'],
|
||||||
|
|||||||
@ -10,6 +10,9 @@
|
|||||||
"require": "./dist/index.cjs"
|
"require": "./dist/index.cjs"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"twenty-shared": "workspace:*"
|
||||||
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "npx vite build"
|
"build": "npx vite build"
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import { ReactNode } from 'react';
|
|
||||||
import { ThemeProvider as EmotionThemeProvider } from '@emotion/react';
|
import { ThemeProvider as EmotionThemeProvider } from '@emotion/react';
|
||||||
|
import { ReactNode } from 'react';
|
||||||
|
|
||||||
import { ThemeContextProvider } from '@ui/theme/provider/ThemeContextProvider';
|
import { ThemeContextProvider } from '@ui/theme/provider/ThemeContextProvider';
|
||||||
|
|
||||||
|
|||||||
@ -10,7 +10,7 @@
|
|||||||
"types": ["node"],
|
"types": ["node"],
|
||||||
"outDir": "../../.cache/tsc",
|
"outDir": "../../.cache/tsc",
|
||||||
"paths": {
|
"paths": {
|
||||||
"@ui/*": ["packages/twenty-ui/src/*"]
|
"@ui/*": ["./src/*"]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"files": [],
|
"files": [],
|
||||||
|
|||||||
@ -2,7 +2,11 @@
|
|||||||
"extends": "./tsconfig.json",
|
"extends": "./tsconfig.json",
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"module": "commonjs",
|
"module": "commonjs",
|
||||||
"types": ["jest", "node"]
|
"types": ["jest", "node"],
|
||||||
|
"baseUrl": "../..",
|
||||||
|
"paths": {
|
||||||
|
"@ui/*": ["./packages/twenty-ui/src/*"]
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"include": [
|
"include": [
|
||||||
"vite.config.ts",
|
"vite.config.ts",
|
||||||
|
|||||||
@ -13,13 +13,7 @@
|
|||||||
"lib": ["es2020", "dom"],
|
"lib": ["es2020", "dom"],
|
||||||
"skipLibCheck": true,
|
"skipLibCheck": true,
|
||||||
"skipDefaultLibCheck": true,
|
"skipDefaultLibCheck": true,
|
||||||
"resolveJsonModule": true,
|
"resolveJsonModule": true
|
||||||
"baseUrl": ".",
|
|
||||||
"paths": {
|
|
||||||
"twenty-emails": ["packages/twenty-emails/src/index.ts"],
|
|
||||||
"twenty-ui": ["packages/twenty-ui/src/index.ts"],
|
|
||||||
"twenty-shared": ["packages/twenty-shared/dist"]
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
"exclude": ["node_modules", "tmp"]
|
"exclude": ["node_modules", "tmp"]
|
||||||
}
|
}
|
||||||
|
|||||||
@ -45581,7 +45581,7 @@ __metadata:
|
|||||||
languageName: unknown
|
languageName: unknown
|
||||||
linkType: soft
|
linkType: soft
|
||||||
|
|
||||||
"twenty-emails@workspace:packages/twenty-emails":
|
"twenty-emails@workspace:*, twenty-emails@workspace:packages/twenty-emails":
|
||||||
version: 0.0.0-use.local
|
version: 0.0.0-use.local
|
||||||
resolution: "twenty-emails@workspace:packages/twenty-emails"
|
resolution: "twenty-emails@workspace:packages/twenty-emails"
|
||||||
languageName: unknown
|
languageName: unknown
|
||||||
@ -45612,6 +45612,7 @@ __metadata:
|
|||||||
file-saver: "npm:^2.0.5"
|
file-saver: "npm:^2.0.5"
|
||||||
recoil-sync: "npm:^0.2.0"
|
recoil-sync: "npm:^0.2.0"
|
||||||
transliteration: "npm:^2.3.5"
|
transliteration: "npm:^2.3.5"
|
||||||
|
twenty-shared: "workspace:*"
|
||||||
languageName: unknown
|
languageName: unknown
|
||||||
linkType: soft
|
linkType: soft
|
||||||
|
|
||||||
@ -45673,6 +45674,8 @@ __metadata:
|
|||||||
rimraf: "npm:^5.0.5"
|
rimraf: "npm:^5.0.5"
|
||||||
ts-morph: "npm:^24.0.0"
|
ts-morph: "npm:^24.0.0"
|
||||||
tsconfig-paths: "npm:^4.2.0"
|
tsconfig-paths: "npm:^4.2.0"
|
||||||
|
twenty-emails: "workspace:*"
|
||||||
|
twenty-shared: "workspace:*"
|
||||||
typeorm: "patch:typeorm@0.3.20#./patches/typeorm+0.3.20.patch"
|
typeorm: "patch:typeorm@0.3.20#./patches/typeorm+0.3.20.patch"
|
||||||
typescript: "npm:5.3.3"
|
typescript: "npm:5.3.3"
|
||||||
unzipper: "npm:^0.12.3"
|
unzipper: "npm:^0.12.3"
|
||||||
@ -45680,7 +45683,7 @@ __metadata:
|
|||||||
languageName: unknown
|
languageName: unknown
|
||||||
linkType: soft
|
linkType: soft
|
||||||
|
|
||||||
"twenty-shared@workspace:packages/twenty-shared":
|
"twenty-shared@workspace:*, twenty-shared@workspace:packages/twenty-shared":
|
||||||
version: 0.0.0-use.local
|
version: 0.0.0-use.local
|
||||||
resolution: "twenty-shared@workspace:packages/twenty-shared"
|
resolution: "twenty-shared@workspace:packages/twenty-shared"
|
||||||
languageName: unknown
|
languageName: unknown
|
||||||
@ -45689,6 +45692,8 @@ __metadata:
|
|||||||
"twenty-ui@workspace:packages/twenty-ui":
|
"twenty-ui@workspace:packages/twenty-ui":
|
||||||
version: 0.0.0-use.local
|
version: 0.0.0-use.local
|
||||||
resolution: "twenty-ui@workspace:packages/twenty-ui"
|
resolution: "twenty-ui@workspace:packages/twenty-ui"
|
||||||
|
dependencies:
|
||||||
|
twenty-shared: "workspace:*"
|
||||||
languageName: unknown
|
languageName: unknown
|
||||||
linkType: soft
|
linkType: soft
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user