mirror of
https://github.com/ajurna/cbwebreader.git
synced 2026-11-02 10:36:55 +00:00
Upgrade frontend dependencies and switch ESLint to a flat config
- Runtime majors: vue-router 5, reveal.js 6, fontawesome 7. Checked against the code that uses them: no change needed for reveal.js (the default export is still a callable factory and every method/option used is still present) or fontawesome (all seven registered icons still resolve). - frontend/src/router/index.js: guards return the redirect instead of calling the deprecated next() callback, which works on vue-router 4 and 5. - Add frontend/eslint.config.mjs because eslint 10 requires a flat config; the lint script now runs eslint directly instead of vue-cli-service. - Drop tooling nothing in the webpack configs uses (@vue/cli-*, jshint, html-webpack-plugin, webpack-bundle-analyzer, @babel/core) and delete the dead vue.config.js. npm audit 35 -> 5 (all dev-only), --omit=dev is 0. - frontend/src/views/UserView.vue: the $route watcher no longer declares unused params.
This commit is contained in:
1 parent
6bcdf89fdc
commit
4d0ba750ad
6 files changed
+2769
-8453
No files matched your search
@@ -0,0 +1,43 @@
|
|||||||
|
import js from '@eslint/js'
|
||||||
|
import pluginVue from 'eslint-plugin-vue'
|
||||||
|
|
||||||
|
export default [
|
||||||
|
{ ignores: ['dist/**', 'node_modules/**', 'public/**'] },
|
||||||
|
js.configs.recommended,
|
||||||
|
...pluginVue.configs['flat/essential'],
|
||||||
|
|
||||||
|
// Build scripts (webpack.*.js) run in Node, so they use CommonJS globals.
|
||||||
|
{
|
||||||
|
files: ['**/*.js'],
|
||||||
|
languageOptions: {
|
||||||
|
ecmaVersion: 2022,
|
||||||
|
sourceType: 'commonjs',
|
||||||
|
globals: {
|
||||||
|
require: 'readonly',
|
||||||
|
module: 'readonly',
|
||||||
|
__dirname: 'readonly',
|
||||||
|
process: 'readonly',
|
||||||
|
console: 'readonly',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
// Application code is browser code bundled by webpack.
|
||||||
|
{
|
||||||
|
files: ['src/**'],
|
||||||
|
languageOptions: {
|
||||||
|
ecmaVersion: 2022,
|
||||||
|
sourceType: 'module',
|
||||||
|
globals: {
|
||||||
|
window: 'readonly',
|
||||||
|
document: 'readonly',
|
||||||
|
localStorage: 'readonly',
|
||||||
|
console: 'readonly',
|
||||||
|
setTimeout: 'readonly',
|
||||||
|
clearTimeout: 'readonly',
|
||||||
|
process: 'readonly',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
rules: {},
|
||||||
|
},
|
||||||
|
]
|
||||||
Generated
+2698
-8393
File diff suppressed because it is too large.
Load diff
+21
-39
@@ -5,55 +5,37 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"serve": "webpack-dev-server --config webpack.dev.js",
|
"serve": "webpack-dev-server --config webpack.dev.js",
|
||||||
"build": "webpack --config webpack.prod.js",
|
"build": "webpack --config webpack.prod.js",
|
||||||
"lint": "vue-cli-service lint"
|
"lint": "eslint ."
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@fortawesome/fontawesome-svg-core": "^6.1.2",
|
"@fortawesome/fontawesome-svg-core": "^7.3.1",
|
||||||
"@fortawesome/free-solid-svg-icons": "^6.1.2",
|
"@fortawesome/free-solid-svg-icons": "^7.3.1",
|
||||||
"@fortawesome/vue-fontawesome": "^3.0.1",
|
"@fortawesome/vue-fontawesome": "^3.3.3",
|
||||||
"axios": "^1.8.4",
|
"axios": "^1.20.0",
|
||||||
"bootstrap": "^5.2.0",
|
"bootstrap": "^5.3.8",
|
||||||
"hammerjs": "^2.0.8",
|
"hammerjs": "^2.0.8",
|
||||||
"jwt-decode": "^4.0.0",
|
"jwt-decode": "^4.0.0",
|
||||||
"reveal.js": "^5.2.1",
|
"reveal.js": "^6.0.2",
|
||||||
"timeago.js": "^4.0.2",
|
"timeago.js": "^4.0.2",
|
||||||
"vue": "^3.5.13",
|
"vue": "^3.5.44",
|
||||||
"vue-router": "^4.0.3",
|
"vue-router": "^5.4.0",
|
||||||
"vue-toast-notification": "^3.0",
|
"vue-toast-notification": "^3.1.3",
|
||||||
"vuejs-paginate-next": "^1.0.2",
|
"vuejs-paginate-next": "^1.0.2",
|
||||||
"vuex": "^4.0.0",
|
"vuex": "^4.1.0"
|
||||||
"webpack": "^5.98.0"
|
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/core": "^7.26.10",
|
"css-loader": "^7.1.5",
|
||||||
"@vue/cli-plugin-babel": "^5.0.8",
|
"eslint": "^10.12.0",
|
||||||
"@vue/cli-plugin-router": "^5.0.0",
|
"eslint-plugin-vue": "^10.11.1",
|
||||||
"@vue/cli-plugin-vuex": "^5.0.0",
|
"mini-css-extract-plugin": "^2.10.2",
|
||||||
"@vue/cli-service": "^5.0.8",
|
|
||||||
"eslint": "^9.24.0",
|
|
||||||
"eslint-plugin-vue": "^10.0.0",
|
|
||||||
"jshint": "^2.13.5",
|
|
||||||
"mini-css-extract-plugin": "^2.9.2",
|
|
||||||
"style-loader": "^4.0.0",
|
"style-loader": "^4.0.0",
|
||||||
"terser-webpack-plugin": "^5.3.14",
|
"terser-webpack-plugin": "^5.6.1",
|
||||||
"vue-loader": "^17.4.2",
|
"vue-loader": "^17.4.2",
|
||||||
"webpack-bundle-analyzer": "^4.10.2",
|
"webpack": "^5.111.1",
|
||||||
"webpack-bundle-tracker": "^3.1.1",
|
"webpack-bundle-tracker": "^3.2.4",
|
||||||
"webpack-cli": "^6.0.1"
|
"webpack-cli": "^7.2.3",
|
||||||
},
|
"webpack-dev-server": "^6.0.0",
|
||||||
"eslintConfig": {
|
"@eslint/js": "^10.0.1"
|
||||||
"root": true,
|
|
||||||
"env": {
|
|
||||||
"node": true
|
|
||||||
},
|
|
||||||
"extends": [
|
|
||||||
"plugin:vue/vue3-essential",
|
|
||||||
"eslint:recommended"
|
|
||||||
],
|
|
||||||
"parserOptions": {
|
|
||||||
"parser": "@babel/eslint-parser"
|
|
||||||
},
|
|
||||||
"rules": {}
|
|
||||||
},
|
},
|
||||||
"browserslist": [
|
"browserslist": [
|
||||||
"defaults"
|
"defaults"
|
||||||
|
|||||||
@@ -10,26 +10,22 @@ const LoginView = () => import('@/views/LoginView')
|
|||||||
const HistoryView = () => import('@/views/HistoryView')
|
const HistoryView = () => import('@/views/HistoryView')
|
||||||
|
|
||||||
// Navigation guard to check if user is authenticated
|
// Navigation guard to check if user is authenticated
|
||||||
function requireAuth(to, from, next) {
|
function requireAuth(to) {
|
||||||
if (!store.getters.isAuthenticated) {
|
if (!store.getters.isAuthenticated) {
|
||||||
next({
|
return {
|
||||||
name: 'login',
|
name: 'login',
|
||||||
query: { next: to.fullPath, error: 'Please log in to access this page' }
|
query: { next: to.fullPath, error: 'Please log in to access this page' }
|
||||||
});
|
};
|
||||||
} else {
|
|
||||||
next();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Navigation guard to check if user is admin
|
// Navigation guard to check if user is admin
|
||||||
function requireAdmin(to, from, next) {
|
function requireAdmin(to) {
|
||||||
if (!store.getters.isAuthenticated || !store.getters.is_superuser) {
|
if (!store.getters.isAuthenticated || !store.getters.is_superuser) {
|
||||||
next({
|
return {
|
||||||
name: 'login',
|
name: 'login',
|
||||||
query: { next: to.fullPath, error: 'Admin access required' }
|
query: { next: to.fullPath, error: 'Admin access required' }
|
||||||
});
|
};
|
||||||
} else {
|
|
||||||
next();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
$route(to, from) {
|
$route() {
|
||||||
this.updateUsers()
|
this.updateUsers()
|
||||||
this.crumbs = [...default_crumbs]
|
this.crumbs = [...default_crumbs]
|
||||||
if (this.userid){
|
if (this.userid){
|
||||||
|
|||||||
@@ -1,10 +0,0 @@
|
|||||||
const { defineConfig } = require('@vue/cli-service')
|
|
||||||
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer')
|
|
||||||
.BundleAnalyzerPlugin;
|
|
||||||
|
|
||||||
module.exports = defineConfig({
|
|
||||||
transpileDependencies: true,
|
|
||||||
configureWebpack: {
|
|
||||||
plugins: [new BundleAnalyzerPlugin()]
|
|
||||||
},
|
|
||||||
})
|
|
||||||
Reference in new issue
Block a user