From 55757d8e3042e3d94c856075f17798b7134f8faa Mon Sep 17 00:00:00 2001 From: mattRedBox Date: Sun, 10 May 2020 14:22:29 +1000 Subject: [PATCH] Fixes: #979: Fix dependencies so upgrade does not trigger libraries which require node version > 8 lts. Update use of font-awesome and vue-directive-tooltip with upgrade. Upgrade to babel 7 due to dependencies required in upgrade. Update configuration to support babel7 and deprecation of kitchen-sink env support. Move to Terser webpack and update config for faster packing (no more idling at >90%). --- .babelrc | 171 +- .electron-vue/webpack.main.config.js | 4 +- .electron-vue/webpack.renderer.config.js | 16 +- .electron-vue/webpack.test.config.js | 3 +- .nycrc | 5 +- package.json | 60 +- src/renderer/components/Errors.vue | 2 +- src/renderer/components/Home.vue | 2 +- src/renderer/components/KeyboardHelp.vue | 2 +- src/renderer/mixins/Tooltip.vue | 2 +- yarn.lock | 9256 ++++++++++------------ 11 files changed, 4393 insertions(+), 5130 deletions(-) diff --git a/.babelrc b/.babelrc index 0c6444f96..8fbe1be06 100644 --- a/.babelrc +++ b/.babelrc @@ -3,41 +3,178 @@ "env": { "unit": { "presets": [ - ["env", { + [ + "@babel/preset-env", + { "targets": { "node": 8 }, - "modules": false - }], - "stage-0" + "modules": false, + "useBuiltIns": "entry", + "corejs": 3 + } + ] ], - "plugins": ["istanbul", "rewire"] + "plugins": [ + "istanbul", + "rewire", + "@babel/plugin-syntax-dynamic-import", + "@babel/plugin-syntax-import-meta", + "@babel/plugin-proposal-class-properties", + "@babel/plugin-proposal-json-strings", + [ + "@babel/plugin-proposal-decorators", + { + "legacy": true + } + ], + "@babel/plugin-proposal-function-sent", + "@babel/plugin-proposal-export-namespace-from", + "@babel/plugin-proposal-numeric-separator", + "@babel/plugin-proposal-throw-expressions", + "@babel/plugin-proposal-export-default-from", + "@babel/plugin-proposal-logical-assignment-operators", + "@babel/plugin-proposal-optional-chaining", + [ + "@babel/plugin-proposal-pipeline-operator", + { + "proposal": "minimal" + } + ], + "@babel/plugin-proposal-nullish-coalescing-operator", + "@babel/plugin-proposal-do-expressions", + "@babel/plugin-proposal-function-bind" + ] }, "test": { "presets": [ - ["env", { - "targets": { "node": 8 } - }], - "stage-0" + [ + "@babel/preset-env", + { + "targets": { + "node": 8 + }, + "useBuiltIns": "entry", + "corejs": 3 + } + ] + ], + "plugins": [ + "istanbul", + "@babel/plugin-syntax-dynamic-import", + "@babel/plugin-syntax-import-meta", + "@babel/plugin-proposal-class-properties", + "@babel/plugin-proposal-json-strings", + [ + "@babel/plugin-proposal-decorators", + { + "legacy": true + } ], - "plugins": ["istanbul"] + "@babel/plugin-proposal-function-sent", + "@babel/plugin-proposal-export-namespace-from", + "@babel/plugin-proposal-numeric-separator", + "@babel/plugin-proposal-throw-expressions", + "@babel/plugin-proposal-export-default-from", + "@babel/plugin-proposal-logical-assignment-operators", + "@babel/plugin-proposal-optional-chaining", + [ + "@babel/plugin-proposal-pipeline-operator", + { + "proposal": "minimal" + } + ], + "@babel/plugin-proposal-nullish-coalescing-operator", + "@babel/plugin-proposal-do-expressions", + "@babel/plugin-proposal-function-bind" + ] }, "main": { "presets": [ - ["env", { + [ + "@babel/preset-env", + { "targets": { "node": 8 + }, + "modules": false, + "useBuiltIns": "entry", + "corejs": 3 + } + ] + ], + "plugins": [ + "@babel/plugin-syntax-dynamic-import", + "@babel/plugin-syntax-import-meta", + "@babel/plugin-proposal-class-properties", + "@babel/plugin-proposal-json-strings", + [ + "@babel/plugin-proposal-decorators", + { + "legacy": true + } + ], + "@babel/plugin-proposal-function-sent", + "@babel/plugin-proposal-export-namespace-from", + "@babel/plugin-proposal-numeric-separator", + "@babel/plugin-proposal-throw-expressions", + "@babel/plugin-proposal-export-default-from", + "@babel/plugin-proposal-logical-assignment-operators", + "@babel/plugin-proposal-optional-chaining", + [ + "@babel/plugin-proposal-pipeline-operator", + { + "proposal": "minimal" } - }], - "stage-0" + ], + "@babel/plugin-proposal-nullish-coalescing-operator", + "@babel/plugin-proposal-do-expressions", + "@babel/plugin-proposal-function-bind" ] }, "renderer": { "presets": [ - ["env", { + [ + "@babel/preset-env", + { "modules": false - }], - "stage-0" + } + ] + ], + "plugins": [ + "@babel/plugin-syntax-dynamic-import", + "@babel/plugin-syntax-import-meta", + "@babel/plugin-proposal-class-properties", + "@babel/plugin-proposal-json-strings", + [ + "@babel/plugin-proposal-decorators", + { + "legacy": true + } + ], + "@babel/plugin-proposal-function-sent", + "@babel/plugin-proposal-export-namespace-from", + "@babel/plugin-proposal-numeric-separator", + "@babel/plugin-proposal-throw-expressions", + "@babel/plugin-proposal-export-default-from", + "@babel/plugin-proposal-logical-assignment-operators", + "@babel/plugin-proposal-optional-chaining", + [ + "@babel/plugin-proposal-pipeline-operator", + { + "proposal": "minimal" + } + ], + "@babel/plugin-proposal-nullish-coalescing-operator", + "@babel/plugin-proposal-do-expressions", + "@babel/plugin-proposal-function-bind" ] } }, - "plugins": ["transform-runtime"] + "plugins": [ + [ + "@babel/plugin-transform-runtime", + { + "corejs": 3 + } + ] + ] } diff --git a/.electron-vue/webpack.main.config.js b/.electron-vue/webpack.main.config.js index a6746738f..ec34a0660 100644 --- a/.electron-vue/webpack.main.config.js +++ b/.electron-vue/webpack.main.config.js @@ -7,7 +7,7 @@ const {dependencies} = require('../package.json') const webpack = require('webpack') // despite `DeprecationWarning: Tapable.plugin is deprecated.` Do not upgrade: causes issues with handsontable creating blanks/repeats in rows -const BabiliWebpackPlugin = require('babili-webpack-plugin') +const TerserPlugin = require('terser-webpack-plugin'); let mainConfig = { entry: { @@ -76,7 +76,7 @@ if (process.env.NODE_ENV !== 'production') { */ if (process.env.NODE_ENV === 'production') { mainConfig.plugins.push( - new BabiliWebpackPlugin(), + new TerserPlugin(), new webpack.DefinePlugin({ 'process.env.NODE_ENV': '"production"' }) diff --git a/.electron-vue/webpack.renderer.config.js b/.electron-vue/webpack.renderer.config.js index 806f49313..594c517a2 100644 --- a/.electron-vue/webpack.renderer.config.js +++ b/.electron-vue/webpack.renderer.config.js @@ -7,7 +7,8 @@ const {dependencies} = require('../package.json') const webpack = require('webpack') // despite `DeprecationWarning: Tapable.plugin is deprecated.` Do not upgrade: causes issues with handsontable creating blanks/repeats in rows -const BabiliWebpackPlugin = require('babili-webpack-plugin') +// const BabiliWebpackPlugin = require('babili-webpack-plugin') +const TerserPlugin = require('terser-webpack-plugin'); const CopyWebpackPlugin = require('copy-webpack-plugin') const MiniCssExtractPlugin = require('mini-css-extract-plugin') const HtmlWebpackPlugin = require('html-webpack-plugin') @@ -52,15 +53,7 @@ let rendererConfig = { name: "vendor", chunks: "initial", minSize: 1 - }, - styles: { - name: 'styles', - test: /\.s?css$/, - chunks: 'initial', - minChunks: 1, - reuseExistingChunk: true, - enforce: true, - }, + } } } } : {}, @@ -158,7 +151,6 @@ let rendererConfig = { }, plugins: [ new VueLoaderPlugin(), - new MiniCssExtractPlugin({filename: 'styles.css'}), createHtmlPlugin('index'), createHtmlPlugin('keyboardhelp'), createHtmlPlugin('urldialog'), @@ -210,7 +202,6 @@ if (process.env.NODE_ENV === 'production' && !process.env.KARMA) { rendererConfig.devtool = '' rendererConfig.plugins.push( - new BabiliWebpackPlugin(), new CopyWebpackPlugin([ { from: path.join(__dirname, '../static'), @@ -225,7 +216,6 @@ if (process.env.NODE_ENV === 'production' && !process.env.KARMA) { minimize: true }) ) - rendererConfig.optimization.minimize = true } module.exports = rendererConfig diff --git a/.electron-vue/webpack.test.config.js b/.electron-vue/webpack.test.config.js index a0a7e5546..7e8baecd9 100644 --- a/.electron-vue/webpack.test.config.js +++ b/.electron-vue/webpack.test.config.js @@ -10,8 +10,7 @@ const {dependencies} = require('../package.json') const webpack = require('webpack') const WebpackShellPlugin = require('webpack-shell-plugin') -const BabiliWebpackPlugin = require('babili-webpack-plugin') - +const TerserPlugin = require('terser-webpack-plugin'); let mainTestConfig = { externals: [nodeExternals()], module: { diff --git a/.nycrc b/.nycrc index eb894623f..11392f4c6 100644 --- a/.nycrc +++ b/.nycrc @@ -6,8 +6,9 @@ "text" ], "require": [ - "babel-register", - "babel-polyfill" + "@babel/register", + "core-js/stable", + "regenerator-runtime/runtime" ], "exclude" : [ "node_modules" diff --git a/package.json b/package.json index f8835fd02..291b6785f 100644 --- a/package.json +++ b/package.json @@ -29,10 +29,10 @@ "unit": "yarn run clean && karma start test/unit/karma.conf.js", "e2e": "yarn run clean && yarn run pack && yarn run cucumber:postpack", "e2e:dev": "yarn run cucumber:postpack:dev && yarn run cucumber:report", - "cucumber:postpack": "cross-env BABEL_ENV=test nyc cucumber-js --require-module babel-core/register test/features -f json:test/cucumber_report.json", - "cucumber:postpack:dev": "cross-env BABEL_ENV=test cucumber-js --fail-fast --require-module babel-core/register --tags @dev test/features", - "cucumber:postpack:impl": "cross-env BABEL_ENV=test nyc cucumber-js --require-module babel-core/register --tags @impl test/features -f json:test/cucumber_report.json", - "cucumber:postpack:witharg": "cross-env BABEL_ENV=test cucumber-js --require-module babel-core/register --tags @impl -f json:test/cucumber_report.json", + "cucumber:postpack": "cross-env BABEL_ENV=test nyc cucumber-js --require-module @babel/register test/features -f json:test/cucumber_report.json", + "cucumber:postpack:dev": "cross-env BABEL_ENV=test cucumber-js --fail-fast --require-module @babel/register --tags @dev test/features", + "cucumber:postpack:impl": "cross-env BABEL_ENV=test nyc cucumber-js --require-module @babel/register --tags @impl test/features -f json:test/cucumber_report.json", + "cucumber:postpack:witharg": "cross-env BABEL_ENV=test cucumber-js --require-module @babel/register --tags @impl -f json:test/cucumber_report.json", "cucumber:report": "node test/cucumber-report.js", "cucumber:report:badge": "node test/postreport.js", "unit:coverage": "cat test/unit/coverage/lcov.info | coveralls" @@ -108,7 +108,7 @@ "sortablejs": "^1.6.0", "spectron-fake-dialog": "^0.0.1", "svgo": "^1.0.5", - "tableschema": "^1.9.1", + "tableschema": "~1.9.1", "tmp": "^0.0.33", "unzipper": "^0.8.14", "vee-validate": "^2.0.9", @@ -126,28 +126,42 @@ "zeroclipboard": "^2.3.0" }, "devDependencies": { - "@vue/test-utils": "^1.0.0-beta.25", - "babel-cli": "^6.26.0", - "babel-core": "^6.26.3", - "babel-eslint": "^8.2.3", - "babel-loader": "^7.1.4", + "@babel/core": "^7.0.0", + "@babel/plugin-proposal-class-properties": "^7.0.0", + "@babel/plugin-proposal-decorators": "^7.0.0", + "@babel/plugin-proposal-do-expressions": "^7.0.0", + "@babel/plugin-proposal-export-default-from": "^7.0.0", + "@babel/plugin-proposal-export-namespace-from": "^7.0.0", + "@babel/plugin-proposal-function-bind": "^7.0.0", + "@babel/plugin-proposal-function-sent": "^7.0.0", + "@babel/plugin-proposal-json-strings": "^7.0.0", + "@babel/plugin-proposal-logical-assignment-operators": "^7.0.0", + "@babel/plugin-proposal-nullish-coalescing-operator": "^7.0.0", + "@babel/plugin-proposal-numeric-separator": "^7.0.0", + "@babel/plugin-proposal-optional-chaining": "^7.0.0", + "@babel/plugin-proposal-pipeline-operator": "^7.0.0", + "@babel/plugin-proposal-throw-expressions": "^7.0.0", + "@babel/plugin-syntax-dynamic-import": "^7.0.0", + "@babel/plugin-syntax-import-meta": "^7.0.0", + "@babel/plugin-transform-runtime": "^7.0.0", + "@babel/preset-env": "^7.0.0", + "@babel/register": "^7.0.0", + "@babel/runtime-corejs3": "^7.7.7", + "@vue/test-utils": "1.0.0-beta.28", + "babel-eslint": "^9.0.0", + "babel-loader": "^8.0.0", "babel-plugin-istanbul": "^5.1.0", "babel-plugin-rewire": "^1.2.0", - "babel-plugin-transform-runtime": "^6.23.0", - "babel-polyfill": "^6.26.0", - "babel-preset-env": "^1.7.0", - "babel-preset-stage-0": "^6.24.1", - "babel-register": "^6.26.0", - "babili-webpack-plugin": "^0.1.2", - "cfonts": "^2.2.2", + "cfonts": "2.5.0", "chai": "^4.1.2", "chai-as-promised": "^7.1.1", - "chalk": "^2.4.1", + "chalk": "^3.0.0", "copy-webpack-plugin": "^4.5.1", + "core-js": "^3.6.0", "coveralls": "^3.0.1", "cross-env": "^5.1.6", - "css-loader": "^0.28.11", - "cucumber": "^4.1.0", + "css-loader": "^3.4.0", + "cucumber": "^6.0.5", "cucumber-html-reporter": "^4.0.2", "del": "^3.0.0", "devtron": "^1.4.0", @@ -171,10 +185,10 @@ "html-webpack-plugin": "^3.2.0", "json-loader": "^0.5.4", "jsonfile": "^4.0.0", - "karma": "^3.1.1", + "karma": "^4.4.1", "karma-coverage": "^1.1.2", "karma-coveralls": "^2.1.0", - "karma-electron": "^6.0.0", + "karma-electron": "^6.3.0", "karma-mocha": "^1.3.0", "karma-sinon-chai": "^2.0.2", "karma-sourcemap-loader": "^0.3.7", @@ -189,6 +203,7 @@ "node-loader": "^0.6.0", "nyc": "^13.1.0", "readme-badger": "^0.3.0", + "regenerator-runtime": "^0.13.3", "replace-in-file": "^3.4.0", "require-dir": "^1.0.0", "sinon": "^7.1.0", @@ -199,6 +214,7 @@ "style-loader": "^0.23.1", "stylus": "^0.54.5", "stylus-loader": "^3.0.2", + "terser-webpack-plugin": "^2.3.1", "url-loader": "^1.1.1", "vue-html-loader": "^1.2.4", "vue-loader": "^15.4.2", diff --git a/src/renderer/components/Errors.vue b/src/renderer/components/Errors.vue index cc891549b..8aeda3c37 100644 --- a/src/renderer/components/Errors.vue +++ b/src/renderer/components/Errors.vue @@ -164,7 +164,7 @@ export default { }