From 26560e8d71bc196f530c9660a9755ad49815ae35 Mon Sep 17 00:00:00 2001 From: Michael Mayer Date: Mon, 12 Jul 2021 19:25:37 +0200 Subject: [PATCH] Frontend: Upgrade Webpack from v4 to v5 Most frontend packages have been upgraded as part of this commit. JS unit tests have been refactored alongside. --- frontend/.babelrc | 18 +- frontend/.eslintrc.js | 3 +- frontend/karma.conf.js | 34 +- frontend/package-lock.json | 15103 +++++++++-------- frontend/package.json | 90 +- frontend/postcss.config.js | 6 +- frontend/src/app.js | 2 +- frontend/src/common/api.js | 17 +- frontend/src/common/clipboard.js | 14 +- frontend/src/common/session.js | 7 +- frontend/src/common/websocket.js | 3 +- frontend/tests/unit/common/api_test.js | 260 +- frontend/tests/unit/common/clipboard_test.js | 257 +- frontend/tests/unit/common/config_test.js | 250 +- frontend/tests/unit/common/form_test.js | 1 + frontend/tests/unit/common/notify_test.js | 27 +- frontend/tests/unit/common/session_test.js | 287 +- frontend/tests/unit/common/util_test.js | 245 +- frontend/tests/unit/common/viewer_test.js | 1 + frontend/tests/unit/config.js | 525 + frontend/tests/unit/fixtures.js | 307 + frontend/tests/unit/model/account_test.js | 135 +- frontend/tests/unit/model/album_test.js | 289 +- frontend/tests/unit/model/file_test.js | 634 +- frontend/tests/unit/model/folder_test.js | 477 +- frontend/tests/unit/model/label_test.js | 202 +- frontend/tests/unit/model/link_test.js | 165 +- frontend/tests/unit/model/photo_test.js | 1436 +- frontend/tests/unit/model/rest_test.js | 440 +- frontend/tests/unit/model/settings_test.js | 77 +- frontend/tests/unit/model/thumb_test.js | 512 +- frontend/tests/unit/model/user_test.js | 101 +- frontend/webpack.config.js | 153 +- 33 files changed, 11251 insertions(+), 10827 deletions(-) create mode 100644 frontend/tests/unit/config.js create mode 100644 frontend/tests/unit/fixtures.js diff --git a/frontend/.babelrc b/frontend/.babelrc index 86fcc1c6d..71ef4f6d8 100644 --- a/frontend/.babelrc +++ b/frontend/.babelrc @@ -1,16 +1,8 @@ { - "env": { - "test": { - "presets": [ - "@babel/preset-env" - ], - "plugins": [ - ["@babel/plugin-transform-runtime"], - ["istanbul", {"exclude": ["**/*_test.js"]}] - ] - } - }, - "presets": [ - "@babel/preset-env" + "compact": false, + "presets": ["@babel/preset-env"], + "plugins": [ + "@babel/plugin-proposal-object-rest-spread", + "@babel/plugin-proposal-class-properties" ] } diff --git a/frontend/.eslintrc.js b/frontend/.eslintrc.js index 1e71fd74a..e45045511 100644 --- a/frontend/.eslintrc.js +++ b/frontend/.eslintrc.js @@ -9,9 +9,8 @@ module.exports = { extends: [ "eslint:recommended", "plugin:vue/recommended", + "prettier", "plugin:prettier-vue/recommended", - // Do not add `'prettier/vue'` if you don't want to use prettier for `