Skip to content

Commit

Permalink
update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
vladimiry committed Nov 19, 2021
1 parent ed10daf commit 2720b0c
Show file tree
Hide file tree
Showing 44 changed files with 789 additions and 601 deletions.
16 changes: 16 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,22 @@
"patterns": [
"rxjs/*",
"!rxjs/operators"
],
"paths": [
{
"name": "@ngrx/store",
"importNames": [
"props"
],
"message": "Import \"props\" from \"src/shared/ngrx-util\" instead."
},
{
"name": "@ngrx/effects",
"importNames": [
"ofType"
],
"message": "Import \"ofType\" from \"src/shared/ngrx-util-of-type\" instead."
}
]
}
],
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
# <common> TODO use YAML anchors feature when it gets supported
- { uses: actions/setup-node@v1, with: { node-version: "${{ env.ELECTRON_MAIL_NODE_VERSION }}" } }
- { uses: actions/setup-node@v2, with: { node-version: "${{ env.ELECTRON_MAIL_NODE_VERSION }}" } }
- { uses: actions/checkout@v2 }
- { name: system setup, if: runner.os == 'Linux', run: ./scripts/ci/github/system-setup-linux.sh }
- name: get yarn cache directory path
Expand Down Expand Up @@ -45,7 +45,7 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
# <common> TODO use YAML anchors feature when it gets supported
- { uses: actions/setup-node@v1, with: { node-version: "${{ env.ELECTRON_MAIL_NODE_VERSION }}" } }
- { uses: actions/setup-node@v2, with: { node-version: "${{ env.ELECTRON_MAIL_NODE_VERSION }}" } }
- { uses: actions/checkout@v2 }
- { name: system setup, if: runner.os == 'Linux', run: ./scripts/ci/github/system-setup-linux.sh }
- name: get yarn cache directory path
Expand All @@ -71,7 +71,7 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
# <common> TODO use YAML anchors feature when it gets supported
- { uses: actions/setup-node@v1, with: { node-version: "${{ env.ELECTRON_MAIL_NODE_VERSION }}" } }
- { uses: actions/setup-node@v2, with: { node-version: "${{ env.ELECTRON_MAIL_NODE_VERSION }}" } }
- { uses: actions/checkout@v2 }
- { name: system setup, if: runner.os == 'Linux', run: ./scripts/ci/github/system-setup-linux.sh }
- name: get yarn cache directory path
Expand Down
83 changes: 42 additions & 41 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,14 @@
"type": "module",
"main": "./app/electron-main/index.cjs",
"scripts": {
"prepare": "npm-run-all prepare:patch-package prepare:husky-install prepare:remove:prebuild-install prepare:ts-patch scripts/code-generation/electron-main",
"prepare": "npm-run-all prepare:patch-package prepare:husky-install prepare:remove:prebuild-install prepare:ts-patch prepare:ts-patch:check scripts/code-generation/electron-main",
"prepare:patch-package": "patch-package --error-on-fail --patch-dir ./patches/patch-package",
"prepare:husky-install": "husky install",
"prepare:ts-patch": "ts-patch install -s",
"prepare:ts-patch:check": "ts-patch check",
"prepare:remove:prebuild-install": "rimraf ./node_modules/prebuild-install",
"yarn:audit": "yarn audit",
"app:dist": "npm-run-all lint build assets build:electron-builder-hooks clean:prebuilds electron-builder:install-app-deps",
"app:dist": "npm-run-all lint build assets build:electron-builder-hooks clean:prebuilds",
"build": "npm-run-all build:electron-main build:electron-preload build:web",
"build:dev": "cross-env NODE_ENV=development npm-run-all build",
"build:electron-main": "npm-run-all scripts/code-generation/electron-main build:electron-main:compile",
Expand Down Expand Up @@ -53,8 +54,10 @@
"build:web:search": "yarn webpack:shortcut --config ./webpack-configs/web/search-in-page-browser-view.ts",
"build:web:search:dev": "cross-env NODE_ENV=development npm-run-all build:web:search",
"build:electron-builder-hooks:celanup": "rimraf ./scripts/electron-builder/hooks/afterPack/index.js",
"build:electron-builder-hooks:pre-build": "yarn ts-node:shortcut ./scripts/typescript-upgrade.ts upgrade",
"build:electron-builder-hooks:build": "yarn webpack:shortcut --config ./webpack-configs/electron-builder-hooks.ts",
"build:electron-builder-hooks": "npm-run-all build:electron-builder-hooks:celanup build:electron-builder-hooks:build",
"build:electron-builder-hooks:after-build": "yarn ts-node:shortcut ./scripts/typescript-upgrade.ts rollback",
"build:electron-builder-hooks": "npm-run-all build:electron-builder-hooks:celanup build:electron-builder-hooks:pre-build build:electron-builder-hooks:build build:electron-builder-hooks:after-build",
"clean:app": "rimraf ./app",
"clean:app-dev": "rimraf ./app-dev",
"clean:output": "rimraf ./output",
Expand All @@ -68,9 +71,7 @@
"assets:webclient:base": "yarn ts-node:shortcut ./scripts/prepare-webclient/index.ts",
"electron-builder:dist": "npm run electron-builder:shortcut -- --x64 --publish never",
"electron-builder:dist:linux:appimage": "yarn ts-node:shortcut ./scripts/electron-builder/build-appimage.ts",
"electron-builder:dist:linux:appimage:do": "npm run electron-builder:shortcut -- --x64 --publish never --linux appimage",
"electron-builder:dist:linux:snap": "yarn ts-node:shortcut ./scripts/electron-builder/build-snap.ts",
"electron-builder:dist:linux:snap:do": "npm run electron-builder:shortcut -- --x64 --publish never --linux snap",
"electron-builder:dist:linux:deb": "npm run electron-builder:shortcut -- --x64 --publish never --linux deb",
"electron-builder:dist:linux:freebsd": "npm run electron-builder:shortcut -- --x64 --publish never --linux freebsd",
"electron-builder:dist:linux:pacman": "npm run electron-builder:shortcut -- --x64 --publish never --linux pacman",
Expand Down Expand Up @@ -101,32 +102,32 @@
"spellchecker": "https://github.com/vladimiry-playground/node-spellchecker#37cebc43ccbfce27dac51f64ec45f72d9aa80b8f"
},
"devDependencies": {
"@angular-devkit/build-optimizer": "0.1300.2",
"@angular-eslint/eslint-plugin": "13.0.0-alpha.0",
"@angular/animations": "13.0.1",
"@angular/cdk": "13.0.0",
"@angular/common": "13.0.1",
"@angular/compiler": "13.0.1",
"@angular/compiler-cli": "13.0.1",
"@angular/core": "13.0.1",
"@angular/forms": "13.0.1",
"@angular/language-service": "13.0.1",
"@angular/platform-browser": "13.0.1",
"@angular/platform-browser-dynamic": "13.0.1",
"@angular/router": "13.0.1",
"@angular-devkit/build-optimizer": "0.1300.3",
"@angular-eslint/eslint-plugin": "13.0.1",
"@angular/animations": "13.0.2",
"@angular/cdk": "13.0.2",
"@angular/common": "13.0.2",
"@angular/compiler": "13.0.2",
"@angular/compiler-cli": "13.0.2",
"@angular/core": "13.0.2",
"@angular/forms": "13.0.2",
"@angular/language-service": "13.0.2",
"@angular/platform-browser": "13.0.2",
"@angular/platform-browser-dynamic": "13.0.2",
"@angular/router": "13.0.2",
"@babel/core": "7.16.0",
"@babel/plugin-proposal-async-generator-functions": "7.16.0",
"@babel/plugin-proposal-async-generator-functions": "7.16.4",
"@babel/plugin-transform-async-to-generator": "7.16.0",
"@babel/plugin-transform-runtime": "7.16.0",
"@babel/plugin-transform-runtime": "7.16.4",
"@babel/runtime": "7.16.3",
"@cliqz/url-parser": "1.1.4",
"@expo/spawn-async": "1.5.0",
"@msgpack/msgpack": "2.7.1",
"@ng-select/ng-select": "7.3.0",
"@ngrx/component": "12.5.1",
"@ngrx/effects": "12.5.1",
"@ngrx/store": "12.5.1",
"@ngtools/webpack": "13.0.2",
"@ng-select/ng-select": "8.1.1",
"@ngrx/component": "13.0.1",
"@ngrx/effects": "13.0.1",
"@ngrx/store": "13.0.1",
"@ngtools/webpack": "13.0.3",
"@playwright/test": "1.16.3",
"@rgba-image/lanczos": "0.1.1",
"@types/archiver": "5.1.1",
Expand All @@ -135,14 +136,14 @@
"@types/fs-extra": "9.0.13",
"@types/html-to-text": "8.0.1",
"@types/mini-css-extract-plugin": "2.4.0",
"@types/node": "16.11.7",
"@types/node": "16.11.9",
"@types/oboe": "2.1.1",
"@types/opentype.js": "1.3.3",
"@types/path-is-inside": "1.0.0",
"@types/randomstring": "1.1.8",
"@types/react": "17.0.34",
"@types/react": "17.0.35",
"@types/react-router": "5.1.17",
"@types/readable-stream": "2.3.11",
"@types/readable-stream": "2.3.12",
"@types/rimraf": "3.0.2",
"@types/sanitize-html": "2.5.0",
"@types/semver": "7.3.9",
Expand All @@ -151,13 +152,13 @@
"@types/tough-cookie": "4.0.1",
"@types/ts-nameof": "4.2.1",
"@types/valid-url": "1.0.3",
"@types/validator": "13.6.6",
"@types/validator": "13.7.0",
"@types/webpack-node-externals": "2.5.3",
"@typescript-eslint/eslint-plugin": "5.3.1",
"@typescript-eslint/parser": "5.3.1",
"@typescript-eslint/eslint-plugin": "5.4.0",
"@typescript-eslint/parser": "5.4.0",
"@vladimiry/import-sort-style": "0.1.4",
"@zerollup/ts-transform-paths": "1.7.18",
"app-builder-lib": "22.14.6",
"app-builder-lib": "22.14.7",
"archiver": "5.3.0",
"asap-es": "1.3.3",
"babel-loader": "8.2.3",
Expand All @@ -168,13 +169,13 @@
"class-validator": "0.13.1",
"color-fns": "0.1.1",
"combine-errors": "3.0.3",
"compare-versions": "4.0.1",
"compare-versions": "4.1.1",
"cpx2": "4.0.0",
"cross-env": "7.0.3",
"css-loader": "6.5.1",
"dts-generator": "3.0.0",
"electron": "16.0.0-beta.8",
"electron-builder": "22.14.3",
"electron": "15.3.2",
"electron-builder": "22.14.7",
"electron-fetch": "1.7.4",
"electron-log": "4.4.1",
"electron-unhandled": "3.0.2",
Expand All @@ -196,9 +197,9 @@
"import-sort-parser-typescript": "6.0.0",
"imports-loader": "3.1.1",
"js-base64": "3.7.2",
"lint-staged": "11.2.6",
"lint-staged": "12.0.3",
"lzutf8": "0.6.0",
"mini-css-extract-plugin": "2.4.4",
"mini-css-extract-plugin": "2.4.5",
"monaco-editor": "0.30.1",
"ndx": "1.0.2",
"ndx-query": "1.0.1",
Expand All @@ -215,7 +216,7 @@
"postcss-loader": "6.2.0",
"postcss-url": "10.1.3",
"pure-uuid": "1.6.2",
"pureimage": "0.3.5",
"pureimage": "0.3.6",
"quickjs-emscripten": "0.13.0",
"randomstring": "1.2.1",
"rate-limiter-flexible": "2.3.4",
Expand All @@ -228,7 +229,7 @@
"sass": "1.43.4",
"sass-loader": "12.3.0",
"semver": "7.3.5",
"serialize-error": "8.1.0",
"serialize-error": "9.0.0",
"sinon": "12.0.1",
"terser-webpack-plugin": "5.2.5",
"to-string-loader": "1.2.0",
Expand All @@ -243,9 +244,9 @@
"ts-patch": "2.0.1",
"tsconfig-paths": "3.11.0",
"tslib": "2.3.1",
"typescript": "4.4.4",
"typescript": "4.5.2",
"valid-url": "1.0.9",
"webpack": "5.63.0",
"webpack": "5.64.1",
"webpack-cli": "4.9.1",
"webpack-merge": "5.8.0",
"webpack-node-externals": "3.0.0",
Expand Down
18 changes: 18 additions & 0 deletions scripts/typescript-upgrade.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// TODO drop "scripts/typescript-upgrade.ts" after typescript gets updated to newer than 4.5.2 version
// see https://github.com/microsoft/TypeScript/pull/46818

import {catchTopLeventAsync, execShell} from "scripts/lib";

const [, , ACTION_TYPE_ARG] = process.argv as [null, null, "upgrade" | "rollback" | unknown];

catchTopLeventAsync(async () => {
if (ACTION_TYPE_ARG === "upgrade") {
await execShell(["yarn", ["add", "--dev", "typescript@4.6.0-dev.20211119"]]);
return;
}
if (ACTION_TYPE_ARG === "rollback") {
await execShell(["yarn", ["add", "--dev", "typescript@4.5.2"]]);
return;
}
throw new Error(`Unexpected action type argument: ${String(ACTION_TYPE_ARG)}`);
});
Original file line number Diff line number Diff line change
Expand Up @@ -149,10 +149,8 @@ const formatEmlDate: (mail: Mail) => string = (() => {
})();

// TODO consider sanitizing "mail.body"
const contentBuilders: Readonly<Record<"eml" | "json", (
mail: Mail,
attachmentsContent?: DeepReadonly<DbExportMailAttachmentItem[]>,
) => string>> = {
const contentBuilders: Record<"eml" | "json",
(mail: DeepReadonly<Mail>, attachmentsContent?: DeepReadonly<DbExportMailAttachmentItem[]>) => string> = {
eml(mail, attachmentsContent) {
const mixedBoundary = `=mixed-${new UUID(4).format()}@${PACKAGE_NAME}`;
const relatedBoundary = `=related-${new UUID(4).format()}@${PACKAGE_NAME}`;
Expand Down Expand Up @@ -243,11 +241,11 @@ const contentBuilders: Readonly<Record<"eml" | "json", (
};

export const writeFile = async (
options: Readonly<{
options: DeepReadonly<{
mail: Mail,
fileType: "eml" | "json",
exportDir: string,
attachments?: DeepReadonly<DbExportMailAttachmentItem[]>
attachments?: DbExportMailAttachmentItem[]
}>
): Promise<{ file: string }> => {
const file = await generateFileName(options.mail, options.exportDir, options.fileType);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import electronLog from "electron-log";
import {defer, lastValueFrom} from "rxjs";
import {filter, first, startWith, takeUntil} from "rxjs/operators";
import {ofType} from "@ngrx/effects";

import {Context} from "src/electron-main/model";
import {
Expand All @@ -17,6 +16,7 @@ import {
import {IpcMainApiEndpoints,} from "src/shared/api/main-process";
import {curryFunctionMembers} from "src/shared/util";
import {indexAccount} from "src/electron-main/api/endpoints-builders/database/indexing/service";
import {ofType} from "src/shared/ngrx-util-of-type";

const logger = curryFunctionMembers(electronLog, __filename);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import UUID from "pure-uuid";
import electronLog from "electron-log";
import {concatMap, filter, first} from "rxjs/operators";
import {lastValueFrom, race, throwError, timer} from "rxjs";
import {ofType} from "@ngrx/effects";
import {pick} from "remeda";

import {Config} from "src/shared/model/options";
Expand All @@ -13,6 +12,7 @@ import {UnionOf} from "src/shared/ngrx-util";
import {curryFunctionMembers} from "src/shared/util";
import {hrtimeDuration} from "src/electron-main/util";
import {readMailBody} from "src/shared/entity-util";
import {ofType} from "src/shared/ngrx-util-of-type";

const logger = curryFunctionMembers(electronLog, __filename);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import UUID from "pure-uuid";
import electronLog from "electron-log";
import {from, lastValueFrom, Observable, of, race, throwError, timer} from "rxjs";
import {concatMap, filter, first, mergeMap, switchMap} from "rxjs/operators";
import {ofType} from "@ngrx/effects";

import {Context} from "src/electron-main/model";
import {IPC_MAIN_API_DB_INDEXER_REQUEST$, IPC_MAIN_API_DB_INDEXER_RESPONSE$} from "src/electron-main/api/constants";
Expand All @@ -11,6 +10,7 @@ import {IndexableMailId} from "src/shared/model/database";
import {IpcMainApiEndpoints} from "src/shared/api/main-process";
import {curryFunctionMembers} from "src/shared/util";
import {searchRootConversationNodes, secondSearchStep} from "src/electron-main/api/endpoints-builders/database/search/service";
import {ofType} from "src/shared/ngrx-util-of-type";

const logger = curryFunctionMembers(electronLog, __filename);

Expand Down
9 changes: 6 additions & 3 deletions src/electron-main/api/endpoints-builders/proton-session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,19 +100,22 @@ export async function buildEndpoints(
}

const session = resolveInitializedAccountSession({login});

// TODO consider setting "samesite=none" cookie attribute when restoring the saved cookie to session
// currently "samesite" is not being restored or set so default value gets applied (likely to be "lax" at the moment)
const sameSiteNoneCookieAttribute: Readonly<NoExtraProps<Pick<import("electron").CookiesSetDetails, "sameSite" | "secure">>> = {
sameSite: "no_restriction",
secure: true, // "samesite=none" attribute requires "secure" attribute
};
await Promise.all([
session.cookies.set({
...pickTokenCookiePropsToApply(accessTokenCookie),
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
url: `${apiEndpointOrigin}${accessTokenCookie.path}`,
...sameSiteNoneCookieAttribute,
}),
session.cookies.set({
...pickTokenCookiePropsToApply(refreshTokenCookie),
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
url: `${apiEndpointOrigin}${refreshTokenCookie.path}`,
...sameSiteNoneCookieAttribute,
}),
]);

Expand Down
2 changes: 1 addition & 1 deletion src/electron-main/tray.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import {app, Menu, MenuItemConstructorOptions, nativeImage, Tray} from "electron";
import {Subscription} from "rxjs";
import {ofType} from "@ngrx/effects";
import {tap} from "rxjs/operators";

import {IPC_MAIN_API_NOTIFICATION$} from "src/electron-main/api/constants";
import {IPC_MAIN_API_NOTIFICATION_ACTIONS} from "src/shared/api/main-process/actions";
import {IpcMainApiEndpoints} from "src/shared/api/main-process";
import {ofType} from "src/shared/ngrx-util-of-type";

// TODO crete "endpoints"-dependent menu items in disabled state and enable on "endpoints" promise resolving
export async function initTray(endpoints: Promise<IpcMainApiEndpoints>): Promise<Tray> {
Expand Down

0 comments on commit 2720b0c

Please sign in to comment.