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": {
|
||||
"serve": "webpack-dev-server --config webpack.dev.js",
|
||||
"build": "webpack --config webpack.prod.js",
|
||||
"lint": "vue-cli-service lint"
|
||||
"lint": "eslint ."
|
||||
},
|
||||
"dependencies": {
|
||||
"@fortawesome/fontawesome-svg-core": "^6.1.2",
|
||||
"@fortawesome/free-solid-svg-icons": "^6.1.2",
|
||||
"@fortawesome/vue-fontawesome": "^3.0.1",
|
||||
"axios": "^1.8.4",
|
||||
"bootstrap": "^5.2.0",
|
||||
"@fortawesome/fontawesome-svg-core": "^7.3.1",
|
||||
"@fortawesome/free-solid-svg-icons": "^7.3.1",
|
||||
"@fortawesome/vue-fontawesome": "^3.3.3",
|
||||
"axios": "^1.20.0",
|
||||
"bootstrap": "^5.3.8",
|
||||
"hammerjs": "^2.0.8",
|
||||
"jwt-decode": "^4.0.0",
|
||||
"reveal.js": "^5.2.1",
|
||||
"reveal.js": "^6.0.2",
|
||||
"timeago.js": "^4.0.2",
|
||||
"vue": "^3.5.13",
|
||||
"vue-router": "^4.0.3",
|
||||
"vue-toast-notification": "^3.0",
|
||||
"vue": "^3.5.44",
|
||||
"vue-router": "^5.4.0",
|
||||
"vue-toast-notification": "^3.1.3",
|
||||
"vuejs-paginate-next": "^1.0.2",
|
||||
"vuex": "^4.0.0",
|
||||
"webpack": "^5.98.0"
|
||||
"vuex": "^4.1.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.26.10",
|
||||
"@vue/cli-plugin-babel": "^5.0.8",
|
||||
"@vue/cli-plugin-router": "^5.0.0",
|
||||
"@vue/cli-plugin-vuex": "^5.0.0",
|
||||
"@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",
|
||||
"css-loader": "^7.1.5",
|
||||
"eslint": "^10.12.0",
|
||||
"eslint-plugin-vue": "^10.11.1",
|
||||
"mini-css-extract-plugin": "^2.10.2",
|
||||
"style-loader": "^4.0.0",
|
||||
"terser-webpack-plugin": "^5.3.14",
|
||||
"terser-webpack-plugin": "^5.6.1",
|
||||
"vue-loader": "^17.4.2",
|
||||
"webpack-bundle-analyzer": "^4.10.2",
|
||||
"webpack-bundle-tracker": "^3.1.1",
|
||||
"webpack-cli": "^6.0.1"
|
||||
},
|
||||
"eslintConfig": {
|
||||
"root": true,
|
||||
"env": {
|
||||
"node": true
|
||||
},
|
||||
"extends": [
|
||||
"plugin:vue/vue3-essential",
|
||||
"eslint:recommended"
|
||||
],
|
||||
"parserOptions": {
|
||||
"parser": "@babel/eslint-parser"
|
||||
},
|
||||
"rules": {}
|
||||
"webpack": "^5.111.1",
|
||||
"webpack-bundle-tracker": "^3.2.4",
|
||||
"webpack-cli": "^7.2.3",
|
||||
"webpack-dev-server": "^6.0.0",
|
||||
"@eslint/js": "^10.0.1"
|
||||
},
|
||||
"browserslist": [
|
||||
"defaults"
|
||||
|
||||
@@ -10,26 +10,22 @@ const LoginView = () => import('@/views/LoginView')
|
||||
const HistoryView = () => import('@/views/HistoryView')
|
||||
|
||||
// Navigation guard to check if user is authenticated
|
||||
function requireAuth(to, from, next) {
|
||||
function requireAuth(to) {
|
||||
if (!store.getters.isAuthenticated) {
|
||||
next({
|
||||
return {
|
||||
name: 'login',
|
||||
query: { next: to.fullPath, error: 'Please log in to access this page' }
|
||||
});
|
||||
} else {
|
||||
next();
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
// Navigation guard to check if user is admin
|
||||
function requireAdmin(to, from, next) {
|
||||
function requireAdmin(to) {
|
||||
if (!store.getters.isAuthenticated || !store.getters.is_superuser) {
|
||||
next({
|
||||
return {
|
||||
name: 'login',
|
||||
query: { next: to.fullPath, error: 'Admin access required' }
|
||||
});
|
||||
} else {
|
||||
next();
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -67,7 +67,7 @@ export default {
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
$route(to, from) {
|
||||
$route() {
|
||||
this.updateUsers()
|
||||
this.crumbs = [...default_crumbs]
|
||||
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