diff --git a/babel.config.js b/babel.config.js index b052c6f3..fec4115a 100644 --- a/babel.config.js +++ b/babel.config.js @@ -1,8 +1,8 @@ -'use strict'; - module.exports = { presets: [ + '@babel/react', '@babel/preset-typescript', + '@babel/preset-env' ], plugins: [ ['@babel/plugin-proposal-class-properties', { loose: true }], @@ -27,6 +27,10 @@ module.exports = { '@babel/plugin-transform-runtime', '@babel/plugin-proposal-nullish-coalescing-operator', '@babel/plugin-proposal-optional-chaining', - ['@babel/plugin-proposal-private-methods', { 'loose': true }] + ['@babel/plugin-proposal-private-methods', { 'loose': true }], + ['@babel/plugin-proposal-private-property-in-object', { 'loose': true }], + '@babel/plugin-syntax-jsx', + '@babel/plugin-transform-react-jsx', + '@babel/plugin-transform-flow-strip-types', ], }; diff --git a/package.json b/package.json index c2859238..2091aad8 100644 --- a/package.json +++ b/package.json @@ -34,18 +34,22 @@ "@babel/plugin-transform-shorthand-properties": "^7.10.4", "@babel/plugin-transform-spread": "^7.11.0", "@babel/plugin-transform-template-literals": "^7.10.5", - "@babel/preset-env": "^7.14.7", + "@babel/preset-env": "^7.16.11", "@babel/preset-flow": "^7.10.4", - "@babel/preset-react": "^7.14.5", - "@babel/preset-typescript": "7.8.3", + "@babel/preset-react": "^7.16.7", + "@babel/preset-typescript": "^7.16.7", "@babel/register": "^7.14.5", "@babel/traverse": "^7.11.0", "@cloudsop/eview-ui": "^0.1.65", "@mattiasbuelens/web-streams-polyfill": "^0.3.2", "art": "0.10.1", + "babel-core": "^6.26.3", "babel-eslint": "^10.0.3", + "babel-jest": "^27.5.1", "babel-loader": "^8.2.2", "babel-plugin-syntax-trailing-function-commas": "^6.5.0", + "babel-preset-env": "^1.7.0", + "babel-preset-react": "^6.24.1", "chalk": "^3.0.0", "clean-webpack-plugin": "^4.0.0-alpha.0", "cli-table": "^0.3.1", @@ -81,7 +85,7 @@ "gzip-size": "^5.1.1", "html-webpack-plugin": "4.4.1", "jasmine-check": "^1.0.0-rc.0", - "jest": "^25.2.7", + "jest": "^25.5.4", "jest-cli": "^25.2.7", "jest-diff": "^25.2.6", "jest-environment-jsdom-sixteen": "^1.0.3", @@ -102,6 +106,7 @@ "react-is": "^17.0.2", "react-lifecycles-compat": "^3.0.4", "react-router-dom": "^5.2.0", + "regenerator-runtime": "^0.13.9", "resemblejs": "^4.0.0", "rimraf": "^3.0.0", "semver": "^7.1.1", @@ -120,19 +125,17 @@ "devEngines": { "node": "8.x || 9.x || 10.x || 11.x || 12.x || 13.x || 14.x" }, - "jest": { - "testRegex": "/scripts/jest/dont-run-jest-directly\\.js$" - }, "scripts": { "build": " webpack --config ./scripts/webpack/webpack.config.js", "build-3rdLib": "node ./scripts/gen3rdLib.js", "build-3rdLib-dev": "node ./scripts/gen3rdLib.js --dev", "debug-test": "yarn test --debug", - "test": "node ./scripts/jest/jest-cli.js", + "test": "jest --config=jest.config.js", "watch-test": "yarn test --watch --release-channel=horizon --dev" }, "dependencies": { "@elg/speedscope": "^1.9.0-a6f84db", + "@types/node": "^17.0.18", "babel-code-frame": "^6.26.0", "grunt-cli": "^1.4.3", "react-dom": "^17.0.2", diff --git a/scripts/webpack/webpack.base.js b/scripts/webpack/webpack.base.js index 4895ebda..ed5ed92d 100644 --- a/scripts/webpack/webpack.base.js +++ b/scripts/webpack/webpack.base.js @@ -10,7 +10,9 @@ const baseConfig = { test: /\.(js)|ts$/, exclude: /node_modules/, use: [ - { loader: 'babel-loader' } + { + loader: 'babel-loader' + } ] }, ] diff --git a/scripts/webpack/webpack.pro.js b/scripts/webpack/webpack.pro.js index e142ad44..b57b8eba 100644 --- a/scripts/webpack/webpack.pro.js +++ b/scripts/webpack/webpack.pro.js @@ -11,7 +11,7 @@ const plugins = [ new webpack.DefinePlugin({ 'process.env.NODE_ENV': '"production"', isDev: 'false', - }), + }) ]; const proBaseConfig = { diff --git a/tsconfig.json b/tsconfig.json index f3af2c18..e05c4501 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -36,5 +36,6 @@ "./libs/**/src/**/*.ts", "libs/index.d.ts" ], - "exclude": ["node_modules", "**/*.spec.ts", "dev"] + "exclude": ["node_modules", "**/*.spec.ts", "dev"], + "types": ["node"], }