Merge pull request #600 from Ravinou/updates

chore: 🧹 update dependencies
This commit is contained in:
Ravinou 2025-12-04 21:56:07 +01:00 committed by GitHub
commit d9a8ecf70b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
19 changed files with 5115 additions and 2765 deletions

View file

@ -1,4 +1,4 @@
export default {
const config = {
extends: ['@commitlint/config-conventional'],
rules: {
'type-enum': [
@ -26,3 +26,5 @@ export default {
},
ignores: [(message) => message.includes('WIP'), (message) => message.includes('wip')],
};
export default config;

View file

@ -1,6 +0,0 @@
{
"extends": [
"next/core-web-vitals",
"next/typescript"
]
}

View file

@ -46,4 +46,4 @@ jobs:
run: npm ci
- name: Run ESLint
run: npm run lint
run: npx eslint

View file

@ -1,4 +1,4 @@
import { useState } from 'react';
import { useState, useMemo } from 'react';
import classes from './Repo.module.css';
import {
IconSettings,
@ -22,6 +22,8 @@ type RepoProps = Omit<Repository, 'unixUser' | 'displayDetails'> & {
export default function Repo(props: RepoProps) {
const isMobile = useMedia({ maxWidth: 1000 });
const currentDate = useMemo(() => new Date(), []);
//Load displayDetails from LocalStorage
const displayDetailsFromLS = (): boolean => {
const key = `displayDetailsRepo${props.id}`;
@ -110,7 +112,7 @@ export default function Repo(props: RepoProps) {
>
{props.lastSave === 0
? '-'
: formatDistanceStrict(fromUnixTime(props.lastSave), Date.now(), {
: formatDistanceStrict(fromUnixTime(props.lastSave), currentDate, {
addSuffix: true,
})}
</span>
@ -177,7 +179,7 @@ export default function Repo(props: RepoProps) {
>
{props.lastSave === 0
? '-'
: formatDistanceStrict(fromUnixTime(props.lastSave), Date.now(), {
: formatDistanceStrict(fromUnixTime(props.lastSave), currentDate, {
addSuffix: true,
})}
</div>
@ -223,7 +225,7 @@ export default function Repo(props: RepoProps) {
>
{props.lastSave === 0
? '-'
: formatDistanceStrict(fromUnixTime(props.lastSave), Date.now(), {
: formatDistanceStrict(fromUnixTime(props.lastSave), currentDate, {
addSuffix: true,
})}
</span>

View file

@ -48,15 +48,7 @@ function WizardStep1() {
Vorta
</a>
.
<br />
Vorta runs on Linux, MacOS and Windows (via Windows Linux Subsystem (WSL)). Find the right
way to install it{' '}
<a href='https://vorta.borgbase.com/install/' target='_blank' rel='noreferrer'>
just here
</a>
.
</div>
<img src='/vorta-demo.gif' alt='Vorta GIF' />
</div>
);
}

View file

@ -69,8 +69,8 @@ function WizardStep2(props: WizardStepProps) {
<h2>Pika, Vorta...</h2>
<div className={classes.description}>
To "Initialize a new repository" or "Add existing repository", copy this into the field
"Repository URL" of your graphical client :
To &quot;Initialize a new repository&quot; or &quot;Add existing repository&quot;, copy this
into the field &quot;Repository URL&quot; of your graphical client :
<br />
<div
style={{
@ -98,7 +98,7 @@ function WizardStep2(props: WizardStepProps) {
<b>Check the fingerprint of server</b>
</div>
To check that you are talking to the right server, please make sure to validate one of the
following key's fingerprint when you first connect :
following key&apos;s fingerprint when you first connect :
<li>
<span className={classes.sshPublicKey}>
ECDSA : {wizardEnv?.SSH_SERVER_FINGERPRINT_ECDSA}

View file

@ -102,7 +102,7 @@ function WizardStep3(props: WizardStepProps) {
}}
>
<div className={classes.code}>
borg export-tar --tar-filter="gzip -9" ssh://
borg export-tar --tar-filter=&quot;gzip -9&quot; ssh://
{UNIX_USER}@{FQDN}
{SSH_SERVER_PORT}/./
{props.selectedRepo?.repositoryName}

View file

@ -42,8 +42,16 @@ export default function RepoList() {
const [displayRepoAdd, setDisplayRepoAdd] = useState(false);
const [displayRepoEdit, setDisplayRepoEdit] = useState(false);
const [wizardEnv, setWizardEnv] = useState<Optional<WizardEnvType>>();
const [sortOption, setSortOption] = useState<SortOption>('alias-asc');
const [searchQuery, setSearchQuery] = useState('');
const [sortOption, setSortOption] = useState<SortOption>(() => {
const savedSort = localStorage.getItem('repoSort');
return (savedSort as SortOption) || 'alias-asc';
});
const [searchQuery, setSearchQuery] = useState(() => {
const savedSearch = localStorage.getItem('repoSearch');
return savedSearch || '';
});
const toastOptions: ToastOptions = {
position: 'top-right',
@ -55,21 +63,10 @@ export default function RepoList() {
progress: undefined,
};
// Load filters from localStorage
useEffect(() => {
const savedSort = localStorage.getItem('repoSort');
const savedSearch = localStorage.getItem('repoSearch');
if (savedSort) setSortOption(savedSort as SortOption);
if (savedSearch) setSearchQuery(savedSearch);
}, []);
useEffect(() => {
if (router.pathname === '/manage-repo/add') {
setDisplayRepoAdd(!displayRepoAdd);
}
if (router.pathname.startsWith('/manage-repo/edit')) {
setDisplayRepoEdit(!displayRepoEdit);
}
// eslint-disable-next-line react-hooks/set-state-in-effect
setDisplayRepoAdd(router.pathname === '/manage-repo/add');
setDisplayRepoEdit(router.pathname.startsWith('/manage-repo/edit'));
const fetchWizardEnv = async () => {
try {
@ -81,7 +78,7 @@ export default function RepoList() {
}
};
fetchWizardEnv();
}, []);
}, [router.pathname]);
const fetcher = async (url: string) => await fetch(url).then((res) => res.json());
const { data, error } = useSWR('/api/v1/repositories', fetcher);

View file

@ -63,7 +63,10 @@ function SetupWizard(props: SetupWizardProps) {
//Component did update
useEffect(() => {
//Go to the step in the URL param when URL change
props.step && setStep(props.step);
if (props.step) {
// eslint-disable-next-line react-hooks/set-state-in-effect
setStep(props.step);
}
}, [props.step]);
//Options for react-select

View file

@ -58,6 +58,7 @@ export default function AppriseAlertSettings() {
}
};
getAppriseAlert();
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);
////Functions

View file

@ -47,6 +47,7 @@ export default function AppriseURLs() {
}
};
getAppriseServices();
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);
//Form submit handler to modify Apprise services

View file

@ -56,6 +56,7 @@ export default function EmailAlertSettings() {
}
};
dataFetch();
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);
////Functions

View file

@ -84,6 +84,7 @@ export default function Integrations() {
////LifeCycle
useEffect(() => {
fetchTokenList();
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);
// Permissions handler

View file

@ -41,7 +41,8 @@ export default function UserSettings({ data }: UserSettingsProps) {
if (tab === 'Integrations' && wizardEnv?.DISABLE_INTEGRATIONS === 'true') {
setTab('General');
}
}, [wizardEnv, tab]);
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [wizardEnv?.DISABLE_INTEGRATIONS]);
return (
<div className={classes.containerSettings}>

16
eslint.config.mjs Normal file
View file

@ -0,0 +1,16 @@
import { defineConfig, globalIgnores } from 'eslint/config';
import nextVitals from 'eslint-config-next/core-web-vitals';
const eslintConfig = defineConfig([
...nextVitals,
// Override default ignores of eslint-config-next.
globalIgnores([
// Default ignores of eslint-config-next:
'.next/**',
'out/**',
'build/**',
'next-env.d.ts',
]),
]);
export default eslintConfig;

1
next-env.d.ts vendored
View file

@ -1,5 +1,6 @@
/// <reference types="next" />
/// <reference types="next/image-types/global" />
import "./.next/dev/types/routes.d.ts";
// NOTE: This file should not be edited
// see https://nextjs.org/docs/pages/api-reference/config/typescript for more information.

6146
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -6,47 +6,48 @@
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "next lint",
"lint": "npx eslint",
"test": "vitest",
"setup": "npm install && npm run setup:hooks",
"setup:hooks": "npx husky install",
"format": "prettier --write \"{Components,Containers,helpers,pages,styles}/**/*.{js,jsx,ts,tsx,json,css,scss,md}\""
},
"dependencies": {
"@tabler/icons-react": "^3.34.0",
"@tabler/icons-react": "^3.35.0",
"async-mutex": "^0.5.0",
"bcryptjs": "^3.0.2",
"chart.js": "^4.4.9",
"bcryptjs": "^3.0.3",
"chart.js": "^4.5.1",
"date-fns": "^4.1.0",
"lowdb": "^7.0.1",
"next": "^15.3.4",
"next-auth": "^4.24.10",
"nodemailer": "^6.10.1",
"next": "^16.0.7",
"next-auth": "^4.24.13",
"nodemailer": "^7.0.11",
"nprogress": "^0.2.0",
"react": "^19.1.0",
"react-chartjs-2": "^5.3.0",
"react-dom": "^19.1.0",
"react-hook-form": "^7.63.0",
"react": "^19.2.1",
"react-chartjs-2": "^5.3.1",
"react-dom": "^19.2.1",
"react-hook-form": "^7.68.0",
"react-select": "^5.10.2",
"react-toastify": "^11.0.5",
"swr": "^2.3.4",
"swr": "^2.3.7",
"use-media": "^1.5.0",
"uuid": "^11.1.0"
"uuid": "^13.0.0"
},
"devDependencies": {
"@commitlint/cli": "^19.8.1",
"@commitlint/config-conventional": "^19.8.1",
"@commitlint/cli": "^20.1.0",
"@commitlint/config-conventional": "^20.0.0",
"@types/bcryptjs": "^2.4.6",
"@types/node": "^22.15.30",
"@types/nodemailer": "^6.4.17",
"@types/node": "^24.10.1",
"@types/nodemailer": "^7.0.4",
"@types/nprogress": "^0.2.3",
"@types/react": "^19.1.8",
"@types/react": "^19.2.7",
"@types/supertest": "^6.0.3",
"eslint-config-next": "^15.5.3",
"eslint": "^9.39.1",
"eslint-config-next": "^16.0.7",
"husky": "^9.1.7",
"node-mocks-http": "^1.17.2",
"prettier": "^3.6.2",
"typescript": "^5.8.3",
"vitest": "^3.1.4"
"prettier": "^3.7.4",
"typescript": "^5.9.3",
"vitest": "^4.0.15"
}
}

View file

@ -1,11 +1,16 @@
{
"compilerOptions": {
"baseUrl": ".",
"paths": {
"~/*": ["./*"]
"~/*": [
"./*"
]
},
"target": "ES2017",
"lib": ["dom", "dom.iterable", "esnext"],
"lib": [
"dom",
"dom.iterable",
"esnext"
],
"allowJs": false,
"skipLibCheck": true,
"strict": true,
@ -16,9 +21,17 @@
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "preserve",
"types": ["vitest/globals"] // Auto import vitest types
"jsx": "react-jsx",
"types": [
"vitest/globals"
] // Auto import vitest types
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"],
"exclude": ["node_modules"]
"include": [
"next-env.d.ts",
"**/*.ts",
"**/*.tsx"
],
"exclude": [
"node_modules"
]
}