[Dev] Bump dependencies (#2152)

This commit is contained in:
Alexander Zinchuk 2022-12-06 13:29:41 +01:00
parent 20549cb6aa
commit d0055d6653
14 changed files with 3559 additions and 18958 deletions

View File

@ -15,3 +15,5 @@ webpack.config.js
jest.config.js
src/lib/secret-sauce/
playwright.config.ts
dist/*

View File

@ -41,7 +41,10 @@
"no-prototype-builtins": "off",
"no-await-in-loop": "off",
"no-nested-ternary": "off",
"function-paren-newline": ["error", "consistent"],
"function-paren-newline": [
"error",
"consistent"
],
"prefer-destructuring": "off",
// Allow for...of. Edited from:
// https://github.com/airbnb/javascript/blob/b4377fb03089dd7f08955242695860d47f9caab4/packages/eslint-config-airbnb-base/rules/style.js#L333
@ -71,13 +74,17 @@
"react/function-component-definition": "off",
// Teact feature
"react/style-prop-object": "off",
"react/jsx-no-bind": ["error", {
"ignoreRefs": true,
"allowArrowFunctions": false,
"allowFunctions": false,
"allowBind": false,
"ignoreDOMComponents": true
}],
"react/no-unknown-property": "off",
"react/jsx-no-bind": [
"error",
{
"ignoreRefs": true,
"allowArrowFunctions": false,
"allowFunctions": false,
"allowBind": false,
"ignoreDOMComponents": true
}
],
"jsx-a11y/click-events-have-key-events": "off",
"jsx-a11y/no-static-element-interactions": "off",
"jsx-a11y/label-has-associated-control": "off",
@ -94,7 +101,10 @@
"@typescript-eslint/camelcase": "off",
"@typescript-eslint/member-delimiter-style": "error",
"@typescript-eslint/default-param-last": "off",
"@typescript-eslint/return-await": ["error", "in-try-catch"],
"@typescript-eslint/return-await": [
"error",
"in-try-catch"
],
"@typescript-eslint/consistent-type-imports": [
"error",
{
@ -106,7 +116,10 @@
},
"settings": {
"import/resolver": "webpack",
"import/core-modules": ["fs", "path"]
"import/core-modules": [
"fs",
"path"
]
},
"parserOptions": {
"project": "./tsconfig.json"

View File

@ -13,7 +13,7 @@ module.exports = {
testEnvironment: 'jsdom',
transform: {
'\\.(jsx?|tsx?)$': 'babel-jest',
'\\.txt$': 'jest-raw-loader',
'\\.txt$': '@glen/jest-raw-loader',
},
globals: {
APP_REVISION: "jest-test",

22337
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -28,8 +28,8 @@
"statoscope:validate-diff": "statoscope validate --input input.json --reference reference.json"
},
"engines": {
"node": "^16.13",
"npm": "^8.5.2"
"node": "^18",
"npm": "^9"
},
"husky": {
"hooks": {
@ -43,93 +43,87 @@
"author": "Alexander Zinchuk (alexander@zinchuk.com)",
"license": "GPL-3.0-or-later",
"devDependencies": {
"@babel/core": "^7.17.9",
"@babel/plugin-proposal-class-properties": "^7.16.7",
"@babel/core": "^7.20.5",
"@babel/plugin-proposal-class-properties": "^7.18.6",
"@babel/plugin-proposal-logical-assignment-operators": "^7.18.9",
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.16.7",
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.18.6",
"@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3",
"@babel/preset-env": "^7.16.11",
"@babel/preset-react": "^7.16.7",
"@babel/preset-typescript": "^7.16.7",
"@peculiar/webcrypto": "^1.3.3",
"@playwright/test": "^1.23.4",
"@statoscope/cli": "^5.20.1",
"@babel/preset-env": "^7.20.2",
"@babel/preset-react": "^7.18.6",
"@babel/preset-typescript": "^7.18.6",
"@glen/jest-raw-loader": "^2.0.0",
"@playwright/test": "^1.28.1",
"@statoscope/cli": "^5.24.0",
"@statoscope/webpack-plugin": "^5.20.1",
"@testing-library/jest-dom": "^5.16.4",
"@testing-library/jest-dom": "^5.16.5",
"@types/croppie": "^2.6.1",
"@types/hast": "^2.3.4",
"@types/jest": "^27.4.1",
"@types/react": "^18.0.5",
"@types/react-dom": "^18.0.0",
"@types/wicg-mediasession": "^1.1.3",
"@typescript-eslint/eslint-plugin": "^5.19.0",
"@typescript-eslint/parser": "^5.19.0",
"@webpack-cli/serve": "^1.6.1",
"autoprefixer": "^10.4.4",
"babel-loader": "^8.2.4",
"@types/jest": "^29.2.3",
"@types/react": "^18.0.25",
"@types/react-dom": "^18.0.9",
"@typescript-eslint/eslint-plugin": "^5.45.0",
"@typescript-eslint/parser": "^5.45.0",
"@webpack-cli/serve": "^2.0.0",
"autoprefixer": "^10.4.13",
"babel-loader": "^9.1.0",
"browserlist": "^1.0.1",
"buffer": "^6.0.3",
"cross-env": "^7.0.3",
"css-loader": "^6.7.1",
"dotenv": "^16.0.0",
"eslint": "^8.13.0",
"css-loader": "^6.7.2",
"dotenv": "^16.0.3",
"eslint": "^8.28.0",
"eslint-config-airbnb": "^19.0.4",
"eslint-config-airbnb-typescript": "^17.0.0",
"eslint-config-react-app": "^7.0.1",
"eslint-import-resolver-webpack": "^0.13.2",
"eslint-plugin-flowtype": "^8.0.3",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-jsx-a11y": "^6.5.1",
"eslint-plugin-jsx-a11y": "^6.6.1",
"eslint-plugin-no-async-without-await": "^1.2.0",
"eslint-plugin-no-null": "^1.0.2",
"eslint-plugin-react": "^7.29.4",
"eslint-plugin-react-hooks": "^4.4.0",
"eslint-plugin-react": "^7.31.11",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-teactn": "git+https://github.com/korenskoy/eslint-plugin-teactn#c2c39dd005d58c07c24c4361de804dce1c6261b5",
"git-revision-webpack-plugin": "^5.0.0",
"gitlog": "^4.0.4",
"html-webpack-plugin": "^5.5.0",
"husky": "^7.0.4",
"jest": "^27.5.1",
"jest-raw-loader": "^1.0.1",
"jsdom": "^19.0.0",
"lint-staged": "^12.3.7",
"mini-css-extract-plugin": "^2.6.0",
"postcss-loader": "^6.2.1",
"postcss-modules": "^4.3.1",
"react": "^18.0.0",
"replace-in-file": "^6.3.2",
"sass": "^1.50.0",
"sass-loader": "^12.6.0",
"husky": "^8.0.2",
"jest": "^29.3.1",
"jest-environment-jsdom": "^29.3.1",
"lint-staged": "^13.0.4",
"mini-css-extract-plugin": "^2.7.1",
"postcss-loader": "^7.0.1",
"postcss-modules": "^6.0.0",
"react": "^18.2.0",
"sass": "^1.56.1",
"sass-loader": "^13.2.0",
"script-loader": "^0.7.2",
"serve": "^13.0.2",
"serve": "^14.1.2",
"style-loader": "^3.3.1",
"stylelint": "^14.6.1",
"stylelint-config-recommended-scss": "^6.0.0",
"stylelint-declaration-block-no-ignored-properties": "^2.5.0",
"stylelint-group-selectors": "^1.0.6",
"stylelint": "^14.15.0",
"stylelint-config-recommended-scss": "^8.0.0",
"stylelint-declaration-block-no-ignored-properties": "^2.6.0",
"stylelint-group-selectors": "^1.0.9",
"stylelint-high-performance-animation": "^1.6.0",
"telegraph-node": "^1.0.4",
"typescript": "^4.6.3",
"webpack": "^5.72.0",
"webpack-cli": "^4.9.2",
"webpack-dev-server": "^4.8.1",
"webpack-merge": "^5.8.0"
"typescript": "^4.9.3",
"webpack": "^5.75.0",
"webpack-dev-server": "^4.11.1",
"whatwg-fetch": "^3.6.2"
},
"dependencies": {
"@cryptography/aes": "^0.1.1",
"async-mutex": "^0.3.2",
"async-mutex": "^0.4.0",
"big-integer": "github:painor/BigInteger.js",
"croppie": "^2.6.5",
"emoji-data-ios": "git+https://github.com/korenskoy/emoji-data-ios#3c401da02c6792cea0b6c758795da406377bf667",
"events": "^3.3.0",
"idb-keyval": "^6.1.0",
"lowlight": "^2.6.1",
"idb-keyval": "^6.2.0",
"lowlight": "^2.8.0",
"opus-recorder": "github:Ajaxy/opus-recorder",
"os-browserify": "^0.3.0",
"pako": "^2.0.4",
"pako": "^2.1.0",
"path-browserify": "^1.0.1",
"qr-code-styling": "github:zubiden/qr-code-styling#10f7cf3",
"websocket": "^1.0.34"
"qr-code-styling": "github:zubiden/qr-code-styling#dbbfed0"
},
"optionalDependencies": {
"fsevents": "2.3.2"

View File

@ -256,7 +256,7 @@ function replaceSimpleMarkdown(textParts: TextPart[], type: 'jsx' | 'html'): Tex
}
const parts = part.split(SIMPLE_MARKDOWN_REGEX);
const entities = part.match(SIMPLE_MARKDOWN_REGEX) || [];
const entities: string[] = part.match(SIMPLE_MARKDOWN_REGEX) || [];
result.push(parts[0]);
return entities.reduce((entityResult: TextPart[], entity, i) => {

View File

@ -275,7 +275,6 @@ const MessageList: FC<OwnProps & StateProps> = ({
isScrollingRef.current = true;
if (!memoFocusingIdRef.current) {
updateStickyDates(container, hasTools);
}

View File

@ -235,13 +235,13 @@ const MiddleColumn: FC<StateProps> = ({
// Fix for mobile virtual keyboard
useEffect(() => {
const { visualViewport } = window as any;
const { visualViewport } = window;
if (!visualViewport) {
return undefined;
}
const handleResize = () => {
if (window.visualViewport.height !== document.documentElement.clientHeight) {
if (visualViewport.height !== document.documentElement.clientHeight) {
document.body.classList.add('keyboard-visible');
} else {
document.body.classList.remove('keyboard-visible');

View File

@ -2,8 +2,6 @@ const { Mutex } = require('async-mutex');
const mutex = new Mutex();
const WebSocketClient = require('websocket').w3cwebsocket;
const closeError = new Error('WebSocket was closed');
class PromisedWebSockets {
@ -80,7 +78,7 @@ class PromisedWebSockets {
});
this.closed = false;
this.website = this.getWebSocketLink(ip, port, testServers, isPremium);
this.client = new WebSocketClient(this.website, 'binary');
this.client = new WebSocket(this.website, 'binary');
return new Promise((resolve, reject) => {
this.client.onopen = () => {
this.receive();

View File

@ -105,6 +105,7 @@ function renderWithVirtual<T extends VirtualElement | undefined>(
}
if (DEBUG && $new) {
// @ts-ignore TS 4.9 bug https://github.com/microsoft/TypeScript/issues/51501
const newTarget = 'target' in $new && $new.target;
if (newTarget && (!$current || ('target' in $current && newTarget !== $current.target))) {
throw new Error('[Teact] Cached virtual element was moved within tree');

View File

@ -1,5 +1,5 @@
export default function getKeyFromEvent(e: KeyboardEvent) {
const key = 'key' in e ? e.key : e.code;
const key = e.key || e.code;
return key.startsWith('Key') ? key.slice(3).toLowerCase() : key;
}

View File

@ -43,7 +43,7 @@ export function pickTruthy<T, K extends keyof T>(object: T, keys: K[]) {
}, {} as Pick<T, K>);
}
export function omit<T, K extends keyof T>(object: T, keys: K[]) {
export function omit<T extends object, K extends keyof T>(object: T, keys: K[]): Omit<T, K> {
const stringKeys = new Set(keys.map(String));
const savedKeys = Object.keys(object)
.filter((key) => !stringKeys.has(key)) as Array<Exclude<keyof T, K>>;
@ -118,7 +118,7 @@ export function split<T extends any>(array: T[], chunkSize: number) {
}
export function cloneDeep<T>(value: T): T {
if (typeof value !== 'object') {
if (!isObject(value)) {
return value;
}
@ -132,6 +132,11 @@ export function cloneDeep<T>(value: T): T {
}, {} as T);
}
function isObject(value: any): value is object {
// eslint-disable-next-line no-null/no-null
return typeof value === 'object' && value !== null;
}
export function findLast<T>(array: Array<T>, predicate: (value: T, index: number, obj: T[]) => boolean): T | undefined {
let cursor = array.length;

View File

@ -92,16 +92,6 @@ export function setPositionState(state?: MediaPositionState) {
mediaSession?.setPositionState?.(state);
}
export function setMicrophoneActive(active: boolean) {
const { mediaSession } = window.navigator;
mediaSession?.setMicrophoneActive?.(active);
}
export function setCameraActive(active: boolean) {
const { mediaSession } = window.navigator;
mediaSession?.setCameraActive?.(active);
}
export function buildMediaMetadata({
title, artist, album, artwork,
}: MediaMetadataParameters) {

View File

@ -38,7 +38,7 @@ const handleResize = throttle(() => {
window.addEventListener('orientationchange', handleResize);
if (IS_IOS) {
window.visualViewport.addEventListener('resize', handleResize);
window.visualViewport!.addEventListener('resize', handleResize);
} else {
window.addEventListener('resize', handleResize);
}
@ -46,7 +46,7 @@ if (IS_IOS) {
export function updateSizes(): IDimensions {
let height: number;
if (IS_IOS) {
height = window.visualViewport.height + window.visualViewport.pageTop;
height = window.visualViewport!.height + window.visualViewport!.pageTop;
} else {
height = window.innerHeight;
}