From 1132bfd129f909b208c33940b76d699efe7579d5 Mon Sep 17 00:00:00 2001 From: Ferdinand Thiessen Date: Mon, 30 Aug 2021 14:21:53 +0200 Subject: [PATCH] [deps] Update to rc pinia and fix TypeScript version for ESLint --- package.json | 34 +++++++++++------------ src/boot/plugins.ts | 37 +++++++++++++++++++------ src/layouts/MainLayout.vue | 56 ++++++++++---------------------------- 3 files changed, 61 insertions(+), 66 deletions(-) diff --git a/package.json b/package.json index f239571..0131fdd 100644 --- a/package.json +++ b/package.json @@ -19,31 +19,31 @@ "@flaschengeist/users": "^1.0.0-alpha.1", "axios": "^0.21.1", "cordova": "^10.0.0", - "pinia": "2.0.0-beta.5", - "quasar": "^2.0.3" + "pinia": "^2.0.0-rc.6", + "quasar": "^2.0.4" }, "devDependencies": { - "@flaschengeist/types": "^1.0.0-alpha.2", - "@quasar/app": "^3.0.3", - "@quasar/extras": "^1.10.9", - "@types/node": "^12.20.15", + "@flaschengeist/types": "^1.0.0-alpha.4", + "@quasar/app": "^3.1.0", + "@quasar/extras": "^1.10.12", + "@types/node": "^12.20.21", "@types/webpack": "^5.28.0", - "@types/webpack-env": "^1.16.0", - "@typescript-eslint/eslint-plugin": "^4.24.0", - "@typescript-eslint/parser": "^4.24.0", - "eslint": "^7.26.0", + "@types/webpack-env": "^1.16.2", + "@typescript-eslint/eslint-plugin": "^4.29.3", + "@typescript-eslint/parser": "^4.29.3", + "eslint": "^7.32.0", "eslint-config-prettier": "^8.3.0", - "eslint-plugin-vue": "^7.9.0", - "eslint-webpack-plugin": "^2.5.4", - "modify-source-webpack-plugin": "^3.0.0-rc.0", - "prettier": "^2.3.0", - "typescript": "^4.2.4", - "vuedraggable": "^4.0.1" + "eslint-plugin-vue": "^7.17.0", + "eslint-webpack-plugin": "^3.0.1", + "modify-source-webpack-plugin": "^3.0.0", + "prettier": "^2.3.2", + "typescript": "~4.3.5", + "vuedraggable": "^4.1.0" }, "prettier": { "singleQuote": true, "semi": true, - "printWidth": 120, + "printWidth": 100, "arrowParens": "always" }, "browserslist": [ diff --git a/src/boot/plugins.ts b/src/boot/plugins.ts index 5a467ca..4c2f3c9 100644 --- a/src/boot/plugins.ts +++ b/src/boot/plugins.ts @@ -1,5 +1,5 @@ import { Notify } from 'quasar'; -import { api } from 'boot/axios'; +import { api } from 'src/boot/axios'; import { boot } from 'quasar/wrappers'; import routes from 'src/router/routes'; import { AxiosResponse } from 'axios'; @@ -118,7 +118,11 @@ function combineMenuRoutes( target.children = []; } convertRoutes(sourceMainConfig.route, sourceMainConfig.children); - if (sourceMainConfig.children && sourceMainConfig.children.length > 0 && !sourceMainConfig.route.component) + if ( + sourceMainConfig.children && + sourceMainConfig.children.length > 0 && + !sourceMainConfig.route.component + ) Object.assign(sourceMainConfig.route, { component: () => import('src/components/navigation/EmptyParent.vue'), }); @@ -130,14 +134,20 @@ function combineMenuRoutes( return target; } -function combineRoutes(target: RouteRecordRaw[], source: FG_Plugin.NamedRouteRecordRaw[], mainPath: '/' | '/in') { +function combineRoutes( + target: RouteRecordRaw[], + source: FG_Plugin.NamedRouteRecordRaw[], + mainPath: '/' | '/in' +) { // Search parent target.forEach((target) => { if (target.path === mainPath) { // Parent found = target source.forEach((sourceRoute) => { // Check if source is already in target - const targetRoot = target.children?.find((targetRoot) => sourceRoute.path === targetRoot.path); + const targetRoot = target.children?.find( + (targetRoot) => sourceRoute.path === targetRoot.path + ); // Already in target routes, add only children if (targetRoot) { if (targetRoot.children === undefined) targetRoot.children = []; @@ -145,7 +155,11 @@ function combineRoutes(target: RouteRecordRaw[], source: FG_Plugin.NamedRouteRec } else { // Append to target if (target.children === undefined) target.children = []; - if (sourceRoute.children && sourceRoute.children.length > 0 && sourceRoute.component === undefined) + if ( + sourceRoute.children && + sourceRoute.children.length > 0 && + sourceRoute.component === undefined + ) Object.assign(sourceRoute, { component: () => import('src/components/navigation/EmptyParent.vue'), }); @@ -211,7 +225,11 @@ function combineShortcuts(target: FG_Plugin.Shortcut[], source: FG_Plugin.MenuRo * @param plugin Plugin to load * @param router VueRouter instance */ -function loadPlugin(loadedPlugins: FG_Plugin.Flaschengeist, plugin: FG_Plugin.Plugin, backend: Backend) { +function loadPlugin( + loadedPlugins: FG_Plugin.Flaschengeist, + plugin: FG_Plugin.Plugin, + backend: Backend +) { // Check if already loaded if (loadedPlugins.plugins.findIndex((p) => p.name === plugin.name) !== -1) return true; @@ -220,7 +238,8 @@ function loadPlugin(loadedPlugins: FG_Plugin.Flaschengeist, plugin: FG_Plugin.Pl !plugin.requiredModules.every( (required) => backend.plugins[required[0]] !== undefined && - (required.length == 1 || true) /* validate the version, semver440 from python is... tricky on node*/ + (required.length == 1 || + true) /* validate the version, semver440 from python is... tricky on node*/ ) ) { console.error(`Plugin ${plugin.name}: Backend modules not satisfied`); @@ -315,7 +334,9 @@ export default boot(async ({ router, app }) => { // Sort widgets by priority /** @todo Remove priority with first beta */ - loadedPlugins.widgets.sort((a, b) => (b.order || b.priority) - (a.order || a.priority)); + loadedPlugins.widgets.sort( + (a, b) => (b.order || b.priority) - (a.order || a.priority) + ); /** @todo Can be cleaned up with first beta */ loadedPlugins.menuLinks.sort((a, b) => { const diff = a.order && b.order ? b.order - a.order : 0; diff --git a/src/layouts/MainLayout.vue b/src/layouts/MainLayout.vue index 4d0ad96..0542067 100644 --- a/src/layouts/MainLayout.vue +++ b/src/layouts/MainLayout.vue @@ -19,11 +19,7 @@ {{ notifications.length }} - +