Run type check for all web app packages in CI (#22578)

* Fix incorrect usage of types pacakge

* Make platform packages properly expose their type definitions

* Have Boards, Channels, and Playbooks get types from platform packages properly

* Run type check for all web app packages in CI

* Fix incorrect job name
Этот коммит содержится в:
Harrison Healey
2023-03-23 10:10:52 -04:00
коммит произвёл GitHub
родитель 2eb5dac9b7
Коммит 1edbde8aa3
25 изменённых файлов: 58 добавлений и 80 удалений

Просмотреть файл

@@ -10,7 +10,8 @@
"files": [
"lib"
],
"main": "./lib/index.js",
"main": "lib/index.js",
"types": "lib/index.d.ts",
"repository": {
"type": "git",
"url": "github:mattermost/mattermost-webapp",

Просмотреть файл

@@ -12,12 +12,14 @@
"jsx": "react",
"outDir": "./lib",
"rootDir": "./src",
"composite": true,
"paths": {
"@mattermost/types/*": ["../types/lib/*"]
}
"composite": true
},
"exclude": ["**/node_modules", "**/lib", "**/*.test.js", "**/*.test.ts"],
"include": [
"./src/**/*"
],
"exclude": [
"**/*.test.*"
],
"references": [
{"path": "../types"}
]

Просмотреть файл

@@ -2,7 +2,7 @@
"name": "@mattermost/components",
"version": "7.4.0",
"module": "dist/index.esm.js",
"types": "dist/index.esm.d.ts",
"types": "dist/index.d.ts",
"styles": "dist/index.esm.css",
"scripts": {
"build": "rollup -c",

Просмотреть файл

@@ -10,12 +10,9 @@
"skipLibCheck": true,
"strictNullChecks": true,
"isolatedModules": true,
"noEmit": true,
"declaration": true,
"outDir": "dist",
"paths": {
"mattermost-redux/*": ["./node_modules/mattermost-redux/src/*"],
"@mattermost/types/*": ["./node_modules/@mattermost/types/src/*"]
}
"rootDir": "src",
"composite": true
}
}

Просмотреть файл

@@ -12,21 +12,6 @@ import {UserProfile} from '@mattermost/types/users';
For technologies that don't support that yet, you can add an alias in its package resolution settings to support that.
### TypeScript
In the `tsconfig.json`, you can use `compilerOptions.paths` to add that alias. This also requires a `compilerOptions.baseUrl` if you haven't set that already.
```json
{
"compilerOptions": {
"baseUrl": ".",
"paths": {
"@mattermost/types/*": ["node_modules/@mattermost/types/lib/*"]
}
}
}
```
### Jest
In your Jest config, you can use the `moduleNameMapper` field to add that alias.

Просмотреть файл

@@ -13,7 +13,11 @@
"exports": {
"./*": "./lib/*.js"
},
"types": "./lib/*.d.ts",
"typesVersions": {
">=3.1": {
"*": ["./lib/*.d.ts"]
}
},
"repository": {
"type": "git",
"url": "github:mattermost/mattermost-webapp",

Просмотреть файл

@@ -14,5 +14,10 @@
"rootDir": "./src",
"composite": true
},
"exclude": ["**/node_modules", "**/lib", "**/*.test.js", "**/*.test.ts"]
"include": [
"./src/**/*"
],
"exclude": [
"**/*.test.*"
]
}