Skip to content

Commit

Permalink
feat: improve build & test performance
Browse files Browse the repository at this point in the history
  • Loading branch information
Wroud committed May 30, 2024
1 parent 571ca34 commit 4261083
Show file tree
Hide file tree
Showing 109 changed files with 374 additions and 455 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/frontend-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,4 @@ jobs:
uses: borales/actions-yarn@v5
with:
dir: webapp
cmd: lerna run test
cmd: test
10 changes: 9 additions & 1 deletion .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"type": "shell",
"command": "yarn",
"group": "test",
"args": ["lerna", "run", "test", "--no-bail", "--stream", "--"]
"args": ["test"]
},
{
"label": "Run DevServer CE",
Expand Down Expand Up @@ -110,6 +110,14 @@
"options": {
"cwd": "${workspaceFolder}/webapp"
}
},
{
"label": "Clean CE",
"type": "shell",
"command": "yarn lerna run clean --parallel --stream",
"options": {
"cwd": "${workspaceFolder}/webapp"
}
}
],
"inputs": [
Expand Down
2 changes: 1 addition & 1 deletion webapp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
"mobx-react-lite": "^4.0.5"
},
"scripts": {
"test": "core-cli-test",
"prebuild": "lerna run gql:gen --stream --parallel",
"pretest": "lerna run gql:gen --stream --parallel && yarn lerna run test --scope @cloudbeaver/tests-runner",
"prepare": "cd .. && husky ./webapp/.husky",
"postinstall": "husky"
},
Expand Down
5 changes: 3 additions & 2 deletions webapp/packages/core-administration/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@
"main": "dist/index.js",
"scripts": {
"build": "tsc -b",
"clean": "rimraf --glob dist",
"lint": "eslint ./src/ --ext .ts,.tsx",
"lint-fix": "eslint ./src/ --ext .ts,.tsx --fix",
"test": "yarn build && core-cli-test",
"test": "core-cli-test",
"validate-dependencies": "core-cli-validate-dependencies",
"update-ts-references": "rimraf --glob dist && typescript-resolve-references"
"update-ts-references": "yarn run clean && typescript-resolve-references"
},
"dependencies": {
"@cloudbeaver/core-data-context": "~0.1.0",
Expand Down
3 changes: 2 additions & 1 deletion webapp/packages/core-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@
"main": "dist/index.js",
"scripts": {
"build": "tsc -b",
"clean": "rimraf --glob dist",
"lint": "eslint ./src/ --ext .ts,.tsx",
"lint-fix": "eslint ./src/ --ext .ts,.tsx --fix",
"validate-dependencies": "core-cli-validate-dependencies",
"update-ts-references": "rimraf --glob dist && typescript-resolve-references"
"update-ts-references": "yarn run clean && typescript-resolve-references"
},
"dependencies": {
"@cloudbeaver/core-blocks": "~0.1.0",
Expand Down
5 changes: 3 additions & 2 deletions webapp/packages/core-authentication/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@
"main": "dist/index.js",
"scripts": {
"build": "tsc -b",
"clean": "rimraf --glob dist",
"lint": "eslint ./src/ --ext .ts,.tsx",
"lint-fix": "eslint ./src/ --ext .ts,.tsx --fix",
"test": "yarn build && core-cli-test",
"test": "core-cli-test",
"validate-dependencies": "core-cli-validate-dependencies",
"update-ts-references": "rimraf --glob dist && typescript-resolve-references"
"update-ts-references": "yarn run clean && typescript-resolve-references"
},
"dependencies": {
"@cloudbeaver/core-data-context": "~0.1.0",
Expand Down
5 changes: 3 additions & 2 deletions webapp/packages/core-blocks/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@
"main": "dist/index.js",
"scripts": {
"build": "tsc -b",
"clean": "rimraf --glob dist",
"lint": "eslint ./src/ --ext .ts,.tsx",
"lint-fix": "eslint ./src/ --ext .ts,.tsx --fix",
"test": "yarn build && core-cli-test",
"test": "core-cli-test",
"validate-dependencies": "core-cli-validate-dependencies",
"update-ts-references": "rimraf --glob dist && typescript-resolve-references"
"update-ts-references": "yarn run clean && typescript-resolve-references"
},
"dependencies": {
"@cloudbeaver/core-authentication": "~0.1.0",
Expand Down
3 changes: 2 additions & 1 deletion webapp/packages/core-bootstrap/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@
"main": "dist/index.js",
"scripts": {
"build": "tsc -b",
"clean": "rimraf --glob dist",
"lint": "eslint ./src/ --ext .ts,.tsx",
"lint-fix": "eslint ./src/ --ext .ts,.tsx --fix",
"validate-dependencies": "core-cli-validate-dependencies",
"update-ts-references": "rimraf --glob dist && typescript-resolve-references"
"update-ts-references": "yarn run clean && typescript-resolve-references"
},
"dependencies": {
"@cloudbeaver/core-administration": "~0.1.0",
Expand Down
5 changes: 3 additions & 2 deletions webapp/packages/core-browser-cookies/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@
"main": "dist/index.js",
"scripts": {
"build": "tsc -b",
"clean": "rimraf --glob dist",
"lint": "eslint ./src/ --ext .ts,.tsx",
"lint-fix": "eslint ./src/ --ext .ts,.tsx --fix",
"test": "yarn build && core-cli-test",
"test": "core-cli-test",
"validate-dependencies": "core-cli-validate-dependencies",
"update-ts-references": "rimraf --glob dist && typescript-resolve-references"
"update-ts-references": "yarn run clean && typescript-resolve-references"
},
"dependencies": {
"@cloudbeaver/core-browser-settings": "~0.1.0",
Expand Down
5 changes: 3 additions & 2 deletions webapp/packages/core-browser-settings/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@
"main": "dist/index.js",
"scripts": {
"build": "tsc -b",
"clean": "rimraf --glob dist",
"lint": "eslint ./src/ --ext .ts,.tsx",
"lint-fix": "eslint ./src/ --ext .ts,.tsx --fix",
"test": "yarn build && core-cli-test",
"test": "core-cli-test",
"validate-dependencies": "core-cli-validate-dependencies",
"update-ts-references": "rimraf --glob dist && typescript-resolve-references"
"update-ts-references": "yarn run clean && typescript-resolve-references"
},
"dependencies": {
"@cloudbeaver/core-di": "~0.1.0",
Expand Down
5 changes: 3 additions & 2 deletions webapp/packages/core-browser/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@
"main": "dist/index.js",
"scripts": {
"build": "tsc -b",
"clean": "rimraf --glob dist",
"lint": "eslint ./src/ --ext .ts,.tsx",
"lint-fix": "eslint ./src/ --ext .ts,.tsx --fix",
"test": "yarn build && core-cli-test",
"test": "core-cli-test",
"validate-dependencies": "core-cli-validate-dependencies",
"update-ts-references": "rimraf --glob dist && typescript-resolve-references"
"update-ts-references": "yarn run clean && typescript-resolve-references"
},
"dependencies": {
"@cloudbeaver/core-di": "~0.1.0",
Expand Down
31 changes: 0 additions & 31 deletions webapp/packages/core-cli/configs/babel.config.js

This file was deleted.

11 changes: 0 additions & 11 deletions webapp/packages/core-cli/configs/jest.babel.config.js

This file was deleted.

8 changes: 4 additions & 4 deletions webapp/packages/core-cli/configs/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ const path = require('path');
/** @type {import('ts-jest').JestConfigWithTsJest} */
module.exports = {
testEnvironment: require.resolve('../tests/test.environment.js'),
rootDir: path.resolve('./dist'),
rootDir: path.resolve('./'),
moduleFileExtensions: ['js', 'jsx', 'json'],
testMatch: ['**/?(*.)+(spec|test).js?(x)'],
testMatch: ['<rootDir>/(packages/*/|)dist/?(*.)+(spec|test).js?(x)'],
transformIgnorePatterns: [
'\\.pnp\\.[^\\/]+$',
'node_modules/(?!@ngrx|(?!deck.gl)|ng-dynamic)',
Expand All @@ -25,11 +25,11 @@ module.exports = {
'\\.(css|scss|less)$': require.resolve('./__mocks__/styleMock.js'),
'^dexie$': require.resolve('dexie'),
},
passWithNoTests: true,
// passWithNoTests: true,
setupFiles: [require.resolve('fake-indexeddb/auto'), require.resolve('../tests/setup.js')],
setupFilesAfterEnv: ['@testing-library/jest-dom'],
transform: {
'\\.jsx?$': ['babel-jest', { configFile: require.resolve('./jest.babel.config.js') }],
'\\.jsx?$': [require.resolve('@swc/jest')],
},
testEnvironmentOptions: {
// This will force JSDOM to use the default export condition when importing msw/node, resulting in correct imports.
Expand Down
13 changes: 2 additions & 11 deletions webapp/packages/core-cli/configs/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,15 +119,6 @@ module.exports = (env, argv) => {
];
}

var babelLoader = {
loader: require.resolve('babel-loader'),
options: {
root: __dirname,
// cacheDirectory: true,
envName: argv.mode,
},
};

let entry = {};

if (devMode) {
Expand Down Expand Up @@ -295,10 +286,10 @@ module.exports = (env, argv) => {
exclude: /node_modules/,
use: ['source-map-loader'],
},
{
devMode && {
test: /\.jsx?$/,
exclude: /node_modules/,
use: ['thread-loader', babelLoader],
use: ['thread-loader', 'swc-loader'],
},
{
test: /\.(css|s[ac]ss)$/,
Expand Down
16 changes: 3 additions & 13 deletions webapp/packages/core-cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,6 @@
"node": ">=20.0.0"
},
"dependencies": {
"@babel/cli": "^7.23.9",
"@babel/core": "^7.24.0",
"@babel/plugin-proposal-decorators": "^7.24.0",
"@babel/plugin-transform-nullish-coalescing-operator": "^7.23.4",
"@babel/plugin-transform-optional-chaining": "^7.23.4",
"@babel/plugin-transform-runtime": "^7.24.0",
"@babel/preset-env": "^7.24.0",
"@babel/preset-react": "^7.23.3",
"@babel/preset-typescript": "^7.23.3",
"babel-loader": "^9.1.3",
"babel-plugin-module-resolver": "^5.0.0",
"babel-plugin-transform-typescript-metadata": "^0.3.2",
"copy-webpack-plugin": "^12.0.2",
"css-loader": "^6.10.0",
"css-minimizer-webpack-plugin": "^7.0.0",
Expand Down Expand Up @@ -67,10 +55,11 @@
},
"devDependencies": {
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.11",
"@swc/core": "^1.5.24",
"@swc/jest": "^0",
"@types/jest": "^29.5.12",
"@types/madge": "^5.0.3",
"allure-commandline": "^2.27.0",
"babel-jest": "^29.7.0",
"fake-indexeddb": "^5.0.2",
"glob": "^10.3.10",
"http-proxy": "^1.18.1",
Expand All @@ -80,6 +69,7 @@
"jest-jasmine2": "^29.7.0",
"madge": "^6.1.0",
"react-refresh": "^0.14.0",
"swc-loader": "^0.2.6",
"tsconfig-paths-webpack-plugin": "^4.1.0",
"upath": "^2.0.1",
"workbox-webpack-plugin": "^7.0.0"
Expand Down
3 changes: 2 additions & 1 deletion webapp/packages/core-client-activity/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@
"main": "dist/index.js",
"scripts": {
"build": "tsc -b",
"clean": "rimraf --glob dist",
"lint": "eslint ./src/ --ext .ts,.tsx",
"lint-fix": "eslint ./src/ --ext .ts,.tsx --fix",
"validate-dependencies": "core-cli-validate-dependencies",
"update-ts-references": "rimraf --glob dist && typescript-resolve-references"
"update-ts-references": "yarn run clean && typescript-resolve-references"
},
"dependencies": {
"@cloudbeaver/core-di": "~0.1.0",
Expand Down
3 changes: 2 additions & 1 deletion webapp/packages/core-connections/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@
"main": "dist/index.js",
"scripts": {
"build": "tsc -b",
"clean": "rimraf --glob dist",
"lint": "eslint ./src/ --ext .ts,.tsx",
"lint-fix": "eslint ./src/ --ext .ts,.tsx --fix",
"validate-dependencies": "core-cli-validate-dependencies",
"update-ts-references": "rimraf --glob dist && typescript-resolve-references"
"update-ts-references": "yarn run clean && typescript-resolve-references"
},
"dependencies": {
"@cloudbeaver/core-authentication": "~0.1.0",
Expand Down
3 changes: 2 additions & 1 deletion webapp/packages/core-data-context/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@
"main": "dist/index.js",
"scripts": {
"build": "tsc -b",
"clean": "rimraf --glob dist",
"lint": "eslint ./src/ --ext .ts,.tsx",
"lint-fix": "eslint ./src/ --ext .ts,.tsx --fix",
"validate-dependencies": "core-cli-validate-dependencies",
"update-ts-references": "rimraf --glob dist && typescript-resolve-references"
"update-ts-references": "yarn run clean && typescript-resolve-references"
},
"dependencies": {
"@cloudbeaver/core-di": "~0.1.0",
Expand Down
5 changes: 3 additions & 2 deletions webapp/packages/core-di/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@
"main": "dist/index.js",
"scripts": {
"build": "tsc -b",
"clean": "rimraf --glob dist",
"lint": "eslint ./src/ --ext .ts,.tsx",
"lint-fix": "eslint ./src/ --ext .ts,.tsx --fix",
"test": "yarn build && core-cli-test",
"test": "core-cli-test",
"validate-dependencies": "core-cli-validate-dependencies",
"update-ts-references": "rimraf --glob dist && typescript-resolve-references"
"update-ts-references": "yarn run clean && typescript-resolve-references"
},
"dependencies": {
"@cloudbeaver/core-executor": "~0.1.0",
Expand Down
3 changes: 2 additions & 1 deletion webapp/packages/core-dialogs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@
"main": "dist/index.js",
"scripts": {
"build": "tsc -b",
"clean": "rimraf --glob dist",
"lint": "eslint ./src/ --ext .ts,.tsx",
"lint-fix": "eslint ./src/ --ext .ts,.tsx --fix",
"validate-dependencies": "core-cli-validate-dependencies",
"update-ts-references": "rimraf --glob dist && typescript-resolve-references"
"update-ts-references": "yarn run clean && typescript-resolve-references"
},
"dependencies": {
"@cloudbeaver/core-di": "~0.1.0",
Expand Down
5 changes: 3 additions & 2 deletions webapp/packages/core-events/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@
"main": "dist/index.js",
"scripts": {
"build": "tsc -b",
"clean": "rimraf --glob dist",
"lint": "eslint ./src/ --ext .ts,.tsx",
"lint-fix": "eslint ./src/ --ext .ts,.tsx --fix",
"test": "yarn build && core-cli-test",
"test": "core-cli-test",
"validate-dependencies": "core-cli-validate-dependencies",
"update-ts-references": "rimraf --glob dist && typescript-resolve-references"
"update-ts-references": "yarn run clean && typescript-resolve-references"
},
"dependencies": {
"@cloudbeaver/core-di": "~0.1.0",
Expand Down
5 changes: 3 additions & 2 deletions webapp/packages/core-executor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@
"main": "dist/index.js",
"scripts": {
"build": "tsc -b",
"clean": "rimraf --glob dist",
"lint": "eslint ./src/ --ext .ts,.tsx",
"lint-fix": "eslint ./src/ --ext .ts,.tsx --fix",
"test": "yarn build && core-cli-test",
"test": "core-cli-test",
"validate-dependencies": "core-cli-validate-dependencies",
"update-ts-references": "rimraf --glob dist && typescript-resolve-references"
"update-ts-references": "yarn run clean && typescript-resolve-references"
},
"dependencies": {
"mobx": "^6.12.0"
Expand Down
Loading

0 comments on commit 4261083

Please sign in to comment.