chore: upgrade deps

This commit is contained in:
lin onetwo 2023-05-19 10:37:26 +08:00
parent ba1bb755da
commit d064cfe260
23 changed files with 11712 additions and 35566 deletions

View file

@ -1,3 +1,4 @@
// eslint-disable-next-line @typescript-eslint/no-var-requires
const tsEslintConfig = require('./tsconfig.eslint.json');
module.exports = {
@ -32,7 +33,7 @@ module.exports = {
},
},
rules: {
'no-use-before-define': ['error', { ignoreTypeReferences: true, functions: false }],
'no-use-before-define': ['error', { functions: false }],
'unicorn/prevent-abbreviations': [
'error',
{
@ -95,10 +96,20 @@ module.exports = {
'unicorn/prefer-ternary': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
semi: [0],
'no-use-before-define': [0],
'@typescript-eslint/no-use-before-define': [1],
'unused-imports/no-unused-imports': 'error',
'unused-imports/no-unused-vars': ['warn', { vars: 'all', varsIgnorePattern: '^_', args: 'after-used', argsIgnorePattern: '^_' }],
'dprint-integration/dprint': [
'warn',
// Global Config (will pass to the dprint formatter directly): Available at https://dprint.dev/config/
{
useDprintJson: true,
},
// Plugin Specific Config (will pass to the dprint plugins): Available at https://dprint.dev/plugins/
{
useDprintJson: true,
},
],
},
extends: [
'eslint:recommended',
@ -106,7 +117,6 @@ module.exports = {
'plugin:security/recommended',
'plugin:react/recommended',
'plugin:unicorn/recommended',
'plugin:prettier/recommended',
'standard-with-typescript',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
@ -115,13 +125,14 @@ module.exports = {
'plugin:import/warnings',
'plugin:import/typescript',
'plugin:react-hooks/recommended',
'prettier',
'plugin:dprint-integration/recommended',
'plugin:dprint-integration/disable-conflict',
'plugin:security-node/recommended',
'plugin:typescript-sort-keys/recommended',
],
plugins: [
'@typescript-eslint/eslint-plugin',
'prettier',
'dprint-integration',
'react',
'html',
'typescript-sort-keys',

22
dprint.json Normal file
View file

@ -0,0 +1,22 @@
{
"lineWidth": 160,
"typescript": {
"quoteProps": "asNeeded",
"quoteStyle": "preferSingle",
"binaryExpression.operatorPosition": "sameLine"
},
"json": {},
"markdown": {},
"includes": [
"**/*.{ts,tsx,js,jsx,cjs,mjs,json,md}",
"./*.json",
"./*.js",
"packages/*/.*.js"
],
"excludes": ["**/node_modules", "**/*-lock.json"],
"plugins": [
"https://plugins.dprint.dev/typescript-0.84.1.wasm",
"https://plugins.dprint.dev/json-0.17.1.wasm",
"https://plugins.dprint.dev/markdown-0.15.2.wasm"
]
}

View file

@ -91,7 +91,7 @@ const config = {
An unhandled rejection has occurred inside Forge:
[object Object]
*/
/* {
{
name: '@reforged/maker-appimage',
platforms: ['linux'],
config: {
@ -101,7 +101,7 @@ const config = {
icon: 'build-resources/icon.ico',
},
},
}, */
},
/**
* Making for target: flatpak - On platform: linux - For arch: x64

35443
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -1,5 +1,5 @@
{
"name": "TidGi",
"name": "tidgi",
"productName": "TidGi",
"description": "Customizable personal knowledge-base with Github as unlimited storage and blogging platform.",
"version": "0.7.15-prerelease",
@ -27,160 +27,154 @@
"author": "Lin Onetwo <linonetwo012@gmail.com>, Quang Lam <quang.lam2807@gmail.com>",
"main": ".webpack/main",
"dependencies": {
"@tiddlygit/tiddlywiki": "^5.2.6-prerelease-2022-12-20",
"@tiddlygit/tiddlywiki": "^5.3.0-prerelease-2023-05-20",
"app-path": "4.0.0",
"best-effort-json-parser": "1.0.0",
"best-effort-json-parser": "1.0.1",
"bluebird": "3.7.2",
"default-gateway": "6.0.3",
"dugite": "^2.1.0",
"dugite": "^2.5.0",
"electron-ipc-cat": "1.2.9",
"electron-is-packaged": "1.0.2",
"electron-settings": "4.0.2",
"electron-settings": "5.0.0",
"electron-squirrel-startup": "1.0.0",
"electron-unhandled": "4.0.1",
"electron-util": "0.17.2",
"electron-window-state": "5.0.3",
"errio": "1.2.2",
"fs-extra": "11.1.0",
"fs-extra": "11.1.1",
"git-sync-js": "^1.0.4",
"i18next": "22.4.5",
"i18next": "22.5.0",
"i18next-electron-fs-backend": "3.0.0",
"i18next-fs-backend": "2.1.0",
"i18next-fs-backend": "2.1.2",
"intercept-stdout": "0.1.2",
"inversify": "6.0.1",
"inversify-inject-decorators": "3.1.0",
"ipaddr.js": "2.0.1",
"jimp": "0.16.2",
"jimp": "0.22.8",
"lodash": "4.17.21",
"menubar": "9.2.3",
"nanoid": "^4.0.0",
"node-fetch": "3.3.0",
"menubar": "9.3.0",
"nanoid": "^4.0.2",
"node-fetch": "3.3.1",
"reflect-metadata": "0.1.13",
"registry-js": "1.15.1",
"rxjs": "7.8.0",
"semver": "7.3.8",
"rxjs": "7.8.1",
"semver": "7.5.1",
"source-map-support": "0.5.21",
"strip-ansi": "^7.0.1",
"threads": "1.7.0",
"type-fest": "3.4.0",
"type-fest": "3.10.0",
"typescript-styled-is": "^2.1.0",
"v8-compile-cache-lib": "^3.0.1",
"winston": "3.8.2",
"winston-daily-rotate-file": "4.7.1",
"winston-transport": "4.5.0",
"zx": "7.1.1"
"zx": "7.2.2"
},
"devDependencies": {
"@cucumber/cucumber": "8.9.1",
"@cucumber/cucumber": "9.1.2",
"@dnd-kit/core": "4.0.0",
"@dnd-kit/modifiers": "4.0.0",
"@dnd-kit/sortable": "5.0.0",
"@dnd-kit/utilities": "3.0.0",
"@electron-forge/cli": "6.0.4",
"@electron-forge/maker-deb": "6.0.4",
"@electron-forge/maker-flatpak": "6.0.4",
"@electron-forge/maker-rpm": "6.0.4",
"@electron-forge/maker-snap": "6.0.4",
"@electron-forge/maker-squirrel": "6.0.4",
"@electron-forge/maker-wix": "6.0.4",
"@electron-forge/maker-zip": "6.0.4",
"@electron-forge/plugin-auto-unpack-natives": "6.0.4",
"@electron-forge/plugin-webpack": "6.0.4",
"@electron/rebuild": "^3.2.10",
"@electron-forge/cli": "6.1.1",
"@electron-forge/maker-deb": "6.1.1",
"@electron-forge/maker-flatpak": "6.1.1",
"@electron-forge/maker-rpm": "6.1.1",
"@electron-forge/maker-snap": "6.1.1",
"@electron-forge/maker-squirrel": "6.1.1",
"@electron-forge/maker-wix": "6.1.1",
"@electron-forge/maker-zip": "6.1.1",
"@electron-forge/plugin-auto-unpack-natives": "6.1.1",
"@electron-forge/plugin-webpack": "6.1.1",
"@electron/rebuild": "^3.2.13",
"@material-ui/core": "5.0.0-alpha.27",
"@material-ui/icons": "5.0.0-alpha.27",
"@material-ui/lab": "5.0.0-alpha.27",
"@material-ui/styled-engine-sc": "5.0.0-alpha.26",
"@reforged/maker-appimage": "^2.1.0",
"@reforged/maker-appimage": "^3.2.0",
"@types/bluebird": "3.5.38",
"@types/chai": "4.3.4",
"@types/chai": "4.3.5",
"@types/circular-dependency-plugin": "5.0.5",
"@types/copy-webpack-plugin": "10.1.0",
"@types/csp-html-webpack-plugin": "3.0.2",
"@types/electron-window-state": "5.0.0",
"@types/eslint": "8.4.10",
"@types/eslint-plugin-prettier": "3.1.0",
"@types/eslint": "8.37.0",
"@types/event-hooks-webpack-plugin": "2.2.2",
"@types/fs-extra": "9.0.13",
"@types/fs-extra": "11.0.1",
"@types/i18next-fs-backend": "1.1.2",
"@types/intercept-stdout": "0.1.0",
"@types/ip": "1.1.0",
"@types/lodash": "4.14.191",
"@types/node": "18.11.16",
"@types/prettier": "2.7.1",
"@types/react": "18.0.26",
"@types/react-dom": "18.0.9",
"@types/lodash": "4.14.194",
"@types/node": "20.2.1",
"@types/react": "18.2.6",
"@types/react-dom": "18.2.4",
"@types/react-helmet": "6.1.6",
"@types/rimraf": "3.0.2",
"@types/semver": "7.3.13",
"@types/rimraf": "4.0.5",
"@types/semver": "7.5.0",
"@types/source-map-support": "0.5.6",
"@types/styled-components": "5.1.26",
"@types/webpack-bundle-analyzer": "4.6.0",
"@types/webpack-node-externals": "2.5.3",
"@typescript-eslint/eslint-plugin": "5.46.1",
"@typescript-eslint/parser": "5.46.1",
"@types/webpack-node-externals": "3.0.0",
"@typescript-eslint/eslint-plugin": "5.59.6",
"@typescript-eslint/parser": "5.59.6",
"@vercel/webpack-asset-relocator-loader": "1.7.3",
"ajv": "^8.11.2",
"ajv": "^8.12.0",
"authing-js-sdk": "4.23.29",
"beautiful-react-hooks": "3.11.2",
"beautiful-react-hooks": "4.3.0",
"chai": "4.3.7",
"circular-dependency-plugin": "5.2.2",
"copy-webpack-plugin": "11.0.0",
"cross-env": "7.0.3",
"csp-html-webpack-plugin": "5.1.0",
"css-loader": "6.7.3",
"date-fns": "2.29.3",
"electron": "22.0.0",
"css-loader": "6.7.4",
"date-fns": "2.30.0",
"dprint": "^0.36.1",
"electron": "24.3.1",
"electron-wix-msi": "^5.0.0",
"esbuild-loader": "^2.20.0",
"eslint": "8.30.0",
"eslint-config-prettier": "8.5.0",
"esbuild-loader": "^3.0.1",
"eslint": "8.40.0",
"eslint-config-standard": "^17.0.0",
"eslint-config-standard-with-typescript": "24.0.0",
"eslint-config-standard-with-typescript": "34.0.1",
"eslint-import-resolver-alias": "1.1.2",
"eslint-import-resolver-typescript": "3.5.2",
"eslint-import-resolver-typescript": "3.5.5",
"eslint-plugin-autofix": "^1.1.0",
"eslint-plugin-dprint-integration": "^0.3.0",
"eslint-plugin-html": "7.1.0",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-n": "^15.6.0",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-n": "^16.0.0",
"eslint-plugin-node": "11.1.0",
"eslint-plugin-prettier": "4.2.1",
"eslint-plugin-promise": "^6.1.1",
"eslint-plugin-react": "7.31.11",
"eslint-plugin-react": "7.32.2",
"eslint-plugin-react-hooks": "4.6.0",
"eslint-plugin-security": "1.5.0",
"eslint-plugin-security": "1.7.1",
"eslint-plugin-security-node": "1.1.1",
"eslint-plugin-typescript-sort-keys": "2.1.0",
"eslint-plugin-unicorn": "45.0.2",
"eslint-plugin-typescript-sort-keys": "2.3.0",
"eslint-plugin-unicorn": "47.0.0",
"eslint-plugin-unused-imports": "^2.0.0",
"event-hooks-webpack-plugin": "2.2.0",
"fork-ts-checker-webpack-plugin": "7.2.14",
"graphql-hooks": "6.0.5",
"event-hooks-webpack-plugin": "2.3.0",
"fork-ts-checker-webpack-plugin": "8.0.0",
"graphql-hooks": "6.2.3",
"if-env": "1.0.4",
"json5": "^2.2.2",
"node-abi": "^3.30.0",
"json5": "^2.2.3",
"node-abi": "^3.40.0",
"node-loader": "2.0.0",
"prettier": "2.8.1",
"react": "18.2.0",
"react-dom": "18.2.0",
"react-helmet": "6.1.0",
"react-i18next": "12.1.1",
"rimraf": "3.0.2",
"react-i18next": "12.3.1",
"rimraf": "5.0.1",
"simplebar": "6.0.0-beta.4",
"simplebar-react": "3.0.0-beta.5",
"spectron": "19.0.0",
"style-loader": "3.3.1",
"style-loader": "3.3.2",
"styled-components": "5.3.6",
"threads-plugin": "1.4.0",
"ts-import-plugin": "2.0.0",
"ts-import-plugin": "3.0.0",
"ts-loader": "9.4.2",
"ts-node": "10.9.1",
"tw5-typed": "^0.2.15",
"tw5-typed": "^0.2.27",
"typeface-roboto": "1.1.13",
"typescript": "4.9.4",
"typescript": "5.0.4",
"typescript-plugin-styled-components": "2.0.0",
"typesync": "0.9.2",
"webpack-bundle-analyzer": "4.7.0",
"typesync": "0.11.0",
"webpack-bundle-analyzer": "4.8.0",
"webpack-node-externals": "3.0.0",
"webpack5-externals-plugin": "1.0.4",
"webpackbar": "5.0.2"

11564
pnpm-lock.yaml generated Normal file

File diff suppressed because it is too large Load diff

View file

@ -3,7 +3,7 @@ import styled, { keyframes } from 'styled-components';
import { Snackbar, Button, IconButton, Tooltip } from '@material-ui/core';
import { Close as CloseIcon } from '@material-ui/icons';
import { useTranslation } from 'react-i18next';
import { useDebouncedCallback } from 'beautiful-react-hooks';
import useDebouncedCallback from 'beautiful-react-hooks/useDebouncedCallback';
const progressAnimation = keyframes`
from {

View file

@ -5,7 +5,7 @@ import styled from 'styled-components';
import { useQuery, useMutation, GraphQLClient, ClientContext } from 'graphql-hooks';
import { trim } from 'lodash';
import { useTranslation } from 'react-i18next';
import { useDebouncedCallback } from 'beautiful-react-hooks';
import useDebouncedCallback from 'beautiful-react-hooks/useDebouncedCallback';
import { TextField, LinearProgress, List, ListItem, ListItemIcon, ListItemText, Button } from '@material-ui/core';
import { Folder as FolderIcon, Cached as CachedIcon, CreateNewFolder as CreateNewFolderIcon } from '@material-ui/icons';

View file

@ -1,6 +1,6 @@
import { useEffect, useState, useCallback } from 'react';
import { AsyncReturnType } from 'type-fest';
import { useDebouncedCallback } from 'beautiful-react-hooks';
import useDebouncedCallback from 'beautiful-react-hooks/useDebouncedCallback';
/**
* Use value from service, especially constant value that never changes

View file

@ -1,4 +1,4 @@
import { usePreviousValue } from 'beautiful-react-hooks';
import usePreviousValue from 'beautiful-react-hooks/usePreviousValue';
import { useState, useEffect, useCallback } from 'react';
import { IWorkspace } from '@services/workspaces/interface';

View file

@ -1,6 +1,6 @@
import React, { useEffect, useState } from 'react';
import { useTranslation } from 'react-i18next';
import { useDebouncedCallback } from 'beautiful-react-hooks';
import useDebouncedCallback from 'beautiful-react-hooks/useDebouncedCallback';
import { List } from '@material-ui/core';

View file

@ -1,5 +1,5 @@
import { useState, useEffect } from 'react';
import { useObservable } from 'beautiful-react-hooks';
import useObservable from 'beautiful-react-hooks/useObservable';
import { IUserInfos } from './interface';
import { SupportedStorageServices } from '@services/types';
import { IGitUserInfos } from '@services/git/interface';

View file

@ -1,13 +1,13 @@
import { ipcMain, IpcMainInvokeEvent } from 'electron';
import { ipcMain, type IpcMainInvokeEvent } from 'electron';
import fs from 'fs-extra';
import path from 'path';
import type { IWindowService } from '@services/windows/interface';
import serviceIdentifier from '@services/serviceIdentifier';
import { container } from '@services/container';
import { LOCALIZATION_FOLDER } from '@/constants/paths';
import { I18NChannels } from '@/constants/channels';
import { IReadFileRequest, IWriteFileRequest } from './types';
import { LOCALIZATION_FOLDER } from '@/constants/paths';
import { container } from '@services/container';
import serviceIdentifier from '@services/serviceIdentifier';
import type { IWindowService } from '@services/windows/interface';
import { type IReadFileRequest, type IWriteFileRequest } from './types';
/**
* This is the code that will go into the main.js file
@ -21,28 +21,31 @@ export function mainBindings(): void {
void windowService.sendToAllWindows(I18NChannels.readFileResponse, {
key: readFileArguments.key,
error,
data: typeof data !== 'undefined' && data !== null ? data.toString() : '',
data: data !== undefined && data !== null ? data.toString() : '',
});
});
});
ipcMain.handle(I18NChannels.writeFileRequest, (_event: IpcMainInvokeEvent, writeFileArguments: IWriteFileRequest) => {
ipcMain.handle(I18NChannels.writeFileRequest, async (_event: IpcMainInvokeEvent, writeFileArguments: IWriteFileRequest) => {
const localeFilePath = path.join(LOCALIZATION_FOLDER, writeFileArguments.filename);
const localeFileFolderPath = path.dirname(localeFilePath);
const windowService = container.get<IWindowService>(serviceIdentifier.Window);
fs.ensureDir(localeFileFolderPath, (directoryCreationError?: Error) => {
// eslint-disable-next-line @typescript-eslint/strict-boolean-expressions
if (directoryCreationError) {
console.error(directoryCreationError);
return;
}
fs.writeFile(localeFilePath, JSON.stringify(writeFileArguments.data), (error: Error) => {
void windowService.sendToAllWindows(I18NChannels.writeFileResponse, {
try {
await fs.ensureDir(localeFileFolderPath);
try {
await fs.writeFile(localeFilePath, JSON.stringify(writeFileArguments.data));
} catch (error) {
await windowService.sendToAllWindows(I18NChannels.writeFileResponse, {
keys: writeFileArguments.keys,
error,
});
});
});
}
} catch (directoryCreationError) {
// eslint-disable-next-line @typescript-eslint/strict-boolean-expressions
if (directoryCreationError) {
console.error(directoryCreationError);
}
}
});
}

View file

@ -1,4 +1,4 @@
import { useObservable } from 'beautiful-react-hooks';
import useObservable from 'beautiful-react-hooks/useObservable';
import { useState } from 'react';
import { IPauseNotificationsInfo } from './interface';

View file

@ -1,4 +1,4 @@
import { useObservable } from 'beautiful-react-hooks';
import useObservable from 'beautiful-react-hooks/useObservable';
import { useState } from 'react';
import { IPreferences } from './interface';

View file

@ -1,4 +1,4 @@
import { useObservable } from 'beautiful-react-hooks';
import useObservable from 'beautiful-react-hooks/useObservable';
import { useState } from 'react';
import i18n from 'i18next';

View file

@ -1,4 +1,4 @@
import { useObservable } from 'beautiful-react-hooks';
import useObservable from 'beautiful-react-hooks/useObservable';
import { useState } from 'react';
import { ITheme } from './interface';

View file

@ -1,5 +1,5 @@
import { useState } from 'react';
import { useObservable } from 'beautiful-react-hooks';
import useObservable from 'beautiful-react-hooks/useObservable';
import type { TFunction } from 'i18next';
import { IUpdaterMetaData, IUpdaterStatus } from './interface';

View file

@ -1,6 +1,6 @@
import { useState, useMemo } from 'react';
import { map } from 'rxjs/operators';
import { useObservable } from 'beautiful-react-hooks';
import useObservable from 'beautiful-react-hooks/useObservable';
import { IWorkspaceWithMetadata, IWorkspace } from './interface';
import { workspaceSorter } from './utils';

@ -1 +1 @@
Subproject commit 8a465b27541f310ae59d84774df7cdaa47c5eff1
Subproject commit 2274aa4e9af025ee45fda5989f66c4a19125d5ab

View file

@ -15,7 +15,8 @@
"src/**/*.d.ts",
"public/**/*.d.ts",
"./*.json",
"./*.js"
"./*.js",
"./*.*.js"
],
"exclude": ["template/**/*.js", "src/services/libs/i18n/i18next-electron-fs-backend.ts"]
}

View file

@ -1,6 +1,6 @@
{
"exclude": ["template/**/*.js"],
"include": ["src", "features"],
"include": ["src"],
"ts-node": {
"files": true,
"compilerOptions": {

View file

@ -54,12 +54,6 @@ module.exports = [
libraryDirectory: null,
camel2DashComponentName: false,
}),
tsImportPluginFactory({
style: false,
libraryName: 'beautiful-react-hooks',
libraryDirectory: null,
camel2DashComponentName: false,
}),
// material-ui
tsImportPluginFactory({
libraryName: '@material-ui/core',