Skip to content

Commit

Permalink
refactor!(deps): Bump all critical dependencies (#2803)
Browse files Browse the repository at this point in the history
  • Loading branch information
tassoevan authored Jan 15, 2024
1 parent 4d5eb17 commit 4b4f2ee
Show file tree
Hide file tree
Showing 149 changed files with 44,368 additions and 25,417 deletions.
16 changes: 16 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,22 @@
}
},
"overrides": [
{
"files": ["*.mjs"],
"parserOptions": {
"sourceType": "module"
}
},
{
"files": ["*.ts", "*.tsx"],
"rules": {
"@typescript-eslint/prefer-optional-chain": "warn"
},
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": ["./tsconfig.json"]
}
},
{
"files": ["**/*.stories.js", "**/*.stories.jsx", "**/*.stories.ts", "**/*.stories.tsx", "**/*.spec.tsx"],
"rules": {
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ jobs:
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup Node 14.21.3
- name: Setup Node 20.10.0
uses: actions/setup-node@v3
with:
node-version: '14.21.3'
node-version: '20.10.0'
- name: Setup node_modules cache
uses: actions/cache@v3
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/validate-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ jobs:
run: git config --global core.autocrlf false
- name: Checkout code
uses: actions/checkout@v3
- name: Setup Node 14.21.3
- name: Setup Node 20.10.0
uses: actions/setup-node@v3
with:
node-version: '14.21.3'
node-version: '20.10.0'
- name: Setup node_modules cache
uses: actions/cache@v3
with:
Expand Down
1 change: 0 additions & 1 deletion .prettierrc.json

This file was deleted.

6 changes: 6 additions & 0 deletions .prettierrc.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import config from '@rocket.chat/prettier-config/fuselage/index.js';

export default {
...config,
"trailingComma": "es5"
}
541 changes: 0 additions & 541 deletions .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs

This file was deleted.

9 changes: 0 additions & 9 deletions .yarn/plugins/@yarnpkg/plugin-typescript.cjs

This file was deleted.

28 changes: 0 additions & 28 deletions .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs

This file was deleted.

783 changes: 0 additions & 783 deletions .yarn/releases/yarn-3.2.2.cjs

This file was deleted.

893 changes: 893 additions & 0 deletions .yarn/releases/yarn-4.0.2.cjs

Large diffs are not rendered by default.

16 changes: 6 additions & 10 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
defaultSemverRangePrefix: "~"
compressionLevel: mixed

nodeLinker: node-modules
defaultSemverRangePrefix: ~

enableGlobalCache: false

plugins:
- path: .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs
spec: "@yarnpkg/plugin-workspace-tools"
- path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs
spec: "@yarnpkg/plugin-interactive-tools"
- path: .yarn/plugins/@yarnpkg/plugin-typescript.cjs
spec: "@yarnpkg/plugin-typescript"
nodeLinker: node-modules

yarnPath: .yarn/releases/yarn-3.2.2.cjs
yarnPath: .yarn/releases/yarn-4.0.2.cjs
8 changes: 7 additions & 1 deletion babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,17 @@ module.exports = {
},
},
],
'@babel/preset-react',
[
'@babel/preset-react',
{
runtime: 'automatic',
},
],
'@babel/preset-typescript',
],
plugins: [
'@babel/plugin-proposal-function-bind',
'@babel/plugin-proposal-class-properties',
'@babel/plugin-syntax-import-attributes',
],
};
Binary file modified build/background.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified build/background@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified build/icon.icns
Binary file not shown.
Binary file modified build/icon.ico
Binary file not shown.
Binary file modified build/icons/128x128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified build/icons/16x16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified build/icons/256x256.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified build/icons/32x32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified build/icons/48x48.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified build/icons/64x64.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified build/installerIcon.ico
Binary file not shown.
Binary file modified build/installerSidebar.bmp
Binary file not shown.
Binary file modified build/uninstallerIcon.ico
Binary file not shown.
Binary file modified build/uninstallerSidebar.bmp
Binary file not shown.
140 changes: 66 additions & 74 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"postinstall": "run-s install-app-deps clean",
"start": "run-s build:watch",
"clean": "rimraf app dist",
"build": "yarn build-get-cloud-info && rollup -c ",
"build": "rollup -c",
"build:watch": "rollup -c -w",
"build-mac": "yarn build && yarn electron-builder --publish never --mac --universal",
"build-win": "yarn build && yarn electron-builder --publish never --win",
Expand All @@ -45,118 +45,110 @@
".:lint:tsc": "tsc --noEmit",
"lint-fix": "run-s .:lint-fix:eslint .:lint:tsc",
".:lint-fix:eslint": "eslint --fix .",
"workspaces:build": "yarn workspaces foreach -t run build",
"build-get-cloud-info": "ts-node -O \"{\\\"module\\\":\\\"commonjs\\\"}\" src/servers/supportedVersions/downloadFromCloud.ts"
"workspaces:build": "yarn workspaces foreach -At run build"
},
"dependencies": {
"@bugsnag/js": "^7.16.0",
"@emotion/css": "^11.7.1",
"@emotion/react": "^11.7.1",
"@emotion/styled": "^11.6.0",
"@ewsjs/xhr": "^2.0.1",
"@bugsnag/js": "~7.22.3",
"@emotion/css": "~11.11.2",
"@emotion/react": "~11.11.3",
"@emotion/styled": "~11.11.0",
"@ewsjs/xhr": "~2.0.2",
"@rocket.chat/css-in-js": "~0.31.25",
"@rocket.chat/fuselage": "~0.36.0",
"@rocket.chat/fuselage": "~0.42.0",
"@rocket.chat/fuselage-hooks": "~0.32.1",
"@rocket.chat/fuselage-polyfills": "~0.31.25",
"@rocket.chat/icons": "~0.32.0",
"abort-controller": "^3.0.0",
"axios": "^1.4.0",
"dotenv": "~16.3.1",
"axios": "~1.6.4",
"electron-dl": "~3.5.1",
"electron-store": "^8.1.0",
"electron-store": "~8.1.0",
"electron-updater": "^5.3.0",
"ews-javascript-api": "~0.13.0",
"i18next": "^21.6.10",
"ews-javascript-api": "~0.13.2",
"i18next": "~23.7.16",
"jsonwebtoken": "~9.0.2",
"moment": "^2.29.4",
"react": "~17.0.2",
"react-dom": "~17.0.2",
"react-hook-form": "^7.43.9",
"react-i18next": "^11.15.3",
"react-keyed-flatten-children": "^1.3.0",
"react-redux": "~7.1.3",
"react-virtuoso": "1.2.4",
"redux": "^4.2.1",
"reselect": "~4.1.8",
"rimraf": "^3.0.2",
"semver": "^7.5.4"
"moment": "~2.30.1",
"react": "~18.2.0",
"react-dom": "~18.2.0",
"react-hook-form": "~7.49.2",
"react-i18next": "~14.0.0",
"react-keyed-flatten-children": "~3.0.0",
"react-redux": "~9.0.4",
"react-virtuoso": "~4.6.2",
"redux": "~5.0.1",
"reselect": "~5.0.1",
"rimraf": "~5.0.5",
"semver": "~7.5.4"
},
"devDependencies": {
"@babel/core": "^7.16.12",
"@babel/eslint-parser": "^7.16.5",
"@babel/plugin-proposal-class-properties": "^7.16.7",
"@babel/plugin-proposal-function-bind": "^7.16.7",
"@babel/preset-env": "^7.16.11",
"@babel/preset-react": "^7.16.7",
"@babel/core": "~7.23.7",
"@babel/eslint-parser": "~7.23.3",
"@babel/plugin-proposal-class-properties": "~7.18.6",
"@babel/plugin-proposal-function-bind": "~7.23.3",
"@babel/preset-env": "~7.23.7",
"@babel/preset-react": "~7.23.3",
"@babel/preset-typescript": "~7.23.3",
"@fiahfy/icns-convert": "^0.0.12",
"@fiahfy/ico-convert": "^0.0.12",
"@kayahr/jest-electron-runner": "~29.10.0",
"@fiahfy/icns-convert": "~0.0.12",
"@fiahfy/ico-convert": "~0.0.12",
"@kayahr/jest-electron-runner": "~29.11.0",
"@rocket.chat/eslint-config": "~0.6.0",
"@rocket.chat/prettier-config": "~0.31.25",
"@rollup/plugin-babel": "~5.3.1",
"@rollup/plugin-commonjs": "~21.1.0",
"@rollup/plugin-json": "~4.1.0",
"@rollup/plugin-node-resolve": "~13.3.0",
"@rollup/plugin-replace": "~3.1.0",
"@types/bluebird": "~3.5.42",
"@rollup/plugin-babel": "~6.0.4",
"@rollup/plugin-commonjs": "~25.0.7",
"@rollup/plugin-json": "~6.1.0",
"@rollup/plugin-node-resolve": "~15.2.3",
"@rollup/plugin-replace": "~5.0.5",
"@types/electron-devtools-installer": "~2.2.5",
"@types/jest": "^27.4.0",
"@types/jest": "~29.5.11",
"@types/jsonwebtoken": "~9.0.5",
"@types/node": "~16.0.3",
"@types/react": "~17.0.70",
"@types/react-dom": "~17.0.23",
"@types/react-redux": "~7.1.30",
"@types/resize-observer-browser": "~0.1.10",
"@types/rimraf": "^3.0.2",
"@types/stylis": "~4.2.3",
"@typescript-eslint/eslint-plugin": "~5.60.1",
"@typescript-eslint/parser": "~5.60.1",
"builtin-modules": "^3.2.0",
"chokidar": "^3.5.3",
"conventional-changelog-cli": "^2.2.2",
"convert-svg-to-png": "^0.5.0",
"@types/node": "~16.18.69",
"@types/react": "~18.2.46",
"@types/react-dom": "~18.2.18",
"@typescript-eslint/eslint-plugin": "~6.17.0",
"@typescript-eslint/parser": "~6.17.0",
"builtin-modules": "~3.3.0",
"chokidar": "~3.5.3",
"conventional-changelog-cli": "~4.1.0",
"convert-svg-to-png": "~0.6.4",
"electron": "22.3.27",
"electron-builder": "^23.6.0",
"electron-devtools-installer": "^3.2.0",
"electron-notarize": "^1.2.2",
"eslint": "~8.53.0",
"eslint-config-prettier": "~9.0.0",
"eslint": "~8.56.0",
"eslint-config-prettier": "~9.1.0",
"eslint-import-resolver-typescript": "~3.6.1",
"eslint-plugin-import": "~2.26.0",
"eslint-plugin-prettier": "~4.2.1",
"eslint-plugin-prettier": "~5.1.2",
"eslint-plugin-react": "~7.33.2",
"eslint-plugin-react-hooks": "~4.6.0",
"jest": "~29.7.0",
"jest-environment-jsdom": "~29.7.0",
"jimp": "~0.16.13",
"npm-run-all": "^4.1.5",
"prettier": "~2.8.8",
"puppeteer": "^13.1.2",
"rollup": "~2.79.1",
"rollup-plugin-copy": "~3.4.0",
"jimp": "~0.22.10",
"npm-run-all": "~4.1.5",
"prettier": "~3.1.1",
"puppeteer": "~21.7.0",
"rollup": "~4.9.2",
"rollup-plugin-copy": "~3.5.0",
"ts-jest": "~29.1.1",
"ts-node": "^10.9.1",
"typescript": "~5.2.2",
"xvfb-maybe": "^0.2.1"
"ts-node": "~10.9.2",
"typescript": "~5.3.3",
"xvfb-maybe": "~0.2.1"
},
"optionalDependencies": {
"fsevents": "2.3.3"
},
"engines": {
"node": ">=12.8.x"
"node": ">=20.10.0"
},
"devEngines": {
"node": ">=12.8.x",
"yarn": ">=1.22.x"
"node": ">=20.10.0",
"yarn": ">=4.0.2"
},
"resolutions": {
"@fiahfy/icns-convert/sharp": "0.29.3",
"@fiahfy/ico-convert/sharp": "0.29.3"
},
"volta": {
"node": "14.21.3",
"yarn": "1.22.18"
"node": "20.10.0",
"yarn": "4.0.2"
},
"packageManager": "yarn@3.2.2"
"packageManager": "yarn@4.0.2"
}
37 changes: 36 additions & 1 deletion rollup.config.js → rollup.config.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { spawn } from 'child_process';
import { mkdir, writeFile } from 'fs/promises';

import babel from '@rollup/plugin-babel';
import commonjs from '@rollup/plugin-commonjs';
Expand All @@ -9,7 +10,7 @@ import builtinModules from 'builtin-modules';
import electron from 'electron';
import copy from 'rollup-plugin-copy';

import appManifest from './package.json';
import appManifest from './package.json' with { type: 'json' };

const NODE_ENV = process.env.NODE_ENV || 'development';
const canRun =
Expand Down Expand Up @@ -42,6 +43,35 @@ const run = () => {
};
};

const downloadSupportedVersions = () => {
const apiUrl =
'https://releases.rocket.chat/v2/server/supportedVersions?source=desktop';

return {
writeBundle: async () => {
const response = await fetch(apiUrl);
if (!response.ok) {
throw new Error(
`Failed to fetch supported versions from ${apiUrl}: ${response.status} ${response.statusText}`
);
}

const json = await response.json();
const signedContent = json?.signed;

if (!signedContent) {
throw new Error(
'JSON response does not contain the expected "signed" field.'
);
}

await mkdir('./app', { recursive: true });
await writeFile('./app/supportedVersions.jwt', signedContent);
console.info('Downloaded supported versions.');
},
};
};

const extensions = ['.js', '.ts', '.tsx'];

export default [
Expand Down Expand Up @@ -74,6 +104,7 @@ export default [
dir: 'app',
format: 'cjs',
sourcemap: 'inline',
interop: 'auto',
},
],
},
Expand Down Expand Up @@ -108,6 +139,7 @@ export default [
dir: 'app',
format: 'cjs',
sourcemap: true,
interop: 'auto',
},
},
{
Expand Down Expand Up @@ -141,6 +173,7 @@ export default [
dir: 'app',
format: 'cjs',
sourcemap: 'inline',
interop: 'auto',
},
],
},
Expand Down Expand Up @@ -184,6 +217,7 @@ export default [
{ src: 'node_modules/@rocket.chat/icons/dist/*', dest: 'app/icons' },
],
}),
downloadSupportedVersions(),
json(),
replace({
'process.env.BUGSNAG_API_KEY': JSON.stringify(
Expand All @@ -204,6 +238,7 @@ export default [
dir: 'app',
format: 'cjs',
sourcemap: 'inline',
interop: 'auto',
},
},
];
2 changes: 1 addition & 1 deletion src/app/main/app.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { app, session } from 'electron';
import rimraf from 'rimraf';
import { rimraf } from 'rimraf';

// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore:next-line
Expand Down
Loading

0 comments on commit 4b4f2ee

Please sign in to comment.