Skip to content

Commit

Permalink
Fixes: #979: Fix dependencies so upgrade does not trigger libraries w…
Browse files Browse the repository at this point in the history
…hich 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%).
  • Loading branch information
mattRedBox committed May 10, 2020
1 parent e00e0b3 commit 1a466c0
Show file tree
Hide file tree
Showing 11 changed files with 4,393 additions and 5,130 deletions.
171 changes: 154 additions & 17 deletions .babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
]
]
}
4 changes: 2 additions & 2 deletions .electron-vue/webpack.main.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down Expand Up @@ -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"'
})
Expand Down
16 changes: 3 additions & 13 deletions .electron-vue/webpack.renderer.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down Expand Up @@ -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,
},
}
}
}
} : {},
Expand Down Expand Up @@ -158,7 +151,6 @@ let rendererConfig = {
},
plugins: [
new VueLoaderPlugin(),
new MiniCssExtractPlugin({filename: 'styles.css'}),
createHtmlPlugin('index'),
createHtmlPlugin('keyboardhelp'),
createHtmlPlugin('urldialog'),
Expand Down Expand Up @@ -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'),
Expand All @@ -225,7 +216,6 @@ if (process.env.NODE_ENV === 'production' && !process.env.KARMA) {
minimize: true
})
)
rendererConfig.optimization.minimize = true
}

module.exports = rendererConfig
3 changes: 1 addition & 2 deletions .electron-vue/webpack.test.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down
5 changes: 3 additions & 2 deletions .nycrc
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@
"text"
],
"require": [
"babel-register",
"babel-polyfill"
"@babel/register",
"core-js/stable",
"regenerator-runtime/runtime"
],
"exclude" : [
"node_modules"
Expand Down
60 changes: 38 additions & 22 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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",
Expand All @@ -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",
Expand All @@ -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",
Expand All @@ -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",
Expand All @@ -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",
Expand Down
Loading

0 comments on commit 1a466c0

Please sign in to comment.