added typechecking for all ts files (#6466)

Fixes: #6436 

Changes made: 

- Added typecheck step before twenty-ui build to check stories TS errors
- Added a tsconfig.dev.json to add stories and tests to typecheking when
in dev mode
- Added tsconfig.dev.json to storybook dev command of twenty-ui to
typecheck stories while developing
- Fixed twenty-ui stories that were broken

- Added a serve command to serve front build
- Fixed unit test from another PR

---------

Co-authored-by: Félix Malfait <felix.malfait@gmail.com>
Co-authored-by: Lucas Bordeau <bordeau.lucas@gmail.com>
This commit is contained in:
Syed Md Mihan Chistie
2024-08-20 14:35:13 +05:30
committed by GitHub
parent 12a657ce29
commit be20a690b3
15 changed files with 135 additions and 66 deletions

View File

@ -10,6 +10,12 @@
"outputPath": "{projectRoot}/build"
}
},
"serve": {
"executor": "nx:run-commands",
"options": {
"command": "npx serve -s {projectRoot}/build"
}
},
"start": {
"executor": "@nx/vite:dev-server",
"options": {

View File

@ -15,6 +15,7 @@ const meta: Meta<typeof Status> = {
component: Status,
args: {
text: 'Urgent',
weight: 'medium',
},
};

View File

@ -9,10 +9,6 @@ describe('title-utils', () => {
expect(getPageTitleFromPath('/invite/:workspaceInviteHash')).toBe('Invite');
expect(getPageTitleFromPath('/create/workspace')).toBe('Create Workspace');
expect(getPageTitleFromPath('/create/profile')).toBe('Create Profile');
expect(getPageTitleFromPath('/tasks')).toBe('Tasks');
expect(getPageTitleFromPath('/objects/opportunities')).toBe(
'Opportunities',
);
expect(getPageTitleFromPath('/settings/objects/opportunities')).toBe(
SettingsPageTitles.Objects,
);

View File

@ -0,0 +1,13 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"types": ["node"]
},
"include": [
"src/**/*.js",
"src/**/*.jsx",
"src/**/*.d.ts",
"src/**/*.ts",
"src/**/*.tsx"
]
}

View File

@ -32,7 +32,10 @@
"include": [],
"references": [
{
"path": "./tsconfig.app.json"
"path": "./tsconfig.dev.json"
},
{
"path": "./tsconfig.build.json"
},
{
"path": "./tsconfig.spec.json"
@ -42,4 +45,4 @@
}
],
"extends": "../../tsconfig.base.json"
}
}

View File

@ -19,9 +19,13 @@ export default defineConfig(({ command, mode }) => {
const isBuildCommand = command === 'build';
const tsConfigPath = isBuildCommand
? path.resolve(__dirname, './tsconfig.build.json')
: path.resolve(__dirname, './tsconfig.dev.json');
const checkers: Checkers = {
typescript: {
tsconfigPath: path.resolve(__dirname, './tsconfig.app.json'),
tsconfigPath: tsConfigPath,
},
overlay: false,
};