feat: upgrade dependencies and lockfile (#5016)

- Close https://github.com/toeverything/AFFiNE/security/dependabot/47
This commit is contained in:
LongYinan
2023-11-23 05:18:05 +00:00
parent 4c8d54b3a7
commit 3499dbbb7f
40 changed files with 5090 additions and 4594 deletions

View File

@@ -2,6 +2,7 @@ import type { i18n, Resource } from 'i18next';
import i18next from 'i18next';
import {
I18nextProvider,
type I18nextProviderProps,
initReactI18next,
Trans,
useTranslation as useRootTranslation,
@@ -66,8 +67,9 @@ const standardizeLocale = (language: string) => {
return fallbackLng;
};
export const createI18n = () => {
const i18n = i18next.createInstance();
export const createI18n = (): I18nextProviderProps['i18n'] => {
// @ts-expect-error ts bug
const i18n: I18nextProviderProps['i18n'] = i18next.createInstance();
i18n
.use(initReactI18next)
.init({

View File

@@ -1,3 +1,5 @@
import type { Request } from 'undici-types';
// cSpell:ignore Tolgee
const TOLGEE_API_KEY = process.env['TOLGEE_API_KEY'];
const TOLGEE_API_URL = 'https://i18n.affine.pro';
@@ -15,7 +17,7 @@ const withTolgee = (
'Content-Type': 'application/json',
});
const isRequest = (input: RequestInfo | URL): input is Request => {
const isRequest = (input: NodeJS.fetch.RequestInfo): input is Request => {
return typeof input === 'object' && !('href' in input);
};
@@ -31,6 +33,7 @@ const withTolgee = (
argArray[0] = {
...argArray[0],
url: `${baseUrl}${argArray[0].url}`,
// @ts-expect-error Node.js types incorrectly define RequestInit
headers,
};
}